From e8c62bd430b9697d3f954125b7ec9f61f18347a2 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期一, 20 十月 2025 11:19:34 +0800
Subject: [PATCH] 测试完成
---
src/views/patient/patient/outpatient.vue | 379 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 339 insertions(+), 40 deletions(-)
diff --git a/src/views/patient/patient/outpatient.vue b/src/views/patient/patient/outpatient.vue
index 06406f8..bb43741 100644
--- a/src/views/patient/patient/outpatient.vue
+++ b/src/views/patient/patient/outpatient.vue
@@ -67,16 +67,16 @@
></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
+ <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"
@@ -85,7 +85,7 @@
:default-time="['12:00:00']"
>
</el-date-picker> -->
- </el-form-item>
+ </el-form-item>
<el-row>
<!-- <el-form-item label=" 灏辫瘖鏃ユ湡 " prop="admitdate">
<el-date-picker
@@ -150,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">
@@ -228,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
@@ -301,7 +319,23 @@
prop="drname"
width="120"
/>
-
+ <el-table-column
+ label="鏄惁瀛樺湪浠诲姟"
+ align="center"
+ key="serverState"
+ prop="serverState"
+ width="100"
+ >
+ <template slot-scope="scope">
+ <span
+ :style="{
+ color: scope.row.serverState == 1 ? 'green' : 'gray',
+ }"
+ >
+ {{ scope.row.serverState == 1 ? "鏄�" : "鏃�" }}
+ </span>
+ </template>
+ </el-table-column>
<el-table-column
label="鎿嶄綔"
fixed="right"
@@ -337,7 +371,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"
@@ -383,6 +523,7 @@
</div>
</el-upload>
</div>
+
<!-- 瀵煎叆妫�鏌� -->
<div class="uploading" v-else-if="dractive == 2">
<el-table :data="uploadingData" style="width: 100%">
@@ -446,7 +587,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";
@@ -509,6 +650,12 @@
Labelchange: false, //淇敼鏂板寮圭獥
propss: { multiple: true },
optionstag: [], //鏍囩鍒楄〃
+ batchTaskVisible: false, // 寮圭獥鍙鎬�
+ selectedPatients: [], // 閫変腑鐨勬偅鑰呭垪琛�
+ taskList: [], // 浠诲姟鍒楄〃
+ selectedTask: null, // 閫変腑鐨勪换鍔″垪琛�
+ batchLoading: false, // 鎵归噺鎻愪氦鍔犺浇鐘舵��
+ deptcode: "",
Patientrange: [
{
name: "鍏ㄩ儴",
@@ -544,8 +691,8 @@
YongHuXX: {
XiTongID: "SUIFANGXT",
XiTongMC: "闅忚绯荤粺",
- YongHuID: "1400466972205912064",
- YongHuXM: "JNRMYY",
+ YongHuID: localStorage.getItem("YongHuID"),
+ YongHuXM: localStorage.getItem("YongHuXM"),
ZuZhiJGID: localStorage.getItem("orgid"),
ZuZhiJGMC: localStorage.getItem("orgname"),
idp: "lyra",
@@ -593,8 +740,7 @@
pageSize: 10,
searchscope: 3,
scopetype: [],
- leaveldeptcodes: [],
- leavehospitaldistrictcodes: [],
+ deptcodes: [],
},
// 琛ㄥ崟鏍¢獙
rules: {
@@ -671,18 +817,18 @@
getList() {
this.loading = true;
if (this.queryParams.searchscope == 3) {
- this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
+ this.queryParams.deptcodes = store.getters.belongDepts.map(
(obj) => obj.deptCode
);
- this.queryParams.leavehospitaldistrictcodes =
- store.getters.belongWards.map((obj) => obj.districtCode);
+ // 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 = '';
+ } else {
+ this.queryParams.beginTime = "";
+ this.queryParams.endTime = "";
}
listPatouthosp(this.queryParams).then((response) => {
this.userList = response.rows;
@@ -708,16 +854,16 @@
handleChange(value) {
let type = value[0];
let code = value.slice(-1)[0];
- this.queryParams.leavehospitaldistrictcodes = [];
- this.queryParams.leaveldeptcodes = [];
+ // this.queryParams.leavehospitaldistrictcodes = [];
+ this.queryParams.deptcodes = [];
if (type == 1) {
- this.queryParams.leaveldeptcodes.push(code);
- this.queryParams.leavehospitaldistrictcodes = [];
+ this.queryParams.deptcodes.push(code);
+ // this.queryParams.leavehospitaldistrictcodes = [];
this.queryParams.searchscope = 1;
} else if (type == 2) {
- this.queryParams.leavehospitaldistrictcodes.push(code);
- this.queryParams.leaveldeptcodes = [];
+ // this.queryParams.leavehospitaldistrictcodes.push(code);
+ this.queryParams.deptcodes = [];
this.queryParams.searchscope = 2;
} else {
this.queryParams.searchscope = 3;
@@ -734,13 +880,10 @@
},
//鎮h��360璺宠浆
gettoken360(sfzh,drcode,drname) {
- this.$modal.msgWarning('360鍔熻兘鏆傛湭寮�閫�');
- return; // 闃绘鍚庣画浠g爜鎵ц
+ // this.$modal.msgWarning('360鍔熻兘鏆傛湭寮�閫�');
+
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) {
@@ -795,10 +938,10 @@
pageSize: 10,
searchscope: 3,
scopetype: [],
- leaveldeptcodes: [],
- leavehospitaldistrictcodes: [],
+ deptcodes: [],
+ // leavehospitaldistrictcodes: [],
};
- this.handleQuery();
+ this.handleQuery();
},
// 澶氶�夋閫変腑鏁版嵁
handleSelectionChange(selection) {
@@ -915,6 +1058,125 @@
this.upload.open = false;
this.dractive = 1;
},
+ /** 鎵归噺娣诲姞浠诲姟鎸夐挳鐐瑰嚮 */
+ handleBatchAddTask() {
+ // 鏍¢獙鏄惁閫変腑鎮h��
+ if (this.ids.length === 0) {
+ this.$modal.msgWarning("璇疯嚦灏戦�変腑1鍚嶆偅鑰�");
+ return;
+ }
+ // 妫�鏌ラ�変腑鐨勬偅鑰呬腑鏄惁鏈夊凡鏈変换鍔$殑
+ const hasTaskPatients = this.userList.filter(
+ (item) => this.ids.includes(item.patid) && item.serverState == 1
+ );
+
+ if (hasTaskPatients.length > 0) {
+ const patientNames = hasTaskPatients.map((p) => p.patname).join("銆�");
+ this.$modal.msgError(
+ `閫変腑鐨勬偅鑰� ${patientNames} 宸叉湁浠诲姟锛屾棤娉曢噸澶嶆坊鍔燻
+ );
+ 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,
+ sendstate:2,
+ ...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>
@@ -963,6 +1225,43 @@
}
}
.button-textsc {
- color: #28cfe6;
+ color: #3664D9;
+}
+.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