From ffa22cc18c75c0a73a3fd987e2b62fbf55316db2 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期四, 25 六月 2026 15:22:46 +0800
Subject: [PATCH] 测试完成
---
src/views/patient/propaganda/particty.vue | 427 ++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 338 insertions(+), 89 deletions(-)
diff --git a/src/views/patient/propaganda/particty.vue b/src/views/patient/propaganda/particty.vue
index 255a030..09e1d13 100644
--- a/src/views/patient/propaganda/particty.vue
+++ b/src/views/patient/propaganda/particty.vue
@@ -310,31 +310,182 @@
<!-- <el-tag v-if="hasMore" type="info">+{{ remaining }} more</el-tag> -->
</el-form-item>
</div>
+ <div
+ style="
+ margin-bottom: 20px;
+ padding: 8px 12px;
+ background-color: #f0f9ff;
+ border-left: 4px solid #409eff;
+ "
+ >
+ <p
+ style="
+ margin: 0;
+ color: #606266;
+ font-size: 13px;
+ line-height: 1.4;
+ "
+ >
+ <i
+ class="el-icon-info"
+ style="color: #409eff; margin-right: 6px"
+ ></i>
+ 閽堝鍚屼竴鐤剧梾鍦ㄥ绉戝/鐥呭尯涓嬪瓨鍦ㄧ殑鎯呭喌锛屽彲閫夋嫨鎬ч厤缃浐瀹氱瀹�/鐥呭尯
+ </p>
+ </div>
+ <!-- 鏂板锛氱柧鐥呭叧鑱斾笅鐨勭瀹ら厤缃紙鍗曢�夛級 -->
+ <el-row :gutter="20" style="margin-top: 20px">
+ <el-col :span="12">
+ <el-form-item label="鍏宠仈绉戝" prop="diseaseDept">
+ <el-select
+ v-model="diseaseDept"
+ style="width: 100%"
+ clearable
+ filterable
+ placeholder="璇烽�夋嫨绉戝锛堝彲閫夛級"
+ value-key="deptCode"
+ @change="handleDiseaseDeptChange"
+ >
+ <el-option
+ v-for="item in belongDepts"
+ :key="item.deptCode"
+ :label="item.deptName"
+ :value="item"
+ ></el-option>
+ </el-select>
+ <div v-if="diseaseDept" class="selected-info">
+ 宸查�夋嫨: {{ diseaseDept.deptName }} ({{
+ diseaseDept.deptCode
+ }})
+ </div>
+ </el-form-item>
+ </el-col>
+
+ <el-col :span="12">
+ <el-form-item label="鍏宠仈鐥呭尯" prop="diseaseWard">
+ <el-select
+ v-model="diseaseWard"
+ style="width: 100%"
+ clearable
+ filterable
+ placeholder="璇烽�夋嫨鐥呭尯锛堝彲閫夛級"
+ value-key="districtCode"
+ @change="handleDiseaseWardChange"
+ >
+ <el-option
+ v-for="item in belongWards"
+ :key="item.districtCode"
+ :label="item.districtName"
+ :value="item"
+ ></el-option>
+ </el-select>
+ <div v-if="diseaseWard" class="selected-info">
+ 宸查�夋嫨: {{ diseaseWard.districtName }} ({{
+ diseaseWard.districtCode
+ }})
+ </div>
+ </el-form-item>
+ </el-col>
+ </el-row>
</el-row>
<el-row v-if="form.appltype == 4">
- <el-col :span="20"
- ><el-form-item label="閫傜敤鎵嬫湳" prop="region">
- <el-select
- v-model="operationcodes"
- style="width: 400px"
- @remove-tag="removeopera"
- :remote-method="remoteopcode"
- size="medium"
- multiple
- filterable
- remote
- placeholder="璇烽�夋嫨鎵嬫湳"
+ <el-form-item label="閫傜敤鎵嬫湳" prop="region">
+ <el-select
+ v-model="form.oplevelcode"
+ style="width: 400px"
+ @remove-tag="removeopera"
+ size="medium"
+ :remote-method="remoteopcode"
+ filterable
+ remote
+ placeholder="璇烽�夋嫨鎵嬫湳"
+ >
+ <el-option
+ class="ruleFormaa"
+ v-for="item in baseoperaList"
+ :label="item.label"
+ :value="item.value"
>
- <el-option
- class="ruleFormaa"
- v-for="item in baseoperaList"
- :key="item.icdcode"
- :label="item.icdname"
- :value="item.icdcode"
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <div
+ style="
+ margin-bottom: 20px;
+ padding: 8px 12px;
+ background-color: #f0f9ff;
+ border-left: 4px solid #409eff;
+ "
+ >
+ <p
+ style="
+ margin: 0;
+ color: #606266;
+ font-size: 13px;
+ line-height: 1.4;
+ "
+ >
+ <i
+ class="el-icon-info"
+ style="color: #409eff; margin-right: 6px"
+ ></i>
+ 閽堝鍚屼竴鎵嬫湳绫诲瀷鍦ㄥ绉戝/鐥呭尯涓嬪瓨鍦ㄧ殑鎯呭喌锛屽彲閫夋嫨鎬ч厤缃浐瀹氱瀹�/鐥呭尯
+ </p>
+ </div>
+ <!-- 鏂板锛氭墜鏈叧鑱斾笅鐨勭瀹ら厤缃紙鍗曢�夛級 -->
+ <el-row :gutter="20" style="margin-top: 20px">
+ <el-col :span="12">
+ <el-form-item label="鍏宠仈绉戝" prop="diseaseDept">
+ <el-select
+ v-model="diseaseDept"
+ style="width: 100%"
+ clearable
+ filterable
+ placeholder="璇烽�夋嫨绉戝锛堝彲閫夛級"
+ value-key="deptCode"
+ @change="handleDiseaseDeptChange"
>
- </el-option>
- </el-select> </el-form-item
- ></el-col>
+ <el-option
+ v-for="item in belongDepts"
+ :key="item.deptCode"
+ :label="item.deptName"
+ :value="item"
+ ></el-option>
+ </el-select>
+ <div v-if="diseaseDept" class="selected-info">
+ 宸查�夋嫨: {{ diseaseDept.deptName }} ({{
+ diseaseDept.deptCode
+ }})
+ </div>
+ </el-form-item>
+ </el-col>
+
+ <el-col :span="12">
+ <el-form-item label="鍏宠仈鐥呭尯" prop="diseaseWard">
+ <el-select
+ v-model="diseaseWard"
+ style="width: 100%"
+ clearable
+ filterable
+ placeholder="璇烽�夋嫨鐥呭尯锛堝彲閫夛級"
+ value-key="districtCode"
+ @change="handleDiseaseWardChange"
+ >
+ <el-option
+ v-for="item in belongWards"
+ :key="item.districtCode"
+ :label="item.districtName"
+ :value="item"
+ ></el-option>
+ </el-select>
+ <div v-if="diseaseWard" class="selected-info">
+ 宸查�夋嫨: {{ diseaseWard.districtName }} ({{
+ diseaseWard.districtCode
+ }})
+ </div>
+ </el-form-item>
+ </el-col>
+ </el-row>
</el-row>
<el-row>
<el-col :span="12"
@@ -372,10 +523,7 @@
placeholder="璇风偣鍑诲彸渚ч�夋嫨"
/>
<el-button
- v-if="
- (form.templateid && form.sendState == 1) ||
- !form.templateid
- "
+ v-if="form.templateid"
style="margin-left: 10px"
type="primary"
icon="el-icon-edit"
@@ -736,7 +884,7 @@
v-if="item.scriptType == 1"
>
<div class="dev-text">
- {{ item.sort }}銆乕鍗曢�塢<span>{{ item.scriptContent }}</span>
+ {{ item.sort }}. [鍗曢�塢<span>{{ item.scriptContent }}</span>
</div>
<div class="dev-xx">
<el-radio-group v-model="item.remark">
@@ -758,7 +906,7 @@
v-if="item.scriptType == 2"
>
<div class="dev-text">
- {{ item.sort }}銆乕澶氶�塢<span>{{ item.scriptContent }}</span>
+ {{ item.sort }}. [澶氶�塢<span>{{ item.scriptContent }}</span>
</div>
<div class="dev-xx">
<el-checkbox-group v-model="qremark">
@@ -781,7 +929,7 @@
v-if="item.scriptType == 4"
>
<div class="dev-text">
- {{ item.sort }}銆乕闂瓟]<span>{{ item.scriptContent }}</span>
+ {{ item.sort }}. [闂瓟]<span>{{ item.scriptContent }}</span>
</div>
<div class="dev-xx">
<el-input
@@ -965,8 +1113,13 @@
questionList: [],
skip: false,
donorchargeList: [],
- baseoperaList: [],
+ baseoperaList: [ { value: "1", label: "涓�绾ф墜鏈�" },
+ { value: "2", label: "浜岀骇鎵嬫湳" },
+ { value: "3", label: "涓夌骇鎵嬫湳" },
+ { value: "4", label: "鍥涚骇鎵嬫湳" },],
selectedOrder: [],
+ diseaseDept: null, // 鐤剧梾鍏宠仈涓嬬殑绉戝锛堝瓨鍌ㄦ暣涓璞★級
+ diseaseWard: null, // 鐤剧梾鍏宠仈涓嬬殑鐥呭尯锛堝瓨鍌ㄦ暣涓璞★級
usable: [
{ value: "0", label: "鍙敤" },
@@ -1309,7 +1462,7 @@
};
this.currenttype = this.$route.query.type;
this.title = "闅忚鍐呭鍒楄〃";
- this.tableLabel = this.tableLabelwj;
+ this.tableLabel = this.tableLabelwj || [];
if (this.form.serviceType == 1) {
this.checkboxlist = [
{
@@ -1329,8 +1482,16 @@
label: "寰俊鍏紬鍙�",
},
];
- } else if (this.form.serviceType == 6) {
+ } else if (
+ this.form.serviceType == 6 ||
+ this.form.serviceType == 14 ||
+ this.form.serviceType == 15
+ ) {
this.checkboxlist = [
+ {
+ value: "1",
+ label: "浜哄伐",
+ },
{
value: "3",
label: "鏅鸿兘璇煶",
@@ -1394,6 +1555,8 @@
];
} else if (
this.form.serviceType == 2 ||
+ this.form.serviceType == 18 ||
+ this.form.serviceType == 19 ||
this.form.serviceType == 3 ||
this.form.serviceType == 16 ||
this.form.serviceType == 4
@@ -1444,15 +1607,24 @@
},
// 淇濆瓨
submitForm(type) {
+ // 闃叉閲嶅鎻愪氦
if (this.submitLoading) {
return;
}
- // 绗簩姝ワ細寮�鍚姞杞界姸鎬侊紝绂佺敤鎸夐挳
+
+ // 寮�鍚姞杞界姸鎬�
this.submitLoading = true;
+
try {
- if (this.templateor && type) this.templateor = false;
- if (this.time4 && this.form.sendType == 3)
+ // 妯℃澘鐩稿叧澶勭悊
+ if (this.templateor && type) {
+ this.templateor = false;
+ }
+
+ // 鏃堕棿澶勭悊
+ if (this.time4 && this.form.sendType == 3) {
this.form.showTimeMorn = this.time4;
+ }
this.form.sendTimeslot = [
{
begantime: this.time4,
@@ -1460,6 +1632,8 @@
xh: 1,
},
];
+
+ // 鏍规嵁搴旂敤绫诲瀷娓呯悊瀛楁
if (this.form.appltype == 1) {
this.leavehospitaldistrictcodes = [];
this.operationcodes = [];
@@ -1477,68 +1651,101 @@
this.illnesscodes = [];
this.leavehospitaldistrictcodes = [];
}
+
+ // ===== 琛ㄥ崟鏍¢獙 =====
+
+ // 1. 鏈嶅姟绫诲瀷鏍¢獙
if (this.checkList) {
- this.form.preachform = this.checkList.join(",");
- this.form.preachformList = this.selectedOrder;
+ this.form.preachform = this.checkList.join(",") || [];
+ this.form.preachformList = this.selectedOrder || [];
} else {
this.$modal.msgError("璇烽�夋嫨鏈嶅姟绫诲瀷");
this.submitLoading = false;
-
return;
}
- if (
+ // 2. 鐤剧梾鍏宠仈绉戝鎴栫梾鍖烘牎楠�
+ if (this.form.appltype == 3 || this.form.appltype == 4) {
+ const hasDept = this.diseaseDept?.deptCode;
+ const hasWard = this.diseaseWard?.districtCode;
+
+ if (!hasDept && !hasWard) {
+ this.$modal.msgError("褰撳墠鐤剧梾闇�鍏宠仈绉戝鎴栫梾鍖�");
+ this.submitLoading = false;
+ return;
+ }
+ }
+
+ // 3. 浠诲姟鍏宠仈鏉′欢鏍¢獙
+ const hasCondition =
this.deptcodesWards[0] ||
this.leavehospitaldistrictcodes[0] ||
this.diagglist[0] ||
this.operationcodes[0] ||
this.form.longTask == 2 ||
- this.serviceType == 3
- ) {
- } else {
+ this.serviceType == 3;
+
+ if (!hasCondition) {
this.$modal.msgError("璇烽�夋嫨浠诲姟鍏宠仈鏉′欢");
this.submitLoading = false;
-
return;
}
- // if (!this.form.patTaskRelevances[0] && !this.form.longTask) {
- // this.$modal.msgError("璇烽�夋嫨鐥呬汉");
- // return;
- // }
+ // 4. 妯℃澘鏍¢獙
if (!this.form.templatename && !this.templateor) {
this.$modal.msgError("鏈�夋嫨妯℃澘");
this.submitLoading = false;
-
return;
}
- if (
+ // 5. 鏃堕棿淇℃伅鏍¢獙
+ const isValidTime =
(this.form.sendType == 1 && this.time1) ||
- this.form.sendType == 2
- ) {
- } else if (
+ this.form.sendType == 2 ||
(this.form.sendType == 3 && this.time4) ||
- this.form.longTask
- ) {
- } else {
- this.submitLoading = false;
+ this.form.longTask;
- return this.$modal.msgError("鏃堕棿淇℃伅缂哄け");
+ if (!isValidTime) {
+ this.submitLoading = false;
+ this.$modal.msgError("鏃堕棿淇℃伅缂哄け");
+ return;
}
+
+ // ===== 鏁版嵁澶勭悊 =====
+
+ // 杩囨护鏂囨湰鍙傛暟
const filteredArray = this.variableList.filter(
(item) =>
item.name !== "濮撳悕" && item.name !== "鐢佃瘽" && item.name !== "鍦板潃"
);
this.form.textParam = this.convertFormat2ToFormat1(filteredArray);
+
+ // 璁剧疆鎿嶄綔绫诲瀷
if (this.form.taskid) {
this.form.isoperation = 2;
} else {
this.form.isoperation = 1;
}
+
+ // 璁剧疆绫诲瀷
if (!this.form.type) {
this.form.type = this.$route.query.type;
}
+
+ // 鐤剧梾鍏宠仈鐨勭瀹�/鐥呭尯
+ if (this.form.appltype == 3) {
+ if (this.diseaseDept) {
+ this.form.deptcode = this.diseaseDept.deptCode;
+ this.form.deptname = this.diseaseDept.deptName;
+ }
+
+ if (this.diseaseWard) {
+ this.form.leavehospitaldistrictcode = this.diseaseWard.districtCode;
+ this.form.leavehospitaldistrictname = this.diseaseWard.districtName;
+ }
+ }
+
+ // 缁勮鎻愪氦鏁版嵁
this.form.serviceType = this.serviceType;
this.form.deptcode = this.deptcodesWards.join(",");
this.form.leavehospitaldistrictcode =
@@ -1547,27 +1754,55 @@
this.form.icd10code = this.diagglist
.map((item) => item.icdcode)
.join(",");
- Editsingletask(this.form).then((res) => {
- if (res.code == 200) {
- if (this.form.taskid) {
- this.$modal.msgSuccess("淇敼鎴愬姛");
+ this.form.icd10name = this.diagglist
+ .map((item) => item.icdname)
+ .join(",");
+
+ // ===== 鎻愪氦鎺ュ彛 =====
+ Editsingletask(this.form)
+ .then((res) => {
+ if (res.code == 200) {
+ // 鉁� 鎴愬姛
+ if (this.form.taskid) {
+ this.$modal.msgSuccess("淇敼鎴愬姛");
+ } else {
+ this.$modal.msgSuccess("鏂板鎴愬姛");
+ }
+ this.submitLoading = false;
+ this.$router.push({
+ path: "/followvisit/tasklist",
+ query: { tasktopic: this.form.serviceType },
+ });
} else {
- this.$modal.msgSuccess("鏂板鎴愬姛");
+ // 鉁� 鎺ュ彛杩斿洖閿欒鐮�
+ this.$modal.msgError(res.msg || "鎿嶄綔澶辫触");
+ this.submitLoading = false;
}
+ })
+ .catch((error) => {
+ // 鉁� 鎹曡幏鎺ュ彛璇锋眰寮傚父
+ console.error("鎻愪氦澶辫触:", error);
+ this.$modal.msgError(error.message || "缃戠粶寮傚父锛岃绋嶅悗閲嶈瘯");
this.submitLoading = false;
- this.$router.push({
- path: "/followvisit/tasklist",
- query: { tasktopic: this.form.serviceType },
- });
- }
- });
+ });
} catch (error) {
+ // 鉁� 鎹曡幏鍚屾浠g爜寮傚父
+ console.error("琛ㄥ崟鎻愪氦寮傚父:", error);
+ this.$modal.msgError(error.message || "琛ㄥ崟鎻愪氦寮傚父");
this.submitLoading = false;
- } finally {
- // 绗洓姝ワ細鏃犺鎴愬姛鎴栧け璐ワ紝鏈�缁堥兘鍏抽棴鍔犺浇鐘舵��
}
},
+ handleDiseaseDeptChange(dept) {
+ console.log(dept, "dept");
+ // 褰撻�夋嫨绉戝鏃讹紝瀛樺偍鏁翠釜绉戝瀵硅薄
+ this.diseaseDept = dept;
+ },
+
+ handleDiseaseWardChange(ward) {
+ // 褰撻�夋嫨鐥呭尯鏃讹紝瀛樺偍鏁翠釜鐥呭尯瀵硅薄
+ this.diseaseWard = ward;
+ },
// ----------------------琛ㄦ牸瀛愮粍浠朵簨浠�
// 閫夋嫨棰勮
@@ -1611,7 +1846,7 @@
// 鐤剧梾
this.getillness(this.form.libtemplateid);
- selectInfoByCondition({id:this.form.templateid} ).then((res) => {
+ selectInfoByCondition({ id: this.form.templateid }).then((res) => {
if (res.code == 200) {
this.previewtf = true;
this.previewtftype = 1;
@@ -1931,13 +2166,23 @@
let filteredArray = "";
if (res.code == 200) {
this.form = res.data;
+ this.diseaseDept = {
+ deptCode: this.form.deptcode,
+ deptName: this.form.deptname,
+ };
+ this.diseaseWard = {
+ districtCode: this.form.leavehospitaldistrictcode,
+ districtName: this.form.leavehospitaldistrictname,
+ };
+ console.log(this.diseaseWard, this.diseaseDept);
+
this.form.serviceType = this.serviceType;
this.form.patTaskRelevances = this.form.patTaskRelevances
? this.form.patTaskRelevances
: [];
this.overallCase = this.form.patTaskRelevances.concat();
this.checkList = this.form.preachform.split(",") || [];
- this.selectedOrder = this.form.preachformList;
+ this.selectedOrder = this.form.preachformList || [];
this.overallCase.forEach((item) => {
if (item.endtime) {
@@ -2010,7 +2255,7 @@
let arr = res.rows;
arr.forEach((item) => {
getillnesslist({
- icdcode: item.icd10code,
+ icdname: item.icd10name,
}).then((res) => {
item.icdname = res.rows[0].icdname;
this.diagglist.push(item);
@@ -2036,24 +2281,24 @@
}).then((row) => {
this.donorchargeList = res.rows;
});
- getbaseopera({
- pageNum: 1,
- pageSize: 1000,
- }).then((row) => {
- this.baseoperaList = res.rows;
- });
+ // getbaseopera({
+ // pageNum: 1,
+ // pageSize: 1000,
+ // }).then((row) => {
+ // this.baseoperaList = res.rows;
+ // });
},
// 鎵嬫湳鏌ヨ
remoteopcode(name) {
- if (name) {
- getbaseopera({
- pageNum: 1,
- pageSize: 1000,
- opdesc: name,
- }).then((res) => {
- this.baseoperaList = res.rows;
- });
- }
+ // if (name) {
+ // getbaseopera({
+ // pageNum: 1,
+ // pageSize: 1000,
+ // opdesc: name,
+ // }).then((res) => {
+ // this.baseoperaList = res.rows;
+ // });
+ // }
},
// 浠诲姟绉戝鍒犻櫎瑙﹀彂
@@ -2284,7 +2529,7 @@
});
},
checkSelectionChange(selectedValues, selectedOrder) {
- this.selectedOrder = selectedValues;
+ this.selectedOrder = selectedValues || [];
console.log("褰撳墠閫変腑:", selectedValues);
console.log("閫変腑椤哄簭:", selectedOrder);
},
@@ -2321,8 +2566,12 @@
if (Array.isArray(this.objyl.suitway)) {
this.objyl.suitway = this.objyl.suitway.join(",");
}
- this.objyl.templateid = this.objyl.id;
+ this.objyl.libtemplateid = this.objyl.id;
+ this.form.libtemplateid = this.objyl.id;
+
this.objyl.isoperation = 1;
+ console.log(this.objyl, "this.objyl");
+
this.objyl.ivrLibaTemplateScriptVOList.forEach((item) => {
item.ivrTaskScriptTargetoptionList =
item.ivrLibaScriptTargetoptionList;
--
Gitblit v1.9.3