From a99e82da2b087d7019cdce015c25befc620b9d61 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期二, 10 十一月 2026 14:14:16 +0800
Subject: [PATCH] 测试完成
---
src/views/followvisit/record/detailpage/index.vue | 204 ++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 187 insertions(+), 17 deletions(-)
diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index 99123e5..9321ac3 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -636,10 +636,16 @@
<el-button
v-if="showQuestionnaireForm"
type="primary"
+ :disabled="!canSaveQuestionnaire"
+ :loading="savingQuestion"
@click="getdetail"
>淇濆瓨闂嵎璇︽儏</el-button
>
- <el-button v-else type="primary" @click="yuyingetdetail"
+ <el-button
+ v-else
+ type="primary"
+ :loading="savingQuestion"
+ @click="yuyingetdetail"
>淇濆瓨闂嵎璇︽儏</el-button
>
</div>
@@ -697,10 +703,15 @@
<el-button
v-if="Voicetype"
type="primary"
+ :loading="savingVoice"
@click="yuyingetdetail"
>淇濆瓨闅忚璇︽儏</el-button
>
- <el-button v-else type="primary" @click="getdetail"
+ <el-button
+ v-else
+ type="primary"
+ :loading="savingQuestion"
+ @click="getdetail"
>淇濆瓨闅忚璇︽儏</el-button
>
</div>
@@ -709,6 +720,38 @@
</div>
</div>
</div>
+
+ <!-- 鏈�夐�夐」鎻愮ず锛氬ぇ瀛楅啋鐩彁閱掞紝鍏佽鐢ㄦ埛鍧氭寔淇濆瓨 -->
+ <el-dialog
+ :visible.sync="confirmSaveVisible"
+ width="640px"
+ append-to-body
+ :close-on-click-modal="false"
+ custom-class="unanswered-dialog"
+ >
+ <div slot="title" class="unanswered-title">
+ <i class="el-icon-warning"></i> 娉ㄦ剰锛氭湁棰樼洰娌℃湁閫夋嫨閫夐」
+ </div>
+ <div class="unanswered-warn">
+ 褰撳墠闂嵎杩樻湁
+ <span class="unanswered-count">{{ unansweredQuestions.length }}</span>
+ 閬撻<strong>娌℃湁閫夋嫨浠讳綍閫夐」</strong>锛岀户缁繚瀛樺皢鎸夆�滄湭浣滅瓟鈥濊褰曪細
+ </div>
+ <div class="unanswered-list">
+ <div v-for="q in unansweredQuestions" :key="q.index">
+ 绗� {{ q.index }} 棰橈細{{ q.title }}
+ </div>
+ </div>
+ <div class="unanswered-tip">纭畾杩樿淇濆瓨鍚楋紵</div>
+ <span slot="footer">
+ <el-button size="medium" @click="confirmSaveVisible = false"
+ >杩斿洖琛ュ~</el-button
+ >
+ <el-button type="danger" size="medium" @click="confirmForceSave"
+ >浠嶈淇濆瓨</el-button
+ >
+ </span>
+ </el-dialog>
<!-- 浜哄伐澶勭悊 -->
<div class="manual-action">
<div class="Followuserinfos">
@@ -1170,7 +1213,7 @@
<!-- 娉ㄦ剰杩欓噷鍙兘浣跨敤 userform.telcode -->
</el-form-item>
<el-form-item label="绉戝">
- <el-input style="width: 400px" v-model="form.deptname"></el-input>
+ <el-input style="width: 400px" v-model="form.leaveldeptname"></el-input>
</el-form-item>
<el-form-item label="鐥呭尯">
<el-input
@@ -1224,7 +1267,7 @@
<el-input
style="width: 100%"
disabled
- v-model="form.deptname"
+ v-model="form.leaveldeptname"
></el-input>
</el-form-item>
<el-form-item label="鐥呭尯">
@@ -1615,6 +1658,12 @@
"棰勭害涓嬫澶嶈瘖",
],
tableDatatop: [], //棰樼洰琛�
+ // 淇濆瓨闂嵎锛氭湭绛旈鎻愮ず寮圭獥 / 鐢ㄦ埛鍧氭寔淇濆瓨鏍囪
+ confirmSaveVisible: false,
+ forceSave: false,
+ // 闃查噸澶嶆彁浜わ細淇濆瓨涓鐢ㄦ寜閽�
+ savingQuestion: false,
+ savingVoice: false,
voiceDatatop: [], //棰樼洰琛�
dynamicTags: [],
isMergeMode: false,
@@ -1779,6 +1828,26 @@
}
},
computed: {
+ // 鏄惁鏈変换鎰忎竴閬撻銆岄�変簡閫夐」銆嶆垨銆屽~浜嗗娉ㄣ��
+ hasAnyAnswer() {
+ return (this.tableDatatop || []).some((item) => this.isQuestionAnswered(item));
+ },
+ // 鍙充晶澶勭悊鎰忚/澶囨敞妗嗘槸鍚︽湁鍐呭
+ hasRemarkText() {
+ const remark = this.form && this.form.remark;
+ return remark !== null && remark !== undefined && String(remark).trim() !== "";
+ },
+ // 淇濆瓨闂嵎璇︽儏鐨勫彲鐐规潯浠讹細闂嵎鏈変綔绛� 鎴� 鍙宠竟澶囨敞妗嗘湁鍐呭锛堟湁鍏朵竴鍗冲彲锛�
+ canSaveQuestionnaire() {
+ return this.hasAnyAnswer || this.hasRemarkText;
+ },
+ // 娌℃湁閫夋嫨閫夐」鐨勯鐩紙淇濆瓨鍓嶇敤澶у瓧閱掔洰鎻愮ず锛屼笉鍖哄垎鏈夋病鏈夊~澶囨敞锛�
+ // index 鐢ㄩ鐩湪闂嵎閲岀殑鍘熷搴忓彿锛屾柟渚垮拰宸﹁竟闂嵎瀵圭収
+ unansweredQuestions() {
+ return (this.tableDatatop || [])
+ .map((item, i) => ({ index: i + 1, title: item.scriptContent || "鏈懡鍚嶉鐩�", raw: item }))
+ .filter((q) => !this.hasOptionValue(q.raw));
+ },
callStatusText() {
if (this.customCallStatus) {
return this.customCallStatus;
@@ -1831,13 +1900,7 @@
this.orgname = localStorage.getItem("orgname");
console.log(localStorage.getItem("orgname"));
- if (
- this.orgname == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ||
- this.orgname == "鐪佺珛鍚屽痉涔嬫睙闄㈠尯" ||
- this.orgname == "鐪佺珛鍚屽痉闂叉灄闄㈠尯" ||
- this.orgname == "鐪佺珛鍚屽痉闈掑北婀栭櫌鍖�" ||
- this.orgname == "鐪佺珛鍚屽痉澶╃洰灞辫矾闄㈠尯"
- ) {
+ if (this.isTongdeCampus) {
this.showContinuationCareBtn = true;
}
@@ -2194,8 +2257,52 @@
}
});
},
+ // 棰樼洰鏄惁閫変簡閫夐」锛堝崟閫夊瓧绗︿覆 / 澶氶�夋暟缁勶級
+ hasOptionValue(item) {
+ if (!item) {
+ return false;
+ }
+ const val = item.scriptResult;
+ if (Array.isArray(val)) {
+ return val.some(
+ (v) => v !== null && v !== undefined && String(v).trim() !== ""
+ );
+ }
+ return val !== null && val !== undefined && String(val).trim() !== "";
+ },
+ // 棰樼洰鏄惁濉簡澶囨敞
+ hasRemarkValue(item) {
+ if (!item) {
+ return false;
+ }
+ const remark = item.answerps;
+ return (
+ remark !== null && remark !== undefined && String(remark).trim() !== ""
+ );
+ },
+ // 棰樼洰鏄惁宸蹭綔绛旓細閫変簡閫夐」 鎴� 濉簡澶囨敞锛堜袱鑰呮湁鍏朵竴鍗崇畻宸茬瓟锛�
+ isQuestionAnswered(item) {
+ return this.hasOptionValue(item) || this.hasRemarkValue(item);
+ },
+ // 鏈瓟棰樻彁绀洪噷鐐广�屼粛瑕佷繚瀛樸��
+ confirmForceSave() {
+ this.forceSave = true;
+ this.confirmSaveVisible = false;
+ this.getdetail();
+ },
// 鍖绘姢浜哄憳瀛樺偍鏁版嵁
getdetail() {
+ // 闂嵎娌′綔绛斻�佸彸杈瑰娉ㄦ涔熺┖ 鈫� 涓嶅厑璁镐繚瀛�
+ if (!this.canSaveQuestionnaire) {
+ this.$message.warning("璇峰厛鍦ㄩ棶鍗蜂腑浣滅瓟锛屾垨鍦ㄥ彸渚у~鍐欏鐞嗘剰瑙�/澶囨敞");
+ return;
+ }
+ // 杩樻湁棰樼洰娌′綔绛旓細澶у瓧鎻愮ず锛岀敤鎴峰潥鎸佹墠缁х画
+ if (this.unansweredQuestions.length > 0 && !this.forceSave) {
+ this.confirmSaveVisible = true;
+ return;
+ }
+ this.forceSave = false;
console.log(1);
let excep = "";
@@ -2250,6 +2357,11 @@
param6: this.id,
type: 2,
};
+ // 闃查噸澶嶆彁浜わ細淇濆瓨涓啀娆$偣鍑荤洿鎺ュ拷鐣�
+ if (this.savingQuestion) {
+ return;
+ }
+ this.savingQuestion = true;
savequestiondetail(obj).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("鏈嶅姟淇濆瓨鎴愬姛");
@@ -2292,6 +2404,8 @@
});
}
}
+ }).finally(() => {
+ this.savingQuestion = false;
});
},
Torouter() {
@@ -2615,6 +2729,11 @@
type: 1,
};
console.log("c", 4);
+ // 闃查噸澶嶆彁浜わ細淇濆瓨涓啀娆$偣鍑荤洿鎺ュ拷鐣�
+ if (this.savingVoice) {
+ return;
+ }
+ this.savingVoice = true;
const orgName = localStorage.getItem("orgname");
console.log(orgName, "orgName");
@@ -2657,6 +2776,8 @@
this.Torouter();
});
}
+ }).finally(() => {
+ this.savingVoice = false;
});
},
// 鍐嶆闅忚鏁版嵁鏇存浛
@@ -2731,7 +2852,7 @@
name: this.form.sendname,
age: this.form.age,
phone: this.userform.telcode,
- deptName: this.form.deptname,
+ deptName: this.form.leaveldeptname,
wardName: this.form.leavehospitaldistrictname,
smsTemplate: `灏婃暚鐨�${this.form.sendname}锛屾偍濂斤紒`,
});
@@ -2913,7 +3034,7 @@
getTaskservelist({
patid: this.patid,
visitCount: 2,
- leaveldeptcodes: [this.form.deptcode],
+ leaveldeptcodes: [this.form.leaveldeptcode],
}).then((res) => {
if (res.rows[0].serviceSubtaskList.length) {
if (
@@ -2923,7 +3044,7 @@
this.$modal
.confirm(
'鏈偅鑰呭湪"' +
- res.rows[0].serviceSubtaskList[0].deptname +
+ res.rows[0].serviceSubtaskList[0].leaveldeptname +
'"绉戝涓嬪凡鏈夊啀娆¢殢璁挎湇鍔¤繘琛屼腑鏄惁缁х画鍒涘缓锛�'
)
.then(() => {
@@ -3164,11 +3285,11 @@
if (form.resource == 2) {
form.visitDeptCode = localStorage.getItem("deptCode")
? localStorage.getItem("deptCode")
- : form.deptcode;
+ : form.leaveldeptcode;
form.visitDeptName = "闅忚涓績";
} else {
- form.visitDeptCode = form.deptcode;
- form.visitDeptName = form.deptname;
+ form.visitDeptCode = form.leaveldeptcode;
+ form.visitDeptName = form.leaveldeptname;
}
} else {
this.$modal.msgError("鏈�夋嫨闅忚鏂瑰紡");
@@ -4540,4 +4661,53 @@
margin-bottom: 12px;
}
}
+
+/* 鏈�夐�夐」鎻愮ず锛氬ぇ瀛楅啋鐩彁閱� */
+.unanswered-title {
+ font-size: 22px;
+ font-weight: 700;
+ color: #f56c6c;
+ display: flex;
+ align-items: center;
+}
+.unanswered-title i {
+ font-size: 26px;
+ margin-right: 10px;
+}
+.unanswered-warn {
+ font-size: 20px;
+ font-weight: 600;
+ color: #303133;
+ line-height: 1.8;
+}
+.unanswered-warn strong {
+ color: #f56c6c;
+ font-size: 22px;
+}
+.unanswered-count {
+ font-size: 40px;
+ font-weight: 700;
+ color: #f56c6c;
+ margin: 0 6px;
+ vertical-align: middle;
+}
+.unanswered-list {
+ margin-top: 14px;
+ max-height: 300px;
+ overflow-y: auto;
+ padding: 12px 16px;
+ background: #fef0f0;
+ border: 1px solid #fbc4c4;
+ border-radius: 6px;
+ font-size: 18px;
+ line-height: 2;
+ color: #303133;
+}
+.unanswered-tip {
+ margin-top: 18px;
+ font-size: 22px;
+ font-weight: 700;
+ color: #f56c6c;
+ text-align: center;
+}
</style>
--
Gitblit v1.9.3