From 80a72af5ffd14dda088a3b81d30084f41708bd1c Mon Sep 17 00:00:00 2001 From: WXL (wul) <wl_5969728@163.com> Date: 星期三, 17 九月 2025 10:17:40 +0800 Subject: [PATCH] 任务派发患者模式更新 --- src/views/followvisit/tasklist/index.vue | 122 +-------------- src/components/PatientSelection/index.vue | 343 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 305 insertions(+), 160 deletions(-) diff --git a/src/components/PatientSelection/index.vue b/src/components/PatientSelection/index.vue index 9fc4498..d63746e 100644 --- a/src/components/PatientSelection/index.vue +++ b/src/components/PatientSelection/index.vue @@ -16,13 +16,13 @@ closables @close="handleClose(item)" > - {{ item.icdname }} + {{ item.name }} </el-tag> <div style="margin-top: 20px; text-align: right"> 鍏遍�夋嫨<span style="font-size: 18px; color: #409eff; margin: 0 10px" >{{ overallCase.length }}</span - >鏉℃暟鎹� + >浣嶆偅鑰� </div> </el-card> </div> @@ -36,12 +36,36 @@ :inline="true" label-width="98px" > - <el-form-item label="鐤剧梾鍚嶇О" prop="name"> + <el-form-item label="鎮h�咃細"> <el-input - v-model="patientqueryParams.icdname" - placeholder="璇疯緭鍏ョ柧鐥呭悕绉�" - @keyup.enter.native="handleAddpatient" - /> + v-model="patientqueryParams.name" + @keyup.enter.native="handleQuery" + ></el-input> + </el-form-item> + <el-form-item label="鎮h�呯被鍨�"> + <el-select + v-model="patientqueryParams.allhosp" + placeholder="璇烽�夋嫨鏂板绫诲瀷" + > + <el-option + v-for="item in taskoptions" + :label="item.label" + :value="item.value" + > + </el-option> + </el-select> + </el-form-item> + <el-form-item label="鎮h�呰瘖鏂細"> + <el-input + v-model="patientqueryParams.leavediagname" + @keyup.enter.native="handleQuery" + ></el-input> + </el-form-item> + <el-form-item label="涓绘不鍖荤敓锛�"> + <el-input + v-model="patientqueryParams.drname" + @keyup.enter.native="handleQuery" + ></el-input> </el-form-item> <el-form-item> @@ -49,7 +73,7 @@ type="primary" icon="el-icon-search" size="medium" - @click="handleAddpatient" + @click="handleQuery" >鎼滅储</el-button > <el-button @@ -60,7 +84,7 @@ > </el-form-item> </el-form> - <!-- 閫夋嫨鍣ㄥ畼鍒楄〃 --> + <!-- 閫夋嫨鎮h�呭垪琛� --> <el-table ref="multipleTable" :data="donorchargeList" @@ -68,21 +92,49 @@ style="width: 100%" @selection-change="handleSelectionChange" > - <el-table-column class="checkall" type="selection" width="55"> - </el-table-column> <el-table-column - prop="icdid" - label="鐤剧梾缂栧彿" - width="100" - show-overflow-tooltip + fixed="left" + class="checkall" + type="selection" + width="55" > </el-table-column> - <el-table-column label="鐤剧梾鍚嶇О" show-overflow-tooltip> - <template slot-scope="scope">{{ scope.row.icdname }}</template> - </el-table-column> + <div v-for="(item, index) in tableLabel"> + <el-table-column + v-if="item.label == '鍑洪櫌鏃ユ湡'" + :key="index" + :prop="item.prop" + :width="item.width" + :label="item.label" + :formatter="formatData" + > + <template slot-scope="scope"> + <span>{{ formatTime(scope.row.endtime) }}</span> + </template> + </el-table-column> + <el-table-column + v-if="item.label == '鎬у埆'" + :key="index" + :prop="item.prop" + :width="item.width" + :label="item.label" + :formatter="formatData" + > + <template slot-scope="scope"> + <span>{{ scope.row.sex == 1 ? "鐢�" : "濂�" }}</span> + </template> + </el-table-column> - <el-table-column prop="icdcode" label="鐤剧梾缂栫爜" width="150"> - </el-table-column> + <el-table-column + v-if="item.label != '鎬у埆' && item.label != '鍑洪櫌鏃ユ湡'" + :key="index" + :prop="item.prop" + :width="item.width" + :label="item.label" + :formatter="formatData" + > + </el-table-column> + </div> </el-table> </el-row> <pagination @@ -90,7 +142,7 @@ :total="patienttotal" :page.sync="patientqueryParams.pageNum" :limit.sync="patientqueryParams.pageSize" - @pagination="handleAddpatient" + @pagination="handleQuery" /> </div> </div> @@ -105,22 +157,71 @@ </template> <script> -import { getillnesslist, deltargetillness } from "@/api/AiCentre/index"; +import { + getillnesslist, + deltargetillness, + getTaskpatientQC, + Questionnairetaskgetson, + Externallist, + Editsingletask, +} from "@/api/AiCentre/index"; export default { name: "Diseasetotality", data() { return { patienttotal: 0, // + allpids: [], // 褰撳墠椤甸�変腑鏁版嵁 multipleSelection: [], - // 鎬婚�変腑鏁版嵁 - // overallCase: [], + overallpatin: [], + form: {}, patientqueryParams: { pageNum: 1, pageSize: 10, + allhosp: "4", + pids: null, }, donorchargeList: [], donorchargeanlList: [], //妗堜緥鍒楄〃 + taskoptions: [ + { + value: "4", + label: "鍑洪櫌鐥呬汉", + }, + { + value: "1", + label: "鍦ㄩ櫌鐥呬汉", + }, + { + value: "2", + label: "闂ㄨ瘖鐥呬汉", + }, + { + value: "3", + label: "浣撴鐥呬汉", + }, + { + value: "6", + label: "闄㈠鎮h��", + }, + { + value: "5", + label: "鎵嬫湳鐥呬汉", + }, + ], + overallCase:[], + tableLabel: [ + { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "inhosptime" }, + { label: "鎮h��", width: "", prop: "name" }, + { label: "鎮h�呰瘖鏂�", width: "", prop: "leavediagname" }, + { label: "韬唤璇�", width: "200", prop: "idcardno" }, + { label: "鎬у埆", width: "", prop: "sex" }, + { label: "骞撮緞", width: "", prop: "age" }, + { label: "璐d换鎶ゅ+", width: "", prop: "nurseName" }, + { label: "涓绘不鍖荤敓", width: "", prop: "drname" }, + { label: "绉戝", width: "240", prop: "dept" }, + { label: "鐥呭尯", width: "240", prop: "leavehospitaldistrictname" }, + ], }; }, @@ -131,22 +232,7 @@ return false; }, }, - // 閫変腑 - overallCase: { - type: Array, - required: true, - default: () => [], - }, - pids: { - type: Array, - required: true, - default: () => [], - }, - allhosp: { - type: String, - required: true, - default: () => [], - }, + // 5闂嵎妯℃澘銆�3闅忚妯℃澘銆�6瀹f暀 type: { type: Number, @@ -165,6 +251,25 @@ watch: {}, methods: { + // 鏁版嵁杩囨护 + formatData(row, column, cellValue) { + if (column.property === "createType") { + if (cellValue === 1) { + return "鑷姩"; + } + return "鎵嬪姩"; + } + if ( + column.property === "createTime" || + column.property === "inhosptime" + ) { + if (cellValue === null) { + return ""; + } + return dayjs(cellValue).format("YYYY-MM-DD "); + } + return cellValue; + }, handleClosehz() { this.$emit("addoption"); }, @@ -172,7 +277,6 @@ handleClose(item) { console.log(item); if (this.multipleSelection.indexOf(item) == -1 && !item.outid) { - console.log(1); this.overallCase.splice(this.overallCase.indexOf(item), 1); } else if (item.outid) { this.$modal @@ -200,17 +304,118 @@ } }, resetQuery() { - this.patientqueryParams.icdname = null; + this.patientqueryParams.name = null; this.handleAddpatient(); }, // 瑙﹀彂鏌ヨ浜嬩欢 - handleAddpatient(row) { + handleAddpatients() { this.$emit("kkoption"); getillnesslist(this.patientqueryParams).then((res) => { this.donorchargeList = res.rows; this.patienttotal = res.total; this.Restorecheck(); + }); + }, + // 瑙﹀彂鏌ヨ浜嬩欢 + handleAddpatient(taskid) { + this.$emit("kkoption"); + if (taskid != this.taskid) { + this.recover(); + } + if (taskid) { + this.taskid = taskid; + Questionnairetaskgetson({ taskid: this.taskid }).then((res) => { + if (res.code == 200) { + this.form = res.data; + this.overallpatin = this.form.patTaskRelevances.concat(); + this.allpids = []; + this.overallpatin.forEach((item) => { + this.allpids.push(item.patid); + }); + if (this.allpids[0]) { + this.patientqueryParams.pids = this.allpids; + } else { + this.patientqueryParams.pids = null; + } + this.handleQuery(); + } + }); + } + }, + handleQuery() { + // 鑾峰彇澶栭儴鎮h�� + if (this.patientqueryParams.allhosp == 6) { + this.Externallist(); + return; + } + console.log(11); + + if (this.patientqueryParams.allhosp == 4) { + this.tableLabel = [ + // { label: "鍏ラ櫌鏃ユ湡", width: "170", prop: "starttime" }, + { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "endtime" }, + { label: "鎮h��", width: "", prop: "name" }, + { label: "鎮h�呰瘖鏂�", width: "", prop: "leavediagname" }, + { label: "韬唤璇�", width: "200", prop: "idcardno" }, + { label: "鎬у埆", width: "", prop: "sex" }, + { label: "骞撮緞", width: "", prop: "age" }, + { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" }, + { label: "璐d换鎶ゅ+", width: "", prop: "nurseName" }, + { label: "鍖荤敓", width: "", prop: "drname" }, + { label: "绉戝", width: "180", prop: "dept" }, + { label: "鐥呭尯", width: "150", prop: "leavehospitaldistrictname" }, + ]; + } else if (this.patientqueryParams.allhosp == 1) { + this.tableLabel = [ + { label: "鍏ラ櫌鏃ユ湡", width: "150", prop: "starttime" }, + { label: "鎮h��", width: "", prop: "name" }, + { label: "鎮h�呰瘖鏂�", width: "", prop: "leavediagname" }, + { label: "韬唤璇�", width: "200", prop: "idcardno" }, + { label: "鎬у埆", width: "", prop: "sex" }, + { label: "骞撮緞", width: "", prop: "age" }, + { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" }, + { label: "璐d换鎶ゅ+", width: "", prop: "nurseName" }, + { label: "鍖荤敓", width: "", prop: "drname" }, + { label: "绉戝", width: "180", prop: "dept" }, + { label: "鐥呭尯", width: "150", prop: "leavehospitaldistrictname" }, + ]; + } + console.log(this.patientqueryParams.allhosp); + + // 鑾峰彇鎮h�呮暟鎹� + getTaskpatientQC(this.patientqueryParams).then((response) => { + this.donorchargeList = response.rows; + this.donorchargeList.forEach((item) => { + if (item.endtime) { + item.endDay = this.daysBetween(item.endtime); + } + }); + this.Restorecheck(); + + this.patienttotal = response.total; + }); + }, + // 鑾峰彇澶栭儴鎮h�呭鍏ュ垪琛� + Externallist() { + this.tableLabel = [ + { label: "鎮h��", width: "", prop: "name" }, + { label: "韬唤璇�", width: "200", prop: "idcardno" }, + { label: "鎬у埆", width: "", prop: "sex" }, + { label: "骞撮緞", width: "", prop: "age" }, + { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" }, + ]; + this.patientqueryParams.pageSize = 1000; + + Externallist(this.patientqueryParams).then((response) => { + this.donorchargeList = response.rows; + this.donorchargeList.forEach((item) => { + if (item.endtime) { + item.endDay = this.daysBetween(item.endtime); + } + }); + // this.dialogVisiblepatient = true; + this.patienttotal = response.total; }); }, // 澶氶�夋閫変腑鏁版嵁 @@ -241,8 +446,19 @@ } // 璧嬪�肩粰鏁翠綋閫変腑鏁扮粍 this.multipleSelection.forEach((item) => { - - if (this.overallCase.every((obj) => obj.icdname != item.icdname)) { + if (this.overallCase.every((obj) => obj.name != item.name)) { + item.isoperation = 1; + item.patid = item.id; + item.hospType = this.patientqueryParams.allhosp; + item.sfzh = item.idcardno; + item.deptCode = item.deptcode; + item.deptName = item.dept; + item.admindate = item.inhosptime; + item.diagname = item.leavediagname; + item.sfzh = item.idcardno; + if (this.patientqueryParams.allhosp == 6) { + item.patfrom = 1; + } this.overallCase.push(item); } }); @@ -251,9 +467,9 @@ // 鍒囨崲椤靛悗鎭㈠閫変腑 Restorecheck() { console.log(this.overallCase, "this.overallCase"); - const allid = this.overallCase.map((item) => item.icdname); + const allid = this.overallCase.map((item) => item.name); const overlap = this.donorchargeList.filter((value) => { - return allid.includes(value.icdname); + return allid.includes(value.name); }); // 淇濇寔ids鍜屽綋鍓嶉〉闈㈢殑鍚屾鎬� this.multipleSelection = overlap; @@ -277,7 +493,40 @@ } }, AddDispatchpatients() { + console.log(this.overallCase); + this.form.patTaskRelevances.push(...this.overallCase); + console.log(this.form.patTaskRelevances); + this.form.isoperation=2; + Editsingletask(this.form).then((res) => { + if (res.code == 200) { + if (this.form.taskid) { + this.$modal.msgSuccess("淇敼鎴愬姛"); + } else { + this.$modal.msgSuccess("鏂板鎴愬姛"); + } + this.recover(); this.$emit("addoption"); + + } + }); + // this.dialogVisiblepatient = false; + // this.$emit("addoption"); + }, + recover() { + this.donorchargeList = []; + this.donorchargeanlList = []; + this.multipleSelection = []; + this.allpids = []; + this.overallpatin = []; + this.form = {}; + this.patientqueryParams = { + pageNum: 1, + pageSize: 10, + allhosp: "4", + pids: null, + }; + this.overallCase = []; + // this.dialogVisiblepatient = false; }, }, }; diff --git a/src/views/followvisit/tasklist/index.vue b/src/views/followvisit/tasklist/index.vue index a3f2c46..0709ab4 100644 --- a/src/views/followvisit/tasklist/index.vue +++ b/src/views/followvisit/tasklist/index.vue @@ -255,7 +255,7 @@ <el-button size="medium" type="text" - @click="handleAddpatient(scope.row)" + @click="handleAddpatient(scope.row.taskid, scope.row.type)" ><span class="button-hz" ><i class="el-icon-circle-plus-outline"></i>鏂板鎮h��</span ></el-button @@ -381,9 +381,7 @@ <Patient-Selection ref="Patient" :dialogVisiblepatient="dialogVisiblepatient" - :overallCase="Patientlist" - :tableLabel="tableLabelhz" - @addoption="dialogVisiblepatient = false" + @addoption="addoption" @kkoption="dialogVisiblepatient = true" /> </div> @@ -400,12 +398,7 @@ } from "@/api/system/user"; import { getTasklist, - getTaskInfo, - Editsingletask, delTaskInfo, - Questionnairetasklist, - Questionnairetaskget, - Questionnairetasksponsor, TaskTemplateSendExecution, } from "@/api/AiCentre/index"; import store from "@/store"; @@ -417,7 +410,7 @@ export default { name: "Tasklist", dicts: ["sys_normal_disable", "sys_user_sex", "task_status"], - components: { Treeselect }, + components: { Treeselect, PatientSelection }, data() { return { // 閬僵灞� @@ -1057,110 +1050,13 @@ const item = data.find((item) => item.value === value); return item ? item.label : null; }, - //鎮h�呮坊鍔犵浉鍏� - handleAddpatient(row) { - this.allpids = []; - this.overallCase.forEach((item) => { - this.allpids.push(item.patid); - }); - if (this.patientqueryParams.allhosp == 4) { - this.tableLabelhz = [ - // { label: "鍏ラ櫌鏃ユ湡", width: "170", prop: "starttime" }, - { label: "鍑洪櫌鏃ユ湡", width: "150", prop: "endtime" }, - { label: "鎮h��", width: "", prop: "name" }, - { label: "鎮h�呰瘖鏂�", width: "", prop: "leavediagname" }, - { label: "韬唤璇�", width: "200", prop: "idcardno" }, - { label: "鎬у埆", width: "", prop: "sex" }, - { label: "骞撮緞", width: "", prop: "age" }, - { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" }, - { label: "璐d换鎶ゅ+", width: "", prop: "nurseName" }, - { label: "鍖荤敓", width: "", prop: "drname" }, - { label: "绉戝", width: "180", prop: "dept" }, - { label: "鐥呭尯", width: "150", prop: "leavehospitaldistrictname" }, - ]; - } else if (this.patientqueryParams.allhosp == 1) { - this.tableLabelhz = [ - { label: "鍏ラ櫌鏃ユ湡", width: "150", prop: "starttime" }, - { label: "鎮h��", width: "", prop: "name" }, - { label: "鎮h�呰瘖鏂�", width: "", prop: "leavediagname" }, - { label: "韬唤璇�", width: "200", prop: "idcardno" }, - { label: "鎬у埆", width: "", prop: "sex" }, - { label: "骞撮緞", width: "", prop: "age" }, - { label: "鍑洪櫌澶╂暟", width: "", prop: "endDay" }, - { label: "璐d换鎶ゅ+", width: "", prop: "nurseName" }, - { label: "鍖荤敓", width: "", prop: "drname" }, - { label: "绉戝", width: "180", prop: "dept" }, - { label: "鐥呭尯", width: "150", prop: "leavehospitaldistrictname" }, - ]; - } - if (this.allpids[0]) { - this.patientqueryParams.pids = this.allpids; - } else { - this.patientqueryParams.pids = null; - } - // 鏉ユ簮鍒ゆ柇 - - if (this.patientqueryParams.allhosp == 4) { - this.patientqueryParams.hospitaldistrictcodes = []; - this.patientqueryParams.deptcodes = []; - } else if (this.patientqueryParams.allhosp == 1) { - this.patientqueryParams.deptcodes = - this.patientqueryParams.leaveldeptcodes; - this.patientqueryParams.hospitaldistrictcodes = - this.patientqueryParams.leavehospitaldistrictcodes; - this.patientqueryParams.leavehospitaldistrictcodes = []; - this.patientqueryParams.leaveldeptcodes = []; - } - getTaskpatientQC(this.patientqueryParams).then((response) => { - this.patientuserList = response.rows; - this.patientuserList.forEach((item) => { - if (item.endtime) { - item.endDay = this.daysBetween(item.endtime); - } - }); - this.patienttotal = response.total; - this.loading = false; - this.Restorecheck(); - }); - this.dialogVisiblepatient = true; + handleAddpatient(taskid) { + this.$refs.Patient.handleAddpatient(taskid); + this.dialogVisiblepatient = true; // 鎵嬪姩鎺у埗寮圭獥鏄剧ず }, - // 鏌ヨ - handleQuery() { - // 鑾峰彇澶栭儴鎮h�� - - if (this.patientqueryParams.allhosp == 6) { - this.Externallist(); - console.log(); - - return; - } - if (this.patientqueryParams.searchscope == 1) { - this.patientqueryParams.leaveldeptcodes = store.getters.belongDepts.map( - (obj) => obj.deptCode - ); - this.patientqueryParams.leavehospitaldistrictcodes = []; - } else if (this.patientqueryParams.searchscope == 2) { - this.patientqueryParams.leavehospitaldistrictcodes = - store.getters.belongWards.map((obj) => obj.districtCode); - this.patientqueryParams.leaveldeptcodes = []; - } else { - this.patientqueryParams.leaveldeptcodes = store.getters.belongDepts.map( - (obj) => obj.deptCode - ); - this.patientqueryParams.leavehospitaldistrictcodes = - store.getters.belongWards.map((obj) => obj.districtCode); - } - if ( - !this.patientqueryParams.leavehospitaldistrictcodes || - !this.patientqueryParams.leavehospitaldistrictcodes[0] - ) - this.patientqueryParams.leavehospitaldistrictcodes = null; - if ( - !this.patientqueryParams.leaveldeptcodes || - !this.patientqueryParams.leaveldeptcodes[0] - ) - this.patientqueryParams.leaveldeptcodes = null; - this.handleAddpatient(); + addoption() { + this.dialogVisiblepatient = false; // 鎵嬪姩鎺у埗寮圭獥鏄剧ず + this.handleQuery(); }, }, }; -- Gitblit v1.9.3