From 38c2fe23d77c9f27d52941dab77a100bb1839dd7 Mon Sep 17 00:00:00 2001 From: WXL (wul) <wl_5969728@163.com> Date: 星期二, 02 九月 2025 16:31:10 +0800 Subject: [PATCH] 测试完成 --- src/views/patient/patient/outpatient.vue | 552 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 503 insertions(+), 49 deletions(-) diff --git a/src/views/patient/patient/outpatient.vue b/src/views/patient/patient/outpatient.vue index 2b3be23..7ee6864 100644 --- a/src/views/patient/patient/outpatient.vue +++ b/src/views/patient/patient/outpatient.vue @@ -11,7 +11,7 @@ v-show="showSearch" label-width="98px" > - <el-form-item label="濮撳悕" prop="name"> + <el-form-item label="濮撳悕" width="100" prop="name"> <el-input v-model="queryParams.patname" placeholder="璇疯緭鍏ュ鍚�" @@ -20,38 +20,84 @@ @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="鎮h�呯紪鍙�" prop="patid"> + <el-form-item label="璇婃柇" width="100" prop="name"> <el-input - v-model="queryParams.patid" - placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" + v-model="queryParams.diagname" + placeholder="璇疯緭鍏ヨ瘖鏂�" + clearable + style="width: 200px" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="绉戝" width="100" prop="name"> + <el-input + v-model="queryParams.deptname" + placeholder="璇疯緭鍏ョ瀹ゅ悕绉�" + clearable + style="width: 200px" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鍖荤敓" width="100" prop="name"> + <el-input + v-model="queryParams.drname" + placeholder="璇疯緭鍏ュ尰鐢熷鍚�" + clearable + style="width: 200px" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鐥呮鍙�" prop="outhospno"> + <el-input + v-model="queryParams.outhospno" + placeholder="璇疯緭鍏ョ梾妗堝彿" clearable style="width: 250px" @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="鎮h�呰寖鍥�" prop="tagId"> - <el-select v-model="queryParams.Patientid" placeholder="璇烽�夋嫨"> - <el-option - v-for="item in Patientrange" - :key="item.id" - :label="item.name" - :value="item.id" + <el-form-item label="鎮h�呰寖鍥�" prop="status"> + <el-cascader + v-model="queryParams.scopetype" + placeholder="榛樿鍏ㄩ儴" + :options="sourcetype" + :props="{ expandTrigger: 'hover' }" + @change="handleChange" + ></el-cascader> + </el-form-item> + <el-form-item label="灏辫瘖鏃ユ湡"> + <el-date-picker + v-model="dateRange" + style="width: 240px" + value-format="yyyy-MM-dd" + type="daterange" + range-separator="-" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + ></el-date-picker> + <!-- <el-date-picker + v-model="dateRange" + type="datetimerange" + value-format="yyyy-MM-dd HH:mm:ss" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + :default-time="['12:00:00']" > - </el-option> - </el-select> + </el-date-picker> --> </el-form-item> <el-row> - <el-form-item label=" 灏辫瘖鏃ユ湡 " prop="createTime"> + <!-- <el-form-item label=" 灏辫瘖鏃ユ湡 " prop="admitdate"> <el-date-picker clearable - v-model="queryParams.createTime" + v-model="queryParams.admitdate" type="date" value-format="yyyy-MM-dd" placeholder="璇烽�夋嫨 灏辫瘖鏃ユ湡 " > </el-date-picker> - </el-form-item> + </el-form-item> --> + <el-form-item> <el-button type="primary" @@ -106,6 +152,18 @@ >鍒犻櫎</el-button > </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-plus" + size="medium" + :disabled="multiple" + @click="handleBatchAddTask" + > + 鎵归噺娣诲姞浠诲姟</el-button + > + </el-col> <el-col :span="19"> <div class="documentf"> <div class="document"> @@ -151,44 +209,57 @@ <el-table-column label="灏辫瘖鏃堕棿" align="center" - key="createTime" - prop="createTime" + key="admitdate" + prop="admitdate" width="160" > <template slot-scope="scope"> - <span>{{ formatTime(scope.row.createTime) }}</span> + <span>{{ formatTime(scope.row.admitdate) }}</span> </template> </el-table-column> - - <el-table-column - label="闂ㄨ瘖鍙�" + <!-- <el-table-column + label="鐥呮鍙�" align="center" - key="patid" - prop="patid" + key="patno" + prop="patno" + /> --> + <el-table-column + label="鐥呮鍙�" + align="center" + key="outhospno" + prop="outhospno" /> <el-table-column - label="濮撳悕" - align="center" - key="patname" - prop="patname" + label="濮撳悕" + width="100" + align="center" + key="patname" + prop="patname" + > + <template slot-scope="scope"> + <el-button + size="medium" + type="text" + @click=" + gettoken360( + scope.row.idcardno, + scope.row.drcode, + scope.row.drname + ) + " + ><span class="button-textsc">{{ + scope.row.patname + }}</span></el-button > - <template slot-scope="scope"> - <el-button - size="medium" - type="text" - @click=" - $router.push({ - path: '/patient/indexls/', - query: { id: scope.row.id }, - }) - " - ><span class="button-textsc" - >{{scope.row.patname}}</span - ></el-button - > - </template> - </el-table-column> - <el-table-column label="鎬у埆" align="center" key="sex" prop="sex"> + </template> + </el-table-column> + <el-table-column + label="鎬у埆" + width="100" + align="center" + key="sex" + prop="sex" + > <template slot-scope="scope"> <span>{{ scope.row.sex == 1 ? "鐢�" : "濂�" }}</span> </template> @@ -284,7 +355,113 @@ /> </el-col> </el-row> + <el-dialog + title="鎵归噺娣诲姞浠诲姟" + :visible.sync="batchTaskVisible" + width="90%" + append-to-body + > + <el-row :gutter="20"> + <!-- 宸︿晶锛氶�変腑鎮h�呭垪琛� --> + <el-col :span="12"> + <div class="batch-patient-section"> + <h4>閫変腑鎮h�咃紙{{ selectedPatients.length }}浜猴級</h4> + <el-table + :data="selectedPatients" + border + style="width: 100%" + size="small" + > + <el-table-column prop="patname" label="濮撳悕" width="100" /> + <el-table-column prop="sex" label="鎬у埆" width="80"> + <template slot-scope="scope"> + {{ scope.row.sex === 1 ? "鐢�" : "濂�" }} + </template> + </el-table-column> + <el-table-column + label="灏辫瘖鏃堕棿" + align="center" + key="admitdate" + prop="admitdate" + > + <template slot-scope="scope"> + <span>{{ formatTime(scope.row.admitdate) }}</span> + </template> + </el-table-column> + <el-table-column prop="outhospno" label="鐥呮鍙�" /> + <el-table-column prop="deptname" label="绉戝" /> + </el-table> + </div> + </el-col> + <!-- 鍙充晶锛氫换鍔″垪琛� --> + <el-col :span="12"> + <div class="batch-task-section"> + <h4>浠诲姟鍒楄〃锛堣閫夋嫨1涓换鍔★級</h4> + <el-table + :data="taskList" + border + style="width: 100%" + size="small" + @current-change="handleTaskSelectionChange" + highlight-current-row + > + <el-table-column + label="浠诲姟鍚嶇О" + fixed + align="center" + key="taskName" + prop="taskName" + :show-overflow-tooltip="true" + /> + + <el-table-column + label="鏈嶅姟椤圭洰" + align="center" + key="templatename" + prop="templatename" + :show-overflow-tooltip="true" + /> + + <el-table-column + label="鍒涘缓浜�" + align="center" + key="createBy" + prop="createBy" + :show-overflow-tooltip="true" + /> + <el-table-column + label="鍒涘缓鏃堕棿" + sortable + align="center" + prop="createTime" + > + <template slot-scope="scope"> + <span>{{ formatTime(scope.row.createTime) }}</span> + </template> + </el-table-column> + <template #empty> + <div class="empty-message"> + <i class="el-icon-warning"></i> + <span>鎮h�呯瀹ゆ棤鍖归厤鏈嶅姟</span> + </div> + </template> + </el-table> + </div> + </el-col> + </el-row> + + <!-- 搴曢儴鎸夐挳 --> + <div slot="footer" class="dialog-footer"> + <el-button @click="batchTaskVisible = false">鍙� 娑�</el-button> + <el-button + type="primary" + :loading="batchLoading" + @click="submitBatchTask" + >鍒涘缓浠诲姟</el-button + > + </div> + </el-dialog> <!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� --> <el-dialog :title="upload.title" @@ -330,12 +507,15 @@ </div> </el-upload> </div> + <!-- 瀵煎叆妫�鏌� --> <div class="uploading" v-else-if="dractive == 2"> <el-table :data="uploadingData" style="width: 100%"> <el-table-column prop="serial" label="搴忓彿"> </el-table-column> - <el-table-column prop="name" label="濮撳悕"> </el-table-column> - <el-table-column prop="sex" label="鎬у埆"> </el-table-column> + <el-table-column prop="name" label="濮撳悕" width="100"> + </el-table-column> + <el-table-column prop="sex" label="鎬у埆" width="100"> + </el-table-column> <el-table-column prop="certificate" label="璇佷欢绫诲瀷"> </el-table-column> <el-table-column prop="certificatenum" label="璇佷欢鍙风爜"> @@ -386,10 +566,14 @@ updatePatouthosp, delPatouthosp, } from "@/api/smartor/patouthosp"; +import { particularpatient } from "@/api/patient/homepage"; import { listtag } from "@/api/system/label"; import { getToken } from "@/utils/auth"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; +import { query360PatInfo, getTasklist, addSubtask } from "@/api/AiCentre/index"; + +import store from "@/store"; export default { name: "Userhuanze", @@ -450,6 +634,12 @@ Labelchange: false, //淇敼鏂板寮圭獥 propss: { multiple: true }, optionstag: [], //鏍囩鍒楄〃 + batchTaskVisible: false, // 寮圭獥鍙鎬� + selectedPatients: [], // 閫変腑鐨勬偅鑰呭垪琛� + taskList: [], // 浠诲姟鍒楄〃 + selectedTask: null, // 閫変腑鐨勪换鍔″垪琛� + batchLoading: false, // 鎵归噺鎻愪氦鍔犺浇鐘舵�� + deptcode: "", Patientrange: [ { name: "鍏ㄩ儴", @@ -460,10 +650,59 @@ id: 1, }, ], + postData: { + XiaoXiTou: { + FaSongFCSJC: "ZJHES", + FaSongJGID: localStorage.getItem("orgid"), + FaSongJGMC: localStorage.getItem("orgname"), + FaSongSJ: "2025-01-09聽17:29:36", + FaSongXTJC: "SUIFANGXT", + FaSongXTMC: "闅忚绯荤粺", + XiaoXiID: "5FA92AFB-9833-4608-87C7-F56A654AC171", + XiaoXiLX: "SC_LC_360STCX", + XiaoXiMC: "360聽瑙嗗浘鏌ヨ", + ZuHuID: localStorage.getItem("ZuHuID"), + ZuHuMC: localStorage.getItem("orgname"), + }, + YeWuXX: { + BingRenXX: { + ZhengJianHM: "", + ZhengJianLXDM: "01", + ZhengJianLXMC: "灞呮皯韬唤璇�", + ZuZhiJGID: localStorage.getItem("orgid"), + ZuZhiJGMC: localStorage.getItem("orgname"), + }, + YongHuXX: { + XiTongID: "SUIFANGXT", + XiTongMC: "闅忚绯荤粺", + YongHuID: "1400466972205912064", + YongHuXM: "JNRMYY", + ZuZhiJGID: localStorage.getItem("orgid"), + ZuZhiJGMC: localStorage.getItem("orgname"), + idp: "lyra", + }, + }, + }, defaultProps: { children: "children", label: "label", }, + sourcetype: [ + { + value: 1, + label: "绉戝", + children: [], + }, + { + value: 2, + label: "鐥呭尯", + children: [], + }, + { + value: 3, + label: "鍏ㄩ儴", + }, + ], // 鐢ㄦ埛瀵煎叆鍙傛暟 upload: { // 鏄惁鏄剧ず寮瑰嚭灞傦紙鐢ㄦ埛瀵煎叆锛� @@ -483,6 +722,10 @@ queryParams: { pageNum: 1, pageSize: 10, + searchscope: 3, + scopetype: [], + leaveldeptcodes: [], + leavehospitaldistrictcodes: [], }, // 琛ㄥ崟鏍¢獙 rules: { @@ -539,6 +782,18 @@ }, }, created() { + this.sourcetype[0].children = store.getters.belongDepts.map((dept) => { + return { + label: dept.deptName, + value: dept.deptCode, + }; + }); + this.sourcetype[1].children = store.getters.belongWards.map((dept) => { + return { + label: dept.districtName, + value: dept.districtCode, + }; + }); this.getList(); this.gettabList(); }, @@ -546,8 +801,21 @@ /** 鏌ヨ鎮h�呭垪琛� */ getList() { this.loading = true; + if (this.queryParams.searchscope == 3) { + this.queryParams.leaveldeptcodes = store.getters.belongDepts.map( + (obj) => obj.deptCode + ); + this.queryParams.leavehospitaldistrictcodes = + store.getters.belongWards.map((obj) => obj.districtCode); + } + if (this.dateRange) { + this.queryParams.beginTime = this.dateRange[0]; + this.queryParams.endTime = this.dateRange[1]; + } else { + this.queryParams.beginTime = ""; + this.queryParams.endTime = ""; + } listPatouthosp(this.queryParams).then((response) => { - console.log(response); this.userList = response.rows; this.total = response.total; this.loading = false; @@ -567,6 +835,25 @@ this.optionstag = response.rows; }); }, + // 鎮h�呰寖鍥村鐞� + handleChange(value) { + let type = value[0]; + let code = value.slice(-1)[0]; + this.queryParams.leavehospitaldistrictcodes = []; + this.queryParams.leaveldeptcodes = []; + + if (type == 1) { + this.queryParams.leaveldeptcodes.push(code); + this.queryParams.leavehospitaldistrictcodes = []; + this.queryParams.searchscope = 1; + } else if (type == 2) { + this.queryParams.leavehospitaldistrictcodes.push(code); + this.queryParams.leaveldeptcodes = []; + this.queryParams.searchscope = 2; + } else { + this.queryParams.searchscope = 3; + } + }, // 鏌ヨ瀵煎叆灞曠ず鍒楄〃 geterryList() { this.loading = true; @@ -576,7 +863,23 @@ this.loading = false; }); }, + //鎮h��360璺宠浆 + gettoken360(sfzh, drcode, drname) { + this.postData.YeWuXX.BingRenXX.ZhengJianHM = sfzh; + if (this.postData.XiaoXiTou.ZuHuMC == "涓芥按甯備腑鍖婚櫌") { + this.postData.YeWuXX.YongHuXX.YongHuID = "1400398571877961728"; + this.postData.YeWuXX.YongHuXX.YongHuXM = "LSZYY"; + } + query360PatInfo(this.postData).then((res) => { + if (res.data.url) { + window.open(res.data.url, "_blank"); + // this.linkUrl = res.data.url; + } else { + this.$modal.msgWarning("360鏌ヨ鏃犵粨鏋�"); + } + }); + }, // 绛涢�夎妭鐐� filterNode(value, data) { if (!value) return true; @@ -616,7 +919,14 @@ resetQuery() { this.dateRange = []; this.resetForm("queryForm"); - this.$refs.tree.setCurrentKey(null); + this.queryParams = { + pageNum: 1, + pageSize: 10, + searchscope: 3, + scopetype: [], + leaveldeptcodes: [], + leavehospitaldistrictcodes: [], + }; this.handleQuery(); }, // 澶氶�夋閫変腑鏁版嵁 @@ -734,6 +1044,113 @@ this.upload.open = false; this.dractive = 1; }, + /** 鎵归噺娣诲姞浠诲姟鎸夐挳鐐瑰嚮 */ + handleBatchAddTask() { + // 鏍¢獙鏄惁閫変腑鎮h�� + if (this.ids.length === 0) { + this.$modal.msgWarning("璇疯嚦灏戦�変腑1鍚嶆偅鑰�"); + return; + } + + // 鑾峰彇閫変腑鎮h�呯殑绉戝淇℃伅锛堢敤浜庢牎楠屽悓涓�绉戝锛� + const patientDepts = new Set(); + let deptcode = ""; + this.ids.forEach((patId) => { + const patient = this.userList.find((item) => item.patid === patId); + if (patient) { + patientDepts.add(patient.deptname); + deptcode = patient.deptcode; + } + }); + + // 鏍¢獙鏄惁鍚屼竴绉戝 + if (patientDepts.size > 1) { + this.$modal.msgError("閫変腑鐨勬偅鑰呬笉灞炰簬鍚屼竴绉戝锛屾棤娉曟壒閲忔坊鍔犱换鍔�"); + return; + } + + // 鑾峰彇閫変腑鎮h�呭垪琛� + this.selectedPatients = this.userList.filter((item) => + this.ids.includes(item.patid) + ); + + // 鏄剧ず寮圭獥 + this.batchTaskVisible = true; + + // 鑾峰彇浠诲姟鍒楄〃 + this.loadTaskList(deptcode); + }, + + /** 鍔犺浇浠诲姟鍒楄〃 */ + loadTaskList(deptcode) { + this.batchLoading = true; + let topqueryParams = { + pageNum: 1, + pageSize: 10, + serviceType: 3, + type: 2, + deptcode: deptcode, + }; + getTasklist(topqueryParams).then((response) => { + this.taskList = response.rows; + this.batchLoading = false; + }); + }, + + /** 澶勭悊浠诲姟閫夋嫨鍙樺寲 */ + handleTaskSelectionChange(currentRow) { + this.selectedTask = currentRow; + }, + + // 閲嶅啓鎵归噺鎻愪氦鏂规硶 + async submitBatchTask() { + // 鏍¢獙鏄惁閫変腑浠诲姟 + if (!this.selectedTask) { + this.$modal.msgWarning("璇烽�夋嫨1涓换鍔�"); + return; + } + + this.batchLoading = true; + const successPatients = []; + const failedPatients = []; + + try { + // 閬嶅巻閫変腑鐨勬偅鑰咃紝閫愪釜璋冪敤鎺ュ彛 + for (const patient of this.selectedPatients) { + const params = { + taskId: this.selectedTask.taskId, + taskName: this.selectedTask.taskName, + serviceType: this.selectedTask.serviceType, + ...patient, + age: "", + }; + + try { + await addSubtask(params); + successPatients.push(patient.patname); + } catch (error) { + failedPatients.push(patient.patname); + } + } + + // 鏄剧ず澶勭悊缁撴灉 + let message = `鎴愬姛涓� ${successPatients.length} 鍚嶆偅鑰呮坊鍔犱换鍔; + if (failedPatients.length > 0) { + message += `锛�${failedPatients.length} 鍚嶆偅鑰呮坊鍔犲け璐; + } + this.$modal.msgSuccess(message); + + this.batchTaskVisible = false; + this.getList(); // 鍒锋柊鎮h�呭垪琛� + } catch (error) { + this.$modal.msgError("鎵归噺娣诲姞浠诲姟杩囩▼涓嚭閿�"); + } finally { + this.batchLoading = false; + } + }, + + /** 鎵归噺娣诲姞鎮h�呬换鍔℃帴鍙� */ + batchAddPatientTask(params) {}, }, }; </script> @@ -784,4 +1201,41 @@ .button-textsc { color: #28cfe6; } +.batch-patient-section, +.batch-task-section { + padding: 15px; + border: 1px solid #ebeef5; + border-radius: 4px; + margin-bottom: 15px; +} + +.el-table--enable-row-hover .el-table__body tr:hover > td { + background-color: #f5f7fa; +} +.el-table__body tr.current-row > td { + background-color: #e6f7ff; +} + +/* 绂佺敤鐘舵�佷笅鎸夐挳鏍峰紡 */ +.el-button.is-disabled { + cursor: not-allowed; +} +.batch-patient-section h4, +.batch-task-section h4 { + margin-top: 0; + margin-bottom: 15px; + color: #303133; + font-size: 16px; +} + +/* 琛ㄦ牸鏍峰紡浼樺寲 */ +.el-table { + margin-bottom: 10px; +} + +/* 寮圭獥搴曢儴鎸夐挳闂磋窛 */ +.dialog-footer { + text-align: right; + padding: 10px 20px 20px; +} </style> -- Gitblit v1.9.3