From 64aba591ee30c2c31953a852fe6a95db79fc0070 Mon Sep 17 00:00:00 2001 From: WXL (wul) <wl_5969728@163.com> Date: 星期四, 11 九月 2025 14:58:04 +0800 Subject: [PATCH] 测试完成 --- src/views/followvisit/record/detailpage/index.vue | 368 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 355 insertions(+), 13 deletions(-) diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue index e2ff50a..d8aeda4 100644 --- a/src/views/followvisit/record/detailpage/index.vue +++ b/src/views/followvisit/record/detailpage/index.vue @@ -18,7 +18,7 @@ >鍙睍绀烘湰娆℃湇鍔′俊鎭�</el-button > </div> - <div style="margin-left: 20px; color: #59a0f0"> + <!-- <div style="margin-left: 20px; color: #59a0f0"> <el-link href="https://9.208.2.207:6060/search-homepage" target="_blank" @@ -26,6 +26,23 @@ > 鍓嶅線CDSS鏌ヨ </el-link> + </div> --> + <div class="merge-controls" v-if="Whetherall"> + <el-button + type="primary" + @click="toggleMergeMode" + :disabled="selectedServices.length < 2" + > + {{ isMergeMode ? "鍙栨秷鍚堝苟" : "鍚堝苟缂栬緫闂嵎" }} + </el-button> + <el-button + v-if="isMergeMode" + type="success" + @click="openMergeDialog" + :disabled="selectedServices.length < 2" + > + 寮�濮嬪悎骞� (宸查�� {{ selectedServices.length }} 涓湇鍔�) + </el-button> </div> </div> <!-- <el-button type="success">闅忚鍚庣煭淇�</el-button> --> @@ -36,7 +53,14 @@ :data="logsheetlist" :row-class-name="tableRowClassName" style="width: 100%" + @selection-change="handleSelectionChange" > + <el-table-column + type="selection" + width="55" + :selectable="checkSelectable" + v-if="Whetherall" + ></el-table-column> <el-table-column prop="sendname" align="center" @@ -213,7 +237,22 @@ </el-table> </div> </div> - + <!-- 娣诲姞鍚堝苟缂栬緫瀵硅瘽妗� --> + <el-dialog + title="鍚堝苟缂栬緫闂嵎" + :visible.sync="mergeDialogVisible" + width="80%" + top="5vh" + v-dialogDrag + > + <MergeAndModify + v-if="mergeDialogVisible" + :selected-services="selectedServices" + :patid="patid" + @save="handleMergeSave" + @cancel="mergeDialogVisible = false" + /> + </el-dialog> <div class="action-container"> <div class="call-action"> <div class="call-container"> @@ -278,7 +317,7 @@ </el-radio-group> </div> <div - v-if="item.showAppendInput" + v-if="item.showAppendInput || item.answerps" class="append-input-container" > <el-input @@ -342,8 +381,18 @@ {{ index + 1 }}銆乕闂瓟]<span>{{ item.scriptContent }}</span> + <span v-if="item.valueType == 3">(鍙兘杈撳叆鏁板瓧)</span> </div> - <div class="dev-xx"> + <div class="dev-xx" v-if="item.valueType == 3"> + <el-input + type="text" + v-numeric-only + placeholder="璇疯緭鍏ョ瓟妗�" + v-model="item.scriptResult" + > + </el-input> + </div> + <div class="dev-xx" v-else> <el-input type="textarea" :rows="2" @@ -398,15 +447,25 @@ <div class="scriptTopic-dev" :key="index" v-else> <div class="dev-text"> {{ index + 1 }}銆乕闂瓟]<span>{{ - item.questiontext + item.scriptContent }}</span> + <span v-if="item.valueType == 3">(鍙兘杈撳叆鏁板瓧)</span> </div> - <div class="dev-xx"> + <div class="dev-xx" v-if="item.valueType == 3"> + <el-input + type="text" + v-numeric-only + placeholder="璇疯緭鍏ョ瓟妗�" + v-model="item.scriptResult" + > + </el-input> + </div> + <div class="dev-xx" v-else> <el-input type="textarea" :rows="2" placeholder="璇疯緭鍏ョ瓟妗�" - v-model="item.matchedtext" + v-model="item.scriptResult" clearable > </el-input> @@ -517,6 +576,46 @@ @click="sendAgain()" >鍐嶆闅忚</el-button > + </div> + <div class="tag-selector-container"> + <el-select + v-model="selectedTag" + placeholder="璇烽�夋嫨寮傚父鐘舵��" + clearable + style="width: 150px; margin-right: 10px" + > + <el-option + v-for="item in tagOptions" + :key="item.value" + :label="item.label" + :value="item.value" + > + <span style="display: flex; align-items: center"> + <span + class="color-indicator" + :style="{ backgroundColor: item.color }" + ></span> + <span>{{ item.label }}</span> + </span> + </el-option> + </el-select> + + <!-- 褰撳墠閫夋嫨鐨勯鑹叉寚绀哄櫒 --> + <div + v-if="selectedTag" + class="color-indicator selected-indicator" + :style="{ backgroundColor: getSelectedTagColor() }" + ></div> + + <!-- 鏍囪璇存槑鎻愮ず --> + <el-tooltip + v-if="selectedTag" + effect="light" + :content="getSelectedDescription()" + placement="top" + > + <i class="el-icon-info tag-info-icon"></i> + </el-tooltip> </div> </div> <el-row> @@ -843,11 +942,73 @@ listcontactinformation, } from "@/api/patient/homepage"; import CallButton from "@/components/CallButton"; +import MergeAndModify from "./MergeAndModify.vue"; export default { components: { CallButton, + MergeAndModify, }, + directives: { + numericOnly: { + bind(el, binding, vnode) { + // 灏濊瘯鑾峰彇瀹為檯鐨刬nput鍏冪礌 + const input = el.tagName === "INPUT" ? el : el.querySelector("input"); + if (!input) { + console.warn("v-numeric-only: 鏈壘鍒癷nput鍏冪礌"); + return; + } + const handleInput = function (event) { + const oldValue = input.value; + const newValue = oldValue.replace(/[^\d]/g, ""); + if (newValue !== oldValue) { + input.value = newValue; + // 瑙﹀彂input浜嬩欢锛岄�氱煡v-model鏇存柊 + input.dispatchEvent(new Event("input", { bubbles: true })); // 娉ㄦ剰bubbles + } + }; + + const handlePaste = function (event) { + event.preventDefault(); + const clipboardData = event.clipboardData || window.clipboardData; + const pastedData = clipboardData.getData("text"); + const numericValue = pastedData.replace(/[^\d]/g, ""); + + // 妯℃嫙鍦ㄥ厜鏍囦綅缃彃鍏ョ函鏁板瓧鏂囨湰 + const start = input.selectionStart; + const end = input.selectionEnd; + input.value = + input.value.substring(0, start) + + numericValue + + input.value.substring(end); + // 璋冩暣鍏夋爣浣嶇疆 + const newCursorPos = start + numericValue.length; + input.setSelectionRange(newCursorPos, newCursorPos); + + // 瑙﹀彂input浜嬩欢 + input.dispatchEvent(new Event("input", { bubbles: true })); + }; + + input.addEventListener("input", handleInput); + input.addEventListener("paste", handlePaste); + + // 瀛樺偍寮曠敤浠ヤ究瑙g粦 + el._numericOnly = { + inputHandle: handleInput, + pasteHandle: handlePaste, + inputEl: input, + }; + }, + unbind(el) { + if (el._numericOnly) { + const { inputHandle, pasteHandle, inputEl } = el._numericOnly; + inputEl.removeEventListener("input", inputHandle); + inputEl.removeEventListener("paste", pasteHandle); + delete el._numericOnly; + } + }, + }, + }, dicts: ["sys_normal_disable", "sys_user_sex", "sys_yujing", "sys_suggest"], data() { const validatePhone = (rule, value, callback) => { @@ -882,6 +1043,33 @@ tableDatatop: [], //棰樼洰琛� voiceDatatop: [], //棰樼洰琛� dynamicTags: [], + isMergeMode: false, + mergeDialogVisible: false, + selectedServices: [], // 閫変腑鐨勬湇鍔″垪琛� + selectedTag: "", + tagOptions: [ + { + value: "0", + label: "姝e父", + type: "normal", + color: "#7ff5e1", + description: "鎮h�呮儏鍐垫甯革紝鏃犻渶鐗瑰埆鍏虫敞", + }, + { + value: "1", + label: "寮傚父", + type: "abnormal", + color: "#f75c5c", + description: "鎮h�呭瓨鍦ㄥ紓甯告儏鍐碉紝闇�瑕侀噸鐐瑰叧娉�", + }, + { + value: "2", + label: "璀﹀憡", + type: "warning", + color: "#fbfb4a", + description: "鎮h�呮儏鍐甸渶瑕佽鍛婃敞鎰忥紝鍙兘瀛樺湪椋庨櫓", + }, + ], zcrules: { resource: [ { required: true, message: "璇烽�夋嫨闅忚鏂瑰紡", trigger: "change" }, @@ -1097,6 +1285,8 @@ }, //鎮h��360璺宠浆 gettoken360(sfzh, drcode, drname) { + this.$modal.msgWarning("360鍔熻兘鏆傛湭寮�閫�"); + return; // 闃绘鍚庣画浠g爜鎵ц this.postData.YeWuXX.BingRenXX.ZhengJianHM = sfzh; if (this.postData.XiaoXiTou.ZuHuMC == "涓芥按甯備腑鍖婚櫌") { this.postData.YeWuXX.YongHuXX.YongHuID = "1400398571877961728"; @@ -1115,7 +1305,7 @@ getuserinfo() { const queryParams = { pid: Number(this.patid), - allhosp: "0", + allhosp: "0", //1浣忛櫌2闂ㄨ瘖3浣撴4鍑洪櫌 }; // 鎮h�呭熀纭�淇℃伅 messagelistpatient(queryParams).then((response) => { @@ -1222,6 +1412,13 @@ let excep = ""; const promises = []; this.tableDatatop.forEach((item) => { + if (item.valueType == 3 && item.scriptResult) { + // 楠岃瘉鏄惁涓烘湁鏁堟暟瀛� + if (!/^\d+$/.test(item.scriptResult)) { + this.$message.error(`闂 "${item.scriptContent}" 蹇呴』杈撳叆鏁板瓧`); + return; + } + } var objs = item.svyLibTemplateTargetoptions.find( (items) => items.optioncontent == item.scriptResult ); @@ -1252,6 +1449,7 @@ promises.push(serviceSubtaskDetailadd(obj)); } }); + // 浣跨敤 Promise.all 绛夊緟鎵�鏈夊紓姝ユ搷浣滃畬鎴� Promise.all(promises) .then((results) => { @@ -1312,6 +1510,7 @@ console.error("鍙戠敓閿欒锛�", error); }); }, + // 鐢佃瘽============================ // 楠岃瘉鐢佃瘽鍙风爜鏍煎紡骞惰繑鍥為敊璇俊鎭� validatePhoneNumber(phone) { if (!phone) { @@ -1343,7 +1542,6 @@ }; } }, - // 浣跨敤绀轰緥 isValidPhone(phone) { return this.validatePhoneNumber(phone).isValid; @@ -1367,7 +1565,6 @@ }); }); }, - // 澶勭悊閫氳瘽鐘舵�佸彉鍖� handleCallStatusChange(status) { console.log(status, "status"); @@ -1389,7 +1586,6 @@ this.$message.error(`鍛煎彨澶辫触: ${status.text}`); } }, - // 缁撴潫褰撳墠閫氳瘽 endCurrentCall() { if (!this.currentCall) return; @@ -1497,6 +1693,7 @@ this.logsheetlist = res.rows[0].serviceSubtaskList; this.templateid = this.logsheetlist[0].templateid; + this.selectedTag = this.logsheetlist[0].excep; const targetDate = new Date(this.form.longSendTime); // 鐩爣鏃ユ湡 const now = new Date(); // 褰撳墠鏃堕棿 if (now < targetDate && this.form.sendstate == 2) { @@ -1546,6 +1743,7 @@ (item) => item.id == this.id ); objson.remark = this.form.remark; + objson.excep = this.selectedTag; if (sendstate) objson.sendstate = sendstate; Editsingletaskson(objson).then((res) => { if (res.code) { @@ -1570,6 +1768,30 @@ } return ""; }, + getSelectedTagType() { + if (!this.selectedTag) return ""; + const tag = this.tagOptions.find( + (item) => item.value === this.selectedTag + ); + return tag ? tag.type : ""; + }, + + getSelectedTagColor() { + if (!this.selectedTag) return ""; + const tag = this.tagOptions.find( + (item) => item.value === this.selectedTag + ); + return tag ? tag.color : ""; + }, + + getSelectedDescription() { + if (!this.selectedTag) return ""; + const tag = this.tagOptions.find( + (item) => item.value === this.selectedTag + ); + return tag ? tag.description : ""; + }, + // 璋冭捣鍐嶆鍙戦�� sendAgain() { document.querySelector("#app").scrollTo(0, 0); @@ -1642,7 +1864,7 @@ this.tableDatatop[questionIndex].showAppendInput = selectedOptionObj.appendflag == 1; - console.log(this.tableDatatop); + console.log(this.tableDatatop); // if (!this.tableDatatop[questionIndex].showAppendInput) { // this.tableDatatop[questionIndex].answerps = ""; // 娓呴櫎闄勫姞淇℃伅 @@ -1793,6 +2015,60 @@ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; }, updateScore(a, b, c) {}, + // 鍚堝苟淇敼鐩稿叧============================= + toggleMergeMode() { + this.isMergeMode = !this.isMergeMode; + if (!this.isMergeMode) { + this.selectedServices = []; + } + }, + + handleSelectionChange(selection) { + this.selectedServices = selection + .filter( + (item) => !item.preachformson || !item.preachformson.includes("3") + ) + .map((item) => ({ + id: item.id, + taskid: item.taskid, + taskName: item.taskName, + sendname: item.sendname, + })); + }, + checkSelectable(row, index) { + // 褰� sendstate 涓� 6 鏃朵笉鍙�� + return row.sendstate !== 6; + }, + openMergeDialog() { + if (this.selectedServices.length < 2) { + this.$message.warning("璇疯嚦灏戦�夋嫨2涓棶鍗锋湇鍔¤繘琛屽悎骞�"); + return; + } + this.mergeDialogVisible = true; + }, + + handleMergeSave(mergedData) { + // 澶勭悊鍚堝苟淇濆瓨閫昏緫 + this.mergeDialogVisible = false; + this.isMergeMode = false; + this.selectedServices = []; + + // 鏄剧ず淇濆瓨缁撴灉 + if (mergedData.successCount == mergedData.totalCount) { + this.$message.success(`鎴愬姛淇濆瓨 ${mergedData.successCount} 涓棶鍗穈); + } else if (mergedData.successCount > 0) { + this.$message.warning( + `鎴愬姛淇濆瓨 ${mergedData.successCount} 涓棶鍗凤紝澶辫触 ${ + mergedData.totalCount - mergedData.successCount + } 涓猔 + ); + } else { + this.$message.error("鎵�鏈夐棶鍗蜂繚瀛樺け璐�"); + } + + // 鍒锋柊鏁版嵁 + this.getTaskservelist(); + }, }, }; </script> @@ -1822,7 +2098,22 @@ height: 100%; /* 纭繚楂樺害缁ф壙 */ } } +.numeric-input { + position: relative; +} +.numeric-input::after { + content: "鍙兘杈撳叆鏁板瓧"; + position: absolute; + right: 8px; + top: 50%; + transform: translateY(-50%); + font-size: 12px; + color: #999; + background: #f5f5f5; + padding: 2px 6px; + border-radius: 4px; +} .call-container { padding: 20px; background: #fff; @@ -1852,7 +2143,11 @@ margin-top: 20px; } } - +.merge-controls { + background: #f5f7fa; + border-radius: 4px; + margin-left: 20px; +} .Followuserinfo { margin: 10px 10px 0 10px; align-items: center; @@ -2061,7 +2356,54 @@ top: 0; } } +.tag-selector-container { + display: flex; + align-items: center; + margin: 0 30px; +} +.color-indicator { + width: 16px; + height: 16px; + border-radius: 3px; + margin-right: 8px; + display: inline-block; +} + +.selected-indicator { + margin-left: 10px; + width: 20px; + height: 20px; +} + +.tag-info-icon { + margin-left: 10px; + color: #909399; + cursor: pointer; + font-size: 16px; +} + +/* 纭繚閫夋嫨鍣ㄩ�夐」涓篃鏄剧ず棰滆壊鍧� */ +.el-select-dropdown__item { + display: flex; + align-items: center; +} + +.tag-normal { + background-color: #7ff5e1; +} +.tag-abnormal { + background-color: #f75c5c; +} +.tag-warning { + background-color: #fbfb4a; +} + +.tag-info { + margin-left: 10px; + color: #909399; + cursor: pointer; +} ::v-deep.offside-value .el-radio__label { color: #fff; } -- Gitblit v1.9.3