From 6ab4b1e0b68e4c347110e37018fa005603f53904 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期二, 29 九月 2026 23:49:04 +0800
Subject: [PATCH] ai优化
---
src/views/ecg/doctor/components/RoutinePanel.vue | 344 ++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 264 insertions(+), 80 deletions(-)
diff --git a/src/views/ecg/doctor/components/RoutinePanel.vue b/src/views/ecg/doctor/components/RoutinePanel.vue
index 9b31f4a..bfebfcd 100644
--- a/src/views/ecg/doctor/components/RoutinePanel.vue
+++ b/src/views/ecg/doctor/components/RoutinePanel.vue
@@ -1,55 +1,141 @@
<!-- 甯歌妫�鏌� 鍖荤敓鐣岄潰-->
<template>
- <el-form
- ref="formRef"
- :model="formData"
- :rules="formRules"
- label-width="100px"
- v-loading="formLoading"
- >
+ <el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading">
<el-row :gutter="20">
- <el-col :span="12">
+ <el-col :span="6">
<el-form-item label="鎮h�呯紪鍙�" prop="patId">
- <el-input
- v-model="formData.patId"
- placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�"
- @input="getRentInfoByPatId"
- />
- <!-- <Qrcode v-if="formData.patId !== undefined && formData.patId !== ''" :text="formData.patId" logo="/logo.gif" width=100 />-->
+ <el-input v-model="formData.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" @input="getRentInfoByPatId" />
+ <!--
+ <Qrcode v-if="formData.patId !== undefined && formData.patId !== ''" :text="formData.patId" logo="/logo.gif" width=100 />
<Barcode v-if="displayBarCode" :value="displayBarCode" :width="100" />
<el-button @click="copyBarcode()">澶嶅埗</el-button>
+ -->
</el-form-item>
+ </el-col>
+ <el-col :span="6">
<el-form-item label="鎮h�呭悕绉�" prop="patName">
<el-input v-model="formData.patName" placeholder="璇疯緭鍏ユ偅鑰呭悕绉�" />
</el-form-item>
- <el-form-item label="鎮h�呮弿杩�" prop="patDetails">
- <dict-tag
- v-if="formData.patDetails?.source"
- :type="DICT_TYPE.ECG_PAT_SOURCE"
- :value="formData.patDetails?.source"
- />
- {{ formData?.patDetails?.deptDesc }} {{ formData?.patDetails?.wardDesc }}
- {{ formData?.patDetails?.bedNo }}
- </el-form-item>
- <el-form-item label="妫�鏌ユ椂闂�" prop="rentTime">
- <el-date-picker
- v-model="formData.rentTime"
- type="date"
- value-format="x"
- placeholder="閫夋嫨瑁呮満鏃堕棿"
- />
+ </el-col><el-col :span="6">
+ <el-form-item label="鎬у埆">
+ {{ genderText }}
</el-form-item>
</el-col>
- <el-col :span="12">
+
+ <el-col :span="6">
+ <el-form-item label="鑱旂郴鐢佃瘽" prop="episodeId">
+ <!-- 淇锛氬師璇� `patDetails.mobile`锛坬ueue 琛ㄧ殑 JSON 蹇収锛屽彧鍚� source/mobile/wardDesc/bedNo 鍥涘瓧娈碉級銆�
+ 鑰� setPatient 宸叉妸鍚庣浠� appointment 鍥炲~鐨�**骞抽摵瀛楁** `patMobile` 璧嬭繘 formData锛�
+ 鏁呭簲浠ュ钩閾哄瓧娈典紭鍏堬紝patDetails 浠呬綔鏃ф暟鎹洖閫�銆� -->
+ {{ formData.patMobile || formData?.patDetails?.mobile || '-' }}
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="6">
+ <el-form-item label="灏辫瘖缂栧彿" prop="episodeId">
+ <el-input v-model="formData.episodeId" placeholder="璇疯緭鍏ユ偅鑰呭氨璇婄紪鍙�" />
+ </el-form-item>
+ </el-col><el-col :span="6">
+ <el-form-item label="鍑虹敓鏃ユ湡">
+ {{ fmtDate(formData.patBirthday) }}
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="骞撮緞">
+ {{ ageText }}
+ </el-form-item>
+ </el-col><el-col :span="6">
+ <el-form-item label="寮�鍗曞尰甯�">
+ {{ formData.doctor }}
+ </el-form-item>
+ </el-col>
+
+
+ </el-row>
+ <el-row><el-col :span="6">
+ <el-form-item label="鐢宠鍗曞彿" prop="applyNo">
+ <el-input v-model="formData.applyNo" placeholder="璇疯緭鍏ョ敵璇峰崟鍙�" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="18">
+ <el-form-item label="绉戝鐥呭尯" prop="patDetails">
+ <!-- 淇锛氭潵婧愪笌鐥呭尯/搴婂彿鍘熻 `patDetails.*`锛坬ueue 琛ㄧ殑 JSON 蹇収锛屽彲鑳芥粸鍚庝笖甯哥己鐥呭尯锛夛紝
+ 鏀逛负**骞抽摵瀛楁浼樺厛**锛堝悗绔凡浠� appointment 鍥炲~ patSrc/patWardDesc/patBedNo锛夛紝
+ patDetails 浠呬綔鏃ф暟鎹洖閫�銆� -->
+ <dict-tag v-if="formData.patSrc ?? formData.patDetails?.source"
+ :type="DICT_TYPE.ECG_PAT_SOURCE"
+ :value="formData.patSrc ?? formData.patDetails?.source" />
+ {{ formData.patWardDesc || formData?.patDetails?.wardDesc || '-' }}
+ - {{ formData.patBedNo || formData?.patDetails?.bedNo || '-' }}
+ </el-form-item></el-col>
+
+
+ </el-row>
+ <el-row>
+ <el-col :span="6">
+ <el-form-item label="寮�鍗曟棩鏈�">
+ {{ fmtDate(formData.doctorTime) }}
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="璺濅粖澶╂暟">
+ {{ daysFromOrder }}
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="鍖诲槺鍙�">
+ <!-- 淇锛氭澶勫師鍏堢粦瀹氱殑鏄� `formData.applyNo`锛堢敵璇峰崟鍙凤級锛�
+ 涓庛�屽尰鍢卞彿銆嶆槸**涓や釜涓嶅悓鐨勬爣璇�**锛�
+ 鐢宠鍗曞彿 apply_no = HIS root 2.16.156.10011.1.24锛屼緥 2126091700011
+ 鍖诲槺鍙� doctor_advice_no = HIS root 2.16.156.10011.1.28锛屼緥 112663505
+ 鍘熷啓娉曟槸鎶婄敵璇峰崟鍙峰啋鍏呮垚鍖诲槺鍙凤紝灞炰簬閿欒灞曠ず銆�
+ 鐜版敼涓鸿鍚庣鏂伴噰闆嗙殑 doctorAdviceNo锛堣鑺傜偣瑙勮寖涓潪蹇呴』椤癸紝鍘嗗彶鏁版嵁涓虹┖ 鈫� 鏄剧ず '-'锛夈�� -->
+ {{ formData.doctorAdviceNo || '-' }}
+ </el-form-item>
+ </el-col><el-col :span="6">
+ <el-form-item label="鐧昏鏃堕棿">
+ {{ fmtDate(formData.registerDate) }}
+ </el-form-item>
+ </el-col>
+
+ </el-row>
+ <!-- 闇�姹�1锛氳ˉ榻愭湰闈㈡澘鍘熷厛缂哄け鐨勪袱椤癸紙鎺掗槦搴忓彿銆佺姸鎬侊級锛屼娇 18 椤归綈鍏� -->
+ <el-row>
+ <el-col :span="6">
+ <el-form-item label="鎺掗槦搴忓彿">
+ {{ formData?.seqNum ?? formData?.bookSeqNum ?? '-' }}
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="鐘舵��">
+ <dict-tag v-if="formData?.status !== undefined && formData?.status !== null"
+ :type="DICT_TYPE.ECG_QUEUE_STATUS" :value="formData.status" />
+ <span v-else>-</span>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="6">
+ <el-form-item label="妫�鏌ユ椂闂�" prop="rentTime">
+ <el-date-picker v-model="formData.rentTime" type="date" value-format="x" placeholder="閫夋嫨鏃堕棿" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
<el-form-item label="妫�鏌ラ」鐩�" prop="">
{{ formData?.checkType && getCheckTypeName(formData?.checkType) }}
</el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="澶氳�愯嵂" prop="tolerance">
+ <!-- 闇�姹�6锛氱粺涓�璧板瓧鍏� ecg_tolerance锛�0=鏃� 1=澶氳�� 2=澶氶噸鑰愯嵂锛夛紱
+ NULL 鎸�"鏃�"鏄剧ず锛圦12锛夈�傚師鍏堢‖缂栫爜"鍚�/鏄�/鏈煡"涓夊垎鏀紝涓庡瓧鍏搁噸澶嶄笖鏂囨涓嶇銆� -->
+ <dict-tag :type="DICT_TYPE.ECG_TOLERANCE" :value="formData.tolerance ?? 0" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
<el-form-item label="澶囨敞" prop="remark">
<el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" />
- </el-form-item>
- <el-form-item label="鏄惁澶氳��" prop="tolerance">
- <el-tag type="info" v-if="formData.tolerance == 0">鍚�</el-tag>
- <el-tag type="danger" v-else>鏄�</el-tag>
</el-form-item>
</el-col>
</el-row>
@@ -57,30 +143,14 @@
<el-button @click="submitForm" type="primary" :disabled="formLoading">妫�鏌ュ畬鎴�</el-button>
<el-button @click="cancelInstall" :disabled="formLoading">鏀惧純妫�鏌�</el-button>
<el-button @click="resetForm()">閲� 缃�</el-button>
- <el-button @click="yddownload()">骞虫澘杩愬姩蹇冪數鍥剧煡鎯呭悓鎰忎功</el-button>
- <el-button @click="sgdownload()">椋熺蹇冭剰鐢电敓鐞嗚瘖鐤楃煡鎯呭悓鎰忎功</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
- >
+ <el-button @click="yddownload()" :loading="yddownloadLoading" :disabled="yddownloadLoading">骞虫澘杩愬姩蹇冪數鍥剧煡鎯呭悓鎰忎功</el-button>
+ <el-button @click="sgdownload()" :loading="sgdownloadLoading" :disabled="sgdownloadLoading">椋熺蹇冭剰鐢电敓鐞嗚瘖鐤楃煡鎯呭悓鎰忎功</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>
- <el-table
- v-loading="loading"
- :data="list"
- :stripe="true"
- :show-overflow-tooltip="true"
- @row-click="onRowClick"
- >
+ <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @row-click="onRowClick">
<!-- <el-table-column label="id" align="center" prop="id" />-->
<el-table-column label="妫�鏌ョ姸鎬�" align="center" prop="lost">
<template #default="scope">
@@ -94,22 +164,10 @@
<!-- <el-table-column label="璁惧缂栧彿" align="center" prop="devId" />-->
<el-table-column label="鎮h�呯紪鍙�" align="center" prop="patId" />
<el-table-column label="鎮h�呭悕绉�" align="center" prop="patName" />
- <el-table-column
- label="浣滀笟鏃堕棿"
- align="center"
- prop="jobTime"
- :formatter="dateFormatter"
- width="180px"
- />
+ <el-table-column label="浣滀笟鏃堕棿" align="center" prop="jobTime" :formatter="dateFormatter" width="180px" />
<!-- <el-table-column label="浣滀笟姒傝" align="center" prop="summary" />-->
<el-table-column label="澶囨敞" align="center" prop="remark" />
- <el-table-column
- label="鍒涘缓鏃堕棿"
- align="center"
- prop="createTime"
- :formatter="dateFormatter"
- width="180px"
- />
+ <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" :formatter="dateFormatter" width="180px" />
<!--
<el-table-column label="鎿嶄綔" align="center" min-width="120px">
<template #default="scope">
@@ -134,12 +192,8 @@
-->
</el-table>
<!-- 鍒嗛〉 -->
- <Pagination
- :total="total"
- v-model:page="queryParams.pageNo"
- v-model:limit="queryParams.pageSize"
- @pagination="getList"
- />
+ <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
+ @pagination="getList" />
</ContentWrap>
</template>
@@ -150,7 +204,9 @@
import { dateFormatter } from '@/utils/formatTime'
import { JobRecordApi, JobRecordVO } from '@/api/ecg/jobrecord'
import { isStringEmpty } from '@/utils/stringUtil'
-import { curDayEnd, curDayStart } from '@/utils/dateUtil'
+import { calculateAge, curDayEnd, curDayStart, formatTimestamp } from '@/utils/dateUtil'
+import { calGender } from '@/utils'
+import dayjs from 'dayjs'
import { QueueVO } from '@/api/ecg/queue'
import { RoomBedVO, DoctorApi } from '@/api/ecg/doctor'
import { Barcode } from '@/components/Barcode'
@@ -183,6 +239,28 @@
formData.value.patId = queueVO?.patId
formData.value.patName = queueVO?.patName
formData.value.checkType = queueVO?.bookCheckType
+ // 浠ヤ笅瀛楁鐢卞悗绔粠棰勭害鍗曡ˉ榻愶紙queue 琛ㄤ笉瀛橈級锛岀敤浜庡尰鐢熺灞曠ず
+ formData.value.patGender = queueVO?.patGender
+ formData.value.tolerance = queueVO?.tolerance
+ formData.value.patBirthday = queueVO?.patBirthday
+ formData.value.registerDate = queueVO?.registerDate
+ formData.value.doctor = queueVO?.doctor
+ formData.value.doctorTime = queueVO?.doctorTime
+ // 闇�姹�1锛氳ˉ榻愭帓闃熷簭鍙� / 鐘舵�� / 鐥呭尯 / 搴婂彿 / 鐢佃瘽 / 鏉ユ簮 / 闂ㄨ瘖鍙�
+ // 杩欎簺骞抽摵瀛楁鐢卞悗绔� QueueServiceImpl#fillAppointmentInfo 鍥炲~锛�
+ // 鍘熷厛杩欓噷娌℃湁璧嬪�硷紝瀵艰嚧妯℃澘閲岃涓嶅埌锛堟樉绀轰负绌猴級銆�
+ formData.value.seqNum = queueVO?.seqNum
+ formData.value.status = queueVO?.status
+ formData.value.patSrc = queueVO?.patSrc
+ formData.value.patMobile = queueVO?.patMobile
+ formData.value.patPhone = queueVO?.patPhone
+ formData.value.patWardDesc = queueVO?.patWardDesc
+ formData.value.patBedNo = queueVO?.patBedNo
+ formData.value.medicalCard = queueVO?.medicalCard
+ formData.value.outpatientNo = queueVO?.outpatientNo
+ // 闇�姹�1锛氬尰鍢卞彿锛堟鍓� 3 涓潰鏉块兘閬楁紡浜嗚瀛楁鐨勮祴鍊硷紝瀵艰嚧 PatientInfoBlock 鎭掓樉绀� '-'锛�
+ formData.value.doctorAdviceNo = queueVO?.doctorAdviceNo
+ formData.value.patIdentityId = queueVO?.patIdentityId
getFreeRentInfo(formData.value)
copyBarcode()
}
@@ -192,7 +270,8 @@
const message = useMessage() // 娑堟伅寮圭獥
const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀�
-
+const yddownloadLoading = ref(false);
+const sgdownloadLoading = ref(false);
const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤
const formData = ref<Partial<DevRentVO>>({
@@ -200,12 +279,46 @@
devId: undefined,
patId: undefined,
patName: undefined,
+ patGender: undefined,
patDetails: undefined,
checkType: undefined,
rentTime: new Date().getTime(),
returnTime: undefined,
+ tolerance: undefined,
+ patBirthday: undefined,
+ registerDate: undefined,
+ doctor: undefined,
+ doctorTime: undefined,
remark: undefined,
paid: undefined
+})
+
+/** 鍚庣鏃ユ湡缁熶竴鏄绉掓椂闂存埑锛岃浆鎴� YYYY-MM-DD 灞曠ず */
+const fmtDate = (value?: number | null) => (value ? formatTimestamp(value as unknown as Date) : '')
+
+// 鎬у埆锛�1 鐢� 2 濂炽�備负绌烘椂涓嶈蛋 calGender锛堝畠浼氭妸绌哄�煎綋鎴�"濂�"锛�
+const genderText = computed(() => {
+ const gender = formData.value.patGender
+ return gender === 1 || gender === 2 ? calGender(gender) : ''
+})
+
+// 骞撮緞锛氭寜鍑虹敓鏃ユ湡璁$畻
+const ageText = computed(() => {
+ const birthday = formData.value.patBirthday
+ if (!birthday) {
+ return ''
+ }
+ const age = calculateAge(birthday as unknown as Date)
+ return Number.isFinite(age) ? `${age}宀乣 : ''
+})
+
+// 璺濅粖澶╂暟锛氭寜寮�鍗曟棩鏈燂紙doctorTime锛夎绠�
+const daysFromOrder = computed(() => {
+ const orderTime = formData.value.doctorTime
+ if (!orderTime) {
+ return ''
+ }
+ return `${dayjs().startOf('day').diff(dayjs(orderTime).startOf('day'), 'day')}澶ー
})
const formRules = reactive({
@@ -251,25 +364,96 @@
devId: undefined,
patId: undefined,
patName: undefined,
+ patGender: undefined,
checkType: undefined,
rentTime: new Date().getTime(),
returnTime: undefined,
+ tolerance: undefined,
+ patBirthday: undefined,
+ registerDate: undefined,
+ doctor: undefined,
+ doctorTime: undefined,
interference: undefined,
baseline: undefined,
detachment: undefined,
remark: undefined,
patDetails: undefined,
paid: undefined,
+ doctorAdviceNo: undefined,
roomId: props.room.roomId,
bedNo: props.room.bedNo
}
formRef.value?.resetFields()
}
const yddownload = async () => {
- await DoctorApi.yddownload(props.setappointmentId)
+ // 妫�鏌� setappointmentId 鏄惁瀛樺湪
+ if (!props.setappointmentId) {
+ message.warning('褰撳墠鏃犲氨璇婁腑鎮h�呰鍏堝彨鍙�')
+ return
+ }
+
+ yddownloadLoading.value = true
+ try {
+ const response = await DoctorApi.yddownload(props.setappointmentId)
+ console.log(response, 'xml1')
+ console.log(response.fileContent, 'xml2')
+ downloadWordFile(response.fileContent, response.fileName)
+ } finally {
+ yddownloadLoading.value = false
+ }
}
+
const sgdownload = async () => {
- await DoctorApi.sgdownload(props.setappointmentId)
+ // 妫�鏌� setappointmentId 鏄惁瀛樺湪
+ if (!props.setappointmentId) {
+ message.warning('褰撳墠鏃犲氨璇婁腑鎮h�呰鍏堝彨鍙�')
+ return
+ }
+
+ sgdownloadLoading.value = true
+ try {
+ const response = await DoctorApi.sgdownload(props.setappointmentId)
+ downloadWordFile(response.fileContent, response.fileName)
+ } finally {
+ sgdownloadLoading.value = false
+ }
+}
+const downloadWordFile = (data, filename = 'document') => {
+ try {
+ // 1. 纭繚鏂囦欢鍚嶄互.doc缁撳熬
+ if (!filename.endsWith('.doc')) {
+ filename += '.doc'
+ }
+
+ // 2. 鍒涘缓Blob瀵硅薄锛屾寚瀹歁IME绫诲瀷涓篧ord鏂囨。[9,10](@ref)
+ // 瀵逛簬Word 2003 XML鏍煎紡锛屼娇鐢�'application/msword'
+ const blob = new Blob([data], { type: 'application/msword' })
+
+ // 3. 涓築lob瀵硅薄鍒涘缓涓�涓复鏃剁殑涓嬭浇URL[8,10](@ref)
+ const url = URL.createObjectURL(blob)
+
+ // 4. 鍒涘缓涓�涓殣钘忕殑涓嶅彲瑙佺殑<a>閾炬帴鍏冪礌[10](@ref)
+ const link = document.createElement('a')
+ link.style.display = 'none' // 闅愯棌閾炬帴
+ link.href = url
+ link.download = filename // 璁剧疆涓嬭浇鐨勬枃浠跺悕
+
+ // 5. 灏嗛摼鎺ユ坊鍔犲埌DOM涓紝妯℃嫙鐐瑰嚮锛岀劧鍚庣Щ闄ゅ畠[10](@ref)
+ document.body.appendChild(link)
+ link.click()
+ document.body.removeChild(link)
+
+ // 6. 閲婃斁URL瀵硅薄浠ラ噴鏀惧唴瀛榌9,10](@ref)
+ // 浣跨敤setTimeout纭繚涓嬭浇瑙﹀彂鍚庡啀閲婃斁
+ setTimeout(() => {
+ URL.revokeObjectURL(url)
+ }, 100)
+
+ console.log('鏂囦欢涓嬭浇宸茶Е鍙戯紒')
+ } catch (error) {
+ console.error('涓嬭浇鏂囦欢鏃跺彂鐢熼敊璇�:', error)
+ // 杩欓噷鍙互娣诲姞鏇村弸濂界殑鐢ㄦ埛閿欒鎻愮ず锛屼緥濡備娇鐢╝lert鎴栭〉闈㈠脊绐�
+ }
}
const getRentInfoByPatId = () => {
const tempPatId = formData.value.patId
--
Gitblit v1.9.3