From 22a9a5fe525fb893ecaa8d4a8bfb65169ce02fc4 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期五, 11 四月 2025 14:52:27 +0800
Subject: [PATCH] update & refactor
---
src/views/ecg/doctor/components/DevReadyPanel.vue | 47 +++++++++++++++++++++++++++--------------------
1 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/src/views/ecg/doctor/components/DevReadyPanel.vue b/src/views/ecg/doctor/components/DevReadyPanel.vue
index 96b1d7b..8c190ff 100644
--- a/src/views/ecg/doctor/components/DevReadyPanel.vue
+++ b/src/views/ecg/doctor/components/DevReadyPanel.vue
@@ -11,7 +11,7 @@
v-loading="formLoading"
>
<el-form-item label="妫�鏌ラ」鐩�" prop="">
- {{formData?.checkType && checkTypeStore.getCheckTypeName(formData?.checkType)}}
+ {{formData?.checkType && getCheckTypeName(formData?.checkType)}}
</el-form-item>
<el-form-item label="鎮h�呯紪鍙�" prop="patId">
<el-input v-model="formData.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" @input="getRentInfoByPatId" />
@@ -55,11 +55,10 @@
<el-button @click="submitForm" type="primary" :disabled="formLoading">棰嗙敤瀹屾垚</el-button>
<el-checkbox style="margin-left:10px" label="鑷姩 " v-model="autoPrint" />
<el-button @click="printBill(formData.patId!, formData.checkType!)">鎵撳嵃灏忕エ</el-button>
- <el-button @click="printBill(formData.patId!, formData.checkType!, 8)">鎵撳嵃灏忕エ2</el-button>
<el-button @click="cancelReady" :disabled="formLoading">鏀惧純棰嗙敤</el-button>
<el-button @click="resetForm()">閲� 缃�</el-button>
- <el-button v-if="formData.checkType && checkTypeStore.getExpenseRecognition(formData.checkType)" @click="feeConfirm" :disabled="formLoading">纭垂</el-button>
- <el-button v-if="formData.checkType && checkTypeStore.getExpenseRecognition(formData.checkType)" @click="feeCancel" :disabled="formLoading">鍙栨秷纭垂</el-button>
+ <el-button v-if="needAutoFeeConfirm(formData.checkType)" @click="feeConfirm" :disabled="formLoading">纭垂</el-button>
+ <el-button v-if="needAutoFeeConfirm(formData.checkType)" @click="feeCancel" :disabled="formLoading">鍙栨秷纭垂</el-button>
<!-- 鍖荤敓瑁呮満鍒楄〃 -->
<ContentWrap>
@@ -150,6 +149,7 @@
import {calGender, getBookBeginTime} from "@/utils";
import {DICT_TYPE} from "@/utils/dict";
import {tranlateDevState} from "@/utils/statusFormatter";
+import {getCheckTypeName} from "../../../../utils/checkTypeFormatter";
/** 璁惧棰嗙敤 琛ㄥ崟 */
defineComponent({ name: 'DevReadyPanel' })
@@ -175,6 +175,7 @@
const checkTypeStore = useCheckTypeStore()
const formData = ref<Partial<DevRentVO>>({
+ id: undefined,
devId: undefined,
patId: undefined,
patName: undefined,
@@ -184,8 +185,6 @@
returnTime: undefined,
remark: undefined,
paid: undefined,
- roomId: props.room.roomId,
- bedNo: props.room.bedNo
})
const formRules = reactive({
@@ -204,6 +203,13 @@
})
const displayBarCode = ref<string> ()
+
+const needAutoFeeConfirm = (checkType: number | null | undefined) => {
+ if (checkType == null)
+ return false
+
+ return checkTypeStore.getExpenseRecognition(checkType)
+}
const getRentInfoByPatId = () => {
const tempPatId = formData.value.patId;
@@ -238,13 +244,16 @@
try {
formData.value.roomId = props.room.roomId
formData.value.bedNo = props.room.bedNo
- const data = formData.value
- console.info( data )
+ await DevRentApi.devReady(formData.value)
- await DevRentApi.devReady(data)
+ if (autoPrint.value && formData.value.patId && formData.value.checkType) {
+ printBill(formData.value.patId, formData.value.checkType)
+ }
- if (autoPrint.value && data.patId && data.checkType)
- printBill( data.patId, data.checkType)
+ // 鑷姩纭垂
+ if (needAutoFeeConfirm(formData.value.checkType)) {
+ feeConfirm()
+ }
dialogVisible.value = false
// 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
@@ -285,8 +294,6 @@
remark: undefined,
patDetails: undefined,
paid: undefined,
- roomId: props.room.roomId,
- bedNo: props.room.bedNo
}
formRef.value?.resetFields()
@@ -373,7 +380,7 @@
//var panel = hiprintTemplate.addPrintPanel({ width: 100, height: 130, paperFooter: 340, paperHeader: 10 }); 瀵艰嚧璧颁笁椤�
var panel = hiprintTemplate.addPrintPanel({ width: 140, height: 130, paperNumberDisabled:true});
//鏂囨湰
- const checkTypeName = checkTypeStore.getCheckTypeName(curAppointment.bookCheckType)
+ const checkTypeName = getCheckTypeName(curAppointment.bookCheckType)
panel.addPrintText({ options: { width: 140, height: 12, top: 2, left: 20, title: checkTypeName, textAlign: 'center', fontSize: 10, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
const patientBaisc = curAppointment.patName + " " + calGender(curAppointment.patGender) + " " + calculateAge(curAppointment.patBirthday) + "宀�"
panel.addPrintText({ options: { width: 140, height: 12, top: 16, left: 20, title: patientBaisc, textAlign: 'center' , fontSize: 10, fontFamily: '寰蒋闆呴粦', fontWeight: '700', } });
@@ -387,8 +394,8 @@
panel.addPrintText({ options: { width: 140, height: 22, top: 86, left: 20, title: curAppointment.episodeId, textType: 'barcode' } });
//鎵撳嵃
- if (undefined === printMode)
- hiprintTemplate.print2([{},{},{}]); // 鍙互浼� [瀹氫綅鍙傛暟] http://https://ccsimple.github.io/sv-print-docs/config/template.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E8%AE%BE%E8%AE%A1%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B
+ if (printMode == null)
+ hiprintTemplate.print2([{},{},{}]); // 棰勮鏂瑰紡 鍙互浼� [瀹氫綅鍙傛暟] http://https://ccsimple.github.io/sv-print-docs/config/template.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E8%AE%BE%E8%AE%A1%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B
else
hiprintTemplate.print([{},{},{}]);
}
@@ -444,24 +451,24 @@
}
const feeConfirm = async () => {
- if (formData.value?.id === undefined) {
+ if (formData.value.id == null) {
message.error(t('璇峰厛棰嗙敤'))
return
}
const result = await DevRentApi.feeConfirm(formData.value.id)
- if (0 == result)
+ if (0 === result)
message.success(t('纭垂鎿嶄綔鎴愬姛'))
}
const feeCancel = async () => {
- if (formData.value?.id === undefined) {
+ if (formData.value.id == null) {
message.error(t('璇峰厛棰嗙敤'))
return
}
const result = await DevRentApi.feeCancel(formData.value.id)
- if (0 == result)
+ if (0 === result)
message.success(t('鎿嶄綔鎴愬姛'))
}
--
Gitblit v1.9.3