From 741805d8daa2d2baa0b6b75bc1724488baf9c6bc Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期一, 15 六月 2026 14:55:10 +0800
Subject: [PATCH] 测试完成
---
src/views/patient/propaganda/QuestionnaireTask.vue | 120 ++++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 81 insertions(+), 39 deletions(-)
diff --git a/src/views/patient/propaganda/QuestionnaireTask.vue b/src/views/patient/propaganda/QuestionnaireTask.vue
index 2f19c12..6c4256a 100644
--- a/src/views/patient/propaganda/QuestionnaireTask.vue
+++ b/src/views/patient/propaganda/QuestionnaireTask.vue
@@ -1503,13 +1503,16 @@
if (this.submitLoading) {
return;
}
- // 绗簩姝ワ細寮�鍚姞杞界姸鎬侊紝绂佺敤鎸夐挳
+
+ // 寮�鍚姞杞界姸鎬�
this.submitLoading = true;
console.log(this.submitLoading);
try {
- if (this.time4 && this.form.sendType == 3)
+ // 鏃堕棿澶勭悊
+ if (this.time4 && this.form.sendType == 3) {
this.form.showTimeMorn = this.time4;
+ }
this.form.sendTimeslot = [
{
begantime: this.time4,
@@ -1517,8 +1520,8 @@
xh: 1,
},
];
- console.log(1);
+ // 鏍规嵁搴旂敤绫诲瀷娓呯悊瀛楁
if (this.form.appltype == 1) {
this.leavehospitaldistrictcodes = [];
this.form.oplevelcode = null;
@@ -1536,75 +1539,90 @@
this.illnesscodes = [];
this.leavehospitaldistrictcodes = [];
}
+
+ // 鏍¢獙锛氭湇鍔$被鍨�
if (this.checkList) {
this.form.preachform = this.checkList.join(",");
this.form.preachformList = this.selectedOrder;
} else {
this.$modal.msgError("璇烽�夋嫨鏈嶅姟绫诲瀷");
this.submitLoading = false;
-
return;
}
- console.log(2);
- if (
+ // 鏍¢獙锛氱柧鐥呭叧鑱旂瀹ゆ垨鐥呭尯
+ if (this.form.appltype == 3) {
+ const hasDept = this.diseaseDept?.deptCode;
+ const hasWard = this.diseaseWard?.districtCode;
+
+ if (!hasDept && !hasWard) {
+ this.$modal.msgError("褰撳墠鐤剧梾闇�鍏宠仈绉戝鎴栫梾鍖�");
+ this.submitLoading = false;
+ return;
+ }
+ }
+
+ // 鏍¢獙锛氫换鍔″叧鑱旀潯浠�
+ const hasCondition =
this.deptcodesWards[0] ||
this.leavehospitaldistrictcodes[0] ||
this.diagglist[0] ||
this.form.oplevelcode ||
this.form.longTask == 2 ||
- this.serviceType == 3
- ) {
- } else {
+ this.serviceType == 3;
+
+ if (!hasCondition) {
this.$modal.msgError("璇烽�夋嫨浠诲姟鍏宠仈鏉′欢");
this.submitLoading = false;
return;
}
- //鏆傚仠浠诲姟鎮h�呴檺鍒�
- // if (!this.form.patTaskRelevances[0] && !this.form.longTask) {
- // this.$modal.msgError("璇烽�夋嫨鐥呬汉");
- // return;
- // }
- console.log(3);
+ // 鏍¢獙锛氭ā鏉�
if (!this.form.templatename && !this.templateor) {
this.$modal.msgError("鏈�夋嫨妯℃澘");
this.submitLoading = false;
-
return;
}
- if (
+ // 鏍¢獙锛氭椂闂翠俊鎭�
+ 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.form.longTask;
+
+ if (!isValidTime) {
this.submitLoading = false;
- return this.$modal.msgError("鏃堕棿淇℃伅缂哄け");
+ 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;
}
- console.log(4);
+
+ // 缁勮鎻愪氦鏁版嵁
this.form.serviceType = this.serviceType;
this.form.deptcode = this.deptcodesWards.join(",");
this.form.leavehospitaldistrictcode =
this.leavehospitaldistrictcodes.join(",");
- // this.form.opcode = this.operationcodes.join(",");
+
+ // 鐤剧梾鍏宠仈鐨勭瀹�/鐥呭尯
if (this.form.appltype == 3) {
if (this.diseaseDept) {
this.form.deptcode = this.diseaseDept.deptCode;
@@ -1617,30 +1635,46 @@
}
}
+ // 璇婃柇淇℃伅
this.form.icd10code = this.diagglist
.map((item) => item.icdcode)
.join(",");
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("淇敼鎴愬姛");
+
+ // 鎻愪氦鎺ュ彛
+ Editsingletask(this.form)
+ .then((res) => {
+ if (res.code == 200) {
+ if (this.form.taskid) {
+ this.$modal.msgSuccess("淇敼鎴愬姛");
+ } else {
+ this.$modal.msgSuccess("鏂板鎴愬姛");
+ }
+ this.$router.push({
+ path: "/followvisit/tasklist",
+ query: { tasktopic: this.form.serviceType },
+ });
} else {
- this.$modal.msgSuccess("鏂板鎴愬姛");
+ // 鉁� 鎺ュ彛杩斿洖閿欒鐮佹椂鐨勫鐞�
+ this.$modal.msgError(res.msg || "鎿嶄綔澶辫触");
}
- this.$router.push({
- path: "/followvisit/tasklist",
- query: { tasktopic: this.form.serviceType },
- });
+ })
+ .catch((error) => {
+ // 鉁� 鎹曡幏鎺ュ彛璇锋眰寮傚父
+ console.error("鎻愪氦澶辫触:", error);
+ this.$modal.msgError(error.message || "缃戠粶寮傚父锛岃绋嶅悗閲嶈瘯");
+ })
+ .finally(() => {
+ // 鉁� 鏃犺鎴愬姛鎴栧け璐ワ紝鏈�缁堥兘鍏抽棴鍔犺浇鐘舵��
this.submitLoading = false;
- }
- });
+ });
} catch (error) {
+ // 鉁� 鎹曡幏鍚屾浠g爜寮傚父
+ console.error("琛ㄥ崟鎻愪氦寮傚父:", error);
+ this.$modal.msgError(error.message || "琛ㄥ崟鎻愪氦寮傚父");
this.submitLoading = false;
- } finally {
- // 绗洓姝ワ細鏃犺鎴愬姛鎴栧け璐ワ紝鏈�缁堥兘鍏抽棴鍔犺浇鐘舵��
}
},
handleDiseaseDeptChange(dept) {
@@ -2102,6 +2136,14 @@
this.form.patTaskRelevances = this.form.patTaskRelevances
? this.form.patTaskRelevances
: [];
+ this.diseaseDept = {
+ deptCode: this.form.deptcode,
+ deptName: this.form.deptname,
+ };
+ this.diseaseWard = {
+ districtCode: this.form.leavehospitaldistrictcode,
+ districtName: this.form.leavehospitaldistrictname,
+ };
this.overallCase = this.form.patTaskRelevances.concat();
this.checkList = this.form.preachform.split(",");
this.selectedOrder = this.form.preachformList;
--
Gitblit v1.9.3