Browse Source

协议调度车牌号全选bug

@dongkboy 3 months ago
parent
commit
0c6111946e

+ 1 - 1
src/components/SearchForm/index.vue

@@ -10,7 +10,7 @@
             <el-option v-for="(item, index) in field.options" :key="index" :label="item[field.props?.label || 'label']"
               :value="item[field.props?.value || 'value']">
               <template #default="scope">
-                <slot :name="`${field.model}-option`" :item="item" >
+                <slot :name="`${field.model}-option`" :item="item">
                   {{ item[field.props?.label || 'label'] }}
                 </slot>
               </template>

+ 7 - 8
src/views/quoteConfig/dispatch/components/rule.vue

@@ -304,17 +304,17 @@ const dispatchId = ref(""); //调度id
 const editType = ref("");
 
 
-const handleCheckAll = (item, val: boolean) => {
-
+const handleCheckAll = (item: any, val: boolean) => {
   item.indeterminate = false
   if (val) {
-    item.minArray = getOptions(item.attrCode).map((_) => _.code)
+    item.minArray = getOptions(item.attrCode).map((item: any) => item.idStr)
   } else {
     item.minArray = []
   }
 }
 
 const change = (item: any) => {
+  console.log('change',item)
   if (item?.attrType == 'select') {
     if (item.minArray.length === 0) {
       item.checkAll = false
@@ -426,7 +426,6 @@ const getOptions = (conditionValue: string) => {
   const target = dispatchList.value.find(
     (item) => item.attrCode === conditionValue
   );
-  console.log(target)
   return target?.dictLabal || [];
 };
 
@@ -440,7 +439,6 @@ const getConditionType = (conditionValue: string) => {
 
 // 条件切换时的处理
 const handleConditionChange = (domain: ConditionRow, val: string) => {
-  console.log(domain, val)
   const target = dispatchList.value.find((item: any) => item.attrCode == val)
   domain.max = null;
   domain.operator = "";
@@ -656,8 +654,7 @@ onMounted(async () => {
 
   // 2. 提取props参数
   const { editType, editData } = props;
-  console.log("当前操作类型:", editType);
-
+  console.log('editData',editData)
   dispatchId.value = editData?.dispatchId || "";
 
   // 3. 初始化formData基础结构(固定保留actionJson默认值,仅动态处理conditionGroups)
@@ -769,6 +766,7 @@ onMounted(async () => {
         };
 
         rawGroup.forEach((rawRow: any, rowIdx: number) => {
+          console.log('rawRow',rawRow)
           group.actions.push({
             key: rawRow.id || `row_${groupIdx}_${rowIdx}_${Date.now()}`,
             attrType: rawRow.attrType || "",
@@ -780,7 +778,6 @@ onMounted(async () => {
             errorMsg: "",
           });
         });
-        console.log(group.actions);
         // 兜底:确保每组至少有一行条件
         if (group.actions.length === 0) {
           group.actions.push({
@@ -794,6 +791,7 @@ onMounted(async () => {
             minArray: [],
           });
         }
+        console.log('group-------------',group)
         return group;
       }
     );
@@ -872,6 +870,7 @@ const regionLicenseNumber = (value: string) => {
         if (licenseNoItem) {
           licenseNoItem.dictLabal = data;
         }
+        console.log(dispatchList.value)
       }
       if (value == '0') {
         const licenseAreaItem = dispatchList.value.find((item: any) => item.attrCode == 'LicenseArea');