From c65b90aaa3477a90ebc325024927d80227c0c841 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期四, 09 四月 2026 14:09:25 +0800
Subject: [PATCH] 测试完成

---
 src/views/Satisfaction/configurationmyd/index.vue                     |  546 ++++++++++++++++++-----------------
 src/views/Satisfaction/configurationmyd/batch.vue                     |   53 ++-
 src/views/Satisfaction/configurationmyd/components/DetailsAnomaly.vue |    6 
 src/views/Satisfaction/configurationmyd/dispose.vue                   |  268 +++++++++--------
 4 files changed, 463 insertions(+), 410 deletions(-)

diff --git a/src/views/Satisfaction/configurationmyd/batch.vue b/src/views/Satisfaction/configurationmyd/batch.vue
index 8e6d01a..bd73abe 100644
--- a/src/views/Satisfaction/configurationmyd/batch.vue
+++ b/src/views/Satisfaction/configurationmyd/batch.vue
@@ -59,7 +59,7 @@
                 <el-option label="宸插鐞�" :value="'1'" />
               </el-select>
             </el-form-item>
-            <el-form-item label="妯℃澘绫诲瀷">
+            <el-form-item label="婊℃剰搴︾被鍨�">
               <el-select
                 v-model="filterParams.templateType"
                 placeholder="璇烽�夋嫨妯℃澘绫诲瀷"
@@ -139,23 +139,23 @@
                 <div class="patient-row">
                   <div class="patient-item">
                     <span class="label">濮撳悕锛�</span>
-                    <span class="value">{{ row.patientName }}</span>
+                    <span class="value">{{ row.patdescJson.sendname }}</span>
                   </div>
                   <div class="patient-item">
                     <span class="label">鎬у埆锛�</span>
                     <span class="value">{{
-                      row.gender === 1 ? "鐢�" : "濂�"
+                      row.patdescJson.sex
                     }}</span>
                   </div>
                   <div class="patient-item">
                     <span class="label">骞撮緞锛�</span>
-                    <span class="value">{{ row.age }}宀�</span>
+                    <span class="value">{{ row.patdescJson.age }}宀�</span>
                   </div>
                 </div>
                 <div class="patient-row">
                   <div class="patient-item full-width">
                     <span class="label">鐢佃瘽锛�</span>
-                    <span class="value">{{ row.phone }}</span>
+                    <span class="value">{{ row.patdescJson.phone }}</span>
                   </div>
                 </div>
               </div>
@@ -484,6 +484,7 @@
 <script>
 import DetailsAnomaly from "./components/DetailsAnomaly.vue";
 import { tracelist, traceedit } from "@/api/AiCentre/index";
+import dayjs from "dayjs";
 import { deptTreeSelect } from "@/api/system/user";
 
 export default {
@@ -512,8 +513,8 @@
       filterParams: {
         todeptcode: "",
         handleFlag: "",
-        templateType: "",
-        scriptid: null,
+        templateType: null,
+        scriptids: null,
         pageNum: 1,
         pageSize: 10,
       },
@@ -598,13 +599,18 @@
 
   created() {
     // 浠庤矾鐢卞弬鏁拌幏鍙栭棶棰業D
-    if (this.$route.query.questionId) {
-      this.filterParams.scriptid = this.$route.query.questionId || null;
-      this.filterParams.scriptids = null;
-    } else if (this.$route.query.questionIds) {
-      this.filterParams.scriptids = this.$route.query.questionIds;
-      this.filterParams.scriptid=null;
-    }
+    this.filterParams.scriptids = this.$route.query.questionId || this.$route.query.questionIds||null;
+    // if (this.$route.query.questionId) {
+    // } else if (this.$route.query.questionIds) {
+    //   console.log(
+    //     this.$route.query.questionIds,
+    //     "this.$route.query.questionIds"
+    //   );
+
+      this.filterParams.templateType = Number(this.$route.query.type)||null;
+
+    //   this.filterParams.scriptid = null;
+    // }
     this.hasQualityPermission = this.checkQualityPermission();
   },
 
@@ -745,8 +751,11 @@
         params.templateType = this.filterParams.templateType;
       }
 
-      if (this.filterParams.scriptid) {
-        params.scriptid = this.filterParams.scriptid;
+      // if (this.filterParams.scriptid) {
+      //   params.scriptid = this.filterParams.scriptid;
+      // }
+      if (this.filterParams.scriptids) {
+        params.scriptids = this.filterParams.scriptids.split(",");
       }
 
       return params;
@@ -789,7 +798,7 @@
         todeptcode: "",
         handleFlag: "",
         templateType: "",
-        scriptid: null, // 淇濈暀闂ID
+        scriptids: null, // 淇濈暀闂ID
         pageNum: 1,
         pageSize: 10,
       };
@@ -833,7 +842,7 @@
       // 鐢熸垚寮规鏍囬
       let title = "寮傚父鍙嶉璇︽儏";
       if (row.patdesc) {
-        const patientName = row.patdesc.split("|")[0];
+        const patientName = row.patdescJson.sendname;
         if (patientName) {
           title = `${patientName} - ${title}`;
         }
@@ -888,6 +897,8 @@
             handleresult: this.processForm.handleresult,
             handledesc: this.processForm.handledesc,
             finaloption: this.processForm.finaloption,
+            handleBy: this.$store.state.user.nickName,
+            handleTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
             // 灏嗘暟缁勮浆鎹负閫楀彿鍒嗛殧鐨勫瓧绗︿覆
             ccdepts: Array.isArray(this.processForm.ccdepts)
               ? this.processForm.ccdepts.join(",")
@@ -1141,7 +1152,7 @@
           .patient-item {
             flex: 1;
             display: flex;
-            justify-content: space-between;
+            justify-content: flex-start;
             align-items: center;
             padding: 0 5px;
 
@@ -1175,7 +1186,7 @@
 
         .info-item {
           display: flex;
-          justify-content: space-between;
+          justify-content: flex-start;
           align-items: center;
           margin-bottom: 5px;
           padding: 2px 0;
@@ -1188,7 +1199,7 @@
           .value {
             color: #333;
             font-weight: 500;
-            text-align: right;
+            // text-align: right;
             flex: 1;
 
             &.time {
diff --git a/src/views/Satisfaction/configurationmyd/components/DetailsAnomaly.vue b/src/views/Satisfaction/configurationmyd/components/DetailsAnomaly.vue
index d25ddf7..1219d47 100644
--- a/src/views/Satisfaction/configurationmyd/components/DetailsAnomaly.vue
+++ b/src/views/Satisfaction/configurationmyd/components/DetailsAnomaly.vue
@@ -73,12 +73,6 @@
             <span class="value">{{ currentRecord.handleBy || '鏈鐞�' }}</span>
           </div>
         </el-col>
-        <el-col :span="24" v-if="currentRecord.patdesc">
-          <div class="info-item">
-            <span class="label">鎮h�呬俊鎭細</span>
-            <span class="value">{{ currentRecord.patdesc }}</span>
-          </div>
-        </el-col>
         <el-col :span="8" v-if="currentRecord.handleresult">
           <div class="info-item">
             <span class="label">澶勭悊缁撴灉锛�</span>
diff --git a/src/views/Satisfaction/configurationmyd/dispose.vue b/src/views/Satisfaction/configurationmyd/dispose.vue
index 8de73b1..4c39707 100644
--- a/src/views/Satisfaction/configurationmyd/dispose.vue
+++ b/src/views/Satisfaction/configurationmyd/dispose.vue
@@ -21,7 +21,7 @@
         >
           <el-form-item label="婊℃剰搴︾被鍨�" prop="templateid">
             <el-select
-              v-model="queryParams.templateid"
+              v-model="queryParams.templateType"
               placeholder="璇烽�夋嫨妯℃澘"
               clearable
               style="width: 200px"
@@ -48,7 +48,7 @@
               <el-option
                 v-for="dept in deptList"
                 :key="dept.deptCode"
-                :label="dept.deptName"
+                :label="dept.label"
                 :value="dept.deptCode"
               />
             </el-select>
@@ -96,11 +96,7 @@
           >
             鎵归噺澶勭悊 ({{ selectedIds.length }})
           </el-button>
-          <el-button
-            type="info"
-            icon="el-icon-download"
-            @click="handleExport"
-          >
+          <el-button type="info" icon="el-icon-download" @click="handleExport">
             瀵煎嚭寮傚父鏁版嵁
           </el-button>
           <el-button
@@ -120,12 +116,14 @@
         <el-col :span="8">
           <el-card shadow="never" class="stat-card">
             <div class="stat-content">
-              <div class="stat-icon" style="background: #f0f9ff;">
-                <i class="el-icon-s-claim" style="color: #5788FE;"></i>
+              <div class="stat-icon" style="background: #f0f9ff">
+                <i class="el-icon-s-claim" style="color: #5788fe"></i>
               </div>
               <div class="stat-info">
                 <div class="stat-title">鎬诲紓甯告暟閲�</div>
-                <div class="stat-value">{{ overviewData.totalExceptionCount }}</div>
+                <div class="stat-value">
+                  {{ overviewData.totalExceptionCount }}
+                </div>
               </div>
             </div>
           </el-card>
@@ -133,8 +131,8 @@
         <el-col :span="8">
           <el-card shadow="never" class="stat-card">
             <div class="stat-content">
-              <div class="stat-icon" style="background: #f0f9ff;">
-                <i class="el-icon-s-flag" style="color: #E6A23C;"></i>
+              <div class="stat-icon" style="background: #f0f9ff">
+                <i class="el-icon-s-flag" style="color: #e6a23c"></i>
               </div>
               <div class="stat-info">
                 <div class="stat-title">寰呭鐞嗗紓甯�</div>
@@ -146,8 +144,8 @@
         <el-col :span="8">
           <el-card shadow="never" class="stat-card">
             <div class="stat-content">
-              <div class="stat-icon" style="background: #f0f9ff;">
-                <i class="el-icon-check" style="color: #67C23A;"></i>
+              <div class="stat-icon" style="background: #f0f9ff">
+                <i class="el-icon-check" style="color: #67c23a"></i>
               </div>
               <div class="stat-info">
                 <div class="stat-title">宸插鐞嗗紓甯�</div>
@@ -170,11 +168,7 @@
           @selection-change="handleSelectionChange"
           class="exception-table"
         >
-          <el-table-column
-            type="selection"
-            width="55"
-            align="center"
-          />
+          <el-table-column type="selection" width="55" align="center" />
 
           <el-table-column
             label="搴忓彿"
@@ -197,7 +191,7 @@
                     size="mini"
                     :type="getTemplateTypeTag(row.templateType)"
                   >
-                    {{ row.templateType === 1 ? '璇煶妯℃澘' : '闂嵎妯℃澘' }}
+                    {{ row.templateType === 1 ? "璇煶妯℃澘" : "闂嵎妯℃澘" }}
                   </el-tag>
                 </div>
               </div>
@@ -225,43 +219,45 @@
             </template>
           </el-table-column>
 
-          <el-table-column
-            label="濉啓鎯呭喌"
-            width="200"
-            align="center"
-          >
+          <el-table-column label="濉啓鎯呭喌" width="200" align="center">
             <template slot-scope="{ row }">
               <div class="fill-statistics">
                 <div class="stat-item">
                   <span class="stat-label">鏈夋晥濉啓锛�</span>
-                  <span class="stat-value">{{ row.fillSituation.effectiveFillNum }}</span>
+                  <span class="stat-value">{{
+                    row.fillSituation.effectiveFillNum
+                  }}</span>
                 </div>
                 <div class="stat-item">
                   <span class="stat-label">寮傚父濉啓锛�</span>
-                  <span class="stat-value exception-count">{{ row.fillSituation.exceptionFillNum }}</span>
+                  <span class="stat-value exception-count">{{
+                    row.fillSituation.exceptionFillNum
+                  }}</span>
                 </div>
               </div>
             </template>
           </el-table-column>
 
-          <el-table-column
-            label="寮傚父浠诲姟"
-            width="280"
-            align="center"
-          >
+          <el-table-column label="寮傚父浠诲姟" width="280" align="center">
             <template slot-scope="{ row }">
               <div class="exception-tasks">
                 <div class="task-category">
                   <div class="task-title">宸插鐞�</div>
-                  <div class="task-count processed">{{ row.exceptionQuesNum.yesDeal }}</div>
+                  <div class="task-count processed">
+                    {{ row.exceptionQuesNum.yesDeal }}
+                  </div>
                 </div>
                 <div class="task-category">
                   <div class="task-title">寰呭鐞�</div>
-                  <div class="task-count pending">{{ row.exceptionQuesNum.noDeal }}</div>
+                  <div class="task-count pending">
+                    {{ row.exceptionQuesNum.noDeal }}
+                  </div>
                 </div>
                 <div class="task-category">
                   <div class="task-title">寮傚父鎬绘暟</div>
-                  <div class="task-count total">{{ row.exceptionQuesNum.all }}</div>
+                  <div class="task-count total">
+                    {{ row.exceptionQuesNum.all }}
+                  </div>
                 </div>
               </div>
             </template>
@@ -275,8 +271,10 @@
           >
             <template slot-scope="{ row }">
               <div v-if="row.handleTime" class="last-process">
-                <div class="process-time">{{ formatDateTime(row.handleTime) }}</div>
-                <div class="process-user">{{ row.handleBy || '绯荤粺澶勭悊' }}</div>
+                <div class="process-time">
+                  {{ formatDateTime(row.handleTime) }}
+                </div>
+                <div class="process-user">{{ row.handleBy || "绯荤粺澶勭悊" }}</div>
               </div>
               <span v-else class="no-process">鏆傛棤澶勭悊璁板綍</span>
             </template>
@@ -321,21 +319,22 @@
 
 <script>
 import { tracedeallist } from "@/api/AiCentre/index";
+import { deptTreeSelect } from "@/api/system/user";
 
 export default {
-  name: 'ExceptionList',
+  name: "ExceptionList",
   data() {
     return {
       // 鏌ヨ鍙傛暟
       queryParams: {
         todeptcode: [], // 澶勭悊绉戝缂栧彿鏁扮粍
-        todeptname: '', // 澶勭悊绉戝鍚嶇О
-        templateid: '', // 浠诲姟妯℃澘ID
-        handleStartTime: '', // 澶勭悊寮�濮嬫椂闂�
-        handleEndTime: '', // 澶勭悊缁撴潫鏃堕棿
+        todeptname: "", // 澶勭悊绉戝鍚嶇О
+        templateType: 2, // 浠诲姟妯℃澘ID
+        handleStartTime: "", // 澶勭悊寮�濮嬫椂闂�
+        handleEndTime: "", // 澶勭悊缁撴潫鏃堕棿
         handleTimeRange: [], // 鏃堕棿鑼冨洿锛岀敤浜庣晫闈㈠睍绀�
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
 
       // 鍔犺浇鐘舵��
@@ -346,27 +345,13 @@
 
       // 妯℃澘鍒楄〃
       templateList: [
-        { id: 1, name: '璇煶妯℃澘' },
-        { id: 2, name: '闂嵎妯℃澘' }
+        { id: 1, name: "璇煶婊℃剰搴�" },
+        { id: 2, name: "闂嵎婊℃剰搴�" },
         // 浣犲彲浠ユ牴鎹疄闄呮儏鍐典粠鎺ュ彛鑾峰彇妯℃澘鍒楄〃
       ],
 
       // 绉戝鍒楄〃
-      deptList: [
-        // 浣犲彲浠ヤ粠鎺ュ彛鑾峰彇绉戝鍒楄〃锛岃繖閲屽厛鐢ㄩ潤鎬佹暟鎹�
-        { deptCode: '001', deptName: '蹇冭绠″唴绉�' },
-        { deptCode: '002', deptName: '绁炵粡鍐呯' },
-        { deptCode: '003', deptName: '鏅绉�' },
-        { deptCode: '004', deptName: '楠ㄧ' },
-        { deptCode: '005', deptName: '濡囦骇绉�' },
-        { deptCode: '006', deptName: '鍎跨' },
-        { deptCode: '007', deptName: '鎬ヨ瘖绉�' },
-        { deptCode: '008', deptName: '鍛煎惛鍐呯' },
-        { deptCode: '009', deptName: '娑堝寲鍐呯' },
-        { deptCode: '010', deptName: '鍐呭垎娉岀' },
-        { deptCode: '011', deptName: '鑲惧唴绉�' },
-        { deptCode: '012', deptName: '鑲跨槫绉�' }
-      ],
+      deptList: [],
 
       // 寮傚父鍒楄〃鏁版嵁
       exceptionList: [],
@@ -377,100 +362,134 @@
         totalExceptionCount: 0,
         pendingCount: 0,
         processedCount: 0,
-        todayProcessedCount: 0
+        todayProcessedCount: 0,
       },
 
       // 鏃ユ湡閫夋嫨鍣ㄩ�夐」
       pickerOptions: {
         shortcuts: [
           {
-            text: '鏈�杩戜竴鍛�',
+            text: "鏈�杩戜竴鍛�",
             onClick(picker) {
               const end = new Date();
               const start = new Date();
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-              picker.$emit('pick', [start, end]);
-            }
+              picker.$emit("pick", [start, end]);
+            },
           },
           {
-            text: '鏈�杩戜竴涓湀',
+            text: "鏈�杩戜竴涓湀",
             onClick(picker) {
               const end = new Date();
               const start = new Date();
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-              picker.$emit('pick', [start, end]);
-            }
+              picker.$emit("pick", [start, end]);
+            },
           },
           {
-            text: '鏈�杩戜笁涓湀',
+            text: "鏈�杩戜笁涓湀",
             onClick(picker) {
               const end = new Date();
               const start = new Date();
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-              picker.$emit('pick', [start, end]);
-            }
-          }
+              picker.$emit("pick", [start, end]);
+            },
+          },
         ],
         disabledDate(time) {
           return time.getTime() > Date.now();
-        }
-      }
+        },
+      },
     };
   },
 
   mounted() {
     this.loadData();
+    this.getDeptOptions();
   },
 
   methods: {
     // 鏍煎紡鍖栨棩鏈熸椂闂�
     formatDateTime(dateTime) {
-      if (!dateTime) return '';
+      if (!dateTime) return "";
       const date = new Date(dateTime);
-      return date.toLocaleDateString().replace(/\//g, '-') + ' ' +
-             date.toTimeString().split(' ')[0];
+      return (
+        date.toLocaleDateString().replace(/\//g, "-") +
+        " " +
+        date.toTimeString().split(" ")[0]
+      );
     },
 
     // 鑾峰彇妯℃澘绫诲瀷鏍囩鏍峰紡
     getTemplateTypeTag(type) {
-      return type === 1 ? 'primary' : 'success';
+      return type === 1 ? "primary" : "success";
     },
 
     // 鏋勫缓鏌ヨ鍙傛暟
     buildQueryParams() {
       const params = {
         pageNum: this.queryParams.pageNum,
-        pageSize: this.queryParams.pageSize
+        pageSize: this.queryParams.pageSize,
       };
 
       // 澶勭悊绉戝缂栧彿
-      if (this.queryParams.todeptcode && this.queryParams.todeptcode.length > 0) {
+      if (
+        this.queryParams.todeptcode &&
+        this.queryParams.todeptcode.length > 0
+      ) {
         // 鎺ュ彛鍙兘闇�瑕佸瓧绗︿覆鏍煎紡鐨勭瀹ょ紪鍙凤紝鏍规嵁瀹為檯鎯呭喌璋冩暣
-        params.todeptcode = this.queryParams.todeptcode.join(',');
+        params.todeptcode = this.queryParams.todeptcode.join(",");
       }
 
       // 妯℃澘ID
-      if (this.queryParams.templateid) {
-        params.templateid = this.queryParams.templateid;
+      if (this.queryParams.templateType) {
+        params.templateType = this.queryParams.templateType;
       }
 
       // 澶勭悊鏃堕棿鑼冨洿
-      if (this.queryParams.handleTimeRange && this.queryParams.handleTimeRange.length === 2) {
+      if (
+        this.queryParams.handleTimeRange &&
+        this.queryParams.handleTimeRange.length === 2
+      ) {
         params.handleStartTime = this.queryParams.handleTimeRange[0];
         params.handleEndTime = this.queryParams.handleTimeRange[1];
       }
 
       return params;
     },
+    /** 鏌ヨ绉戝鍒楄〃 */
+    getDeptOptions() {
+      deptTreeSelect()
+        .then((res) => {
+          if (res.code == 200) {
+            this.deptList = this.flattenArray(res.data) || [];
+          }
+        })
+        .catch((error) => {
+          console.error("鑾峰彇绉戝鍒楄〃澶辫触:", error);
+          this.$message.error("鑾峰彇绉戝鍒楄〃澶辫触");
+        });
+    },
+    flattenArray(multiArray) {
+      let result = [];
 
+      function flatten(element) {
+        if (element.children && element.children.length > 0) {
+          element.children.forEach((child) => flatten(child));
+        } else {
+          let item = JSON.parse(JSON.stringify(element));
+          result.push(item);
+        }
+      }
+
+      multiArray.forEach((element) => flatten(element));
+      return result;
+    },
     // 鍔犺浇鏁版嵁
     async loadData() {
       this.loading = true;
       try {
-        await Promise.all([
-          this.loadExceptionList(),
-          this.loadOverviewData()
-        ]);
+        await Promise.all([this.loadExceptionList(), this.loadOverviewData()]);
       } finally {
         this.loading = false;
       }
@@ -482,19 +501,19 @@
         const params = this.buildQueryParams();
         const response = await tracedeallist(params);
 
-        if (response.code==200) {
+        if (response.code == 200) {
           this.exceptionList = response.rows.detailTraceDealDTOList || [];
-          this.overviewData.totalExceptionCount=response.rows.totalException
-          this.overviewData.pendingCount=response.rows.noDealException
-          this.overviewData.processedCount=response.rows.yesDealException
+          this.overviewData.totalExceptionCount = response.rows.totalException;
+          this.overviewData.pendingCount = response.rows.noDealException;
+          this.overviewData.processedCount = response.rows.yesDealException;
           this.total = response.total || 0;
         } else {
           this.exceptionList = [];
           this.total = 0;
         }
       } catch (error) {
-        console.error('鍔犺浇寮傚父鍒楄〃澶辫触:', error);
-        this.$message.error('鍔犺浇寮傚父鍒楄〃澶辫触锛岃绋嶅悗閲嶈瘯');
+        console.error("鍔犺浇寮傚父鍒楄〃澶辫触:", error);
+        this.$message.error("鍔犺浇寮傚父鍒楄〃澶辫触锛岃绋嶅悗閲嶈瘯");
         this.exceptionList = [];
         this.total = 0;
       }
@@ -504,18 +523,26 @@
     async loadOverviewData() {
       try {
         // 浠庢帴鍙f暟鎹绠楃粺璁℃暟鎹�
-        const totalExceptionCount = this.exceptionList.reduce((sum, item) =>
-          sum + (item.exceptionQuesNum?.all || 0), 0);
-        const pendingCount = this.exceptionList.reduce((sum, item) =>
-          sum + (item.exceptionQuesNum?.noDeal || 0), 0);
-        const processedCount = this.exceptionList.reduce((sum, item) =>
-          sum + (item.exceptionQuesNum?.yesDeal || 0), 0);
+        const totalExceptionCount = this.exceptionList.reduce(
+          (sum, item) => sum + (item.exceptionQuesNum?.all || 0),
+          0
+        );
+        const pendingCount = this.exceptionList.reduce(
+          (sum, item) => sum + (item.exceptionQuesNum?.noDeal || 0),
+          0
+        );
+        const processedCount = this.exceptionList.reduce(
+          (sum, item) => sum + (item.exceptionQuesNum?.yesDeal || 0),
+          0
+        );
 
         // 璁$畻浠婃棩澶勭悊鏁帮紙杩欓噷鍙互鏍规嵁瀹為檯闇�姹傝皟鏁撮�昏緫锛�
-        const today = new Date().toISOString().split('T')[0];
-        const todayProcessedCount = this.exceptionList.filter(item => {
+        const today = new Date().toISOString().split("T")[0];
+        const todayProcessedCount = this.exceptionList.filter((item) => {
           if (!item.handleTime) return false;
-          const handleDate = new Date(item.handleTime).toISOString().split('T')[0];
+          const handleDate = new Date(item.handleTime)
+            .toISOString()
+            .split("T")[0];
           return handleDate === today;
         }).length;
 
@@ -523,15 +550,15 @@
           totalExceptionCount,
           pendingCount,
           processedCount,
-          todayProcessedCount
+          todayProcessedCount,
         };
       } catch (error) {
-        console.error('鍔犺浇姒傝鏁版嵁澶辫触:', error);
+        console.error("鍔犺浇姒傝鏁版嵁澶辫触:", error);
         this.overviewData = {
           totalExceptionCount: 0,
           pendingCount: 0,
           processedCount: 0,
-          todayProcessedCount: 0
+          todayProcessedCount: 0,
         };
       }
     },
@@ -554,43 +581,44 @@
     // 澶勭悊鎵归噺澶勭悊
     handleBatchProcess() {
       if (this.selectedIds.length === 0) {
-        this.$message.warning('璇峰厛閫夋嫨瑕佸鐞嗙殑寮傚父棰樼洰');
+        this.$message.warning("璇峰厛閫夋嫨瑕佸鐞嗙殑寮傚父棰樼洰");
         return;
       }
 
       // 璺宠浆鍒版壒閲忓鐞嗛〉闈�
       this.$router.push({
-        path: '/Intelligentcenter/batch',
+        path: "/Intelligentcenter/batch",
         query: {
-          questionIds: this.selectedIds.join(',')
-        }
+          questionIds: this.selectedIds.join(","),
+          type: this.queryParams.templateType,
+        },
       });
     },
 
     // 澶勭悊瀵煎嚭
     handleExport() {
-      this.$message.success('瀵煎嚭鍔熻兘寮�鍙戜腑...');
+      this.$message.success("瀵煎嚭鍔熻兘寮�鍙戜腑...");
     },
 
     // 鍒锋柊鏁版嵁
     refreshData() {
       this.loadData();
-      this.$message.success('鏁版嵁宸插埛鏂�');
+      this.$message.success("鏁版嵁宸插埛鏂�");
     },
 
     // 澶勭悊閫夋嫨鍙樺寲
     handleSelectionChange(selection) {
-      this.selectedIds = selection.map(item => item.scriptid);
+      this.selectedIds = selection.map((item) => item.scriptid);
     },
 
     // 澶勭悊鍗曚釜棰樼洰鎵归噺澶勭悊
     handleBatchQuestion(row) {
       this.$router.push({
-        path: '/Intelligentcenter/batch',
+        path: "/Intelligentcenter/batch",
         query: {
           questionId: row.scriptid,
-          questionText: encodeURIComponent(row.questiontext)
-        }
+          type: this.queryParams.templateType,
+        },
       });
     },
 
@@ -605,8 +633,8 @@
     handlePageChange(page) {
       this.queryParams.pageNum = page;
       this.loadExceptionList();
-    }
-  }
+    },
+  },
 };
 </script>
 
@@ -619,7 +647,7 @@
   .page-header {
     margin-bottom: 20px;
     padding: 20px;
-    background: linear-gradient(135deg, #5788FE 0%, #66b1ff 100%);
+    background: linear-gradient(135deg, #5788fe 0%, #66b1ff 100%);
     border-radius: 8px;
     color: white;
 
@@ -803,7 +831,7 @@
             }
 
             &.total {
-              color: #5788FE;
+              color: #5788fe;
             }
           }
         }
@@ -818,7 +846,7 @@
 
         .process-user {
           font-size: 13px;
-          color: #5788FE;
+          color: #5788fe;
           font-weight: 500;
         }
       }
diff --git a/src/views/Satisfaction/configurationmyd/index.vue b/src/views/Satisfaction/configurationmyd/index.vue
index b92dfd9..75038c3 100644
--- a/src/views/Satisfaction/configurationmyd/index.vue
+++ b/src/views/Satisfaction/configurationmyd/index.vue
@@ -481,89 +481,95 @@
         </div>
       </div>
     </div>
-<!-- 閫夐」閰嶇疆瀵硅瘽妗� -->
-<el-dialog
-  title="閫夐」寮傚父鐘舵�侀厤缃�"
-  :visible.sync="optionDialogVisible"
-  width="700px"
-  center
-  :close-on-click-modal="false"
->
-  <div v-if="editingQuestion" class="option-config-wrapper">
-    <div class="dialog-header">
-      <h4>{{ editingQuestion.scriptTopic || '鏃犱富棰�' }}</h4>
-      <p class="dialog-subtitle">{{ editingQuestion.scriptContent }}</p>
-    </div>
+    <!-- 閫夐」閰嶇疆瀵硅瘽妗� -->
+    <el-dialog
+      title="閫夐」寮傚父鐘舵�侀厤缃�"
+      :visible.sync="optionDialogVisible"
+      width="700px"
+      center
+      :close-on-click-modal="false"
+    >
+      <div v-if="editingQuestion" class="option-config-wrapper">
+        <div class="dialog-header">
+          <h4>{{ editingQuestion.scriptTopic || "鏃犱富棰�" }}</h4>
+          <p class="dialog-subtitle">{{ editingQuestion.scriptContent }}</p>
+        </div>
 
-    <div class="option-list">
-      <el-alert
-        v-if="!currentOptions.some(opt => opt.isabnormal === 1)"
-        title="璇疯嚦灏戣缃竴涓紓甯搁�夐」锛堟爣璁颁负寮傚父锛�"
-        type="warning"
-        :closable="false"
-        show-icon
-        style="margin-bottom: 20px;"
-      />
+        <div class="option-list">
+          <el-alert
+            v-if="!currentOptions.some((opt) => opt.isabnormal === 1)"
+            title="璇疯嚦灏戣缃竴涓紓甯搁�夐」锛堟爣璁颁负寮傚父锛�"
+            type="warning"
+            :closable="false"
+            show-icon
+            style="margin-bottom: 20px"
+          />
 
-      <div v-for="(option, index) in currentOptions" :key="index" class="option-item">
-        <el-form
-          :model="option"
-          :rules="optionRules"
-          ref="optionForm"
-          size="small"
-          class="option-form"
-        >
-          <el-row :gutter="12" align="middle">
-            <el-col :span="2">
-              <div class="option-index">#{{ index + 1 }}</div>
-            </el-col>
+          <div
+            v-for="(option, index) in currentOptions"
+            :key="index"
+            class="option-item"
+          >
+            <el-form
+              :model="option"
+              :rules="optionRules"
+              ref="optionForm"
+              size="small"
+              class="option-form"
+            >
+              <el-row :gutter="12" align="middle">
+                <el-col :span="2">
+                  <div class="option-index">#{{ index + 1 }}</div>
+                </el-col>
 
-            <el-col :span="12">
-              <el-form-item prop="targetvalue">
-                <el-input
-                  v-model="option.targetvalue"
-                  placeholder="璇疯緭鍏ラ�夐」鍐呭"
-                  clearable
-                  maxlength="200"
-                  show-word-limit
-                />
-              </el-form-item>
-            </el-col>
+                <el-col :span="12">
+                  <el-form-item prop="targetvalue">
+                    <el-input
+                      v-model="option.targetvalue"
+                      placeholder="璇疯緭鍏ラ�夐」鍐呭"
+                      clearable
+                      maxlength="200"
+                      show-word-limit
+                    />
+                  </el-form-item>
+                </el-col>
 
-            <el-col :span="6">
-              <el-form-item prop="isabnormal">
-                <el-select
-                  v-model="option.isabnormal"
-                  placeholder="閫夋嫨鐘舵��"
-                  style="width: 100%"
-                >
-                  <el-option
-                    v-for="status in abnormalOptions"
-                    :key="status.value"
-                    :label="status.label"
-                    :value="status.value"
-                  >
-                    <el-tag :type="status.type" size="small">{{ status.label }}</el-tag>
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
+                <el-col :span="6">
+                  <el-form-item prop="isabnormal">
+                    <el-select
+                      v-model="option.isabnormal"
+                      placeholder="閫夋嫨鐘舵��"
+                      style="width: 100%"
+                    >
+                      <el-option
+                        v-for="status in abnormalOptions"
+                        :key="status.value"
+                        :label="status.label"
+                        :value="status.value"
+                      >
+                        <el-tag :type="status.type" size="small">{{
+                          status.label
+                        }}</el-tag>
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
 
-            <el-col :span="4">
-              <el-button
-                type="danger"
-                icon="el-icon-delete"
-                @click="removeOption(index)"
-                size="small"
-                circle
-                plain
-              />
-            </el-col>
-          </el-row>
-        </el-form>
-      </div>
+                <el-col :span="4">
+                  <el-button
+                    type="danger"
+                    icon="el-icon-delete"
+                    @click="removeOption(index)"
+                    size="small"
+                    circle
+                    plain
+                  />
+                </el-col>
+              </el-row>
+            </el-form>
+          </div>
 
-      <!-- <el-button
+          <!-- <el-button
         type="primary"
         icon="el-icon-plus"
         @click="addNewOption"
@@ -573,16 +579,16 @@
       >
         娣诲姞閫夐」
       </el-button> -->
-    </div>
-  </div>
+        </div>
+      </div>
 
-  <span slot="footer" class="dialog-footer">
-    <el-button @click="optionDialogVisible = false">鍙栨秷</el-button>
-    <el-button type="primary" @click="saveOptions" :loading="savingOptions">
-      淇濆瓨閰嶇疆
-    </el-button>
-  </span>
-</el-dialog>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="optionDialogVisible = false">鍙栨秷</el-button>
+        <el-button type="primary" @click="saveOptions" :loading="savingOptions">
+          淇濆瓨閰嶇疆
+        </el-button>
+      </span>
+    </el-dialog>
     <!-- 棰樼洰棰勮瀵硅瘽妗� -->
     <el-dialog
       title="棰樼洰棰勮"
@@ -848,30 +854,12 @@
           this.voiceCategories.includes(q.scriptAssortid)
         ).length;
       }
+      return 0;
     },
-    // 妫�鏌ラ鐩槸鍚︽湁寮傚父閫夐」
-    hasAbnormalOption(question) {
-      return (question) => {
-        if (!question) return false;
 
-        // 闂嵎妯℃澘
-        if (this.templateForm.templateType === 1) {
-          const options = question.svyLibTemplateTargetoptions || [];
-          return options.some((opt) => opt.isabnormal === 1);
-        }
-        // 璇煶妯℃澘
-        else if (this.templateForm.templateType === 2) {
-          const options = question.ivrLibaScriptTargetoptionList || [];
-          return options.some((opt) => opt.isabnormal === 1);
-        }
-
-        return false;
-      };
-    },
     // 绛涢�夊悗鐨勯鐩垪琛�
     filteredQuestionList() {
       let filtered = this.questionList;
-      console.log(this.questionnaireCategorys);
 
       // 绛涢�夋弧鎰忓害棰樼洰
       if (this.templateForm.templateType === 1) {
@@ -888,7 +876,7 @@
       if (this.queryParams.scriptTopic) {
         const keyword = this.queryParams.scriptTopic.toLowerCase();
         filtered = filtered.filter(
-          (q) => q.scriptTopic && q.scriptTopic.toLowerCase().includes(keyword)
+          (q) => q.scriptTopic && q.criptTopic.toLowerCase().includes(keyword)
         );
       }
 
@@ -1212,9 +1200,9 @@
     /** 閰嶇疆鍙樻洿澶勭悊 */
     handleConfigChange(question) {
       this.$nextTick(() => {
-        const index = this.filteredQuestionList.findIndex(
-          (q) => q.id === question.id
-        );
+        const index = this.filteredQuestionList.findIndex((q) => q.id === question.id);
+        console.log(index,'index');
+
         if (index !== -1) {
           const formRef = this.$refs.configForm && this.$refs.configForm[index];
           if (formRef) {
@@ -1261,24 +1249,61 @@
       const changedItems = this.questionList.filter((q) => q.hasChanges);
       this.changedCount = changedItems.length;
       this.hasChanges = changedItems.length > 0;
+
+      // 寮哄埗鏇存柊瑙嗗浘
+      this.$forceUpdate();
+    },
+
+    /** 妫�鏌ラ鐩槸鍚︽湁寮傚父閫夐」 */
+    checkHasAbnormalOptions(question) {
+      if (this.templateForm.templateType === 1) {
+        return (question.svyLibTemplateTargetoptions || []).some(
+          (opt) => opt.isabnormal === 1
+        );
+      } else if (this.templateForm.templateType === 2) {
+        return (question.ivrLibaScriptTargetoptionList || []).some(
+          (opt) => opt.isabnormal === 1
+        );
+      }
+      return false;
     },
 
     /** 淇濆瓨鍗曚釜棰樼洰閰嶇疆 */
-    async saveSingleConfig(question) {
-      if (!question.hasChanges) return;
+    async saveSingleConfig(question, skipAbnormalCheck = false) {
+      // 妫�鏌ユ槸鍚︽湁鍙樻洿
+      if (!question.hasChanges && !skipAbnormalCheck) {
+        this.$message.info("褰撳墠閰嶇疆鏃犲彉鍖�");
+        return;
+      }
 
-      const index = this.filteredQuestionList.findIndex(
-        (q) => q.id === question.id
-      );
-      console.log(index, "filteredQuestionList");
+      // 妫�鏌ユ槸鍚︽湁寮傚父閫夐」
+      if (!skipAbnormalCheck && !this.checkHasAbnormalOptions(question)) {
+        this.$confirm(
+          "璇ラ鐩病鏈夎缃紓甯搁�夐」锛屽繀椤诲厛閰嶇疆寮傚父閫夐」鎵嶈兘淇濆瓨銆傛槸鍚︾珛鍗抽厤缃紵",
+          "鎻愮ず",
+          {
+            confirmButtonText: "鍘婚厤缃�",
+            cancelButtonText: "鍙栨秷",
+            type: "warning",
+          }
+        )
+          .then(() => {
+            this.openOptionDialog(question);
+          })
+          .catch(() => {});
+        return;
+      }
 
+      const index = this.questionList.findIndex((q) => q.id === question.id);
       if (index === -1) return;
 
       const formRef = this.$refs.configForm && this.$refs.configForm[index];
       if (!formRef) return;
 
-      const valid = await formRef.validate();
-      if (!valid) {
+      // 楠岃瘉琛ㄥ崟
+      try {
+        await formRef.validate();
+      } catch (error) {
         this.$message.warning("璇峰厛瀹屾垚蹇呭~椤�");
         return;
       }
@@ -1339,6 +1364,18 @@
           reportDeptName: reportDeptNames.join(","),
         };
 
+        // 濡傛灉闇�瑕侊紝涔熸洿鏂伴�夐」鏁版嵁
+        if (question.hasChanges && this.templateForm.templateType === 1) {
+          questions[questionIndex].svyLibTemplateTargetoptions =
+            question.svyLibTemplateTargetoptions || [];
+        } else if (
+          question.hasChanges &&
+          this.templateForm.templateType === 2
+        ) {
+          questions[questionIndex].ivrLibaScriptTargetoptionList =
+            question.ivrLibaScriptTargetoptionList || [];
+        }
+
         // 鏇存柊妯℃澘
         updatedTemplateDetail[questionsField] = questions;
 
@@ -1375,7 +1412,6 @@
       }
     },
 
-    /** 澶勭悊淇濆瓨鎴愬姛 */
     /** 澶勭悊淇濆瓨鎴愬姛 */
     handleSaveSuccess(question) {
       // 鍚屾椂鏇存柊棰樼洰椤跺眰瀛楁
@@ -1450,6 +1486,36 @@
     async handleBatchSave() {
       if (!this.hasChanges || this.batchSaving) return;
 
+      // 鑾峰彇鏈夊彉鏇寸殑棰樼洰
+      const changedQuestions = this.questionList.filter((q) => q.hasChanges);
+      if (changedQuestions.length === 0) {
+        this.$message.info("娌℃湁闇�瑕佷繚瀛樼殑閰嶇疆鍙樻洿");
+        return;
+      }
+
+      // 妫�鏌ユ槸鍚︽湁棰樼洰缂哄皯寮傚父閫夐」
+      const questionsWithoutAbnormal = changedQuestions.filter(
+        (q) => !this.checkHasAbnormalOptions(q)
+      );
+
+      if (questionsWithoutAbnormal.length > 0) {
+        this.$confirm(
+          `鏈� ${questionsWithoutAbnormal.length} 涓鐩病鏈夎缃紓甯搁�夐」锛屽繀椤婚厤缃紓甯搁�夐」鍚庢墠鑳戒繚瀛樸�傛槸鍚﹀厛鍘婚厤缃紵`,
+          "鎻愮ず",
+          {
+            confirmButtonText: "鍘婚厤缃�",
+            cancelButtonText: "鍙栨秷",
+            type: "warning",
+          }
+        )
+          .then(() => {
+            // 鎵撳紑绗竴涓病鏈夊紓甯搁�夐」鐨勯鐩殑閰嶇疆瀵硅瘽妗�
+            this.openOptionDialog(questionsWithoutAbnormal[0]);
+          })
+          .catch(() => {});
+        return;
+      }
+
       this.$confirm("纭畾瑕佷繚瀛樻墍鏈変慨鏀硅繃鐨勯厤缃悧锛�", "鎵归噺淇濆瓨", {
         confirmButtonText: "纭畾",
         cancelButtonText: "鍙栨秷",
@@ -1458,24 +1524,20 @@
         .then(async () => {
           this.batchSaving = true;
 
-          const changedQuestions = this.questionList.filter(
-            (q) => q.hasChanges
-          );
           const results = [];
-
           for (const question of changedQuestions) {
             try {
-              await this.saveSingleConfig(question);
+              // 璺宠繃寮傚父妫�鏌ワ紝鍥犱负鍦ㄤ笂闈㈠凡缁忔鏌ヨ繃浜�
+              await this.saveSingleConfig(question, true);
               results.push({
                 id: question.id,
-                success:
-                  !question.hasChanges &&
-                  question.saveStatus?.type === "success",
+                success: !question.hasChanges,
               });
             } catch (error) {
               results.push({
                 id: question.id,
                 success: false,
+                error: error.message,
               });
             }
           }
@@ -1492,6 +1554,11 @@
             this.$message.warning(
               `鎴愬姛淇濆瓨 ${successCount} 涓紝澶辫触 ${failCount} 涓猔
             );
+            // 鍙互鏄剧ず鍏蜂綋鍝簺澶辫触浜�
+            const failedQuestions = results
+              .filter((r) => !r.success)
+              .map((r) => r.id);
+            console.error("淇濆瓨澶辫触鐨勯鐩甀D:", failedQuestions);
           }
         })
         .catch(() => {
@@ -1505,39 +1572,38 @@
       this.previewAnswer = "";
       this.previewVisible = true;
     },
-    /** 妫�鏌ラ鐩槸鍚︽湁寮傚父閫夐」 */
-    checkHasAbnormalOptions(question) {
-      if (this.templateForm.templateType === 1) {
-        return (question.svyLibTemplateTargetoptions || []).some(
-          (opt) => opt.isabnormal === 1
-        );
-      } else if (this.templateForm.templateType === 2) {
-        return (question.ivrLibaScriptTargetoptionList || []).some(
-          (opt) => opt.isabnormal === 1
-        );
-      }
-      return false;
-    },
 
-    /** 鎵撳紑閫夐」绠$悊瀵硅瘽妗� */
+    /** 淇敼閫夐」绠$悊瀵硅瘽妗嗙殑鎵撳紑鏂规硶锛屼繚瀛樺師濮嬮�夐」 */
     openOptionDialog(question) {
       this.editingQuestion = question;
+
+      // 淇濆瓨鍘熷閫夐」鐨勫揩鐓�
+      if (this.templateForm.templateType === 1) {
+        this.editingQuestion.originalOptions = JSON.parse(
+          JSON.stringify(question.svyLibTemplateTargetoptions || [])
+        );
+      } else if (this.templateForm.templateType === 2) {
+        this.editingQuestion.originalOptions = JSON.parse(
+          JSON.stringify(question.ivrLibaScriptTargetoptionList || [])
+        );
+      }
 
       // 澶嶅埗閫夐」鏁版嵁
       if (this.templateForm.templateType === 1) {
         this.currentOptions = JSON.parse(
           JSON.stringify(question.svyLibTemplateTargetoptions || [])
-        ).map((opt) => ({
+        ).map((opt, index) => ({
           ...opt,
-          id: opt.id,
+          id: opt.id || `temp_${Date.now()}_${index}`,
           targetvalue: opt.optioncontent || "",
           isabnormal: opt.isabnormal || 0,
         }));
       } else if (this.templateForm.templateType === 2) {
         this.currentOptions = JSON.parse(
           JSON.stringify(question.ivrLibaScriptTargetoptionList || [])
-        ).map((opt) => ({
+        ).map((opt, index) => ({
           ...opt,
+          id: opt.id || `temp_${Date.now()}_${index}`,
           targetvalue: opt.targetvalue || "",
           isabnormal: opt.isabnormal || 0,
         }));
@@ -1549,7 +1615,7 @@
     /** 娣诲姞鏂伴�夐」 */
     addNewOption() {
       this.currentOptions.push({
-        id: Date.now(), // 涓存椂ID
+        id: `temp_${Date.now()}_${this.currentOptions.length}`,
         targetvalue: "",
         isabnormal: 0,
         isNew: true,
@@ -1558,16 +1624,25 @@
 
     /** 鍒犻櫎閫夐」 */
     removeOption(index) {
-      this.currentOptions.splice(index, 1);
+      this.$confirm("纭畾瑕佸垹闄よ繖涓�夐」鍚楋紵", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+      })
+        .then(() => {
+          this.currentOptions.splice(index, 1);
+        })
+        .catch(() => {});
     },
 
     /** 淇濆瓨閫夐」閰嶇疆 */
     async saveOptions() {
       try {
         // 楠岃瘉蹇呭~椤�
-        for (const option of this.currentOptions) {
+        for (let i = 0; i < this.currentOptions.length; i++) {
+          const option = this.currentOptions[i];
           if (!option.targetvalue || option.targetvalue.trim() === "") {
-            this.$message.warning("璇峰~鍐欐墍鏈夐�夐」鍐呭");
+            this.$message.warning(`绗� ${i + 1} 涓�夐」鍐呭涓嶈兘涓虹┖`);
             return;
           }
         }
@@ -1582,6 +1657,27 @@
           return;
         }
 
+        // 鍒ゆ柇閫夐」鏄惁鍙戠敓鍙樺寲
+        let isOptionsChanged = false;
+
+        if (this.templateForm.templateType === 1) {
+          const originalOptions =
+            this.editingQuestion.svyLibTemplateTargetoptions || [];
+          isOptionsChanged = this.checkOptionsChanged(
+            originalOptions,
+            this.currentOptions,
+            "questionnaire"
+          );
+        } else if (this.templateForm.templateType === 2) {
+          const originalOptions =
+            this.editingQuestion.ivrLibaScriptTargetoptionList || [];
+          isOptionsChanged = this.checkOptionsChanged(
+            originalOptions,
+            this.currentOptions,
+            "voice"
+          );
+        }
+
         // 淇濆瓨閫昏緫 - 鏇存柊棰樼洰瀵硅薄鐨勯�夐」鏁版嵁
         if (this.templateForm.templateType === 1) {
           this.editingQuestion.svyLibTemplateTargetoptions =
@@ -1589,14 +1685,24 @@
               ...opt,
               optioncontent: opt.targetvalue,
               isabnormal: opt.isabnormal,
+              // 娓呴櫎涓存椂瀛楁
+              targetvalue: undefined,
+              isNew: undefined,
             }));
         } else if (this.templateForm.templateType === 2) {
           this.editingQuestion.ivrLibaScriptTargetoptionList =
-            this.currentOptions;
+            this.currentOptions.map((opt) => ({
+              ...opt,
+              // 娓呴櫎涓存椂瀛楁
+              isNew: undefined,
+            }));
         }
 
-        // 瑙﹀彂閰嶇疆鍙樻洿妫�鏌�
-        this.handleConfigChange(this.editingQuestion);
+        // 濡傛灉閫夐」鏈夊彉鍖栵紝鍒欒缃鐩负鏈夊彉鏇寸姸鎬�
+        if (isOptionsChanged) {
+          this.editingQuestion.hasChanges = true;
+          this.updateChangedStatus();
+        }
 
         this.$message.success("閫夐」閰嶇疆淇濆瓨鎴愬姛");
         this.optionDialogVisible = false;
@@ -1605,126 +1711,39 @@
         this.$message.error("淇濆瓨閫夐」澶辫触");
       }
     },
-
-    /** 淇敼淇濆瓨鍗曚釜棰樼洰閰嶇疆鏂规硶锛屾坊鍔犲紓甯搁�夐」妫�鏌� */
-    async saveSingleConfig(question) {
-      // 妫�鏌ユ槸鍚︽湁寮傚父閫夐」
-      if (!this.checkHasAbnormalOptions(question)) {
-        this.$confirm("璇ラ鐩病鏈夎缃紓甯搁�夐」锛屾槸鍚﹀厛閰嶇疆閫夐」锛�", "鎻愮ず", {
-          confirmButtonText: "鍘婚厤缃�",
-          cancelButtonText: "鍙栨秷",
-          type: "warning",
-        })
-          .then(() => {
-            this.openOptionDialog(question);
-          })
-          .catch(() => {});
-        return;
+    /** 妫�鏌ラ�夐」鏄惁鍙戠敓鍙樺寲 */
+    checkOptionsChanged(originalOptions, newOptions, templateType) {
+      // 濡傛灉鏁伴噺涓嶅悓锛屽垯涓�瀹氬彉鍖栦簡
+      if (originalOptions.length !== newOptions.length) {
+        return true;
       }
 
-      // 鍘熸湁鐨勪繚瀛橀�昏緫...
-      if (!question.hasChanges) return;
+      // 姣旇緝姣忎釜閫夐」鐨勫唴瀹瑰拰寮傚父鐘舵��
+      for (let i = 0; i < originalOptions.length; i++) {
+        const original = originalOptions[i];
+        const current = newOptions[i];
 
-      const index = this.filteredQuestionList.findIndex(
-        (q) => q.id === question.id
-      );
-
-      if (index === -1) return;
-
-      const formRef = this.$refs.configForm && this.$refs.configForm[index];
-      if (!formRef) return;
-
-      const valid = await formRef.validate();
-      if (!valid) {
-        this.$message.warning("璇峰厛瀹屾垚蹇呭~椤�");
-        return;
-      }
-
-      // 缁х画鍘熸湁鐨勪繚瀛橀�昏緫...
-      question.saving = true;
-      question.saveStatus = null;
-
-      try {
-        // ... 鍘熸湁鐨勪繚瀛橀�昏緫涓嶅彉
-      } catch (error) {
-        // ... 閿欒澶勭悊涓嶅彉
-      } finally {
-        question.saving = false;
-      }
-    },
-
-    /** 鎵归噺淇濆瓨鏃朵篃瑕佹鏌� */
-    async handleBatchSave() {
-      if (!this.hasChanges || this.batchSaving) return;
-
-      // 妫�鏌ユ墍鏈夋湁鍙樻洿鐨勯鐩槸鍚﹂兘鏈夊紓甯搁�夐」
-      const changedQuestions = this.questionList.filter((q) => q.hasChanges);
-      const questionsWithoutAbnormal = changedQuestions.filter(
-        (q) => !this.checkHasAbnormalOptions(q)
-      );
-
-      if (questionsWithoutAbnormal.length > 0) {
-        this.$confirm(
-          `鏈� ${questionsWithoutAbnormal.length} 涓鐩病鏈夎缃紓甯搁�夐」锛岃鍏堥厤缃�夐」銆傛槸鍚︾户缁紵`,
-          "鎻愮ず",
-          {
-            confirmButtonText: "缁х画",
-            cancelButtonText: "鍘婚厤缃�",
-            type: "warning",
+        if (templateType === "questionnaire") {
+          // 闂嵎妯℃澘姣旇緝
+          if (
+            original.optioncontent !== current.targetvalue ||
+            original.isabnormal !== current.isabnormal
+          ) {
+            return true;
           }
-        )
-          .then(() => {
-            // 缁х画鎵ц鎵归噺淇濆瓨
-            this.executeBatchSave(changedQuestions);
-          })
-          .catch(() => {
-            // 鍙互鍦ㄨ繖閲岃烦杞埌绗竴涓病鏈夊紓甯搁�夐」鐨勯鐩�
-            if (questionsWithoutAbnormal.length > 0) {
-              this.openOptionDialog(questionsWithoutAbnormal[0]);
-            }
-          });
-      } else {
-        this.executeBatchSave(changedQuestions);
-      }
-    },
-
-    /** 鎵ц鎵归噺淇濆瓨 */
-    async executeBatchSave(changedQuestions) {
-      this.$confirm("纭畾瑕佷繚瀛樻墍鏈変慨鏀硅繃鐨勯厤缃悧锛�", "鎵归噺淇濆瓨", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning",
-      })
-        .then(async () => {
-          this.batchSaving = true;
-
-          const results = [];
-          for (const question of changedQuestions) {
-            try {
-              // 杩欓噷璋冪敤淇敼鍚庣殑saveSingleConfig鏂规硶
-              await this.saveSingleConfig(question);
-              results.push({
-                id: question.id,
-                success:
-                  !question.hasChanges &&
-                  question.saveStatus?.type === "success",
-              });
-            } catch (error) {
-              results.push({
-                id: question.id,
-                success: false,
-              });
-            }
+        } else if (templateType === "voice") {
+          // 璇煶妯℃澘姣旇緝
+          if (
+            original.targetvalue !== current.targetvalue ||
+            original.isabnormal !== current.isabnormal
+          ) {
+            return true;
           }
+        }
+      }
 
-          this.batchSaving = false;
-          // ... 鍚庣画澶勭悊涓嶅彉
-        })
-        .catch(() => {
-          this.batchSaving = false;
-        });
+      return false;
     },
-
     /** 鑾峰彇寮傚父閫夐」缁熻 */
     getAbnormalStats(question) {
       if (this.templateForm.templateType === 1) {
@@ -1746,6 +1765,7 @@
       }
       return { total: 0, abnormal: 0, warning: 0, normal: 0 };
     },
+
     /** 鎼滅储 */
     handleQuery() {
       // 浠呯瓫閫夋樉绀猴紝涓嶉渶瑕侀噸鏂板姞杞�

--
Gitblit v1.9.3