From c2b56ed357481d89807003e3e887ed236bf707ba Mon Sep 17 00:00:00 2001 From: ChenQiuYu Date: Sun, 27 Apr 2025 16:16:24 +0800 Subject: [PATCH] dev --- src/components/outpatient/MedicalHistory.vue | 5 +++- .../outpatient/PharmaceuticalConsumables.vue | 6 ++--- src/components/registration/Edit.vue | 22 ++++++++-------- src/views/outpatient/index.vue | 26 +++++++++++-------- src/views/registration/index.vue | 2 +- 5 files changed, 34 insertions(+), 27 deletions(-) diff --git a/src/components/outpatient/MedicalHistory.vue b/src/components/outpatient/MedicalHistory.vue index ddd7e35..3be39e9 100644 --- a/src/components/outpatient/MedicalHistory.vue +++ b/src/components/outpatient/MedicalHistory.vue @@ -38,7 +38,10 @@ const init = (patientId: any) => { list.value = res }) } -defineExpose({init}) +const clearList = () => { + list.value = [] +} +defineExpose({init,clearList}) \ No newline at end of file diff --git a/src/views/outpatient/index.vue b/src/views/outpatient/index.vue index 0a1ed7a..3218be3 100644 --- a/src/views/outpatient/index.vue +++ b/src/views/outpatient/index.vue @@ -6,20 +6,21 @@
- +
- +
-
- +
@@ -121,25 +122,28 @@ const deleteItem = () => { } const getStatus = (e: any) => { status.value = e + formData.value = {} + goodsList.value = [] + itemList.value = [] + patientRegistration.value = {} + nextTick(() => { + medicalHistoryRef.value?.clearList(); + }) } -const edit=()=>{ +const edit = () => { post('registration/changeStatus', {id: registerId.value, status: 2}).then((res: any) => { status.value = 2 }) } // 使用 watch 监听 goodsList 和 itemList 的变化 -watch([()=>goodsList.value, itemList,status], ([newGoodsList, newItemList,newStatus]) => { +watch([() => goodsList.value, itemList], ([newGoodsList, newItemList]) => { const pharmaceuticalTotalAmount = newItemList.reduce((pre: any, cur: any) => { return pre + cur.unitPrice }, 0); const serviceTotalAmount = newGoodsList.reduce((pre: any, cur: any) => { - - return pre + cur.selectNum * cur.selectedPrice + return pre + cur.selectedNum * cur.selectedPrice }, 0); totalAmount.value = pharmaceuticalTotalAmount + serviceTotalAmount; - if (newStatus) { - registerId.value='' - } }, {deep: true});