From b60394f8417f6565ea673f47375ee33dd17688c0 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期六, 25 十月 2025 10:19:50 +0800
Subject: [PATCH] 测试完成

---
 src/views/followvisit/record/detailpage/index.vue |  306 ++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 204 insertions(+), 102 deletions(-)

diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index 5139ab4..c34b48f 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -314,6 +314,9 @@
                               :class="items.isabnormal ? 'red-star' : ''"
                               :key="indexs"
                               :label="items.optioncontent"
+                              @click.native.prevent="
+                                handleRadioToggle(item, items.optioncontent)
+                              "
                               >{{ items.optioncontent }}</el-radio
                             >
                           </el-radio-group>
@@ -436,6 +439,9 @@
                               v-for="(items, index) in item.scriptResult"
                               :key="items"
                               :label="items"
+                              @click.native.prevent="
+                                handleRadioToggle(item, items.optioncontent)
+                              "
                               >{{ items }}</el-radio
                             >
                           </el-radio-group>
@@ -963,14 +969,14 @@
         <el-divider></el-divider>
         <el-row>
           <el-col :span="12">
-            <el-form-item label="闅忚鏂瑰紡" prop="date1">
+            <el-form-item label="闅忚鏂瑰紡" prop="visitType">
               <el-select
                 v-model="form.visitType"
                 filterable
                 allow-create
                 default-first-option
                 @change="visitChange"
-                placeholder="璇烽�夋嫨闅忚鏂瑰紡(渚濆嚭闄㈡椂闂存妧璁$畻)"
+                placeholder="璇烽�夋嫨闅忚鏂瑰紡(渚濆嚭闄㈡椂闂磋绠�)"
               >
                 <el-option
                   v-for="item in options"
@@ -991,6 +997,8 @@
                 align="right"
                 v-model="form.date1"
                 class="custom-disabled"
+                value-format="yyyy-MM-dd"
+                @change="checkFollowupDate"
               ></el-date-picker>
             </el-form-item>
           </el-col>
@@ -1013,6 +1021,21 @@
         <el-button type="primary" @click="setupsubtask">纭鍒涘缓鏈嶅姟</el-button>
       </div>
     </el-dialog>
+    <div class="main-content" v-if="orgname == '鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�'">
+      <!-- <el-button @click="CaldialogVisible = true">鎵撳紑寮规</el-button> -->
+
+      <!-- 寮规璋冪敤 -->
+      <el-dialog
+        title="鍛煎彨鍔熻兘妗�"
+        :visible.sync="CaldialogVisible"
+        width="60%"
+      >
+        <CallCenterLs
+          ref="callCenterModal"
+          :initial-phone="currentPhoneNumber"
+        />
+      </el-dialog>
+    </div>
   </div>
 </template>
 
@@ -1038,10 +1061,12 @@
 } from "@/api/patient/homepage";
 import CallButton from "@/components/CallButton";
 import MergeAndModify from "./MergeAndModify.vue";
+import CallCenterLs from "@/components/CallCenterLs";
 export default {
   components: {
     CallButton,
     MergeAndModify,
+    CallCenterLs,
   },
   directives: {
     numericOnly: {
@@ -1125,6 +1150,7 @@
       // 宸叉湁鏁版嵁...
       callStatus: "idle", // idle, calling, connected, ended, failed
       isEndingCall: false,
+      CaldialogVisible: false,
       currentCall: null, // 褰撳墠閫氳瘽瀵硅薄
       input: "浠婂ぉ韬綋杩樹笉閿�",
       radio: "2",
@@ -1196,7 +1222,23 @@
         resource: [
           { required: true, message: "璇烽�夋嫨闅忚鏂瑰紡", trigger: "change" },
         ],
-        date1: [{ required: true, message: "璇烽�夋嫨闅忚鏃堕棿", trigger: "blur" }],
+        date1: [
+          { required: true, message: "璇烽�夋嫨闅忚鏃堕棿", trigger: "blur" },
+          {
+            validator: (rule, value, callback) => {
+              if (!value) {
+                return callback(new Error("璇烽�夋嫨闅忚鏃堕棿"));
+              }
+              const selectedDate = new Date(value);
+              const now = new Date();
+              if (selectedDate < now) {
+                return callback(new Error("闅忚鏃堕棿涓嶈兘鏃╀簬褰撳墠鏃ユ湡"));
+              }
+              callback();
+            },
+            trigger: "change",
+          },
+        ],
       },
       userrules: {
         telcode: [{ validator: validatePhone, trigger: "blur" }],
@@ -1241,56 +1283,56 @@
           // 绂佺敤浠婂ぉ鍙婁箣鍓嶇殑鏃ユ湡
           return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
         },
-        shortcuts: [
-          {
-            text: "涓冨ぉ鍚�",
-            onClick(picker) {
-              const date = new Date();
-              date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
-              picker.$emit("pick", date);
-            },
-          },
-          {
-            text: "15澶╁悗",
-            onClick(picker) {
-              const date = new Date();
-              date.setTime(date.getTime() + 3600 * 1000 * 24 * 15);
-              picker.$emit("pick", date);
-            },
-          },
-          {
-            text: "涓�涓湀鍚�",
-            onClick(picker) {
-              const date = new Date();
-              date.setTime(date.getTime() + 3600 * 1000 * 24 * 30);
-              picker.$emit("pick", date);
-            },
-          },
-          {
-            text: "涓変釜鏈堝悗",
-            onClick(picker) {
-              const date = new Date();
-              date.setTime(date.getTime() + 3600 * 1000 * 24 * 90);
-              picker.$emit("pick", date);
-            },
-          },
-          {
-            text: "鍏釜鏈堝悗",
-            onClick(picker) {
-              const date = new Date();
-              date.setTime(date.getTime() + 3600 * 1000 * 24 * 180);
-              picker.$emit("pick", date);
-            },
-          },
-          {
-            text: "涓�骞村悗",
-            onClick(picker) {
-              const date = new Date();
-              date.setTime(date.getTime() + 3600 * 1000 * 24 * 365);
-              picker.$emit("pick", date);
-            },
-          },
-        ],
+        // shortcuts: [
+        //   {
+        //     text: "涓冨ぉ鍚�",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        //   {
+        //     text: "15澶╁悗",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 15);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        //   {
+        //     text: "涓�涓湀鍚�",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 30);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        //   {
+        //     text: "涓変釜鏈堝悗",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 90);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        //   {
+        //     text: "鍏釜鏈堝悗",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 180);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        //   {
+        //     text: "涓�骞村悗",
+        //     onClick(picker) {
+        //       const date = new Date();
+        //       date.setTime(date.getTime() + 3600 * 1000 * 24 * 365);
+        //       picker.$emit("pick", date);
+        //     },
+        //   },
+        // ],
       },
       options: [
         {
@@ -1446,35 +1488,64 @@
     },
     // 鍐嶆闅忚鏃堕棿閫夊彇
     visitChange(value) {
-      // 鏍规嵁閫夋嫨鐨勯殢璁挎柟寮忚缃椂闂�
+      if (!this.form.endtime) {
+        this.$message.warning("璇峰厛纭鍑洪櫌鏃堕棿");
+        this.form.visitType = "";
+        this.$refs.zcform.clearValidate(["visitType"]);
+        return;
+      }
+
+      const dischargeDate = new Date(this.form.endtime);
       const now = new Date();
+      let followupDate = new Date(dischargeDate);
+
+      // 鏍规嵁閫夋嫨鐨勯殢璁挎柟寮忚绠楅殢璁挎棩鏈�
       if (value.includes("涓冨ぉ鍚�")) {
-        this.form.date1 = new Date(
-          Date.parse(this.form.endtime) + 3600 * 1000 * 24 * 7
-        );
+        followupDate.setDate(dischargeDate.getDate() + 7);
       } else if (value.includes("15澶╁悗")) {
-        this.form.date1 = new Date(
-          Date.parse(this.form.endtime) + 3600 * 1000 * 24 * 15
-        );
+        followupDate.setDate(dischargeDate.getDate() + 15);
       } else if (value.includes("涓�涓湀鍚�")) {
-        this.form.date1 = new Date(
-          Date.parse(this.form.endtime) + 3600 * 1000 * 24 * 30
-        );
+        followupDate.setMonth(dischargeDate.getMonth() + 1);
       } else if (value.includes("涓変釜鏈堝悗")) {
-        this.form.date1 = new Date(
-          Date.parse(this.form.endtime) + 3600 * 1000 * 24 * 90
-        );
+        followupDate.setMonth(dischargeDate.getMonth() + 3);
       } else if (value.includes("鍏釜鏈堝悗")) {
-        this.form.date1 = new Date(
-          Date.parse(this.form.endtime) + 3600 * 1000 * 24 * 180
-        );
+        followupDate.setMonth(dischargeDate.getMonth() + 6);
       } else if (value.includes("涓�骞村悗")) {
-        this.form.date1 = new Date(
-          Date.parse(this.form.endtime) + 3600 * 1000 * 24 * 365
+        followupDate.setFullYear(dischargeDate.getFullYear() + 1);
+      }
+
+      if (followupDate < now) {
+        this.$message.warning(
+          `璁$畻鍑虹殑闅忚鏃堕棿 ${this.formatTime(followupDate)} 宸茶繃鏈焋
         );
+        this.form.visitType = "";
+        this.$refs.zcform.clearValidate(["visitType", "date1"]);
+        return;
+      }
+
+      this.form.date1 = this.formatTime(followupDate);
+
+      this.$refs.zcform.clearValidate(["date1"]);
+    },
+    // 妫�鏌ラ殢璁挎棩鏈熸槸鍚︽湁鏁�
+    checkFollowupDate(date) {
+      console.log(date);
+
+      if (!date) {
+        this.form.date1 = '';
+        this.$refs.zcform.clearValidate(["date1"]);
+        return;
+      }
+
+      const selectedDate = new Date(date);
+      const now = new Date();
+
+      if (selectedDate < now) {
+        this.$message.warning("闅忚鏃堕棿涓嶈兘鏃╀簬褰撳墠鏃ユ湡");
+        this.form.date1 = '';
+        this.$refs.zcform.validateField("date1"); // 瑙﹀彂楠岃瘉
       }
     },
-
     // 鑾峰彇璇煶鏁版嵁
     getPersonVoices(id) {
       let obj = {
@@ -1586,7 +1657,7 @@
           this.$modal
             .confirm(
               '浠诲姟淇濆瓨鎴愬姛鏄惁閽堝鎮h�咃細"' +
-                this.logsheetlist[0].sendname +
+                this.userform.name +
                 '"鍐嶆闅忚锛�',
               "纭",
               {
@@ -1673,8 +1744,13 @@
         this.$message.error("璇疯緭鍏ユ纭殑鎵嬫満鍙风爜");
         return;
       }
-
       this.currentPhoneNumber = phone;
+      // 鍛煎彨鍒ゆ柇
+      if (this.orgname == "鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�") {
+        this.CaldialogVisible = true;
+        return;
+      }
+
       this.callType = type;
       this.callStatus = "calling";
 
@@ -1721,28 +1797,28 @@
       }, 3000);
     },
     yuyingetdetail() {
-     const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
+      const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
 
-  dataToSubmit.forEach((item, index) => {
-    // 瀵规嫹璐濈殑鏁版嵁杩涜鎿嶄綔锛屼笉褰卞搷鍘熷鐨� scriptResult 鏁扮粍
-    item.scriptResult = item.scriptResult.join("&");
-    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;
-  });
+      dataToSubmit.forEach((item, index) => {
+        // 瀵规嫹璐濈殑鏁版嵁杩涜鎿嶄綔锛屼笉褰卞搷鍘熷鐨� scriptResult 鏁扮粍
+        item.scriptResult = item.scriptResult.join("&");
+        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;
+      });
 
-  let obj = {
-    serviceSubtaskDetailList: dataToSubmit, // 鎻愪氦澶勭悊鍚庣殑鍓湰
-    param1: this.taskid,
-    param2: this.patid,
-    subId: this.id,
-  };
+      let obj = {
+        serviceSubtaskDetailList: dataToSubmit, // 鎻愪氦澶勭悊鍚庣殑鍓湰
+        param1: this.taskid,
+        param2: this.patid,
+        subId: this.id,
+      };
 
       addPersonVoices(obj).then((res) => {
         if (res.code == 200) {
@@ -1797,7 +1873,16 @@
     formtidy() {
       this.form.visitType2 = this.form.visitType;
       this.form.date2 = this.form.longSendTime;
+      // this.form.date1 = this.setCurrentDate();
       this.form.remark2 = this.form.remark;
+    },
+    setCurrentDate() {
+      // 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� yyyy-MM-dd
+      const today = new Date();
+      const year = today.getFullYear();
+      const month = String(today.getMonth() + 1).padStart(2, "0");
+      const day = String(today.getDate()).padStart(2, "0");
+      return `${year}-${month}-${day}`;
     },
     // 鑾峰彇鎮h�呰褰�
     getTaskservelist(id) {
@@ -1816,11 +1901,11 @@
           this.form = res.rows[0].serviceSubtaskList.find(
             (item) => item.id == this.id
           );
-          console.log(this.form.serviceType, "serviceType");
+          console.log(this.form, "serviceType");
 
           this.logsheetlist = res.rows[0].serviceSubtaskList;
-          this.templateid = this.logsheetlist[0].templateid;
-          this.selectedTag = this.logsheetlist[0].excep;
+          this.templateid = this.form.templateid;
+          this.selectedTag = this.form.excep;
           const targetDate = new Date(this.form.longSendTime); // 鐩爣鏃ユ湡
           const now = new Date(); // 褰撳墠鏃堕棿
           if (now < targetDate && this.form.sendstate == 2) {
@@ -1960,11 +2045,11 @@
       this.$modal
         .confirm('鏄惁鏌ョ湅浠诲姟涓�"' + row.taskName + '"鐨勬湇鍔¤鎯呮暟鎹紵')
         .then(() => {
-          if (row.preachformson) {
-            if (row.preachformson.includes("3")) {
-              this.Voicetype = 1;
-            }
-          }
+          let type = "";
+      console.log(row, "rwo");
+        if (row.type == 1) {
+          type = 1;
+        }
           this.taskid = row.taskid;
           this.id = row.id;
           this.patid = row.patid;
@@ -2002,6 +2087,23 @@
       }
       this.$forceUpdate();
     },
+    // 鏂板鐨勫垏鎹㈤�変腑/鍙栨秷閫変腑鏂规硶
+    handleRadioToggle(questionItem, optionValue) {
+      // 濡傛灉鐐瑰嚮鐨勬槸褰撳墠宸查�変腑鐨勯�夐」锛屽垯鍙栨秷閫変腑
+      if (questionItem.scriptResult === optionValue) {
+        questionItem.scriptResult = ""; // 娓呯┖閫変腑鍊�
+        // 鍚屾椂閲嶇疆涓庨�夐」鐩稿叧鐨勭姸鎬�
+        questionItem.isabnormal = false;
+        questionItem.showAppendInput = false;
+        // 娉ㄦ剰锛氬彇娑堥�変腑鏃讹紝鎴戜滑閫氬父涓嶅笇鏈涜Е鍙戦鐩烦杞�昏緫锛屾墍浠ョ洿鎺ヨ繑鍥�
+        // 濡傛灉闇�瑕侊紝鍙互鍦ㄨ繖閲屾坊鍔犲彇娑堥�変腑鍚庣殑鐗瑰畾閫昏緫锛屼緥濡傞噸缃鐩簭鍒�
+      } else {
+        // 濡傛灉鐐瑰嚮鐨勬槸鏈�変腑鐨勯�夐」锛屽垯閫氳繃鏇存敼缁戝畾鍊兼潵瑙﹀彂鍘熷鐨� handleOptionChange 鏂规硶
+        // 杩欓噷鍙渶瑕佹敼鍙� v-model 缁戝畾鐨勫�硷紝change浜嬩欢浼氳嚜鍔ㄨЕ鍙�
+        questionItem.scriptResult = optionValue;
+        // 鍚庣画鐨勮烦杞瓑澶嶆潅閫昏緫浼氬湪 handleOptionChange 涓甯告墽琛�
+      }
+    },
     // 鍦╩ethods閮ㄥ垎锛屼慨鏀筯andleOptionChange鏂规硶:
     handleOptionChange(selectedOption, questionIndex, options, a) {
       if (document.activeElement) {

--
Gitblit v1.9.3