From 00bcd2371282fe4ea4bd096b6ff47a3ff3ecae49 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期四, 18 九月 2025 16:10:18 +0800
Subject: [PATCH] 测试完成

---
 src/views/followvisit/record/detailpage/index.vue |  237 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 174 insertions(+), 63 deletions(-)

diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue
index e2ff50a..c128a84 100644
--- a/src/views/followvisit/record/detailpage/index.vue
+++ b/src/views/followvisit/record/detailpage/index.vue
@@ -27,6 +27,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> -->
         </div>
@@ -36,7 +53,15 @@
           :data="logsheetlist"
           :row-class-name="tableRowClassName"
           style="width: 100%"
+           height="350"
+          @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 +238,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 +318,7 @@
                           </el-radio-group>
                         </div>
                         <div
-                          v-if="item.showAppendInput"
+                          v-if="item.showAppendInput || item.answerps"
                           class="append-input-container"
                         >
                           <el-input
@@ -509,7 +549,7 @@
                     >淇濆瓨鍩虹淇℃伅</el-button
                   >
                 </div>
-                <div>
+                <!-- <div>
                   <el-button
                     type="primary"
                     round
@@ -517,7 +557,7 @@
                     @click="sendAgain()"
                     >鍐嶆闅忚</el-button
                   >
-                </div>
+                </div> -->
               </div>
               <el-row>
                 <el-col :span="14"
@@ -843,9 +883,11 @@
   listcontactinformation,
 } from "@/api/patient/homepage";
 import CallButton from "@/components/CallButton";
+import MergeAndModify from "./MergeAndModify.vue";
 export default {
   components: {
     CallButton,
+    MergeAndModify,
   },
 
   dicts: ["sys_normal_disable", "sys_user_sex", "sys_yujing", "sys_suggest"],
@@ -882,6 +924,9 @@
       tableDatatop: [], //棰樼洰琛�
       voiceDatatop: [], //棰樼洰琛�
       dynamicTags: [],
+      isMergeMode: false,
+      mergeDialogVisible: false,
+      selectedServices: [], // 閫変腑鐨勬湇鍔″垪琛�
       zcrules: {
         resource: [
           { required: true, message: "璇烽�夋嫨闅忚鏂瑰紡", trigger: "change" },
@@ -1263,55 +1308,56 @@
           });
           this.Editsingletasksonyic(6);
 
-          this.$modal
-            .confirm(
-              '浠诲姟淇濆瓨鎴愬姛鏄惁閽堝鎮h�咃細"' +
-                this.logsheetlist[0].sendname +
-                '"鍐嶆闅忚锛�',
-              "纭",
-              {
-                confirmButtonText: "纭畾",
-                cancelButtonText: "鍙栨秷",
-                showCancelButton: true,
-                dangerouslyUseHTMLString: true,
-                confirmButtonClass: "custom-confirm-button", // 鑷畾涔夌‘璁ゆ寜閽殑绫诲悕
-                cancelButtonClass: "custom-cancel-button", // 鑷畾涔夊彇娑堟寜閽殑绫诲悕
-              }
-            )
-            .then(() => {
-              document.querySelector("#app").scrollTo(0, 0);
-              this.formtidy();
-              this.dialogFormVisible = true;
-            })
-            .catch(() => {
-              if (this.form.serviceType == 13) {
-                if (this.visitCount != 1) {
-                  this.$router.push({
-                    path: "/logisticsservice/zbAgain",
-                  });
-                } else {
-                  this.$router.push({
-                    path: "/logisticsservice/record",
-                  });
-                }
-              } else if (this.form.serviceType == 2) {
-                if (this.visitCount != 1) {
-                  this.$router.push({
-                    path: "/logisticsservice/again",
-                  });
-                } else {
-                  this.$router.push({
-                    path: "/followvisit/discharge",
-                  });
-                }
-              }
-            });
+          // this.$modal
+          //   .confirm(
+          //     '浠诲姟淇濆瓨鎴愬姛鏄惁閽堝鎮h�咃細"' +
+          //       this.logsheetlist[0].sendname +
+          //       '"鍐嶆闅忚锛�',
+          //     "纭",
+          //     {
+          //       confirmButtonText: "纭畾",
+          //       cancelButtonText: "鍙栨秷",
+          //       showCancelButton: true,
+          //       dangerouslyUseHTMLString: true,
+          //       confirmButtonClass: "custom-confirm-button", // 鑷畾涔夌‘璁ゆ寜閽殑绫诲悕
+          //       cancelButtonClass: "custom-cancel-button", // 鑷畾涔夊彇娑堟寜閽殑绫诲悕
+          //     }
+          //   )
+          //   .then(() => {
+          //     document.querySelector("#app").scrollTo(0, 0);
+          //     this.formtidy();
+          //     this.dialogFormVisible = true;
+          //   })
+          //   .catch(() => {
+          //     if (this.form.serviceType == 13) {
+          //       if (this.visitCount != 1) {
+          //         this.$router.push({
+          //           path: "/logisticsservice/zbAgain",
+          //         });
+          //       } else {
+          //         this.$router.push({
+          //           path: "/logisticsservice/record",
+          //         });
+          //       }
+          //     } else if (this.form.serviceType == 2) {
+          //       if (this.visitCount != 1) {
+          //         this.$router.push({
+          //           path: "/logisticsservice/again",
+          //         });
+          //       } else {
+          //         this.$router.push({
+          //           path: "/followvisit/discharge",
+          //         });
+          //       }
+          //     }
+          //   });
         })
         .catch((error) => {
           // 濡傛灉鏈変换浣曚竴涓紓姝ユ搷浣滃け璐ワ紝浼氳繘鍏ヨ繖閲�
           console.error("鍙戠敓閿欒锛�", error);
         });
     },
+    // 鐢佃瘽============================
     // 楠岃瘉鐢佃瘽鍙风爜鏍煎紡骞惰繑鍥為敊璇俊鎭�
     validatePhoneNumber(phone) {
       if (!phone) {
@@ -1343,7 +1389,6 @@
         };
       }
     },
-
     // 浣跨敤绀轰緥
     isValidPhone(phone) {
       return this.validatePhoneNumber(phone).isValid;
@@ -1367,7 +1412,6 @@
         });
       });
     },
-
     // 澶勭悊閫氳瘽鐘舵�佸彉鍖�
     handleCallStatusChange(status) {
       console.log(status, "status");
@@ -1389,7 +1433,6 @@
         this.$message.error(`鍛煎彨澶辫触: ${status.text}`);
       }
     },
-
     // 缁撴潫褰撳墠閫氳瘽
     endCurrentCall() {
       if (!this.currentCall) return;
@@ -1488,11 +1531,16 @@
       getTaskservelist({
         patid: this.patid,
         subId: id,
+        pageSize:100,
       }).then((res) => {
         if (res.code == 200) {
+          console.log(11);
+
           this.form = res.rows[0].serviceSubtaskList.find(
             (item) => item.id == this.id
           );
+          console.log(this.form);
+
           console.log(this.form.serviceType, "serviceType");
 
           this.logsheetlist = res.rows[0].serviceSubtaskList;
@@ -1597,17 +1645,17 @@
     },
     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 (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
@@ -1626,6 +1674,11 @@
     },
     // 鍦╩ethods閮ㄥ垎锛屼慨鏀筯andleOptionChange鏂规硶:
     handleOptionChange(selectedOption, questionIndex, options, a) {
+      // 鍒ゆ柇鏄惁璇煶
+      if (this.Voicetype) {
+        this.aahandleOptionChange(selectedOption, questionIndex, options);
+        return;
+      }
       if (document.activeElement) {
         document.activeElement.blur();
       }
@@ -1642,7 +1695,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 +1846,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>
@@ -1852,7 +1959,11 @@
     margin-top: 20px;
   }
 }
-
+.merge-controls {
+  background: #f5f7fa;
+  border-radius: 4px;
+  margin-left: 20px;
+}
 .Followuserinfo {
   margin: 10px 10px 0 10px;
   align-items: center;

--
Gitblit v1.9.3