Compare commits

...

2 Commits

Author SHA1 Message Date
admin 11a5e12b15 update: 优化 2024-07-30 09:32:55 +08:00
admin 21fd91cb80 update: 结算清空数值默认为null 2024-07-29 16:44:05 +08:00
4 changed files with 77 additions and 45 deletions

View File

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

View File

@ -42,9 +42,17 @@
<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>
{{ item.isBefore ? item.unit : "" }}
<!-- ------- -->
<text v-if="item.name === '净重误差'">
{{
(state.order.netWeight || 0) -
(state.order.settlementNet || 0)
}}
</text>
<text v-else> {{ item.num }}</text>
<!-- -------- -->
{{ item.isBefore ? "" : item.unit }}
</text>
</view>

View File

@ -43,7 +43,9 @@
<text v-if="item.key === 'subtractNum'">
{{
model1.order.buttonType === 0
? (!isKg() ? item.unit1 : item.unit)
? !isKg()
? item.unit1
: item.unit
: "%"
}}
</text>
@ -68,6 +70,7 @@
v-if="item.type === 'radio'"
v-model="(model1.order as any)[item.key]"
placement="row"
@change="item.changeRadio"
>
<u-radio
v-for="(c, index) in item.child"
@ -109,7 +112,7 @@ import {
num_subtract,
countDots,
isTwoDecimalPlaces,
num_multiply
num_multiply,
} from "@/utils";
import {
ImagesType,
@ -190,9 +193,10 @@ const handleBlur = (e: any, item: any) => {
}
}
};
const model1 = reactive<{
scaleStatusBtnType: number;
order: Shipment;
order: any;
}>({
scaleStatusBtnType: 2,
order: {
@ -213,6 +217,8 @@ const model1 = reactive<{
settlementUnit: 1,
},
});
const recordSettlementUnit = ref(1);
const isKg = () => {
if (model1.order.settlementUnit === 1) {
return false;
@ -304,6 +310,25 @@ const formAttrList = reactive<ComType>([
name: "吨",
},
],
changeRadio: (v: any) => {
if (recordSettlementUnit.value !== model1.order.settlementUnit) {
model1.order.settlementGross = null;
model1.order.settlementTare = null;
model1.order.settlementNet = null;
model1.order.unitPrice = null;
model1.order.buttonType = 0;
model1.order.subtractNum = null;
model1.order.settlementWeight = null;
model1.order.estimatePrice = null;
model1.order.totalPrice = null;
model1.order.freight = null;
model1.order.incidentals = null;
model1.order.realIncome = null;
model1.order.paymentMethodName = null;
model1.order.settlementNotes = "";
}
recordSettlementUnit.value = v;
},
},
{
name: "毛重",
@ -346,13 +371,6 @@ const formAttrList = reactive<ComType>([
fn: () => {},
isNumber: true,
},
// {
// name: "",
// key: "number",
// type: "input",
// required: true,
// unit: "",
// },
{
name: "扣杂",
key: "buttonType",
@ -409,16 +427,6 @@ const formAttrList = reactive<ComType>([
type: "input",
unit: "",
disabled: true,
// child: [
// {
// id: 0,
// name: "",
// },
// {
// id: 1,
// name: "",
// },
// ],
},
{
name: "运费",
@ -491,25 +499,39 @@ watch(
预估总价 结算单价*结算重量
实际收入实际结算金额-运费-杂费
*/
model1.order.settlementNet = <any>num_subtract(
settlementGrossNew || 0,
settlementTareNew || 0
).toFixed(2);
model1.order.settlementNet = <any>(
num_subtract(settlementGrossNew || 0, settlementTareNew || 0).toFixed(2)
);
if (model1.order.buttonType === 0) {
if (model1.order.subtractNum) {
model1.order.settlementWeight = <any>num_subtract(<any>model1.order.settlementNet, model1.order.subtractNum).toFixed(2)
// model1.order.settlementNet - model1.order.subtractNum;
model1.order.settlementWeight = <any>(
num_subtract(
<any>model1.order.settlementNet,
model1.order.subtractNum
).toFixed(2)
);
// model1.order.settlementNet - model1.order.subtractNum;
} else {
model1.order.settlementWeight = model1.order.settlementNet;
}
} else if (model1.order.buttonType === 1) {
if (model1.order.subtractNum) {
model1.order.settlementWeight = <any>num_multiply(<any>model1.order.settlementNet, ((100 - model1.order.subtractNum) / 100)).toFixed(2)
model1.order.settlementWeight = <any>(
num_multiply(
<any>model1.order.settlementNet,
(100 - model1.order.subtractNum) / 100
).toFixed(2)
);
} else {
model1.order.settlementWeight = model1.order.settlementNet;
}
}
model1.order.estimatePrice = <any>num_multiply((model1.order.unitPrice || 0),(model1.order.settlementWeight || 0)).toFixed(2)
model1.order.estimatePrice = <any>(
num_multiply(
model1.order.unitPrice || 0,
model1.order.settlementWeight || 0
).toFixed(2)
);
// if (!model1.order.totalPrice) {
// model1.order.totalPrice = model1.order.estimatePrice;
// }
@ -754,8 +776,12 @@ onLoad((option) => {
fileLists: model1.order.fileLists.map((item: any) => {
return { ...item, fileID: item.id };
}),
settlementUnit: 1,
settlementUnit:
res.data.settlementUnit !== null ? res.data.settlementUnit : 1,
settlementWeight: res.data.settlementWeight,
estimatePrice: res.data.estimatePrice,
};
recordSettlementUnit.value = model1.order.settlementUnit;
}
});

View File

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