update: 细节优化

This commit is contained in:
admin 2024-04-23 10:47:52 +08:00
parent 10848775bc
commit 0deee4db0c
23 changed files with 650 additions and 250 deletions

View File

@ -26,7 +26,7 @@
<view
>{{ state.type === "1" ? "应付" : "应收" }}金额<text class="num"
>¥{{
state.type === "1" ? item.balanceTotalPrice : item.totalPrice
state.type === "1" ? formatMoney(item.balanceTotalPrice) : formatMoney(item.totalPrice)
}}</text
></view
>
@ -39,6 +39,7 @@
<script setup lang="ts">
import PageView from "@/components/PageView/index.vue";
import { ReceiveApi, ShipmentApi } from "@/services";
import { formatMoney } from "@/utils";
import { ScaleStatus } from "@/utils/enum";
import { onLoad } from "@dcloudio/uni-app";
const pageList: PageResult<Order> = reactive({

View File

@ -14,11 +14,15 @@
</text>
</view>
<view class="c-grid">
<view v-if="currentTab === 5" class="time"
>{{ state.startTime.split(" ")[0] }} -
{{ state.endTime.split(" ")[0] }}</view
>
<view class="box">
<view v-for="(item, index) in gridList1" :key="index">
<text v-if="item.name">{{ item.name }}</text
><text
>{{ item.isBefore ? item.unit : "" }} {{ item.num }}
>{{ item.isBefore ? item.unit : "" }} {{ formatMoney(item.num) }}
{{ item.isBefore ? "" : item.unit }}
</text>
</view>
@ -27,8 +31,8 @@
<view class="box">
<view v-for="(item, index) in gridList2" :key="index">
<text v-if="item.name">{{ item.name }}</text
><text
>{{ item.isBefore ? item.unit : "" }} {{ item.num }}
><text :class="item.isHighLight ? 'highLight' : ''"
>{{ item.isBefore ? item.unit : "" }} {{ formatMoney(item.num) }}
{{ item.isBefore ? "" : item.unit }}
</text>
</view>
@ -37,8 +41,8 @@
<view class="box">
<view v-for="(item, index) in gridList3" :key="index">
<text>{{ item.name }}</text
><text
>{{ item.isBefore ? item.unit : "" }} {{ item.num }}
><text :class="item.isHighLight ? 'highLight' : ''"
>{{ item.isBefore ? item.unit : "" }} {{ formatMoney(item.num) }}
{{ item.isBefore ? "" : item.unit }}
</text>
</view>
@ -56,7 +60,7 @@
import StatisticCard from "@/components/StatisticCard/index.vue";
import TimeRangeFilter from "./components/TimeRangeFilter.vue";
import { FinanceApi, ReceiveApi, ShipmentApi } from "@/services";
import { timeRange } from "@/utils";
import { formatMoney, timeRange } from "@/utils";
const list = reactive([
{
num: 0,
@ -171,6 +175,7 @@ const gridList2 = reactive([
num: "",
unit: "¥",
isBefore: true,
isHighLight: true,
},
{
name: "出货应收金额",
@ -178,11 +183,13 @@ const gridList2 = reactive([
num: "",
unit: "¥",
isBefore: true,
isHighLight: true,
},
{
name: "出货笔数",
enName: "orderOutNum",
num: "2",
isHighLight: true,
},
{
name: "",
@ -252,6 +259,7 @@ const gridList3 = reactive([
num: "",
unit: "KG",
isBefore: false,
isHighLight: true,
},
{
name: "收货笔数",
@ -259,6 +267,7 @@ const gridList3 = reactive([
num: "",
unit: "",
isBefore: false,
isHighLight: true,
},
{
name: "收货重量(已付)",
@ -372,16 +381,16 @@ const getOverview = () => {
// /
const getTotal = () => {
ReceiveApi.getTotal().then((res:any) => {
if(res.code === 200) {
const {unPayCustomerTotal, unPaySupplierTotal} = res.data
list[0].num = unPayCustomerTotal
list[1].num = unPaySupplierTotal
ReceiveApi.getTotal().then((res: any) => {
if (res.code === 200) {
const { unPayCustomerTotal, unPaySupplierTotal } = res.data;
list[0].num = unPayCustomerTotal;
list[1].num = unPaySupplierTotal;
}
})
}
});
};
onMounted(() => {
getTotal()
getTotal();
getOverview();
});
</script>
@ -415,11 +424,21 @@ onMounted(() => {
font-weight: 400;
font-size: 24rpx;
color: #000000;
.time {
margin-top: 30rpx;
margin-right: 30rpx;
text-align: right;
font-size: 26rpx;
font-weight: bold;
}
.box {
padding: 30rpx;
display: grid;
grid-template-columns: repeat(2, 1fr);
flex: 1;
.highLight {
color: rgba(236, 15, 62, 1);
}
> view {
line-height: 50rpx;
}

View File

@ -95,7 +95,12 @@ const changeUser = (obj:any) => {
state.user = obj
}
const changeProduct = (obj:any) => {
state.project = {...obj, name: obj.reProductsName}
if (props.isShipment) {
state.project = {...obj, name: obj.shmProductsName}
} else {
state.project = {...obj, name: obj.reProductsName}
}
}
const resetState = () => {
state.project = {

View File

@ -2,20 +2,43 @@
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose">
<view class="c-dialog-filter">
<view class="title">{{ isShipment ? "出货" : "收货" }}产品</view>
<view class="dialog-product-layout">
<view v-if="isShipment">
<view v-for="(item, index) in state.list" :key="index">
<view class="first-title">{{ item.shmCategoryName }}</view>
<view v-for="(cItem, cIndex) in item.childrenList" :key="cIndex">
<view class="second-title">{{ cItem.shmCategoryName }}</view>
<view class="dialog-product-layout">
<view v-if="cItem.childrenLists">
<text
v-for="(child, childIndex) in cItem.childrenLists"
:key="childIndex"
:class="{ active: state.current === child.childIndex }"
@click="handleSelect(child)"
>{{ child.shmProductsName }}</text
>
</view>
<view v-else style="flex: auto">
<u-empty
mode="data"
icon="http://cdn.uviewui.com/uview/empty/data.png"
>
</u-empty>
</view>
</view>
</view>
</view>
</view>
<view class="dialog-product-layout" v-else>
<text
v-for="(item, index) in state.list"
:class="{ active: state.current === item.id }"
@click="handleSelect(item)"
:key="index"
>{{isShipment ? item.shmProductsName : item.reProductsName }}</text
>{{ isShipment ? item.shmProductsName : item.reProductsName }}</text
>
</view>
<!-- <view class="btn-confirm">
<view class="btn">
<u-button type="primary" :text="'确认'"></u-button>
</view>
</view> -->
</view>
</u-popup>
</template>
@ -42,9 +65,17 @@ const handleSelect = (item: any) => {
};
const getList = () => {
if (props.isShipment) {
GoodsApi.getShipmentProductList().then((res) => {
// GoodsApi.getShipmentProductList().then((res) => {
// if (res.code === 200) {
// state.list = res.data;
// }
// });
GoodsApi.getChildrenList().then((res) => {
if (res.code === 200) {
state.list = res.data;
if (res.code === 200) {
state.list = res.data;
}
}
});
} else {
@ -63,6 +94,8 @@ onMounted(() => {
.c-dialog-filter {
width: 95vw;
padding: 25rpx;
height: 90vh;
overflow-y: scroll;
.title {
font-weight: 500;
font-size: 32rpx;
@ -70,12 +103,22 @@ onMounted(() => {
text-align: center;
}
}
.first-title {
font-size: 28rpx;
font-weight: 500;
}
.second-title {
font-size: 26rpx;
font-weight: 500;
color: rgba(0, 0, 0, 0.7);
margin: 20rpx;
}
// dialog
.dialog-product-layout {
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 42rpx 25rpx;
padding: 19rpx;
margin: 30rpx 24rpx;
padding: 20rpx;
display: flex;
justify-content: flex-start;
align-items: center;

View File

@ -5,7 +5,7 @@
<view class="detail">
<view v-for="(item, index) in billList" :key="index" @click="getDetail(item)">
<text>{{ item.supplierName }}</text>
<text class="num">¥{{ item.unPayTotalPrice }} <text class="tip"></text></text>
<text class="num">¥{{ formatMoney(item.unPayTotalPrice) }} <text class="tip"></text></text>
</view>
<u-empty v-if="billList.length === 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</u-empty>
@ -16,6 +16,7 @@
import Search from "@/components/Search/index.vue";
import StatisticCard from "@/components/StatisticCard/index.vue";
import { ShipmentApi } from "@/services";
import { formatMoney } from "@/utils";
const list = reactive([
{
num: 0,

View File

@ -4,14 +4,14 @@
<u-input
v-model="state.startTime"
disabled
disabledColor=""
placeholder="请选择开始时间"
></u-input>
<text>-</text>
<u-input
v-model="state.endTime"
disabled
disabledColor=""
placeholder="请选择结束时间"
></u-input>
<u-icon
@ -37,12 +37,19 @@
>
</u-empty>
<!-- 单据弹框 -->
<ProductTypeDialog
<!-- <ProductTypeDialog
:isShipment="true"
:show="showDialog.showFilter"
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
@changeProduct="changeProduct"
/>
/> -->
<ProductDialog
:show="showDialog.showFilter"
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
@changeProduct="changeProduct"
ref="productRef"
:isShipment="true"
></ProductDialog>
<!-- 时间弹框 -->
<TimeDialog
@ -55,7 +62,7 @@
<script setup lang="ts">
import TimeDialog from "./components/TimeDialog.vue";
import CEcharts from "./Echarts/echarts.vue";
import ProductTypeDialog from "./components/ProductTypeDialog.vue";
import ProductDialog from "./components/ProductDialog.vue";
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
import { ShipmentApi } from "@/services";
import _ from "underscore";
@ -140,7 +147,7 @@ const changeTime = (obj: any) => {
getList();
};
const changeProduct = (obj: any) => {
state.productId = obj.productId;
state.productId = obj.id;
getList();
};
const handleDialog = (key: string, v: boolean) => {

View File

@ -4,14 +4,14 @@
<u-input
v-model="state.startTime"
disabled
disabledColor=""
placeholder="请选择开始时间"
></u-input>
<text>-</text>
<u-input
v-model="state.endTime"
disabled
disabledColor=""
placeholder="请选择结束时间"
></u-input>
<u-icon
@ -29,19 +29,19 @@
<up-row>
<up-col span="4">
<view class="inner-box" style="border: none">
<view class="num">{{ state.summary.totalAmount }}</view>
<view class="num highlight">{{ formatMoney(state.summary.totalAmount) }}</view>
<view>收货总量/kg</view>
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
<view class="num">{{ state.summary.totalPaid }}</view>
<view class="num">{{ formatMoney(state.summary.totalPaid) }}</view>
<view>已付/kg</view>
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
<view class="num">{{ state.summary.totalUnpaid }}</view>
<view class="num">{{ formatMoney(state.summary.totalUnpaid) }}</view>
<view>未付/kg</view>
</view>
</up-col>
@ -52,19 +52,19 @@
<up-row>
<up-col span="4">
<view class="inner-box" style="border: none">
<view class="num">{{ state.summary.totalPayment }}</view>
<view class="num highlight">{{ formatMoney(state.summary.totalPayment) }}</view>
<view>结算金额/</view>
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
<view class="num">{{ state.summary.totalPaidPrice }}</view>
<view class="num">{{ formatMoney(state.summary.totalPaidPrice) }}</view>
<view>实收金额</view>
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
<view class="num">{{ state.summary.totalUnpaidPrice }}</view>
<view class="num">{{ formatMoney(state.summary.totalUnpaidPrice) }}</view>
<view>应付金额</view>
</view>
</up-col>
@ -74,13 +74,13 @@
<up-row>
<up-col span="6">
<view class="inner-box" style="border: none">
<view class="num">{{ state.summary.totalReceipt }}</view>
<view class="num">{{ formatMoney(state.summary.totalReceipt) }}</view>
<view>收货单</view>
</view>
</up-col>
<up-col span="6">
<view class="inner-box">
<view class="num">{{ state.summary.averagePrice }}</view>
<view class="num">{{ formatMoney(state.summary.averagePrice) }}</view>
<view>均价/kg</view>
</view>
</up-col>
@ -136,7 +136,7 @@ import TimeDialog from "./components/TimeDialog.vue";
import StatusDialog from "./components/StatusDialog.vue";
import FilterDialog from "./components/FilterDialog.vue";
import { ReceiveApi } from "@/services";
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
import { formatDate, formatMoney, getCurrentMonthStartAndEnd } from "@/utils";
const tableTitleList = reactive([
{
name: "收货产品",
@ -292,6 +292,9 @@ onMounted(() => {
font-weight: bold;
font-size: 28rpx;
}
.highlight {
color: rgba(236, 15, 62, 1);
}
}
::v-deep .uni-table {
min-width: 500px !important;

View File

@ -4,14 +4,14 @@
<u-input
v-model="state.startTime"
disabled
disabledColor=""
placeholder="请选择开始时间"
></u-input>
<text>-</text>
<u-input
v-model="state.endTime"
disabled
disabledColor=""
placeholder="请选择结束时间"
></u-input>
<u-icon
@ -29,19 +29,19 @@
<up-row>
<up-col span="4">
<view class="inner-box" style="border: none">
<view class="num">{{ state.summary.totalAmount }}</view>
<view class="num highlight">{{ formatMoney(state.summary.totalAmount) }}</view>
<view>出货总量/kg</view>
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
<view class="num">{{ state.summary.totalPayShipment }}</view>
<view class="num">{{ formatMoney(state.summary.totalPayShipment) }}</view>
<view>已收/kg</view>
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
<view class="num">{{ state.summary.totalUnPayShipment }}</view>
<view class="num">{{ formatMoney(state.summary.totalUnPayShipment) }}</view>
<view>未收/kg</view>
</view>
</up-col>
@ -52,19 +52,19 @@
<up-row>
<up-col span="4">
<view class="inner-box" style="border: none">
<view class="num">{{ state.summary.totalCollection }}</view>
<view class="num highlight">{{ formatMoney(state.summary.totalCollection) }}</view>
<view>结算金额/</view>
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
<view class="num">{{ state.summary.totalPayCollection }}</view>
<view class="num">{{ formatMoney(state.summary.totalPayCollection) }}</view>
<view>实收金额</view>
</view>
</up-col>
<up-col span="4">
<view class="inner-box">
<view class="num">{{ state.summary.totalUnPayCollection }}</view>
<view class="num">{{ formatMoney(state.summary.totalUnPayCollection) }}</view>
<view>应收金额</view>
</view>
</up-col>
@ -137,7 +137,7 @@ import TimeDialog from "./components/TimeDialog.vue";
import StatusDialog from "./components/StatusDialog.vue";
import FilterDialog from "./components/FilterDialog.vue";
import { ShipmentApi } from "@/services";
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
import { formatDate, formatMoney, getCurrentMonthStartAndEnd } from "@/utils";
const tableTitleList = reactive([
{
name: "客户",
@ -293,6 +293,9 @@ onMounted(() => {
font-weight: bold;
font-size: 27rpx;
}
.highlight {
color: rgba(236, 15, 62, 1);
}
}
::v-deep .uni-table {
min-width: 500px !important;

View File

@ -4,14 +4,14 @@
<u-input
v-model="state.startTime"
disabled
disabledColor=""
placeholder="请选择开始时间"
></u-input>
<text>-</text>
<u-input
v-model="state.endTime"
disabled
disabledColor=""
placeholder="请选择结束时间"
></u-input>
<u-icon
@ -40,18 +40,26 @@
/>
<!-- 单据弹框 -->
<view>
<ProductTypeDialog
<!-- <ProductTypeDialog
:show="showDialog.showFilter"
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
:isShipment="false"
@changeProduct="changeProduct"
/>
/> -->
<ProductDialog
:show="showDialog.showFilter"
@handleDialog="(v:boolean) => {handleDialog('showFilter', v)}"
@changeProduct="changeProduct"
ref="productRef"
:isShipment="false"
></ProductDialog>
</view>
</template>
<script setup lang="ts">
import TimeDialog from "./components/TimeDialog.vue";
import CEcharts from "./Echarts/echarts.vue";
import ProductTypeDialog from "./components/ProductTypeDialog.vue";
import ProductDialog from "./components/ProductDialog.vue";
import { ReceiveApi } from "@/services";
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
import _ from "underscore";
@ -105,7 +113,7 @@ const getOptions = (x: Array<any>, y: Array<any>) => {
};
};
const changeProduct = (obj: any) => {
state.productId = obj.productId;
state.productId = obj.id;
getList();
};
const showDialog = <

View File

@ -8,7 +8,7 @@
>
<view class="left" @click="handleMsg()">
<view class="msg-badge">
<up-badge max="99" :value="state.count"></up-badge>
<up-badge max="99" :value="count"></up-badge>
</view>
<up-image
@ -28,27 +28,26 @@ import { UsersType } from "@/utils/enum";
import valid from "@/utils/validate";
console.log(ProfileApi,ReceiveApi,ShipmentApi,PictureApi,ReceiveProductApi,DeviceApi,StockCardApi,GoodsApi,SupplierApi,CustomerApi,FinanceApi,formatDate,UsersType, valid)
const props = withDefaults(
defineProps<{
count: number
}>(),
{
count: 0
}
);
const navbarRect = reactive({
height: 32,
top: 28,
msgCount: 10,
});
const state = reactive({
count: 0
})
onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
navbarRect.height = menuButtonInfo.height;
navbarRect.top = menuButtonInfo.top;
// #endif
MessageApi.getUserNoticeInfoNumVo().then((res: any) => {
if (res.code === 200) {
state.count = res.data.unreadNoticeNum
}
})
});
const handleMsg = () => {
uni.navigateTo({

View File

@ -3,7 +3,7 @@
<up-row>
<up-col v-for="(item, index) in list" :span="12 / list.length">
<view class="inner-box" :style="{ border: index === 0 ? 'none' : '' }">
<view class="num">{{ item.num }}</view>
<view class="num">{{ formatMoney(item.num) }}</view>
<view>{{ item.name }}</view>
</view>
</up-col>
@ -11,6 +11,8 @@
</view>
</template>
<script setup lang="ts">
import { formatMoney } from '@/utils';
const props = withDefaults(
defineProps<{
list: any;
@ -46,6 +48,7 @@ const props = withDefaults(
.num {
font-weight: bold;
font-size: 28rpx;
color: rgba(236, 15, 62, 1);
}
}
</style>

View File

@ -33,6 +33,7 @@
border="none"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="['客户','结算时间', '结算方式'].indexOf(item.name) > -1?'#ffffff':'#f5f7fa'"
@change="(e:any) => {handleInput(e, item)}"
>
<template #suffix>
<text>
@ -100,9 +101,11 @@
</template>
<script setup lang="ts">
import { CustomerApi, FinanceApi, PictureApi } from "@/services";
import { formatDate } from "@/utils";
import { DeviceType, ImagesType, OrderType } from "@/utils/enum";
import { countDots, formatDate } from "@/utils";
import { ImagesType, OrderType } from "@/utils/enum";
import _ from "underscore";
import SupplierDialog from "./SupplierDialog.vue";
import valid from "@/utils/validate";
//
const showDialog = <
{
@ -122,6 +125,25 @@ const changeUser = (obj: any) => {
model1.order.customerId = obj.id;
};
//
const handleInput = (e: any, item: any) => {
if (
["totalPrice"].indexOf(item.key) > -1
) {
const temp = e?.replace(valid.valid_decimal.pattern, "");
if (countDots(temp).length > 1) {
uni.showToast({
title: "请输入正确的" + item.name,
icon: "none",
});
}
setTimeout(() => {
model1.order[item.key] = temp;
}, 100);
}
};
const model1 = reactive<any>({
order: {
buttonType: 3,
@ -132,7 +154,7 @@ const model1 = reactive<any>({
customerList: [],
});
const rules = reactive({
"order.supCusName": {
"order.customerName": {
type: "string",
required: true,
message: "请选择客户",
@ -144,16 +166,10 @@ const rules = reactive({
message: "请选择结算时间",
trigger: ["blur", "change"],
},
"order.incidentals": {
type: "string",
"order.totalPrice": {
type: "number",
required: true,
message: "请输入jin",
trigger: ["blur", "change"],
},
"order.freight": {
type: "string",
required: true,
message: "请输入运费",
message: "金额为空或金额输入错误",
trigger: ["blur", "change"],
},
"order.paymentMethodName": {
@ -369,9 +385,10 @@ const startSave = () => {
if (res.code === 200) {
model1.order.id = res.data;
upload();
uni.redirectTo({
url: "/pagesHome/index", //
});
// uni.redirectTo({
// url: "/pagesHome/index", //
// });
uni.navigateBack()
}
});
};

View File

@ -507,9 +507,10 @@ const startSave = () => {
if (res.code === 200) {
model1.order.id = res.data;
upload();
uni.redirectTo({
url: "/pagesHome/index", //
});
// uni.redirectTo({
// url: "/pagesHome/index", //
// });
uni.navigateBack()
}
});
};

View File

@ -108,6 +108,7 @@ import PageView from "@/components/PageView/index.vue";
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
import TimeDialog from "./components/TimeDialog.vue";
import FilterDialog from "./components/CustomFilterDialog.vue";
import { onShow } from "@dcloudio/uni-app";
const options1 = ref([
{
@ -137,7 +138,7 @@ const state = reactive({
{
name: "其他收款",
key: 1,
}
},
],
userId: -1,
userType: -1,
@ -145,9 +146,7 @@ const state = reactive({
});
const getPayment = (item: any) => {
return ["出货单收款", "其他收款"][
item.paymentType
];
return ["出货单收款", "其他收款"][item.paymentType];
};
const showDialog = <
{
@ -254,7 +253,8 @@ const getList = (v?: boolean) => {
}
});
};
onMounted(() => {
onShow(() => {
resetPageList();
getList();
});
</script>

View File

@ -108,6 +108,7 @@ import PageView from "@/components/PageView/index.vue";
import { formatDate, getCurrentMonthStartAndEnd } from "@/utils";
import TimeDialog from "./components/TimeDialog.vue";
import FilterDialog from "./components/CustomFilterDialog.vue";
import { onShow } from "@dcloudio/uni-app";
const options1 = ref([
{
@ -263,7 +264,8 @@ const getList = (v?: boolean) => {
}
});
};
onMounted(() => {
onShow(() => {
resetPageList();
getList();
});
</script>

View File

@ -22,39 +22,45 @@
:height="100"
:isLoading="pageList.isLoading"
>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
<view class="no"> 出货单号{{ item.orderNumber }} </view>
<view class="supplier"> {{ item.deviceName }} </view>
<view class="box" v-for="(item, index) in pageList.list" :key="index">
<view class="base">
<view>
<view class="no"> 出货单号{{ item.orderNumber }} </view>
<view class="supplier"> {{ item.deviceName }} </view>
</view>
<view>
<text class="btn" @click="handleScenePhoto((item as any).id)"
>现场照片</text
>
</view>
</view>
<view>
<text class="btn" @click="handleScenePhoto((item as any).id)">现场照片</text>
<view class="name"
>{{ item.userName }}
<text>{{ getScaleStatus((item as any).scaleStatus) }}</text>
<text v-if="item.repairTime">补单</text>
</view>
<view class="type">{{ item.productName }}</view>
<view class="more">
<view
v-for="(cItem, index) in gridList1"
:key="index"
:style="{
width: `${cItem.name === '创建时间' ? 'max-content' : ''}`,
'font-size': `${cItem.isCustomStyle ? '22rpx' : ''}`,
color: `${cItem.isCustomStyle ? '#999' : ''}`,
}"
>
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
{{ cItem.num }}
{{ cItem.isBefore ? "" : cItem.unit }}
</text>
</view>
</view>
</view>
<view class="name">{{ item.userName }} <text>{{ getScaleStatus((item as any).scaleStatus) }}</text></view>
<view class="type">{{ item.productName }}</view>
<view class="more">
<view
v-for="(cItem, index) in gridList1"
:key="index"
:style="{
width: `${cItem.name === '创建时间' ? 'max-content' : ''}`,
'font-size': `${cItem.isCustomStyle ? '22rpx' : ''}`,
color: `${cItem.isCustomStyle ? '#999' : ''}`,
}"
>
<text v-if="cItem.name">{{ cItem.name }}</text
><text
>{{ cItem.isBefore ? cItem.unit : "" }}
{{ cItem.num }}
{{ cItem.isBefore ? "" : cItem.unit }}
</text>
</view>
</view>
</view>
</page-view>
</view>
</template>
@ -206,9 +212,7 @@ const getList = (v?: boolean) => {
}).then((res: any) => {
if (res.code === 200) {
pageList.isLoading = false;
(pageList as any).list = pageList.list.concat(
res.data.list
);
(pageList as any).list = pageList.list.concat(res.data.list);
pageList.total = (res.data as any).total;
}
});

View File

@ -1,6 +1,6 @@
<template>
<!-- 自定义工作台头部 -->
<NavBar></NavBar>
<NavBar :count="state.count"></NavBar>
<view
class="contaner"
:style="{
@ -20,7 +20,7 @@
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pages/${item.imgUrl}`"
/>
<view class="box">
<view class="num">{{ formatMoney(item.num) }}</view>
<view class="num">{{ formatMoney(item.num, 2) }}</view>
<view class="title">{{ item.title }}</view>
</view>
</view>
@ -156,9 +156,15 @@
<script setup lang="ts">
import { useMemberStore } from "@/store/index";
import { ProfileApi, ReceiveApi, ShipmentApi } from "@/services/index";
import {
MessageApi,
ProfileApi,
ReceiveApi,
ShipmentApi,
} from "@/services/index";
import TabBar from "@/components/TabBar/index.vue";
import { formatMoney } from "@/utils";
import { onBackPress, onShow } from "@dcloudio/uni-app";
const store = useMemberStore();
const navbarRect = reactive({
height: 32,
@ -475,44 +481,6 @@ const appList = reactive([
},
},
]);
//
ReceiveApi.countOrderByMonth().then((res) => {
if (res.code === 200) {
const {
totalReceipt,
totalExpenditure,
toBePriced,
toBeTare,
audit,
toBePaid,
} = res.data;
summaryList[0].num = totalReceipt;
summaryList[1].num = totalExpenditure;
receiveList[0].num = toBePriced;
receiveList[1].num = toBeTare;
receiveList[2].num = audit;
receiveList[3].num = toBePaid;
}
});
//
ShipmentApi.countOrderByMonth().then((res) => {
if (res.code === 200) {
const {
totalShipment,
totalIncome,
toBeShipped,
roughWeight,
shipmentReview,
toBeSettled,
} = res.data;
summaryList[2].num = totalShipment;
summaryList[3].num = totalIncome;
shipmentList[0].num = toBeShipped;
shipmentList[1].num = roughWeight;
shipmentList[2].num = shipmentReview;
shipmentList[3].num = toBeSettled;
}
});
// app
const isShowModule = (list: any) => {
@ -525,7 +493,62 @@ const isShowModule = (list: any) => {
});
return flag;
};
const state = reactive({
count: 0,
});
const init = () => {
//
MessageApi.getUserNoticeInfoNumVo().then((res: any) => {
if (res.code === 200) {
state.count = res.data.unreadNoticeNum;
}
});
//
ReceiveApi.countOrderByMonth().then((res) => {
if (res.code === 200) {
const {
totalReceipt,
totalExpenditure,
toBePriced,
toBeTare,
audit,
toBePaid,
} = res.data;
summaryList[0].num = totalReceipt;
summaryList[1].num = totalExpenditure;
receiveList[0].num = toBePriced;
receiveList[1].num = toBeTare;
receiveList[2].num = audit;
receiveList[3].num = toBePaid;
}
});
//
ShipmentApi.countOrderByMonth().then((res) => {
if (res.code === 200) {
const {
totalShipment,
totalIncome,
toBeShipped,
roughWeight,
shipmentReview,
toBeSettled,
} = res.data;
summaryList[2].num = totalShipment;
summaryList[3].num = totalIncome;
shipmentList[0].num = toBeShipped;
shipmentList[1].num = roughWeight;
shipmentList[2].num = shipmentReview;
shipmentList[3].num = toBeSettled;
}
});
//
ProfileApi.getUserInfo().then((res: any) => {
if (res.code === 200) {
store.setProfile({ ...res.data, token: store.profile.token });
}
});
};
onMounted(() => {
// #ifdef APP-PLUS || MP-WEIXIN
let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
@ -533,12 +556,9 @@ onMounted(() => {
navbarRect.top = menuButtonInfo.top;
getSafeHeight();
// #endif
//
ProfileApi.getUserInfo().then((res: any) => {
if (res.code === 200) {
store.setProfile({ ...res.data, token: store.profile.token });
}
});
});
onShow(() => {
init();
});
</script>

View File

@ -5,21 +5,41 @@
labelPosition="left"
:model="model1"
:rules="rules"
ref="loginForm"
ref="form"
:labelWidth="0"
:errorType="'border-bottom'"
>
<u-form-item
v-for="(item, index) in formAttrList"
:key="index"
:prop="`userInfo.${item.modelName}`"
:prop="`userInfo.${item.key}`"
>
<u-input
:border="index === 2 ? 'none' : 'bottom'"
v-model="model1.userInfo[`${item.modelName}`]"
:placeholder="item.placeholder"
<up-input
v-model="(model1.userInfo as any)[item.key]"
:placeholder="`${item.type === 'select' ? '选择' : '输入'}${
item.name
}`"
:clearable="true"
:type="'password'"
></u-input>
:customStyle="{}"
:border="index === 2 ? 'none' : 'bottom'"
:value="(model1.userInfo as any)[item.key]"
:type="item.isShowPwd ? 'text' : 'password'"
>
<template #suffix>
<image
v-if="!item.isShowPwd"
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/login/hide.png`"
class="custom-icon"
@click="item.isShowPwd = true"
></image>
<image
v-else
:src="`https://backend-common.obs.cn-east-3.myhuaweicloud.com/static/pagesLogin/login/show.png`"
class="custom-icon"
@click="item.isShowPwd = false"
></image>
</template>
</up-input>
</u-form-item>
</u-form>
</view>
@ -37,27 +57,35 @@
</view>
</template>
<script setup lang="ts">
import { ProfileApi } from "@/services";
import valid from "@/utils/validate";
//
const formAttrList = ref([
{
modelName: "password",
name: "当前密码",
key: "password",
type: "password",
placeholder: "请输入当前密码",
required: true,
isShowPwd: false,
},
{
modelName: "passwordNew",
name: "新密码",
key: "newPassword",
type: "password",
placeholder: "请输入新密码",
required: true,
isShowPwd: false,
},
{
modelName: "passwordConfirm",
name: "确认密码",
key: "passwordConfirm",
type: "password",
placeholder: "请确认新密码",
required: true,
isShowPwd: false,
},
]);
const model1 = <any>reactive({
userInfo: {
userName: "",
password: "",
},
});
@ -68,7 +96,7 @@ const rules = ref({
message: "请输入当前密码",
trigger: ["blur", "change"],
},
"userInfo.passwordNew": {
"userInfo.newPassword": {
type: "string",
required: true,
message: "请输入新密码",
@ -81,10 +109,59 @@ const rules = ref({
trigger: ["blur", "change"],
},
});
const form = ref();
const check = () => {
return new Promise((resolve) => {
form.value
.validate()
.then((res: boolean) => {
resolve(res);
})
.catch((errors: any) => {
resolve(false);
uni.showToast({
icon: "none",
title: errors[0].message || "校验失败",
});
});
});
};
const submit = () => {};
const startSave = () => {
console.log( model1.userInfo)
ProfileApi.updateUserPwd({...model1.userInfo}).then(res => {
if (res.code === 200) {
uni.showToast({ icon: "none", title: '密码修改成功'});
}
})
};
const submit = () => {
// if (!valid.password.pattern.test(model1.userInfo.password) || !valid.password.pattern.test(model1.userInfo.newPassword) || !valid.password.pattern.test(model1.userInfo.passwordConfirm)) {
// uni.showToast({ icon: "none", title: valid.password.message });
// return;
// }
if (model1.userInfo.password === model1.userInfo.newPassword) {
uni.showToast({ icon: "none", title: '新密码不能和旧密码相同'});
return;
}
if (model1.userInfo.newPassword !== model1.userInfo.passwordConfirm) {
uni.showToast({ icon: "none", title: '新密码必须和确认密码相同' });
return;
}
check().then((res) => {
if (res) {
startSave();
}
});
};
</script>
<style lang="scss">
.custom-icon {
width: 37.18rpx;
height: 18.59rpx;
}
.baseinfo {
background: #f8f8f8;
height: 100vh;

View File

@ -13,7 +13,7 @@
:prop="`order.${item.key}`"
:label="item.name"
:required="item.required"
v-for="(item, index) in formAttrList"
v-for="(item, index) in prePage ? formAttrList1 : formAttrList"
:key="index"
@click="item.fn"
:borderBottom="false"
@ -36,12 +36,9 @@
:value="(model1.order as any)[item.key]"
@change="(e:any) => {handleInput(e, item)}"
:disabled="item.disabled || item.type === 'select'"
:disabledColor="item.name === '收货产品'?'#ffffff':'#f5f7fa'"
:disabledColor="item.name === '收货产品' ? '#ffffff' : '#f5f7fa'"
>
<template #suffix>
<text v-if="item.key === 'subtractNum'">
{{ model1.order.buttonType === 0 ? item.unit : "%" }}
</text>
@ -76,15 +73,15 @@
:customStyle="{ marginRight: '10px' }"
></u-radio>
</u-radio-group>
<template
#right
v-if="item.type === 'select'"
>
<template #right v-if="item.type === 'select'">
<u-icon name="arrow-right"></u-icon>
</template>
</u-form-item>
</u-form>
<block v-for="(item, index) in formAttrList" :key="index">
<block
v-for="(item, index) in prePage ? formAttrList1 : formAttrList"
:key="index"
>
<u-action-sheet
v-if="item.type === 'select'"
:actions="contrlModalParams[item.childKey].list"
@ -213,12 +210,13 @@ const model1 = reactive<{ order: Order }>({
carNumber: "",
productId: "", // Id,
productName: "", //
price: "", //
price: 0, //
buttonType: 0, // 01
weighingMethod: 0, // 0 1
multiCategory: 0, // 0 1
fileLists: [],
scaleStatus: 1,
netWeight: 0,
},
});
@ -323,7 +321,7 @@ const formAttrList = reactive<ComType>([
type: "input",
unit: "KG",
required: true,
disabled: true
disabled: true,
},
{
name: "扣杂",
@ -391,6 +389,153 @@ const formAttrList = reactive<ComType>([
},
]);
const formAttrList1 = reactive<ComType>([
{
name: "供应商",
key: "userName",
type: "select",
unit: "",
childKey: "userSelect",
required: true,
fn: () => {
// handleDialog("showSupplier", true);
uni.hideKeyboard();
},
},
{
name: "车牌号",
key: "carNumber",
type: "input",
unit: "",
},
{
name: "收货产品",
key: "productName",
type: "select",
unit: "",
childKey: "productSelect",
required: true,
fn: () => {
handleDialog("showProduct", true);
uni.hideKeyboard();
// contrlModalParams.productSelect.isShow = true;
// contrlModalParams.productSelect.title = "";
},
},
{
name: "毛重",
key: "grossWeight",
type: "input",
unit: "KG",
required: true,
disabled: true,
},
{
name: "皮重",
key: "tare",
type: "input",
unit: "KG",
required: true,
disabled: true,
},
{
name: "扣杂",
key: "buttonType",
type: "radio",
child: [
{
id: 0,
name: "按固定重量",
},
{
id: 1,
name: "按百分比",
},
],
},
{
name: "杂质扣除",
key: "subtractNum",
type: "input",
unit: "KG",
},
{
name: "净重",
key: "netWeight",
type: "input",
unit: "KG",
required: true,
disabled: true,
},
{
name: "单价",
key: "price",
type: "input",
unit: "元/KG",
required: true,
},
{
name: "预估总价",
key: "totalPrice",
type: "input",
unit: "元",
disabled: true,
},
{
name: "货款金额",
key: "balanceTotalPrice",
type: "input",
required: true,
unit: "元",
},
{
name: "备注",
key: "notes",
type: "textarea",
},
{
name: "货品照片",
key: "photo",
type: "upload",
},
]);
//
watch(
[
() => model1.order.grossWeight,
() => model1.order.tare,
() => model1.order.price,
() => model1.order.subtractNum,
() => model1.order.buttonType,
],
([grossWeightNew, tareNew]) => {
/**
* 过磅净重 毛重-皮重
结算重量 过磅净重-扣杂
预估总价 结算单价*结算重量
实际收入实际结算金额-运费-杂费
*/
model1.order.netWeight = parseFloat(((parseFloat(grossWeightNew as any) || 0) - (parseFloat(tareNew as any) || 0)).toFixed(2));
if (model1.order.buttonType === 0) {
if (model1.order.subtractNum) {
model1.order.netWeight =
model1.order.netWeight - model1.order.subtractNum;
}
} else if (model1.order.buttonType === 1) {
if (model1.order.subtractNum) {
model1.order.netWeight =
model1.order.netWeight * ((100 - model1.order.subtractNum) / 100);
}
}
model1.order.totalPrice =
(model1.order.price || 0) * (model1.order.netWeight || 0);
// =
model1.order.balanceTotalPrice = model1.order.totalPrice;
}
);
SupplierApi.getSupplierUserList({}).then((res) => {
if (res.code === 200) {
contrlModalParams.userSelect.list = res.data;
@ -495,7 +640,7 @@ const save = () => {
}
if (
model1.order.price &&
model1.order.price[model1.order.price.length - 1] === "."
model1.order.price.toString()[model1.order.price.toString().length - 1] === "."
) {
uni.showToast({
title: "请输入正确的单价",
@ -506,8 +651,8 @@ const save = () => {
if (model1.order.minPrice && model1.order.maxPrice) {
if (
parseInt(model1.order.price + "") < model1.order.minPrice ||
parseInt(model1.order.price + "") > model1.order.maxPrice
parseFloat(model1.order.price + "") < parseFloat(model1.order.minPrice) ||
parseFloat(model1.order.price + "") > parseFloat(model1.order.maxPrice)
) {
uni.showToast({
title: `单价应在${model1.order.minPrice}-${model1.order.maxPrice}之间`,
@ -603,7 +748,11 @@ const prePage = ref("");
onLoad((option) => {
model1.order.id = parseInt((option as any).id);
prePage.value = (option as any).prePage;
if (prePage.value) {
uni.setNavigationBarTitle({
title: "编辑信息",
});
}
if (model1.order.id) {
ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => {
if (res.code === 200) {
@ -619,6 +768,9 @@ onLoad((option) => {
res.data.buttonType === 0
? res.data.buckleMiscellaneous
: res.data.points,
balanceTotalPrice: res.data.balanceTotalPrice
? res.data.balanceTotalPrice
: res.data.totalPrice,
fileLists: model1.order.fileLists.map((item: any) => {
return { ...item, fileID: item.id };
}),

View File

@ -430,9 +430,10 @@ const updateOrder = () => {
icon: "success",
});
if (state.scaleStatus === ScaleStatus.ToBeShipment || state.scaleStatus === ScaleStatus.ToBeGrossWeight) {
uni.redirectTo({
url: "/pagesShipment/shipmenting?scaleStatus=" + state.scaleStatus, //
});
// uni.redirectTo({
// url: "/pagesShipment/shipmenting?scaleStatus=" + state.scaleStatus, //
// });
uni.navigateBack()
} else {
uni.redirectTo({
url:

View File

@ -71,7 +71,7 @@
import { ShipmentApi } from "@/services/index";
import SmallModal from "@/components/Modal/smallModal.vue";
import PageView from "@/components/PageView/index.vue";
import { onLoad } from "@dcloudio/uni-app";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { ScaleStatus } from "@/utils/enum";
const pageList: PageResult<Shipment> = reactive({
@ -82,6 +82,14 @@ const pageList: PageResult<Shipment> = reactive({
pageNum: 1,
pageSize: 10,
});
const resetPageList = () => {
pageList.noMoreData = false;
pageList.total = 0;
pageList.list = [];
pageList.pageNum = 1;
pageList.pageSize = 10;
};
const isShowCancelModal = ref(false);
const deleteId = ref(0);
const handleModal = (v: boolean, id: number) => {
@ -132,7 +140,8 @@ const handleOk = () => {
});
};
onMounted(() => {
onShow(() => {
resetPageList();
getList();
});

View File

@ -28,9 +28,9 @@ interface Order {
buttonType?: number; //扣杂状态0扣杂1扣点
points?: number; //扣点
buckleMiscellaneous?: number; //扣杂
price?: string; //单价
balanceTotalPrice?: string; //结算总价 货款金额
totalPrice?: string; //实际总价 预估价格
price?: number; //单价
balanceTotalPrice?: number; //结算总价 货款金额
totalPrice?: number; //实际总价 预估价格
weighingMethod?: number; //称重方式0有皮重 1零皮重
multiCategory?: number; //多品类0单品类 1多品类
notes?: string; //备注

View File

@ -162,45 +162,70 @@ export function timeRange(id: number) {
}
// 格式化金额
export function formatMoney(number:any, decimals = 0, decPoint = '.', thousandsSep = ',') {
number = (number + '').replace(/[^0-9+-Ee.]/g, '')
const n = !isFinite(+number) ? 0 : +number
const prec = !isFinite(+decimals) ? 0 : Math.abs(decimals)
const sep = typeof thousandsSep === 'undefined' ? ',' : thousandsSep
const dec = typeof decPoint === 'undefined' ? '.' : decPoint
let s:any = ''
const toFixedFix = function(n:number, prec:number) {
const k = Math.pow(10, prec)
return '' + Math.ceil(signFigures(n * k)) / k
export function formatMoney(
number: any,
decimals?: any,
dec_point?: any,
thousands_sep?: any,
roundtag?: any
) {
/*
*
* number
* decimals
* dec_point
* thousands_sep
* roundtag:舍入参数 "ceil" ,"floor","round"
* */
if (!number) {
number = 0;
}
s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.')
const re = /(-?\d+)(\d{3})/
if (!decimals) {
decimals = 0; //默认保留2位小数
}
if (!dec_point) {
dec_point = ".";
}
if (!thousands_sep) {
thousands_sep = ",";
}
if (!roundtag) {
roundtag = "round";
}
number = (number + "").replace(/[^0-9+-Ee.]/g, "");
roundtag = roundtag || "ceil"; //"ceil","floor","round"
var n = !isFinite(+number) ? 0 : +number,
prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
sep = typeof thousands_sep === "undefined" ? "," : thousands_sep,
dec = typeof dec_point === "undefined" ? "." : dec_point,
s:any = "",
toFixedFix = function (n:any, prec:any) {
var k = Math.pow(10, prec);
return (
"" +
parseFloat(
(Math as any)[roundtag](parseFloat((n * k).toFixed(prec * 2))).toFixed(
prec * 2
)
) /
k
);
};
s = (prec ? toFixedFix(n, prec) : "" + Math.round(n)).split(".");
var re = /(-?\d+)(\d{3})/;
while (re.test(s[0])) {
s[0] = s[0].replace(re, '$1' + sep + '$2')
s[0] = s[0].replace(re, "$1" + sep + "$2");
}
if ((s[1] || '').length < prec) {
s[1] = s[1] || ''
s[1] += new Array(prec - s[1].length + 1).join('0')
if ((s[1] || "").length < prec) {
s[1] = s[1] || "";
s[1] += new Array(prec - s[1].length + 1).join("0");
}
return s.join(dec)
}
export function signFigures (num:number, rank = 6) {
if (!num) return (0)
const sign = num / Math.abs(num)
const number = num * sign
const temp = rank - 1 - Math.floor(Math.log10(number))
let ans
if (temp > 0) {
ans = parseFloat(number.toFixed(temp))
} else if (temp < 0) {
ans = Math.round(number / Math.pow(10, temp)) * temp
} else {
ans = Math.round(number)
}
return (ans * sign)
return s.join(dec);
}
// 判断字符串中有几个.
export function countDots(str:any) {
export function countDots(str: any) {
return (str.match(/\./g) || []).length;
}