From a5cba9ab040f6f97558046885dce3017f9bab7e9 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期二, 11 八月 2026 14:12:29 +0800
Subject: [PATCH] 提交

---
 src/views/Satisfaction/configurationmyd/index.vue |  186 ++++++++++++++++++++++------------------------
 1 files changed, 90 insertions(+), 96 deletions(-)

diff --git a/src/views/Satisfaction/configurationmyd/index.vue b/src/views/Satisfaction/configurationmyd/index.vue
index a6debdc..dbc0df8 100644
--- a/src/views/Satisfaction/configurationmyd/index.vue
+++ b/src/views/Satisfaction/configurationmyd/index.vue
@@ -116,7 +116,7 @@
               <span class="meta-item">
                 <i class="el-icon-s-order"></i>
                 妯℃澘绫诲瀷锛歿{
-                  templateForm.templateType === 1 ? "闂嵎妯℃澘" : "璇煶妯℃澘"
+                  templateForm.templateType == 1 ? "闂嵎妯℃澘" : "璇煶妯℃澘"
                 }}
               </span>
               <span class="meta-item">
@@ -132,11 +132,11 @@
           <div class="info-right">
             <el-tag
               :type="
-                currentTemplateInfo.templateStatus === 1 ? 'success' : 'info'
+                currentTemplateInfo.templateStatus == 1 ? 'success' : 'info'
               "
               size="medium"
             >
-              {{ currentTemplateInfo.templateStatus === 1 ? "鍚敤" : "鍋滅敤" }}
+              {{ currentTemplateInfo.templateStatus == 1 ? "鍚敤" : "鍋滅敤" }}
             </el-tag>
           </div>
         </div>
@@ -211,13 +211,12 @@
       </div>
 
       <div
-        v-else-if="questionList.length === 0 && templateForm.templateId"
+        v-else-if="questionList.length == 0 && templateForm.templateId"
         class="empty-wrapper"
       >
         <el-empty description="璇ユā鏉夸腑鏆傛棤婊℃剰搴﹂鐩�">
           <p class="empty-tip">
-            璇烽�夋嫨鍏朵粬妯℃澘鎴栨鏌ユā鏉夸腑鏄惁鍖呭惈婊℃剰搴︾被鍨嬮鐩紙鍒嗙被ID:
-            404,405,406锛�
+            璇烽�夋嫨鍏朵粬妯℃澘鎴栨鏌ユā鏉夸腑鏄惁鍖呭惈婊℃剰搴︾被鍨嬮鐩�
           </p>
         </el-empty>
       </div>
@@ -378,7 +377,15 @@
                       </div>
                     </el-form-item>
                   </div>
-
+                  <div class="config-field">
+                    <el-form-item label="璐d换浜哄伐鍙�">
+                      <el-input
+                        v-model="question.exceptionConfig.dutyDeptPersonCode"
+                        placeholder="璇疯緭鍏ヨ矗浠讳汉宸ュ彿"
+                        @input="handleConfigChange(question)"
+                      />
+                    </el-form-item>
+                  </div>
                   <!-- 鎶ュ绉戝锛堝閫夛級 -->
                   <div class="config-field">
                     <el-form-item
@@ -444,9 +451,7 @@
                       :closable="false"
                       show-icon
                       :effect="
-                        question.saveStatus.type === 'success'
-                          ? 'dark'
-                          : 'light'
+                        question.saveStatus.type == 'success' ? 'dark' : 'light'
                       "
                       size="small"
                     />
@@ -495,7 +500,7 @@
 
         <div class="option-list">
           <el-alert
-            v-if="!currentOptions.some((opt) => opt.isabnormal === 1)"
+            v-if="!currentOptions.some((opt) => opt.isabnormal == 1)"
             title="璇疯嚦灏戣缃竴涓紓甯搁�夐」锛堟爣璁颁负寮傚父锛�"
             type="warning"
             :closable="false"
@@ -582,9 +587,7 @@
 
       <span slot="footer" class="dialog-footer">
         <el-button @click="optionDialogVisible = false">鍙栨秷</el-button>
-        <el-button type="primary" @click="saveOptions" :loading="savingOptions">
-          淇濆瓨閰嶇疆
-        </el-button>
+        <el-button type="primary" @click="saveOptions"> 淇濆瓨閰嶇疆 </el-button>
       </span>
     </el-dialog>
     <!-- 棰樼洰棰勮瀵硅瘽妗� -->
@@ -801,7 +804,7 @@
           },
           {
             validator: (rule, value, callback) => {
-              if (!value || value.length === 0) {
+              if (!value || value.length == 0) {
                 callback(new Error("璇疯嚦灏戦�夋嫨涓�涓矗浠荤瀹�"));
               } else {
                 callback();
@@ -818,7 +821,7 @@
           },
           {
             validator: (rule, value, callback) => {
-              if (!value || value.length === 0) {
+              if (!value || value.length == 0) {
                 callback(new Error("璇疯嚦灏戦�夋嫨涓�涓姤澶囩瀹�"));
               } else {
                 callback();
@@ -833,9 +836,9 @@
   computed: {
     // 鏍规嵁妯℃澘绫诲瀷杩囨护妯℃澘閫夐」
     filteredTemplateOptions() {
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         return this.questionnaireTemplates;
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         return this.followupTemplates;
       }
       return [];
@@ -843,11 +846,11 @@
 
     // 婊℃剰搴﹂鐩暟閲�
     satisfactionQuestionsCount() {
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         return this.questionList.filter((q) =>
           this.questionnaireCategorys.includes(q.categoryid)
         ).length;
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         return this.questionList.filter((q) =>
           this.voiceCategories.includes(q.scriptAssortid)
         ).length;
@@ -858,14 +861,13 @@
     // 绛涢�夊悗鐨勯鐩垪琛�
     filteredQuestionList() {
       let filtered = this.questionList;
-      console.log("queryParams:", this.queryParams);
-      console.log("questionList:", this.questionList);
+
       // 绛涢�夋弧鎰忓害棰樼洰
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         filtered = filtered.filter((q) =>
           this.questionnaireCategorys.includes(q.categoryid)
         );
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         filtered = filtered.filter((q) =>
           this.voiceCategories.includes(q.scriptAssortid)
         );
@@ -892,6 +894,9 @@
   },
   created() {
     if (store.getters.satisfactionCategories) {
+      // this.questionnaireCategorys = [404, 405, 406, 10039, 10041, 10042];
+      // console.log(1);
+
       this.questionnaireCategorys =
         store.getters.satisfactionCategories.questionnaireCategorys.map(
           (item) => item.categoryid
@@ -951,13 +956,13 @@
     /** 鏍规嵁绉戝缂栫爜鑾峰彇绉戝鍚嶇О */
     getDeptName(deptCode) {
       if (!deptCode) return "";
-      const dept = this.deptOptions.find((d) => d.deptCode === deptCode);
+      const dept = this.deptOptions.find((d) => d.deptCode == deptCode);
       return dept ? dept.label : deptCode;
     },
 
     /** 鏍规嵁绉戝缂栫爜鏁扮粍鑾峰彇绉戝鍚嶇О鏁扮粍 */
     getDeptNames(deptCodes) {
-      if (!Array.isArray(deptCodes) || deptCodes.length === 0) return [];
+      if (!Array.isArray(deptCodes) || deptCodes.length == 0) return [];
       return deptCodes
         .map((code) => this.getDeptName(code))
         .filter((name) => name && name.trim());
@@ -1029,7 +1034,7 @@
     handleTemplateChange(templateId) {
       if (templateId) {
         const selectedTemplate = this.filteredTemplateOptions.find(
-          (t) => t.id === templateId
+          (t) => t.id == templateId
         );
         if (selectedTemplate) {
           this.currentTemplateInfo = {
@@ -1043,9 +1048,9 @@
         this.loading = true;
         this.questionList = [];
 
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           this.loadQuestionnaireTemplateDetail();
-        } else if (this.templateForm.templateType === 2) {
+        } else if (this.templateForm.templateType == 2) {
           this.loadFollowupTemplateDetail();
         }
       } else {
@@ -1066,9 +1071,9 @@
         this.loading = true;
         this.questionList = [];
 
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           this.loadQuestionnaireTemplateDetail();
-        } else if (this.templateForm.templateType === 2) {
+        } else if (this.templateForm.templateType == 2) {
           this.loadFollowupTemplateDetail();
         }
       });
@@ -1081,7 +1086,7 @@
           this.templateLoading = false;
           this.loading = false;
 
-          if (res.code === 200 && res.rows && res.rows.length > 0) {
+          if (res.code == 200 && res.rows && res.rows.length > 0) {
             const templateDetail = res.rows[0];
 
             // 鏇存柊妯℃澘淇℃伅
@@ -1116,7 +1121,7 @@
           this.templateLoading = false;
           this.loading = false;
 
-          if (res.code === 200) {
+          if (res.code == 200) {
             const templateDetail = res.data;
 
             // 鏇存柊妯℃澘淇℃伅
@@ -1152,6 +1157,7 @@
         let exceptionConfig = {
           responsibilityDept: [], // 璐d换绉戝缂栫爜鏁扮粍
           reportDept: [], // 鎶ュ绉戝缂栫爜鏁扮粍
+          dutyDeptPersonCode: question.dutyDeptPersonCode || "", // 璐d换浜哄伐鍙�
         };
 
         // 浠庨鐩《灞傚瓧娈佃鍙栨暟鎹�
@@ -1205,27 +1211,12 @@
 
     /** 閰嶇疆鍙樻洿澶勭悊 */
     handleConfigChange(question) {
-      this.$nextTick(() => {
-        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) {
-            formRef.validate((valid) => {
-              if (valid) {
-                question.hasChanges = !this.isConfigEqual(
-                  question.exceptionConfig,
-                  question.originalConfig
-                );
-                this.updateChangedStatus();
-              }
-            });
-          }
-        }
-      });
+      // 鐩存帴瀵规瘮閰嶇疆鏄惁鍙樺寲锛屼笉渚濊禆琛ㄥ崟鏍¢獙锛堥伩鍏嶅彧鏀逛竴涓瓧娈垫椂鏍¢獙涓嶉�氳繃瀵艰嚧 hasChanges 鏃犳硶鏇存柊锛�
+      question.hasChanges = !this.isConfigEqual(
+        question.exceptionConfig,
+        question.originalConfig
+      );
+      this.updateChangedStatus();
     },
 
     /** 姣旇緝閰嶇疆鏄惁鏀瑰彉 */
@@ -1248,8 +1239,12 @@
         .sort()
         .join(",")
         .toLowerCase();
+      const person1 = (config1.dutyDeptPersonCode || "").trim();
+      const person2 = (config2.dutyDeptPersonCode || "").trim();
 
-      return responsibility1 === responsibility2 && report1 === report2;
+      return responsibility1 == responsibility2
+        && report1 == report2
+        && person1 == person2;
     },
 
     /** 鏇存柊鍙樻洿鐘舵�� */
@@ -1264,13 +1259,13 @@
 
     /** 妫�鏌ラ鐩槸鍚︽湁寮傚父閫夐」 */
     checkHasAbnormalOptions(question) {
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         return (question.svyLibTemplateTargetoptions || []).some(
-          (opt) => opt.isabnormal === 1
+          (opt) => opt.isabnormal == 1
         );
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         return (question.ivrLibaScriptTargetoptionList || []).some(
-          (opt) => opt.isabnormal === 1
+          (opt) => opt.isabnormal == 1
         );
       }
       return false;
@@ -1302,8 +1297,8 @@
         return;
       }
 
-      const index = this.questionList.findIndex((q) => q.id === question.id);
-      if (index === -1) 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;
@@ -1322,16 +1317,16 @@
       try {
         // 鑾峰彇褰撳墠妯℃澘璇︽儏
         let templateDetail;
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           // 闂嵎妯℃澘
           const res = await getQtemplateobj({
             svyid: this.templateForm.templateId,
           });
-          if (res.code !== 200 || !res.rows || res.rows.length === 0) {
+          if (res.code !== 200 || !res.rows || res.rows.length == 0) {
             throw new Error(res.msg || "鑾峰彇妯℃澘璇︽儏澶辫触");
           }
           templateDetail = res.rows[0];
-        } else if (this.templateForm.templateType === 2) {
+        } else if (this.templateForm.templateType == 2) {
           // 璇煶妯℃澘
           const res = await getvFollowup({ id: this.templateForm.templateId });
           if (res.code !== 200) {
@@ -1343,14 +1338,14 @@
         // 鏇存柊棰樼洰閰嶇疆
         let updatedTemplateDetail = { ...templateDetail };
         let questionsField =
-          this.templateForm.templateType === 1
+          this.templateForm.templateType == 1
             ? "svyTemplateLibScripts"
             : "ivrLibaTemplateScriptVOList";
 
         const questions = updatedTemplateDetail[questionsField] || [];
-        const questionIndex = questions.findIndex((q) => q.id === question.id);
+        const questionIndex = questions.findIndex((q) => q.id == question.id);
 
-        if (questionIndex === -1) {
+        if (questionIndex == -1) {
           throw new Error("鏈壘鍒伴鐩�");
         }
 
@@ -1370,16 +1365,14 @@
           dutyDeptName: responsibilityDeptNames.join(","),
           reportDeptCode: question.exceptionConfig.reportDept.join(","),
           reportDeptName: reportDeptNames.join(","),
+          dutyDeptPersonCode: question.exceptionConfig.dutyDeptPersonCode || "",
         };
 
         // 濡傛灉闇�瑕侊紝涔熸洿鏂伴�夐」鏁版嵁
-        if (question.hasChanges && this.templateForm.templateType === 1) {
+        if (question.hasChanges && this.templateForm.templateType == 1) {
           questions[questionIndex].svyLibTemplateTargetoptions =
             question.svyLibTemplateTargetoptions || [];
-        } else if (
-          question.hasChanges &&
-          this.templateForm.templateType === 2
-        ) {
+        } else if (question.hasChanges && this.templateForm.templateType == 2) {
           questions[questionIndex].ivrLibaScriptTargetoptionList =
             question.ivrLibaScriptTargetoptionList || [];
         }
@@ -1389,7 +1382,7 @@
 
         // 淇濆瓨妯℃澘
         let response;
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           response = await compileQtemplate({
             ...updatedTemplateDetail,
             id: this.templateForm.templateId,
@@ -1403,7 +1396,7 @@
           });
         }
 
-        if (response.code === 200) {
+        if (response.code == 200) {
           this.handleSaveSuccess(question);
         } else {
           throw new Error(response.msg || "淇濆瓨澶辫触");
@@ -1436,6 +1429,7 @@
       question.dutyDeptName = responsibilityDeptNames.join(",");
       question.reportDeptCode = question.exceptionConfig.reportDept.join(",");
       question.reportDeptName = reportDeptNames.join(",");
+      question.dutyDeptPersonCode = question.exceptionConfig.dutyDeptPersonCode || "";
 
       // 鏇存柊鍘熷閰嶇疆
       question.originalConfig = JSON.parse(
@@ -1496,7 +1490,7 @@
 
       // 鑾峰彇鏈夊彉鏇寸殑棰樼洰
       const changedQuestions = this.questionList.filter((q) => q.hasChanges);
-      if (changedQuestions.length === 0) {
+      if (changedQuestions.length == 0) {
         this.$message.info("娌℃湁闇�瑕佷繚瀛樼殑閰嶇疆鍙樻洿");
         return;
       }
@@ -1555,7 +1549,7 @@
           const successCount = results.filter((r) => r.success).length;
           const failCount = results.length - successCount;
 
-          if (failCount === 0) {
+          if (failCount == 0) {
             this.saveSuccessVisible = true;
             this.$message.success(`鎴愬姛淇濆瓨 ${successCount} 涓厤缃甡);
           } else {
@@ -1586,18 +1580,18 @@
       this.editingQuestion = question;
 
       // 淇濆瓨鍘熷閫夐」鐨勫揩鐓�
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         this.editingQuestion.originalOptions = JSON.parse(
           JSON.stringify(question.svyLibTemplateTargetoptions || [])
         );
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         this.editingQuestion.originalOptions = JSON.parse(
           JSON.stringify(question.ivrLibaScriptTargetoptionList || [])
         );
       }
 
       // 澶嶅埗閫夐」鏁版嵁
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         this.currentOptions = JSON.parse(
           JSON.stringify(question.svyLibTemplateTargetoptions || [])
         ).map((opt, index) => ({
@@ -1606,7 +1600,7 @@
           targetvalue: opt.optioncontent || "",
           isabnormal: opt.isabnormal || 0,
         }));
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         this.currentOptions = JSON.parse(
           JSON.stringify(question.ivrLibaScriptTargetoptionList || [])
         ).map((opt, index) => ({
@@ -1649,7 +1643,7 @@
         // 楠岃瘉蹇呭~椤�
         for (let i = 0; i < this.currentOptions.length; i++) {
           const option = this.currentOptions[i];
-          if (!option.targetvalue || option.targetvalue.trim() === "") {
+          if (!option.targetvalue || option.targetvalue.trim() == "") {
             this.$message.warning(`绗� ${i + 1} 涓�夐」鍐呭涓嶈兘涓虹┖`);
             return;
           }
@@ -1657,7 +1651,7 @@
 
         // 妫�鏌ユ槸鍚︽湁寮傚父閫夐」
         const hasAbnormal = this.currentOptions.some(
-          (opt) => opt.isabnormal === 1
+          (opt) => opt.isabnormal == 1
         );
 
         if (!hasAbnormal) {
@@ -1668,7 +1662,7 @@
         // 鍒ゆ柇閫夐」鏄惁鍙戠敓鍙樺寲
         let isOptionsChanged = false;
 
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           const originalOptions =
             this.editingQuestion.svyLibTemplateTargetoptions || [];
           isOptionsChanged = this.checkOptionsChanged(
@@ -1676,7 +1670,7 @@
             this.currentOptions,
             "questionnaire"
           );
-        } else if (this.templateForm.templateType === 2) {
+        } else if (this.templateForm.templateType == 2) {
           const originalOptions =
             this.editingQuestion.ivrLibaScriptTargetoptionList || [];
           isOptionsChanged = this.checkOptionsChanged(
@@ -1687,7 +1681,7 @@
         }
 
         // 淇濆瓨閫昏緫 - 鏇存柊棰樼洰瀵硅薄鐨勯�夐」鏁版嵁
-        if (this.templateForm.templateType === 1) {
+        if (this.templateForm.templateType == 1) {
           this.editingQuestion.svyLibTemplateTargetoptions =
             this.currentOptions.map((opt) => ({
               ...opt,
@@ -1697,7 +1691,7 @@
               targetvalue: undefined,
               isNew: undefined,
             }));
-        } else if (this.templateForm.templateType === 2) {
+        } else if (this.templateForm.templateType == 2) {
           this.editingQuestion.ivrLibaScriptTargetoptionList =
             this.currentOptions.map((opt) => ({
               ...opt,
@@ -1731,7 +1725,7 @@
         const original = originalOptions[i];
         const current = newOptions[i];
 
-        if (templateType === "questionnaire") {
+        if (templateType == "questionnaire") {
           // 闂嵎妯℃澘姣旇緝
           if (
             original.optioncontent !== current.targetvalue ||
@@ -1739,7 +1733,7 @@
           ) {
             return true;
           }
-        } else if (templateType === "voice") {
+        } else if (templateType == "voice") {
           // 璇煶妯℃澘姣旇緝
           if (
             original.targetvalue !== current.targetvalue ||
@@ -1754,21 +1748,21 @@
     },
     /** 鑾峰彇寮傚父閫夐」缁熻 */
     getAbnormalStats(question) {
-      if (this.templateForm.templateType === 1) {
+      if (this.templateForm.templateType == 1) {
         const options = question.svyLibTemplateTargetoptions || [];
         return {
           total: options.length,
-          abnormal: options.filter((opt) => opt.isabnormal === 1).length,
-          warning: options.filter((opt) => opt.isabnormal === 2).length,
-          normal: options.filter((opt) => opt.isabnormal === 0).length,
+          abnormal: options.filter((opt) => opt.isabnormal == 1).length,
+          warning: options.filter((opt) => opt.isabnormal == 2).length,
+          normal: options.filter((opt) => opt.isabnormal == 0).length,
         };
-      } else if (this.templateForm.templateType === 2) {
+      } else if (this.templateForm.templateType == 2) {
         const options = question.ivrLibaScriptTargetoptionList || [];
         return {
           total: options.length,
-          abnormal: options.filter((opt) => opt.isabnormal === 1).length,
-          warning: options.filter((opt) => opt.isabnormal === 2).length,
-          normal: options.filter((opt) => opt.isabnormal === 0).length,
+          abnormal: options.filter((opt) => opt.isabnormal == 1).length,
+          warning: options.filter((opt) => opt.isabnormal == 2).length,
+          normal: options.filter((opt) => opt.isabnormal == 0).length,
         };
       }
       return { total: 0, abnormal: 0, warning: 0, normal: 0 };

--
Gitblit v1.9.3