From 5f4d48e663c47eb7390e4a1784d773d6814889ff Mon Sep 17 00:00:00 2001 From: WXL (wul) <wl_5969728@163.com> Date: 星期二, 02 九月 2025 13:40:04 +0800 Subject: [PATCH] 测试完成 --- src/views/patient/patient/outpatient.vue | 357 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 327 insertions(+), 30 deletions(-) diff --git a/src/views/patient/patient/outpatient.vue b/src/views/patient/patient/outpatient.vue index d317a51..a323439 100644 --- a/src/views/patient/patient/outpatient.vue +++ b/src/views/patient/patient/outpatient.vue @@ -20,6 +20,33 @@ @keyup.enter.native="handleQuery" /> </el-form-item> + <el-form-item label="璇婃柇" width="100" prop="name"> + <el-input + 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" @@ -39,6 +66,26 @@ @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-date-picker> --> + </el-form-item> <el-row> <!-- <el-form-item label=" 灏辫瘖鏃ユ湡 " prop="admitdate"> <el-date-picker @@ -50,26 +97,7 @@ > </el-date-picker> </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-date-picker> --> - </el-form-item> + <el-form-item> <el-button type="primary" @@ -122,6 +150,18 @@ @click="handleDelete" v-hasPermi="['system:user:remove']" >鍒犻櫎</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"> @@ -200,7 +240,13 @@ <el-button size="medium" type="text" - @click="gettoken360(scope.row.idcardno,scope.row.drcode,scope.row.drname)" + @click=" + gettoken360( + scope.row.idcardno, + scope.row.drcode, + scope.row.drname + ) + " ><span class="button-textsc">{{ scope.row.patname }}</span></el-button @@ -309,7 +355,107 @@ /> </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> + </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" @@ -355,6 +501,7 @@ </div> </el-upload> </div> + <!-- 瀵煎叆妫�鏌� --> <div class="uploading" v-else-if="dractive == 2"> <el-table :data="uploadingData" style="width: 100%"> @@ -418,7 +565,7 @@ import { getToken } from "@/utils/auth"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; -import { query360PatInfo } from "@/api/AiCentre/index"; +import { query360PatInfo, getTasklist, addSubtask } from "@/api/AiCentre/index"; import store from "@/store"; @@ -481,6 +628,12 @@ Labelchange: false, //淇敼鏂板寮圭獥 propss: { multiple: true }, optionstag: [], //鏍囩鍒楄〃 + batchTaskVisible: false, // 寮圭獥鍙鎬� + selectedPatients: [], // 閫変腑鐨勬偅鑰呭垪琛� + taskList: [], // 浠诲姟鍒楄〃 + selectedTask: null, // 閫変腑鐨勪换鍔″垪琛� + batchLoading: false, // 鎵归噺鎻愪氦鍔犺浇鐘舵�� + deptcode: "", Patientrange: [ { name: "鍏ㄩ儴", @@ -652,9 +805,9 @@ if (this.dateRange) { this.queryParams.beginTime = this.dateRange[0]; this.queryParams.endTime = this.dateRange[1]; - }else{ - this.queryParams.beginTime = ''; - this.queryParams.endTime = ''; + } else { + this.queryParams.beginTime = ""; + this.queryParams.endTime = ""; } listPatouthosp(this.queryParams).then((response) => { this.userList = response.rows; @@ -705,11 +858,11 @@ }); }, //鎮h��360璺宠浆 - gettoken360(sfzh,drcode,drname) { + 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'; + if (this.postData.XiaoXiTou.ZuHuMC == "涓芥按甯備腑鍖婚櫌") { + this.postData.YeWuXX.YongHuXX.YongHuID = "1400398571877961728"; + this.postData.YeWuXX.YongHuXX.YongHuXM = "LSZYY"; } query360PatInfo(this.postData).then((res) => { @@ -768,7 +921,7 @@ leaveldeptcodes: [], leavehospitaldistrictcodes: [], }; - this.handleQuery(); + this.handleQuery(); }, // 澶氶�夋閫変腑鏁版嵁 handleSelectionChange(selection) { @@ -885,6 +1038,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> @@ -935,4 +1195,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