This commit is contained in:
ChenQiuYu 2025-04-25 13:51:37 +08:00
parent f86c13b301
commit 0d8e8932f0
1 changed files with 4 additions and 2 deletions

View File

@ -124,7 +124,7 @@ const edit=()=>{
}) })
} }
// 使 watch goodsList itemList // 使 watch goodsList itemList
watch([()=>goodsList.value, itemList], ([newGoodsList, newItemList]) => { watch([()=>goodsList.value, itemList,status], ([newGoodsList, newItemList,newStatus]) => {
const pharmaceuticalTotalAmount = newItemList.reduce((pre: any, cur: any) => { const pharmaceuticalTotalAmount = newItemList.reduce((pre: any, cur: any) => {
return pre + cur.unitPrice return pre + cur.unitPrice
}, 0); }, 0);
@ -133,7 +133,9 @@ watch([()=>goodsList.value, itemList], ([newGoodsList, newItemList]) => {
return pre + cur.selectNum * cur.selectedPrice return pre + cur.selectNum * cur.selectedPrice
}, 0); }, 0);
totalAmount.value = pharmaceuticalTotalAmount + serviceTotalAmount; totalAmount.value = pharmaceuticalTotalAmount + serviceTotalAmount;
console.log(serviceTotalAmount) if (newStatus) {
registerId.value=''
}
}, {deep: true}); }, {deep: true});
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">