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});