From f12b3e4c7c8d55217cc1d21f814a9a3d5fc57251 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 03 十一月 2026 16:02:21 +0800
Subject: [PATCH] 提交Merge branch 'subtask' of http://116.62.18.175:6699/r/~yxh/smartor-web into subtask
---
src/views/followvisit/record/detailpage/index.vue | 357 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 334 insertions(+), 23 deletions(-)
diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index cb7e4ef..61ae393 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -127,6 +127,29 @@
</el-tooltip>
</template>
</el-table-column>
+ <el-table-column
+ v-if="
+ orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�' ||
+ orgname == '涓芥按甯備腑鍖婚櫌'
+ "
+ label="鎷ㄥ彿鐘舵��"
+ width="120"
+ align="center"
+ key="isManuallyCalled"
+ prop="isManuallyCalled"
+ >
+ <template slot-scope="scope">
+ <el-tag
+ v-if="Number(scope.row.isManuallyCalled) > 0"
+ type="success"
+ :disable-transitions="false"
+ >鎷ㄩ�歿{ scope.row.isManuallyCalled }}娆�</el-tag
+ >
+ <el-tag v-else type="info" :disable-transitions="false"
+ >鏈嫧閫�</el-tag
+ >
+ </template>
+ </el-table-column>
<el-table-column
prop="finishtime"
align="center"
@@ -283,6 +306,8 @@
>
</el-table-column>
+
+
<el-table-column
prop="bankcardno"
align="center"
@@ -383,9 +408,20 @@
type="primary"
round
@click="smsSubTask"
- v-if="orgname != '鐪佺珛鍚屽痉缈犺嫅闄㈠尯'"
+ v-if="
+ orgname != '鐪佺珛鍚屽痉缈犺嫅闄㈠尯' &&
+ orgname != '涓芥按甯備腑鍖婚櫌'
+ "
>
闂嵎鐭俊鎺ㄩ��
+ </el-button>
+ <el-button
+ type="primary"
+ round
+ @click="weChatSubTask"
+ v-if="orgname == '涓芥按甯備腑鍖婚櫌'"
+ >
+ 闂嵎寰俊鎺ㄩ��
</el-button>
</span>
</div>
@@ -603,10 +639,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>
@@ -664,10 +706,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>
@@ -676,6 +723,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">
@@ -1121,7 +1200,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
@@ -1144,9 +1223,9 @@
title="鎮h�呭啀娆¢殢璁�"
v-dialogDrags
:visible.sync="dialogFormVisible"
- width="700px"
+ width="900px"
>
- <el-form ref="zcform" :rules="zcrules" :model="form" label-width="80px">
+ <el-form ref="zcform" :rules="zcrules" :model="form" label-width="120px">
<!-- 鍩虹鏈嶅姟淇℃伅 - 榛樿鎶樺彔 -->
<el-collapse v-model="activeNames" @change="handleCollapseChange">
<el-collapse-item title="鍩虹鏈嶅姟淇℃伅" name="basic">
@@ -1175,7 +1254,7 @@
<el-input
style="width: 100%"
disabled
- v-model="form.deptname"
+ v-model="form.leaveldeptname"
></el-input>
</el-form-item>
<el-form-item label="鐥呭尯">
@@ -1246,6 +1325,13 @@
<!-- 涓嬫闅忚淇℃伅 - 榛樿灞曞紑 -->
<el-collapse-item title="涓嬫闅忚" name="next">
+ <el-form-item label="鍐嶆闅忚浠诲姟">
+ <el-input
+ disabled
+ v-model="nextTaskName"
+ placeholder="鍐嶆闅忚浠诲姟"
+ ></el-input>
+ </el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="闅忚鏂瑰紡" prop="visitType">
@@ -1293,6 +1379,12 @@
<el-form-item label="闅忚璁板綍" :required="form.resource == '2'">
<el-input type="textarea" v-model="form.remark"></el-input>
</el-form-item>
+ <el-form-item label="鍖荤敓澶勭悊鎰忚" prop="doctorOpinion">
+ <el-input
+ type="textarea"
+ v-model="form.doctorOpinion"
+ ></el-input>
+ </el-form-item>
</el-collapse-item>
</el-collapse>
</el-form>
@@ -1312,7 +1404,11 @@
:visible.sync="CaldialogVisible"
width="60%"
>
- <CallCenterLs ref="CallCenterLs" :initial-phone="currentPhoneNumber" />
+ <CallCenterLs
+ ref="CallCenterLs"
+ :initial-phone="currentPhoneNumber"
+ @call-connected="recordCallConnected"
+ />
</el-dialog>
</div>
</div>
@@ -1336,8 +1432,10 @@
query360PatInfonh,
sendMsg,
smsSubTask,
+ weChatSubTask,
getconfigKey,
} from "@/api/AiCentre/index";
+import { getIvrtask } from "@/api/smartor/ivrtask";
import {
messagelistpatient,
alterpatient,
@@ -1487,6 +1585,7 @@
input: "浠婂ぉ韬綋杩樹笉閿�",
radio: "2",
taskname: "",
+ nextTaskName: "",
activeName: "wj",
voice: "",
templateid: "",
@@ -1533,6 +1632,12 @@
"棰勭害涓嬫澶嶈瘖",
],
tableDatatop: [], //棰樼洰琛�
+ // 淇濆瓨闂嵎锛氭湭绛旈鎻愮ず寮圭獥 / 鐢ㄦ埛鍧氭寔淇濆瓨鏍囪
+ confirmSaveVisible: false,
+ forceSave: false,
+ // 闃查噸澶嶆彁浜わ細淇濆瓨涓鐢ㄦ寜閽�
+ savingQuestion: false,
+ savingVoice: false,
voiceDatatop: [], //棰樼洰琛�
dynamicTags: [],
isMergeMode: false,
@@ -1582,6 +1687,9 @@
},
trigger: "change",
},
+ ],
+ doctorOpinion: [
+ { required: true, message: "璇疯緭鍏ュ尰鐢熷鐞嗘剰瑙�", trigger: "blur" },
],
},
userrules: {
@@ -1683,6 +1791,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;
@@ -2094,8 +2222,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 = "";
@@ -2150,6 +2322,11 @@
param6: this.id,
type: 2,
};
+ // 闃查噸澶嶆彁浜わ細淇濆瓨涓啀娆$偣鍑荤洿鎺ュ拷鐣�
+ if (this.savingQuestion) {
+ return;
+ }
+ this.savingQuestion = true;
savequestiondetail(obj).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("鏈嶅姟淇濆瓨鎴愬姛");
@@ -2192,6 +2369,8 @@
});
}
}
+ }).finally(() => {
+ this.savingQuestion = false;
});
},
Torouter() {
@@ -2216,7 +2395,8 @@
});
}
} else {
- location.reload();
+ // location.reload();
+ this.$router.go(-1);
}
},
// 鐢佃瘽============================
@@ -2299,6 +2479,22 @@
console.log(err);
});
},
+ weChatSubTask() {
+ this.$modal
+ .confirm("鏄惁鍚戞偅鑰呴�氳繃寰俊鎺ㄩ�侀棶鍗峰唴瀹癸紵")
+ .then(() => {
+ weChatSubTask(this.id).then((res) => {
+ if (String(res.code) === "200") {
+ this.$modal.msgSuccess(res.msg || "鍙戦�佹垚鍔�");
+ } else {
+ this.$modal.msgError(res.message || res.msg || "鍙戦�佸け璐�");
+ }
+ });
+ })
+ .catch((err) => {
+ console.log(err);
+ });
+ },
handleConfirmReplace() {
// 閬嶅巻鎵�鏈夐鐩紙tableDatatop锛�
this.tableDatatop.forEach((item) => {
@@ -2349,7 +2545,7 @@
this.CaldialogVisible = true;
return;
}
- // 涓嬫柟鏄腑鍖婚櫌鍛煎彨
+ // 涓嬫柟鏄附姘村競涓尰闄�
if (this.isSipRegistering) {
this.$message.warning("绯荤粺姝e湪鍒濆鍖栵紝璇风◢鍊�...");
return;
@@ -2379,11 +2575,15 @@
this.callStatus = status.type;
if (status.type === "connected") {
- this.currentCall = {
- phone: this.currentPhoneNumber,
- type: this.callType,
- startTime: new Date(),
- };
+ if (!this.currentCall) {
+ this.currentCall = {
+ phone: this.currentPhoneNumber,
+ type: this.callType,
+ startTime: new Date(),
+ };
+ // 涓芥按甯備腑鍖婚櫌锛氱數璇濇帴閫氬悗璁板綍鎷ㄦ墦鎴愬姛娆℃暟
+ this.recordCallConnected();
+ }
} else if (status.type === "ended" || status.type === "failed") {
this.currentCall = null;
}
@@ -2392,6 +2592,39 @@
if (status.type === "failed") {
this.$message.error(`鍛煎彨澶辫触: ${status.text}`);
}
+ },
+ // 鐢佃瘽鎷ㄦ墦鎴愬姛鍚庯紙鎺ラ�氾級娆℃暟 +1锛屽苟閫氳繃 Editsingletaskson 鏇存柊鏈嶅姟鏁版嵁
+ // 浠呴檺鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄笌涓芥按甯備腑鍖婚櫌
+ recordCallConnected() {
+ const allowedOrgs = ["鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�", "涓芥按甯備腑鍖婚櫌"];
+ if (!allowedOrgs.includes(this.orgname)) return;
+
+ getTaskservelist({
+ patid: this.patid,
+ subId: this.id,
+ }).then((res) => {
+ if (res.code == 200) {
+ const objson = res.rows[0].serviceSubtaskList.find(
+ (item) => item.id == this.id
+ );
+ if (!objson) return;
+ objson.isManuallyCalled = (Number(objson.isManuallyCalled) || 0) + 1;
+ Editsingletaskson(objson).then((r) => {
+ if (r.code == 200) {
+ // 鍙婃椂鏇存柊椤堕儴鏈嶅姟鍒楄〃涓庤〃鍗曚腑鐨勬嫧鍙风姸鎬�
+ const localRow = (this.logsheetlist || []).find(
+ (item) => item.id == this.id
+ );
+ if (localRow) {
+ localRow.isManuallyCalled = objson.isManuallyCalled;
+ }
+ if (this.form && this.form.id == this.id) {
+ this.form.isManuallyCalled = objson.isManuallyCalled;
+ }
+ }
+ });
+ }
+ });
},
// 缁撴潫褰撳墠閫氳瘽
endCurrentCall() {
@@ -2441,6 +2674,11 @@
type: 1,
};
console.log("c", 4);
+ // 闃查噸澶嶆彁浜わ細淇濆瓨涓啀娆$偣鍑荤洿鎺ュ拷鐣�
+ if (this.savingVoice) {
+ return;
+ }
+ this.savingVoice = true;
const orgName = localStorage.getItem("orgname");
console.log(orgName, "orgName");
@@ -2483,6 +2721,8 @@
this.Torouter();
});
}
+ }).finally(() => {
+ this.savingVoice = false;
});
},
// 鍐嶆闅忚鏁版嵁鏇存浛
@@ -2522,6 +2762,7 @@
console.log(this.form.templatename, "templatename");
this.form.remark = this.form.remark || "";
+ this.form.doctorOpinion = this.form.doctorOpinion || "";
this.logsheetlist = res.rows[0].serviceSubtaskList;
this.templateid = this.form.templateid;
this.selectedTag = this.form.excep;
@@ -2555,7 +2796,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}锛屾偍濂斤紒`,
});
@@ -2711,12 +2952,33 @@
return tag ? tag.description : "";
},
+ // 鑾峰彇鍐嶆闅忚浠诲姟淇℃伅锛堜笅娆¢殢璁块儴鍒嗗睍绀猴級
+ fetchNextTaskInfo() {
+ const taskid = this.form.taskid || this.taskid;
+ if (!taskid) {
+ this.nextTaskName = "";
+ return;
+ }
+ getIvrtask(taskid).then((r) => {
+ const task = r.data || {};
+ const nextid = task.nexttaskid;
+ if (nextid) {
+ getIvrtask(nextid).then((r2) => {
+ this.nextTaskName =
+ (r2.data && r2.data.taskName) || task.nexttaskname || "";
+ });
+ } else {
+ this.nextTaskName = task.nexttaskname || "";
+ }
+ });
+ },
// 璋冭捣鍐嶆鍙戦��
sendAgain() {
+ this.fetchNextTaskInfo();
getTaskservelist({
patid: this.patid,
visitCount: 2,
- leaveldeptcodes: [this.form.deptcode],
+ leaveldeptcodes: [this.form.leaveldeptcode],
}).then((res) => {
if (res.rows[0].serviceSubtaskList.length) {
if (
@@ -2726,7 +2988,7 @@
this.$modal
.confirm(
'鏈偅鑰呭湪"' +
- res.rows[0].serviceSubtaskList[0].deptname +
+ res.rows[0].serviceSubtaskList[0].leaveldeptname +
'"绉戝涓嬪凡鏈夊啀娆¢殢璁挎湇鍔¤繘琛屼腑鏄惁缁х画鍒涘缓锛�'
)
.then(() => {
@@ -2955,11 +3217,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("鏈�夋嫨闅忚鏂瑰紡");
@@ -3653,14 +3915,14 @@
margin-top: 20px;
}
-.el-input.is-disabled .el-input__inner {
+::v-deep .el-input.is-disabled .el-input__inner {
background-color: #fff;
border-color: #dcdfe6;
color: #080808 !important;
cursor: not-allowed;
}
-.el-textarea.is-disabled .el-textarea__inner {
+::v-deep .el-textarea.is-disabled .el-textarea__inner {
background-color: #fff;
border-color: #dcdfe6;
color: #080808 !important;
@@ -4296,4 +4558,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