From d79ce11fcd47db138764557d214f4ea2169fb90a Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期五, 20 六月 2025 18:05:38 +0800 Subject: [PATCH] 维护 --- src/views/ecg/doctor/components/DevReadyPanel.vue | 131 +++++++++++++++++++++++++------------------ 1 files changed, 77 insertions(+), 54 deletions(-) diff --git a/src/views/ecg/doctor/components/DevReadyPanel.vue b/src/views/ecg/doctor/components/DevReadyPanel.vue index 8b3411f..1b6991b 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)}} + {{getCheckTypeName(formData.checkType)}} </el-form-item> <el-form-item label="鎮h�呯紪鍙�" prop="patId"> <el-input v-model="formData.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" @input="getRentInfoByPatId" /> @@ -40,6 +40,17 @@ placeholder="閫夋嫨棰嗙敤鏃堕棿" /> </el-form-item> + <el-form-item label="鏄惁澶氳��" prop="tolerance"> + <el-radio-group v-model="formData.tolerance" readonly> + <el-radio + v-for="dict in getIntDictOptions(DICT_TYPE.ecg_tolerance)" + :key="dict.value" + :value="dict.value" + > + {{ dict.label }} + </el-radio> + </el-radio-group> + </el-form-item> <el-form-item label="澶囨敞" prop="remark"> <el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" /> </el-form-item> @@ -54,12 +65,11 @@ </el-form> <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="printBill(formData.patDetails?.appointmentId)">鎵撳嵃灏忕エ</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> @@ -148,8 +158,9 @@ import {AppointmentApi, AppointmentVO} from "@/api/ecg/appointment"; import {useCheckTypeStore} from '@/store/modules/checkType' import {calGender, getBookBeginTime} from "@/utils"; -import {DICT_TYPE} from "@/utils/dict"; +import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import {tranlateDevState} from "@/utils/statusFormatter"; +import {getCheckTypeName, needAutoFeeConfirm} from "../../../../utils/checkTypeFormatter"; /** 璁惧棰嗙敤 琛ㄥ崟 */ defineComponent({ name: 'DevReadyPanel' }) @@ -166,8 +177,6 @@ const { t } = useI18n() // 鍥介檯鍖� const message = useMessage() // 娑堟伅寮圭獥 -const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀� - const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤 const autoPrint = ref<boolean>(true); @@ -176,8 +185,6 @@ const formData = ref<DevRentVO>({ id: undefined, - applyNo: undefined, - episodeId: undefined, devId: undefined, patId: undefined, patName: undefined, @@ -185,13 +192,8 @@ checkType: undefined, rentTime: new Date().getTime(), returnTime: undefined, - interference: undefined, - baseline: undefined, - detachment: undefined, remark: undefined, paid: undefined, - roomId: props.room.roomId, - bedNo: props.room.bedNo }) const formRules = reactive({ @@ -224,6 +226,9 @@ // 鏍规嵁鎮h�呮垨璁惧, 鑾峰彇 Free鐨勭璧� const getFreeRentInfo = async (devRentVO) => { + if ((devRentVO.devId == null || devRentVO.devId === '') && (devRentVO.patId == null || devRentVO.patId === '') ) + return + const data = await DevRentApi.getFreeRent(devRentVO) if (null === data) return @@ -244,20 +249,22 @@ 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.patDetails?.appointmentId) + } - if (autoPrint.value && data.patId && data.checkType) - printBill( data.patId, data.checkType) + // 鑷姩纭垂 + if (needAutoFeeConfirm(formData.value.checkType)) { + feeConfirm() + } - dialogVisible.value = false - // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢 - emit('event_dev_ready') resetForm() getList() + // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢 + emit('event_dev_ready') message.success(t('鎿嶄綔瀹屾垚')) } finally { formLoading.value = false @@ -282,23 +289,15 @@ /** 閲嶇疆琛ㄥ崟 */ const resetForm = () => { formData.value = { - id: undefined, - applyNo: undefined, - episodeId: undefined, devId: undefined, patId: undefined, patName: undefined, checkType: undefined, rentTime: new Date().getTime(), returnTime: undefined, - interference: undefined, - baseline: undefined, - detachment: undefined, remark: undefined, patDetails: undefined, paid: undefined, - roomId: props.room.roomId, - bedNo: props.room.bedNo } formRef.value?.resetFields() @@ -317,7 +316,7 @@ formData.value.patId = queueVO?.patId formData.value.patName = queueVO?.patName formData.value.checkType = queueVO?.bookCheckType - getFreeRentInfo(formData.value) + getFreeRentInfo(formData.value) // 寰呮鏌ョ殑淇℃伅 @ dev_rent 琛� copyBarcode() } defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰� @@ -369,10 +368,11 @@ devInfo.value.state = data.devState } -const printBill = async (patId: string, checkType: number, printMode?: number) => { +const printBill = async (appointmentId: number | null | undefined, printMode?: number) => { + if ( appointmentId == null ) + return - const curAppointment: AppointmentVO = await AppointmentApi.getCurAppointmentByPatIdAndCheckType( patId, checkType ) - console.info( curAppointment ) + const curAppointment: AppointmentVO = await AppointmentApi.getAppointment( appointmentId ) // 寮曞叆鍚庝娇鐢ㄧず渚� hiprint.init({ @@ -385,7 +385,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', } }); @@ -399,8 +399,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([{},{},{}]); } @@ -456,41 +456,59 @@ } const feeConfirm = async () => { - if (formData.value?.id === undefined) { - message.error(t('璇峰厛棰嗙敤')) + if (formData.value.id == null) { + message.error('璇峰厛棰嗙敤') return } - const result = await DevRentApi.feeConfirm(formData.value.id) - if (0 == result) - message.success(t('纭垂鎿嶄綔鎴愬姛')) + try { + const result = await DevRentApi.feeConfirm(formData.value.id) + if (0 === result) { + //message.success('纭垂鎿嶄綔鎴愬姛') + } + } catch (err) { + // 妗嗘灦 浼氱粰鍑� 鍚庡彴鐨� 閿欒淇℃伅 + } } const feeCancel = async () => { - if (formData.value?.id === undefined) { - message.error(t('璇峰厛棰嗙敤')) + if (formData.value.id == null) { + message.error('璇峰厛棰嗙敤') return } - const result = await DevRentApi.feeCancel(formData.value.id) - if (0 == result) - message.success(t('鎿嶄綔鎴愬姛')) + try { + const result = await DevRentApi.feeCancel(formData.value.id) + if (0 === result) { + //message.success('纭垂鍙栨秷鎴愬姛') + } + } catch (err) { + // 妗嗘灦 浼氱粰鍑� 鍚庡彴鐨� 閿欒淇℃伅 + } } +/** + * 鑾峰彇鏉″舰鐮侊紝鏄剧ず涓庡惁 鍚屼竴涓�� + */ const getDisplayBarcode = (): string => { - if (!formData.value.checkType) + if (formData.value.checkType == null) return "" - const displayBarcode: number[] = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType!) - if (formData.value.patDetails == null || formData.value.patDetails.source == null || - !displayBarcode.includes( formData.value.patDetails.source )) + if (formData.value.patDetails?.source == null) + return "" + + const displayBarcode: number[] = checkTypeStore.getCheckTypeDispBarCode(formData.value.checkType) + if (displayBarcode == null || displayBarcode.length === 0) + return "" + + if (!displayBarcode.includes( formData.value.patDetails.source )) return "" return getBarcode() } const getBarcode = (): string => { - if (!formData.value.checkType) + if (formData.value.checkType == null) return "" const patSource = formData.value.patDetails?.source @@ -507,7 +525,12 @@ const copyBarcode = async () => { displayBarCode.value = getDisplayBarcode() - await navigator.clipboard.writeText( getBarcode() ); + + const barCode = getBarcode() + if (isStringEmpty(barCode)) + return + + await navigator.clipboard.writeText( barCode ); } /** 鍒濆鍖� **/ -- Gitblit v1.9.3