pull/781/head
zy 2025-05-10 18:15:12 +08:00
parent 5ef22f6a27
commit a22b8dccef
2 changed files with 7 additions and 5 deletions

View File

@ -320,11 +320,11 @@ watch(
let totalOfflinePrice = 0;
for (const product of newProducts) {
if (typeof product.onlinePrice === 'number') {
totalOnlinePrice += product.onlinePrice;
if (typeof product.onlinePrice) {
totalOnlinePrice += Number(product.onlinePrice);
}
if (typeof product.offlinePrice === 'number') {
totalOfflinePrice += product.offlinePrice;
if (typeof product.offlinePrice) {
totalOfflinePrice += Number(product.offlinePrice);
}
}
formData.value.onlinePrice = totalOnlinePrice.toFixed(2)

View File

@ -114,6 +114,7 @@ watch(
);
//
const emit = defineEmits(['success']) // success
watch(
() => formData.value,
(val) => {
@ -128,6 +129,8 @@ watch(
item.totalPrice = 0;
}
});
// emit('success', formData.value)
},
{ deep: true }
);
@ -149,7 +152,6 @@ watch(
// };
// formData.value.push(newRow);
// };
const emit = defineEmits(['success']) // success
const getList = (val: []) => {
for(let i = formData.value.length - 1; i >= 0; i--) {
let obj = formData.value[i]