From 7c6c4f453165065256cd2d882c60529a28b200ee Mon Sep 17 00:00:00 2001 From: ChenQiuYu Date: Thu, 8 May 2025 11:49:23 +0800 Subject: [PATCH] dev --- src/components/SearchInput.vue | 3 +- src/components/charge/ServiceDetail.vue | 84 ------------- .../common/service/ServiceDetail.vue | 110 ++++++++++++++++++ src/views/charge/index.vue | 12 +- src/views/outpatient/index.vue | 39 +++++-- 5 files changed, 145 insertions(+), 103 deletions(-) delete mode 100644 src/components/charge/ServiceDetail.vue create mode 100644 src/components/common/service/ServiceDetail.vue diff --git a/src/components/SearchInput.vue b/src/components/SearchInput.vue index 56219e9..858c73e 100644 --- a/src/components/SearchInput.vue +++ b/src/components/SearchInput.vue @@ -29,7 +29,6 @@ v-for="item in showConfig" :prop="item.prop" :label="item.label" - show-overflow-tooltip > @@ -58,7 +57,7 @@ const props = defineProps({ }, width: { type: Number, - default: 600 + default: 800 }, showConfig: { type: Array as () => showConfig[], diff --git a/src/components/charge/ServiceDetail.vue b/src/components/charge/ServiceDetail.vue deleted file mode 100644 index c7643bb..0000000 --- a/src/components/charge/ServiceDetail.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - \ No newline at end of file diff --git a/src/components/common/service/ServiceDetail.vue b/src/components/common/service/ServiceDetail.vue new file mode 100644 index 0000000..2d317d6 --- /dev/null +++ b/src/components/common/service/ServiceDetail.vue @@ -0,0 +1,110 @@ + + + \ No newline at end of file diff --git a/src/views/charge/index.vue b/src/views/charge/index.vue index b840c14..f7fc609 100644 --- a/src/views/charge/index.vue +++ b/src/views/charge/index.vue @@ -42,9 +42,7 @@
- - - +
@@ -79,7 +77,7 @@ import Panel from "@/components/common/Panel.vue"; import ChargeQueue from "@/components/charge/ChargeQueue.vue"; import {nextTick, onMounted, ref} from "vue"; import {post} from "@/utils/request.ts"; -import ServiceDetail from "@/components/charge/ServiceDetail.vue"; +import ServiceDetail from "@/components/common/service/ServiceDetail.vue"; import GoodsDetail from "@/components/charge/GoodsDetail.vue"; import DiagnosisSearchInput from "@/components/outpatient/DiagnosisSearchInput.vue"; import Settlement from "@/components/charge/Settlement.vue"; @@ -94,6 +92,8 @@ const socialCard = ref({payInfo: {}}) const formData = ref({ patientInfo: {}, diagnosisMedicalRecord: {}, + goodsList: [], + itemDetail: [], }) const statusDisabled = ref(0) const diagnosisKeyword = ref("") @@ -171,10 +171,10 @@ onMounted(() => { }) const getOrderTotalPrice = () => { let totalPrice = 0 - formData.value.itemDetail.forEach((item: any) => { + formData.value.itemDetail?.forEach((item: any) => { totalPrice += item.selectedPrice * item.selectedNum }) - formData.value.goodsDetail.forEach((item: any) => { + formData.value.goodsList.forEach((item: any) => { totalPrice += item.selectedPrice * item.selectedNum }) formData.value.preTotalPrice = totalPrice diff --git a/src/views/outpatient/index.vue b/src/views/outpatient/index.vue index bb44f27..05a3da3 100644 --- a/src/views/outpatient/index.vue +++ b/src/views/outpatient/index.vue @@ -10,8 +10,8 @@
- - + +
({diagType: 1}) +const formData = ref({ + diagType: 1, + itemDetail: [], + goodsDetail: [], +}) const save = () => { let json = { chinaAdjunctCheck: formData.value.chinaAdjunctCheck, @@ -81,7 +86,7 @@ const save = () => { const data = { registrationId: registerId.value, patientId: patientId.value, - itemList: itemList.value, + itemList: itemDetail.value, goodsList: goodsList.value, diagnosisMedicalRecord: medicalRecord, @@ -122,7 +127,7 @@ const getId = (item: any) => { }).then((res: any) => { formData.value = res.diagnosisMedicalRecord goodsList.value = res.goodsDetail - itemList.value = res.itemDetail + itemDetail.value = res.itemDetail patientRegistration.value = res.patientRegistration }) @@ -141,9 +146,10 @@ const deleteItem = () => { } const getStatus = (e: any) => { status.value = e - formData.value = {} - goodsList.value = [] - itemList.value = [] + + formData.value.itemDetail = [] + // goodsList.value = [] + // itemDetail.value = [] patientRegistration.value = {} nextTick(() => { medicalHistoryRef.value?.clearList(); @@ -155,8 +161,19 @@ const edit = () => { status.value = 2 }) } +const getOrderTotalPrice = () => { + let totalPrice = 0 + formData.value.itemDetail?.forEach((item: any) => { + totalPrice += item.selectedPrice * item.selectedNum + }) + formData.value.goodsDetail?.forEach((item: any) => { + totalPrice += item.selectedPrice * item.selectedNum + }) + formData.value.preTotalPrice = totalPrice + formData.value.totalPrice = totalPrice +} // 使用 watch 监听 goodsList 和 itemList 的变化 -watch([() => goodsList.value, itemList], ([newGoodsList, newItemList]) => { +watch([() => goodsList.value, itemDetail], ([newGoodsList, newItemList]) => { const pharmaceuticalTotalAmount = newItemList.reduce((pre: any, cur: any) => { return pre + cur.unitPrice * cur.selectedNum }, 0); @@ -176,7 +193,7 @@ const copyForm=(item:any) => { } const copyItemList=(item:any) => { console.log(item) - itemList.value = item.itemDetail + itemDetail.value = item.itemDetail } const copyGoodsList=(item:any) => { goodsList.value = item.goodsDetail