From f9902f7a3b79d22bde9f199263ac36de26816470 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期五, 08 五月 2026 14:46:10 +0800
Subject: [PATCH] 测试完成
---
src/views/followvisit/record/detailpage/index.vue | 348 +++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 237 insertions(+), 111 deletions(-)
diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index 360bc90..cfe9b61 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -76,7 +76,8 @@
gettoken360(
scope.row.sfzh,
scope.row.drcode,
- scope.row.drname
+ scope.row.drname,
+ scope.row.patid
)
"
><span class="button-textsc">{{
@@ -129,9 +130,7 @@
>
</div>
<div v-if="scope.row.sendstate == 7">
- <el-tag type="danger" :disable-transitions="false"
- >瓒呮椂</el-tag
- >
+ <el-tag type="danger" :disable-transitions="false">瓒呮椂</el-tag>
</div>
</template>
</el-table-column>
@@ -449,7 +448,7 @@
<div class="scriptTopic-dev" :key="index" v-else>
<div class="dev-text">
{{ index + 1 }}銆乕闂瓟]<span>{{
- item.scriptContent
+ item.questiontext
}}</span>
<span v-if="item.valueType == 3">(鍙兘杈撳叆鏁板瓧)</span>
</div>
@@ -560,11 +559,7 @@
<div class="header-actions">
<!-- 鍩虹鎿嶄綔鎸夐挳缁� -->
<div class="action-group basic-actions">
- <el-button
- type="primary"
- plain
- @click="Editsingletasksonyic('')"
- >
+ <el-button type="primary" plain @click="alterpatient('')">
淇濆瓨鍩虹淇℃伅
</el-button>
@@ -582,7 +577,7 @@
type="primary"
round
@click="sendAgain"
- v-if="form.isVisitAgain != 2"
+ v-if="(form.isVisitAgain != 2) & (visitAgain == 2)"
>
鍐嶆闅忚
</el-button>
@@ -653,6 +648,23 @@
icon="el-icon-phone"
@click="handleCall(userform.telcode, 'tel')"
:disabled="!isValidPhone(userform.telcode)"
+ ></el-button>
+ </el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="10">
+ <el-form-item
+ label="鐭彿鐢佃瘽"
+ v-if="orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'"
+ >
+ <el-input
+ placeholder="鑱旂郴鐢佃瘽缂哄け"
+ v-model="userform.telshortcode"
+ >
+ <el-button
+ slot="append"
+ icon="el-icon-phone"
+ @click="handleCall(userform.telshortcode, 'tel', true)"
></el-button>
</el-input>
</el-form-item>
@@ -740,12 +752,44 @@
/>
</div>
</div>
-
+ <el-form-item label="浠诲姟澶勭悊鐘舵��">
+ <el-select
+ v-model="serviceStates"
+ placeholder="璇烽�夋嫨鐘舵��"
+ clearable
+ style="width: 150px; margin-right: 10px"
+ >
+ <el-option
+ v-for="item in serviceState"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
+ </el-select>
+ </el-form-item>
<!-- 闅忚鍐呭/璁板綍 -->
<el-form-item
:label="orgname == '涓芥按甯備腑鍖婚櫌' ? '闅忚鍐呭' : '闅忚璁板綍'"
>
- <el-input type="textarea" v-model="form.remark"></el-input>
+ <!-- 蹇嵎鐭鏍囩 -->
+ <div style="margin-bottom: 8px">
+ <el-tag
+ v-for="(item, index) in dict.type.quickfollow_up"
+ :key="index"
+ style="margin-right: 8px; cursor: pointer"
+ @click="insertText(item.value)"
+ >
+ {{ item.value }}
+ </el-tag>
+ </div>
+ <!-- 鏂囨湰鍩� -->
+ <el-input
+ type="textarea"
+ :rows="4"
+ v-model="form.remark"
+ ref="textareaRef"
+ placeholder="鍙偣鍑讳笂鏂瑰揩鎹锋爣绛炬垨鎵嬪姩杈撳叆"
+ ></el-input>
</el-form-item>
<!-- 闅忚鎯呭喌 -->
@@ -1060,7 +1104,7 @@
align="right"
v-model="form.date1"
class="custom-disabled"
- value-format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd hh:mm:ss"
@change="checkFollowupDate"
></el-date-picker>
</el-form-item>
@@ -1110,6 +1154,7 @@
serviceSubtaskDetailedit,
serviceSubtaskDetailadd,
updatePersonVoices,
+ savequestiondetail,
addPersonVoices,
query360PatInfo,
sendMsg,
@@ -1122,6 +1167,7 @@
import CallButton from "@/components/CallButton";
import MergeAndModify from "./MergeAndModify.vue";
import CallCenterLs from "@/components/CallCenterLs";
+import store from "@/store";
export default {
components: {
CallButton,
@@ -1189,7 +1235,13 @@
},
},
},
- dicts: ["sys_normal_disable", "sys_user_sex", "sys_yujing", "sys_suggest"],
+ dicts: [
+ "sys_normal_disable",
+ "quickfollow_up",
+ "sys_user_sex",
+ "sys_yujing",
+ "sys_suggest",
+ ],
data() {
const validatePhone = (rule, value, callback) => {
if (!value) {
@@ -1204,6 +1256,7 @@
}, 300);
};
return {
+ visitAgain: 1,
userid: "",
currentPhoneNumber: "",
callType: "", // 鐢ㄤ簬鍖哄垎鏄摢涓數璇�
@@ -1214,6 +1267,29 @@
isEndingCall: false,
CaldialogVisible: false,
currentCall: null, // 褰撳墠閫氳瘽瀵硅薄
+ serviceStates: 6,
+ serviceState: [
+ {
+ value: 2,
+ label: "寰呴殢璁�",
+ },
+ {
+ value: 3,
+ label: "琛ㄥ崟宸插彂閫�",
+ },
+ {
+ value: 5,
+ label: "鍙戦�佸け璐�",
+ },
+ {
+ value: 6,
+ label: "宸插畬鎴�",
+ },
+ {
+ value: 4,
+ label: "涓嶆墽琛�",
+ },
+ ],
// 鏂板鍔熻兘鏁版嵁
showPatientInfo: true,
showContinuationCareBtn: false, // 鎺у埗寤剁画鎶ょ悊鎸夐挳鏄剧ず
@@ -1259,6 +1335,14 @@
label: "鍏朵粬",
value: "7",
},
+ ],
+ quickContents: [
+ "鐥呮儏绋冲畾锛岀户缁綋鍓嶆不鐤�",
+ "鎮h�呭凡姝讳骸",
+ "鎮h�呬笉闇�瑕侀殢璁�",
+ "鎸夋椂鏈嶈嵂锛屾敞鎰忎紤鎭�",
+ "楗娓呮贰锛屽繉杈涜荆",
+ "棰勭害涓嬫澶嶈瘖",
],
tableDatatop: [], //棰樼洰琛�
voiceDatatop: [], //棰樼洰琛�
@@ -1490,6 +1574,10 @@
this.Voicetype = this.$route.query.Voicetype;
this.visitCount = this.$route.query.visitCount;
this.serviceType = this.$route.query.serviceType;
+ this.visitAgain = store.getters.visitAgain;
+ console.log(store.getters.visitAgain);
+
+
this.orgname = localStorage.getItem("orgname");
if (this.orgname == "鐪佺珛鍚屽痉缈犺嫅闄㈠尯") {
this.showContinuationCareBtn = true;
@@ -1554,8 +1642,6 @@
methods: {
// 鑾峰彇涓婚鏍峰紡绫�
getTopicClass(item) {
- console.log(item.isabnormal, "getTopicClass");
-
// 鏍规嵁鐘舵�佸�艰繑鍥炲搴旂殑鏍峰紡绫�
if (item.isabnormal == 1) {
return "scriptTopic-isabnormal"; // 寮傚父 - 绾㈣壊
@@ -1574,6 +1660,29 @@
return "yellow-star"; // 璀﹀憡 - 榛勮壊鏄熷彿
}
return ""; // 姝e父 - 鏃犵壒娈婃牱寮�
+ },
+ insertText(text) {
+ const textarea = this.$refs.textareaRef;
+ console.log(textarea);
+
+ if (!textarea) return;
+
+ const target = textarea.$el.querySelector("textarea");
+ const start = target.selectionStart;
+ const end = target.selectionEnd;
+ const original = this.form.remark;
+ console.log(original, 11);
+
+ // 鍦ㄥ厜鏍囧鎻掑叆锛屽苟鏇存柊鍏夋爣浣嶇疆
+ this.form.remark =
+ original.substring(0, start) + text + original.substring(end);
+
+ // 淇濇寔鐒︾偣骞剁Щ鍔ㄥ厜鏍囧埌鎻掑叆鍐呭鍚�
+ this.$nextTick(() => {
+ target.focus();
+ const newPos = start + text.length;
+ target.setSelectionRange(newPos, newPos);
+ });
},
// 鑾峰彇闂嵎鏁版嵁
getsearchrResults(id) {
@@ -1598,13 +1707,15 @@
this.tableDatatop = res.data.scriptResult;
this.tableDatatop.forEach((item) => {
- if (item.scriptType == 2) item.scriptResult = [];
if (item.scriptResultId && item.scriptType != 2) {
item.isoption = 3;
item.scriptResult = item.scriptResult;
} else if (item.scriptResultId && item.scriptType == 2) {
+ console.log(item.scriptResult, "item.scriptResult");
item.scriptResult = item.scriptResult.split("&");
item.isoption = 3;
+ } else if (!item.scriptResultId && item.scriptType == 2) {
+ item.scriptResult = [];
}
});
this.taskname = res.data.taskName;
@@ -1613,8 +1724,25 @@
});
},
//鎮h��360璺宠浆
- gettoken360(sfzh, drcode, drname) {
- // this.$modal.msgWarning("360鍔熻兘鏆傛湭寮�閫�");
+ gettoken360(sfzh, drcode, drname, id) {
+ const orgname = localStorage.getItem("orgname");
+ if (orgname == "鍗楀崕澶у闄勫睘绗竴鍖婚櫌") {
+ query360PatInfonh(id).then((res) => {
+ if (res.url) {
+ window.open(res.url, "_blank");
+ } else {
+ this.$modal.msgWarning("360鏌ヨ鏃犵粨鏋�");
+ }
+ });
+ return;
+ } else if (
+ orgname == "绗竴浜烘皯鍖婚櫌婀栨花闄㈠尯" ||
+ orgname == "绗竴浜烘皯鍖婚櫌鍚村北闄㈠尯"
+ ) {
+ let url = `http://192.200.81.189:9100/blj/view?BINGRENID=${id}&YONGHUID=DBA`;
+ window.open(url, "_blank");
+ return;
+ }
this.postData.YeWuXX.BingRenXX.ZhengJianHM = sfzh;
@@ -1728,7 +1856,7 @@
if (item.targetvalue) {
item.scriptResult = item.targetvalue.split("&");
} else {
- item.scriptResult = [];
+ item.scriptResult = item.asrtext;
}
});
@@ -1744,19 +1872,19 @@
if (res.code == 200) {
this.tableDatatop = res.data.ivrTaskTemplateScriptVOList;
this.tableDatatop.forEach((item) => {
+ item.scriptID = item.id;
item.id = null;
// 绫诲瀷鍒ゆ柇璧嬪��
- if (item.ivrTaskScriptTargetoptionList) {
+ if (item.ivrTaskScriptTargetoptionList.length) {
item.targetvalue = 1;
item.questiontext = item.scriptContent;
+
item.targetvalue = item.ivrTaskScriptTargetoptionList
.map((obj) => obj.targetvalue)
.join("&");
}
if (item.targetvalue) {
item.scriptResult = item.targetvalue.split("&");
- } else {
- item.scriptResult = [];
}
});
}
@@ -1764,16 +1892,18 @@
},
// 鍖绘姢浜哄憳瀛樺偍鏁版嵁
getdetail() {
+ console.log(1);
let excep = "";
- const promises = [];
+
+ // 鍏堝鐞� tableDatatop 涓殑鏁版嵁
this.tableDatatop.forEach((item) => {
if (item.valueType == 3 && item.scriptResult) {
- // 楠岃瘉鏄惁涓烘湁鏁堟暟瀛�
if (!/^\d+$/.test(item.scriptResult)) {
this.$message.error(`闂 "${item.scriptContent}" 蹇呴』杈撳叆鏁板瓧`);
return;
}
}
+
var objs = item.svyTaskTemplateTargetoptions.find(
(items) => items.optioncontent == item.scriptResult
);
@@ -1784,46 +1914,45 @@
this.selectedTag = objs.isabnormal;
}
}
- console.log(excep, "excep");
- let obj = {
- asrtext: null,
- patid: this.patid,
- subId: this.id,
- taskid: this.taskid,
- scriptid: item.id,
- excep: excep,
- questiontext: item.scriptContent,
- categoryid: item.categoryid,
- answerps: item.answerps || null, // 娣诲姞闄勫姞淇℃伅
- };
- if (item.scriptType == 2 && item.scriptResult[0]) {
- obj.asrtext = item.scriptResult.join("&");
+ // 澶勭悊 scriptResult锛岀洿鎺ヤ慨鏀瑰師濮嬫暟鎹�
+ if (item.scriptType == 2 && item.scriptResult) {
+ // 澶勭悊鏁扮粍绫诲瀷鐨� scriptResult
+ if (Array.isArray(item.scriptResult)) {
+ item.originalScriptResult = item.scriptResult; // 淇濆瓨鍘熷鏁扮粍锛堝彲閫夛級
+ item.scriptResult = item.scriptResult.join("&"); // 杞崲涓哄瓧绗︿覆
+ }
} else if (item.scriptType != 2 && item.scriptResult) {
- obj.asrtext = item.scriptResult;
- }
-
- if (item.isoption == 3) {
- promises.push(serviceSubtaskDetailedit(obj));
- } else {
- promises.push(serviceSubtaskDetailadd(obj));
+ // 纭繚闈炴暟缁勭被鍨嬪凡缁忔槸瀛楃涓�
+ if (Array.isArray(item.scriptResult)) {
+ item.originalScriptResult = item.scriptResult; // 淇濆瓨鍘熷鏁扮粍锛堝彲閫夛級
+ item.scriptResult =
+ item.scriptResult.length > 0 ? item.scriptResult[0] : "";
+ }
}
});
- // 浣跨敤 Promise.all 绛夊緟鎵�鏈夊紓姝ユ搷浣滃畬鎴�
- Promise.all(promises)
- .then((results) => {
- // 鎵�鏈夊紓姝ユ搷浣滄垚鍔熷畬鎴愬悗鐨勯�昏緫
- results.forEach((res) => {
- if (res.code !== 200) {
- this.$modal.error("淇敼澶辫触");
- }
- });
- this.Editsingletasksonyic(6);
- const orgName = localStorage.getItem("orgname");
- console.log(orgName, "orgName");
+ // 鍒涘缓鍓湰鐢ㄤ簬淇濆瓨锛岄伩鍏嶅奖鍝嶆樉绀�
+ const saveData = this.tableDatatop.map((item) => ({
+ ...item,
+ // 濡傛灉闇�瑕侊紝鍙互鍦ㄨ繖閲屽仛鏈�鍚庣殑鏁版嵁娓呯悊
+ scriptResult: item.scriptResult || "", // 纭繚涓嶄负 undefined
+ }));
- if (this.form.isVisitAgain != 1 || orgName == "涓芥按甯備腑鍖婚櫌") {
+ let obj = {
+ svyTaskTemplateScriptVOS: saveData, // 浣跨敤澶勭悊鍚庣殑鏁版嵁
+ param1: this.taskid,
+ param2: this.patid,
+ param6: this.id,
+ type: 2,
+ };
+ savequestiondetail(obj).then((res) => {
+ if (res.code == 200) {
+ this.$modal.msgSuccess("鏈嶅姟淇濆瓨鎴愬姛");
+ this.Editsingletasksonyic(this.serviceStates);
+ const orgName = localStorage.getItem("orgname");
+
+ if (this.form.isVisitAgain != 1 || orgName == "涓芥按甯備腑鍖婚櫌"||this.visitAgain==1) {
this.Torouter();
return;
}
@@ -1850,11 +1979,8 @@
.catch(() => {
this.Torouter();
});
- })
- .catch((error) => {
- // 濡傛灉鏈変换浣曚竴涓紓姝ユ搷浣滃け璐ワ紝浼氳繘鍏ヨ繖閲�
- console.error("鍙戠敓閿欒锛�", error);
- });
+ }
+ });
},
Torouter() {
if (this.form.serviceType == 13) {
@@ -1915,8 +2041,8 @@
isValidPhone(phone) {
return this.validatePhoneNumber(phone).isValid;
},
- handleCall(phone, type) {
- if (!this.isValidPhone(phone)) {
+ handleCall(phone, type, dh) {
+ if (!this.isValidPhone(phone) && !dh) {
this.$message.error("璇疯緭鍏ユ纭殑鎵嬫満鍙风爜");
return;
}
@@ -1986,36 +2112,48 @@
},
yuyingetdetail() {
const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
- console.log(dataToSubmit, "dataToSubmit");
- // return;
+
dataToSubmit.forEach((item, index) => {
// 瀵规嫹璐濈殑鏁版嵁杩涜鎿嶄綔锛屼笉褰卞搷鍘熷鐨� scriptResult 鏁扮粍
- item.scriptResult = item.scriptResult.join("&");
+ if (item.targetvalue) {
+ item.scriptResult = item.scriptResult.join("&");
+ item.asrtext = item.matchedtext;
+ item.ivrtext = item.matchedtext;
+ } else {
+ item.asrtext = item.scriptResult;
+ item.ivrtext = item.scriptResult;
+ }
item.templatequestionnum = index + 1;
item.subId = this.id;
+
item.taskid = this.taskid;
- item.asrtext = item.matchedtext;
if (!item.id) {
item.isoperation = 1;
}
item.patid = this.patid;
item.templateid = item.templateID;
+ if (item.nextScriptno == null) {
+ item.nextScriptno = index == dataToSubmit.length - 1 ? 0 : index + 2;
+ }
});
+ console.log("c", 3);
let obj = {
- serviceSubtaskDetailList: dataToSubmit, // 鎻愪氦澶勭悊鍚庣殑鍓湰
+ ivrTaskTemplateScriptVOList: dataToSubmit, // 鎻愪氦澶勭悊鍚庣殑鍓湰
param1: this.taskid,
param2: this.patid,
- subId: this.id,
+ param6: this.id,
+ type: 1,
};
+ console.log("c", 4);
const orgName = localStorage.getItem("orgname");
console.log(orgName, "orgName");
- if (this.form.isVisitAgain != 1 || orgName == "涓芥按甯備腑鍖婚櫌") {
+ if (this.form.isVisitAgain != 1 || orgName == "涓芥按甯備腑鍖婚櫌"||this.visitAgain==1) {
this.Torouter();
return;
}
- addPersonVoices(obj).then((res) => {
+ savequestiondetail(obj).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("鏈嶅姟淇濆瓨鎴愬姛");
this.$modal
@@ -2047,7 +2185,7 @@
// 鍐嶆闅忚鏁版嵁鏇存浛
formtidy() {
this.form.visitType2 = this.form.visitType;
- this.form.date2 = this.form.longSendTime;
+ this.form.date2 = this.form.visitTime;
// this.form.date1 = this.setCurrentDate();
this.form.remark2 = this.form.remark;
},
@@ -2076,13 +2214,15 @@
this.form = res.rows[0].serviceSubtaskList.find(
(item) => item.id == this.id
);
- console.log(this.form, "serviceType");
-
+ this.form.remark = this.form.remark || "";
this.logsheetlist = res.rows[0].serviceSubtaskList;
this.templateid = this.form.templateid;
this.selectedTag = this.form.excep;
- const targetDate = new Date(this.form.longSendTime); // 鐩爣鏃ユ湡
+ const targetDate = new Date(this.form.visitTime); // 鐩爣鏃ユ湡
const now = new Date(); // 褰撳墠鏃堕棿
+ console.log(now,'褰撳墠鏃堕棿');
+ console.log(targetDate,'鐩爣鏃ユ湡');
+
if (now < targetDate && this.form.sendstate == 2) {
this.$confirm("褰撳墠鏈嶅姟鏈埌鍙戦�佹椂闂磋璋ㄦ厧淇敼", "鎻愮ず", {
confirmButtonText: "纭畾",
@@ -2177,6 +2317,15 @@
}
});
},
+ alterpatient(sendstate) {
+ alterpatient(this.userform).then((res) => {
+ if (res.code == 200) {
+ this.$modal.msgSuccess("鍩虹淇℃伅淇濆瓨鎴愬姛");
+ } else {
+ this.$modal.msgError("鍩虹淇℃伅淇敼澶辫触");
+ }
+ });
+ },
// 寮傚父鍒楁覆鏌�
tableRowClassName({ row, rowIndex }) {
if (row.id == this.id) {
@@ -2261,35 +2410,7 @@
})
.catch(() => {});
},
- aahandleOptionChange(a, b, c) {
- const result = c.find((item) => item.optioncontent == a);
- if (result.nextQuestion == 0) {
- this.tableDatatop = this.tableDatatop.reduce((acc, item, i) => {
- acc.push(i > b ? { ...item, astrict: 1 } : item);
- return acc;
- }, []);
- } else {
- this.tableDatatop = this.tableDatatop.reduce((acc, item, i) => {
- acc.push(i > b ? { ...item, astrict: 0 } : item);
- return acc;
- }, []);
- }
- if (this.Voicetype) {
- var obj = this.tableDatatop[b].ivrTaskScriptTargetoptionList.find(
- (item) => item.optioncontent == a
- );
- } else {
- var obj = this.tableDatatop[b].svyTaskTemplateTargetoptions.find(
- (item) => item.optioncontent == a
- );
- }
- if (obj.isabnormal) {
- this.tableDatatop[b].isabnormal = true;
- } else {
- this.tableDatatop[b].isabnormal = false;
- }
- this.$forceUpdate();
- },
+
handleRadioToggles(questionItem, optionValue) {
if (!questionItem.matchedtext) {
questionItem.matchedtext == "";
@@ -2348,7 +2469,13 @@
this.tableDatatop[questionIndex].showAppendInput =
selectedOptionObj.appendflag == 1;
console.log(this.tableDatatop);
-
+ if (
+ selectedOptionObj.nextQuestion !== undefined &&
+ selectedOptionObj.nextQuestion !== null
+ ) {
+ this.tableDatatop[questionIndex].nextScriptno =
+ selectedOptionObj.nextQuestion;
+ }
// if (!this.tableDatatop[questionIndex].showAppendInput) {
// this.tableDatatop[questionIndex].answerps = ""; // 娓呴櫎闄勫姞淇℃伅
// }
@@ -2418,7 +2545,6 @@
hiddenByEnd: index === questionIndex + 1 ? false : item.hiddenByEnd,
}));
}
- 2;
this.$forceUpdate();
},
@@ -2450,7 +2576,7 @@
this.form.remark =
this.form.remark + "銆�" + this.getCurrentTime() + "銆�";
let form = structuredClone(this.form);
- form.longSendTime = this.formatTime(form.date1);
+ form.visitTime = this.parseTime(form.date1);
form.finishtime = "";
if (form.resource) {
if (form.resource == 2) {
--
Gitblit v1.9.3