update: 优化

This commit is contained in:
admin 2024-07-30 09:32:55 +08:00
parent 21fd91cb80
commit 11a5e12b15
4 changed files with 25 additions and 18 deletions

View File

@ -22,7 +22,8 @@
<view v-for="(item, index) in gridList1" :key="index"> <view v-for="(item, index) in gridList1" :key="index">
<text v-if="item.name">{{ item.name }}</text <text v-if="item.name">{{ item.name }}</text
><text v-if="item.name" ><text v-if="item.name"
>{{ item.isBefore ? item.unit : "" }} {{ formatMoney(item.num, item.decimal) }} >{{ item.isBefore ? item.unit : "" }}
{{ formatMoney(item.num, item.decimal) }}
{{ item.isBefore ? "" : item.unit }} {{ item.isBefore ? "" : item.unit }}
</text> </text>
</view> </view>
@ -30,10 +31,13 @@
<view class="box"> <view class="box">
<view v-for="(item, index) in gridList2" :key="index"> <view v-for="(item, index) in gridList2" :key="index">
<text v-if="item.name">{{ item.name }}</text <text v-if="item.name">{{ item.name }}</text>
<text
:class="{ highLight: item.isHighLight || false }"
v-if="item.name"
> >
<text :class="{'highLight': item.isHighLight || false}" v-if="item.name" {{ item.isBefore ? item.unit : "" }}
>{{ item.isBefore ? item.unit : "" }} {{ formatMoney(item.num, item.decimal) }} {{ formatMoney(item.num, item.decimal) }}
{{ item.isBefore ? "" : item.unit }} {{ item.isBefore ? "" : item.unit }}
</text> </text>
</view> </view>
@ -43,7 +47,8 @@
<view v-for="(item, index) in gridList3" :key="index"> <view v-for="(item, index) in gridList3" :key="index">
<text>{{ item.name }}</text <text>{{ item.name }}</text
><text :class="item.isHighLight ? 'highLight' : ''" ><text :class="item.isHighLight ? 'highLight' : ''"
>{{ item.isBefore ? item.unit : "" }} {{ formatMoney(item.num, item.decimal)}} >{{ item.isBefore ? item.unit : "" }}
{{ formatMoney(item.num, item.decimal) }}
{{ item.isBefore ? "" : item.unit }} {{ item.isBefore ? "" : item.unit }}
</text> </text>
</view> </view>
@ -106,9 +111,6 @@ const handleOk = (v: any) => {
currentTab.value = 5; currentTab.value = 5;
getOverview(); getOverview();
}; };
const randomNum = (index: number) => {
return Math.floor(Math.random() * (10000 - 1 + 1)) + 1 + index;
};
const gridList1 = reactive([ const gridList1 = reactive([
{ {
@ -202,7 +204,6 @@ const gridList2 = reactive([
num: "", num: "",
isHighLight: true, isHighLight: true,
decimal: 0, decimal: 0,
}, },
{ {
name: "", name: "",

View File

@ -42,9 +42,17 @@
<view class="box"> <view class="box">
<view v-for="(item, index) in gridList2" :key="index"> <view v-for="(item, index) in gridList2" :key="index">
<text v-if="item.name">{{ item.name }}</text <text v-if="item.name">{{ item.name }}</text
><text ><text>
>{{ item.isBefore ? item.unit : "" }} {{ item.isBefore ? item.unit : "" }}
{{ item.num }} <!-- ------- -->
<text v-if="item.name === '净重误差'">
{{
(state.order.netWeight || 0) -
(state.order.settlementNet || 0)
}}
</text>
<text v-else> {{ item.num }}</text>
<!-- -------- -->
{{ item.isBefore ? "" : item.unit }} {{ item.isBefore ? "" : item.unit }}
</text> </text>
</view> </view>

View File

@ -325,7 +325,7 @@ const formAttrList = reactive<ComType>([
model1.order.incidentals = null; model1.order.incidentals = null;
model1.order.realIncome = null; model1.order.realIncome = null;
model1.order.paymentMethodName = null; model1.order.paymentMethodName = null;
model1.order.settlementNotes = ''; model1.order.settlementNotes = "";
} }
recordSettlementUnit.value = v; recordSettlementUnit.value = v;
}, },
@ -778,8 +778,9 @@ onLoad((option) => {
}), }),
settlementUnit: settlementUnit:
res.data.settlementUnit !== null ? res.data.settlementUnit : 1, res.data.settlementUnit !== null ? res.data.settlementUnit : 1,
settlementWeight: res.data.settlementWeight,
estimatePrice: res.data.estimatePrice,
}; };
recordSettlementUnit.value = model1.order.settlementUnit; recordSettlementUnit.value = model1.order.settlementUnit;
} }
}); });

View File

@ -236,10 +236,7 @@ const contrlModalParams = reactive<{ [attrName: string]: any }>({
], ],
}, },
}); });
const state = reactive<{ const state = reactive<any>({
order: Shipment;
[attrName: string]: any;
}>({
order: { order: {
id: "", id: "",
buttonType: 0, buttonType: 0,