From 39c8b288ec8294e026459dfb1955f0bbc49ebb52 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期一, 19 十月 2026 11:10:40 +0800
Subject: [PATCH] 测试完成

---
 src/views/Satisfaction/configurationmyd/batch.vue |  204 +++++++++++++++++++++++++++++---------------------
 1 files changed, 118 insertions(+), 86 deletions(-)

diff --git a/src/views/Satisfaction/configurationmyd/batch.vue b/src/views/Satisfaction/configurationmyd/batch.vue
index 59ada45..7f7efc7 100644
--- a/src/views/Satisfaction/configurationmyd/batch.vue
+++ b/src/views/Satisfaction/configurationmyd/batch.vue
@@ -266,7 +266,7 @@
     <el-dialog
       title="澶勭悊寮傚父鍙嶉"
       :visible.sync="processDialogVisible"
-      width="60%"
+      width="80%"
       top="6vh"
       center
     >
@@ -276,6 +276,7 @@
           <el-form
             :model="processForm"
             :rules="processRules"
+            :validate-on-rule-change="false"
             ref="processForm"
             label-width="100px"
             size="medium"
@@ -295,6 +296,7 @@
                 v-model="processForm.handleFlag"
                 placeholder="璇烽�夋嫨澶勭悊鐘舵��"
                 style="width: 100%"
+                @change="handleFlagChange('single', $event)"
               >
                 <el-option label="宸插鐞�" :value="'1'" />
                 <el-option label="鍙栨秷澶勭悊" :value="'0'" />
@@ -326,6 +328,7 @@
                 placeholder="璇烽�夋嫨澶勭悊缁撴灉"
                 style="width: 100%"
                 :disabled="processForm.handleFlag !== '1'"
+                @change="handleResultChange('single')"
               >
                 <el-option label="宸茶В鍐�" value="resolved" />
                 <el-option label="宸茶В閲�" value="explained" />
@@ -404,7 +407,7 @@
                     v-model="processForm.flowDepts"
                     multiple
                     filterable
-                    collapse-tags
+
                     placeholder="璇烽�夋嫨娴佽浆绉戝"
                     style="width: 100%"
                     @change="onFlowDeptChange"
@@ -412,24 +415,8 @@
                     <el-option
                       v-for="dept in deptList"
                       :key="dept.deptCode"
-                      :label="dept.label"
+                      :label="dept.label + '锛�' + dept.deptCode + '锛�'"
                       :value="dept.deptCode"
-                    />
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="娴佽浆绉戝code">
-                  <el-select
-                    v-model="processForm.flowDeptCodes"
-                    multiple
-                    disabled
-                    placeholder="閫夋嫨绉戝鍚庤嚜鍔ㄧ敓鎴�"
-                    style="width: 100%"
-                  >
-                    <el-option
-                      v-for="code in processForm.flowDeptCodes"
-                      :key="code"
-                      :label="code"
-                      :value="code"
                     />
                   </el-select>
                 </el-form-item>
@@ -438,7 +425,7 @@
                     v-model="processForm.pushUsers"
                     multiple
                     filterable
-                    collapse-tags
+
                     placeholder="璇烽�夋嫨鎺ㄩ�佽礋璐d汉"
                     style="width: 100%"
                     @change="onPushUserChange"
@@ -535,7 +522,8 @@
     >
       <el-form
         :model="batchProcessForm"
-        :rules="processRules"
+        :rules="batchProcessRules"
+        :validate-on-rule-change="false"
         ref="batchProcessForm"
         label-width="100px"
         size="medium"
@@ -543,8 +531,10 @@
         <el-form-item label="澶勭悊鐘舵��" prop="handleFlag">
           <el-select
             v-model="batchProcessForm.handleFlag"
+            clearable
             placeholder="璇烽�夋嫨澶勭悊鐘舵��"
             style="width: 100%"
+            @change="handleFlagChange('batch', $event)"
           >
             <el-option label="宸插鐞�" :value="'1'" />
             <el-option label="鍙栨秷澶勭悊" :value="'0'" />
@@ -554,6 +544,7 @@
         <el-form-item label="鎶ュ绉戝" prop="ccdepts">
           <el-select
             v-model="batchProcessForm.ccdepts"
+            clearable
             placeholder="璇烽�夋嫨鎶ュ绉戝"
             multiple
             filterable
@@ -573,9 +564,11 @@
         <el-form-item label="澶勭悊缁撴灉" prop="handleresult">
           <el-select
             v-model="batchProcessForm.handleresult"
+            clearable
             placeholder="璇烽�夋嫨澶勭悊缁撴灉"
             style="width: 100%"
             :disabled="batchProcessForm.handleFlag !== '1'"
+            @change="handleResultChange('batch')"
           >
             <el-option label="宸茶В鍐�" value="resolved" />
             <el-option label="宸茶В閲�" value="explained" />
@@ -682,7 +675,7 @@
         todeptcode: "",
         handleFlag: "",
         templateType: null,
-        scriptids: null,
+        scriptids: [],
         pageNum: 1,
         pageSize: 10,
       },
@@ -734,42 +727,6 @@
         processed: 0,
         total: 0,
       },
-      processRules: {
-        handleFlag: [
-          { required: true, message: "璇烽�夋嫨澶勭悊鐘舵��", trigger: "change" },
-        ],
-        handleresult: [
-          {
-            required: true,
-            message: "璇烽�夋嫨澶勭悊缁撴灉",
-            trigger: "change",
-            validator: (rule, value, callback) => {
-              if (this.processForm.handleFlag === "1" && !value) {
-                callback(new Error("璇烽�夋嫨澶勭悊缁撴灉"));
-              } else {
-                callback();
-              }
-            },
-          },
-        ],
-        handledesc: [
-          {
-            required: true,
-            message: "璇疯緭鍏ュ鐞嗚鏄�",
-            trigger: "blur",
-            validator: (rule, value, callback) => {
-              if (
-                this.processForm.handleFlag === "1" &&
-                (!value || value.trim().length < 3)
-              ) {
-                callback(new Error("澶勭悊璇存槑鑷冲皯3涓瓧绗�"));
-              } else {
-                callback();
-              }
-            },
-          },
-        ],
-      },
 
       // 鎵归噺澶勭悊瀵硅瘽妗�
       batchDialogVisible: false,
@@ -783,20 +740,9 @@
   },
 
   created() {
-    // 浠庤矾鐢卞弬鏁拌幏鍙栭棶棰業D
-    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"
-    //   );
-
+    // 浠庤矾鐢卞弬鏁拌幏鍙栭棶棰業D闆嗗悎锛坰criptids 涓烘暟缁勫舰寮忥級
+    this.filterParams.scriptids = this.resolveScriptids();
     this.filterParams.templateType = Number(this.$route.query.type) || null;
-
-    //   this.filterParams.scriptid = null;
-    // }
     this.hasQualityPermission = this.checkQualityPermission();
   },
 
@@ -806,7 +752,89 @@
     this.getUserOptions();
   },
 
+  computed: {
+    // 鍗曟潯澶勭悊琛ㄥ崟鏍¢獙瑙勫垯
+    processRules() {
+      return this.buildProcessRules(
+        () => this.processForm.handleFlag,
+        () => this.processForm.handleresult
+      );
+    },
+    // 鎵归噺澶勭悊琛ㄥ崟鏍¢獙瑙勫垯
+    batchProcessRules() {
+      return this.buildProcessRules(
+        () => this.batchProcessForm.handleFlag,
+        () => this.batchProcessForm.handleresult
+      );
+    },
+  },
+
   methods: {
+    // 鐢熸垚澶勭悊琛ㄥ崟鏍¢獙瑙勫垯
+    //   澶勭悊缁撴灉锛氬鐞嗙姸鎬佷负銆屽凡澶勭悊銆嶆椂蹇呭~
+    //   澶勭悊璇存槑锛氬鐞嗙粨鏋滀负銆屽凡瑙e喅銆嶆椂蹇呭~锛屽叾浠栨儏鍐典笉蹇呭~锛堜絾浠嶅彲濉啓锛�
+    buildProcessRules(getFlag, getResult) {
+      return {
+        handleFlag: [
+          { required: true, message: "璇烽�夋嫨澶勭悊鐘舵��", trigger: "change" },
+        ],
+        handleresult: [
+          {
+            required: true,
+            trigger: "change",
+            validator: (rule, value, callback) => {
+              if (getFlag() === "1" && !value) {
+                callback(new Error("璇烽�夋嫨澶勭悊缁撴灉"));
+              } else {
+                callback();
+              }
+            },
+          },
+        ],
+        handledesc: [
+          {
+            required: true,
+            trigger: "blur",
+            validator: (rule, value, callback) => {
+              if (
+                getResult() === "resolved" &&
+                (!value || String(value).trim().length < 3)
+              ) {
+                callback(
+                  new Error("澶勭悊缁撴灉涓恒�屽凡瑙e喅銆嶆椂锛屽鐞嗚鏄庤嚦灏戝~鍐�3涓瓧绗�")
+                );
+              } else {
+                callback();
+              }
+            },
+          },
+        ],
+      };
+    },
+
+    // 鍒囨崲澶勭悊鐘舵�佹椂锛氶潪銆屽凡澶勭悊銆嶆竻绌轰粠灞炲瓧娈靛苟娓呮帀鏃х殑鏍¢獙鎻愮ず
+    // 锛堟鏃朵笁涓帶浠跺浜� disabled锛岀敤鎴锋棤娉曚慨鏀癸紝鐣欐畫鍊间細琚彁浜ゆ垚鑴忔暟鎹級
+    handleFlagChange(type, val) {
+      const isBatch = type === "batch";
+      const form = isBatch ? this.batchProcessForm : this.processForm;
+      const refName = isBatch ? "batchProcessForm" : "processForm";
+      if (val !== "1") {
+        form.ccdepts = [];
+        form.handleresult = "";
+        form.handledesc = "";
+      }
+      const ref = this.$refs[refName];
+      if (ref) ref.clearValidate(["handleresult", "handledesc"]);
+    },
+
+    // 鍒囨崲澶勭悊缁撴灉鏃讹細鍙竻鎺夊鐞嗚鏄庣殑鏃ф牎楠屾彁绀猴紝涓嶆竻绌哄凡濉唴瀹�
+    // 锛堥潪銆屽凡瑙e喅銆嶆椂璇存槑涓嶆槸蹇呭~锛屼絾鐢ㄦ埛浠嶅彲鑷効濉啓锛�
+    handleResultChange(type) {
+      const refName = type === "batch" ? "batchProcessForm" : "processForm";
+      const ref = this.$refs[refName];
+      if (ref) ref.clearValidate(["handledesc"]);
+    },
+
     // 鏍煎紡鍖栨棩鏈熸椂闂�
     formatDateTime(dateTime) {
       if (!dateTime) return "";
@@ -840,7 +868,7 @@
     },
     /** 鏌ヨ鐢ㄦ埛鍒楄〃锛堟祦杞礋璐d汉鍊欓�夛級 */
     getUserOptions() {
-      listUser({ pageNum: 1, pageSize: 999 })
+      listUser({ pageNum: 1, pageSize: 19999 })
         .then((res) => {
           if (res.code == 200) {
             this.userList = res.rows || [];
@@ -932,6 +960,14 @@
       });
     },
 
+    // 瑙f瀽璺敱涓殑 scriptids锛堝吋瀹规暟缁� / 閫楀彿鍒嗛殧瀛楃涓诧紝缁熶竴杩斿洖鏁扮粍锛�
+    resolveScriptids() {
+      const raw = this.$route.query.scriptids;
+      if (Array.isArray(raw)) return raw;
+      if (raw) return String(raw).split(",");
+      return [];
+    },
+
     // 鏋勫缓鏌ヨ鍙傛暟
     buildQueryParams() {
       const params = {
@@ -951,11 +987,8 @@
         params.templateType = this.filterParams.templateType;
       }
 
-      // if (this.filterParams.scriptid) {
-      //   params.scriptid = this.filterParams.scriptid;
-      // }
-      if (this.filterParams.scriptids) {
-        params.scriptids = this.filterParams.scriptids.split(",");
+      if (this.filterParams.scriptids && this.filterParams.scriptids.length) {
+        params.scriptids = this.filterParams.scriptids;
       }
 
       return params;
@@ -997,10 +1030,8 @@
       this.filterParams = {
         todeptcode: "",
         handleFlag: "",
-        scriptids:
-          this.$route.query.questionId || this.$route.query.questionIds || null,
+        scriptids: this.resolveScriptids(),
         templateType: Number(this.$route.query.type) || null,
-
         pageNum: 1,
         pageSize: 10,
       };
@@ -1357,7 +1388,7 @@
           };
 
           // 鎺у埗骞跺彂鏁�
-          const CONCURRENT_LIMIT = 10; // 鍚屾椂鏈�澶�3涓姹�
+          const CONCURRENT_LIMIT = 10; // 鍚屾椂鏈�澶� 10 涓姹�
           const totalCount = this.selectedExceptionIds.length;
           const results = [];
           let successCount = 0;
@@ -1406,11 +1437,12 @@
                 console.error(`澶勭悊璁板綍 ${result.id} 澶辫触:`, result.error);
               }
             });
-            // 鏇存柊杩涘害
-            this.batchProgress.processed = i + 1;
-            this.batchProgress.percentage = Math.round(
-              ((i + 1) / totalCount) * 100
-            );
+            // 鏇存柊杩涘害锛歩 鏄壒娆¤捣濮嬬储寮曪紙姝ラ暱涓� CONCURRENT_LIMIT锛夛紝
+            // 蹇呴』鍔犱笂鏈壒瀹為檯鏉℃暟锛屽惁鍒欒繘搴﹀彧浼氭寜鎵规暟閫掑锛堝 25 鏉″彧鍒� 84%锛�
+            this.batchProgress.processed = i + batchIds.length;
+            this.batchProgress.percentage = totalCount
+              ? Math.round(((i + batchIds.length) / totalCount) * 100)
+              : 100;
             // 鏄剧ず杩涘害
             console.log(
               `杩涘害: ${Math.min(

--
Gitblit v1.9.3