pull/781/head
parent
5ef22f6a27
commit
a22b8dccef
|
|
@ -320,11 +320,11 @@ watch(
|
||||||
let totalOfflinePrice = 0;
|
let totalOfflinePrice = 0;
|
||||||
|
|
||||||
for (const product of newProducts) {
|
for (const product of newProducts) {
|
||||||
if (typeof product.onlinePrice === 'number') {
|
if (typeof product.onlinePrice) {
|
||||||
totalOnlinePrice += product.onlinePrice;
|
totalOnlinePrice += Number(product.onlinePrice);
|
||||||
}
|
}
|
||||||
if (typeof product.offlinePrice === 'number') {
|
if (typeof product.offlinePrice) {
|
||||||
totalOfflinePrice += product.offlinePrice;
|
totalOfflinePrice += Number(product.offlinePrice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
formData.value.onlinePrice = totalOnlinePrice.toFixed(2)
|
formData.value.onlinePrice = totalOnlinePrice.toFixed(2)
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ watch(
|
||||||
);
|
);
|
||||||
|
|
||||||
// 监听合同产品变化,计算合同产品总价
|
// 监听合同产品变化,计算合同产品总价
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
watch(
|
watch(
|
||||||
() => formData.value,
|
() => formData.value,
|
||||||
(val) => {
|
(val) => {
|
||||||
|
|
@ -128,6 +129,8 @@ watch(
|
||||||
item.totalPrice = 0;
|
item.totalPrice = 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// emit('success', formData.value)
|
||||||
|
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
);
|
);
|
||||||
|
|
@ -149,7 +152,6 @@ watch(
|
||||||
// };
|
// };
|
||||||
// formData.value.push(newRow);
|
// formData.value.push(newRow);
|
||||||
// };
|
// };
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
||||||
const getList = (val: []) => {
|
const getList = (val: []) => {
|
||||||
for(let i = formData.value.length - 1; i >= 0; i--) {
|
for(let i = formData.value.length - 1; i >= 0; i--) {
|
||||||
let obj = formData.value[i]
|
let obj = formData.value[i]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue