3 Комити 61dc57493a ... c7ba5f1380

Аутор SHA1 Порука Датум
  AmandaG c7ba5f1380 Merge branch 'dev' into dev_g пре 1 месец
  AmandaG 6838618c76 fix:修改recommend delivery date下port精确查询 пре 1 месец
  Jack Zhou 408c0996cc Merge branch 'dev_g' of United_Software/k_online_ui into dev пре 1 месец

+ 1 - 1
package.json

@@ -71,7 +71,7 @@
     "postcss": "^8.4.41",
     "postcss-loader": "^8.1.1",
     "prettier": "^3.2.5",
-    "rollup-plugin-visualizer": "^6.0.3",
+    "rollup-plugin-visualizer": "^6.0.4",
     "sass": "^1.79.4",
     "typescript": "~5.4.0",
     "unplugin-auto-import": "^0.18.2",

+ 15 - 3
src/views/Dashboard/src/components/DashFiters.vue

@@ -46,7 +46,7 @@ const checkboxGroup1 = ref(['All'])
 const CheckboxGroup2 = ref('ETD')
 const CheckboxGroup3 = ref('invoice Issue Date')
 const filters_visible = ref(false)
-const shipper = ref(['All', 'Air', 'Sea', 'Road'])
+const shipper = ref(['All', 'Air', 'Sea', 'Road', 'Rail'])
 const shipper_two = ref(['ETD', 'ETA'])
 const shipper_three = ref(['invoice Issue Date'])
 const DashDate = ref()
@@ -206,14 +206,14 @@ const guideStore = useGuideStore()
         </el-button>
       </template>
       <div class="Dash_title">Transport Mode</div>
-      <div class="filter_filter">
+      <div class="filter_filter_one">
         <el-checkbox-group
           @change="changeCheckboxGroup1"
           v-model="checkboxGroup1"
           size="large"
           :disabled="checkboxDisabled"
         >
-          <el-checkbox-button v-for="item in shipper" :key="item" :value="item">
+          <el-checkbox-button class="filter_button" v-for="item in shipper" :key="item" :value="item">
             {{ item }}
           </el-checkbox-button>
         </el-checkbox-group>
@@ -373,9 +373,21 @@ const guideStore = useGuideStore()
   justify-content: center;
   margin: 8px 16px 0 16px;
 }
+.filter_filter_one {
+  margin: 0 16px;
+  :deep(.el-checkbox-group) {
+    display: flex;
+  }
+}
 .filter_filter {
   margin-left: 16px;
 }
+.filter_button {
+  width: 20%;
+  :deep(.el-checkbox-button__inner) {
+    width: 100%;
+  }
+}
 .dash_flex {
   display: flex;
   align-items: center;

+ 13 - 7
src/views/DestinationDelivery/src/components/ConfiguRations/src/components/CreateNewRule.vue

@@ -101,6 +101,7 @@ const CreateRuleDisabled = computed(() => {
     }
 
     // 3.2 验证航空规则(如果选择了 Air)
+    console.log(recommendCheckedList.value)
     if (recommendCheckedList.value.includes('Air')) {
       const isAirValid = recommendCheckedAirList.value.every(item => 
         item.ports.length > 0 && 
@@ -113,14 +114,19 @@ const CreateRuleDisabled = computed(() => {
 
     // 3.3 验证海运规则(如果选择了 Sea)
     if (recommendCheckedList.value.includes('Sea')) {
-      const isSeaValid = recommendCheckedSeaList.value.every(item => 
-        item.ports.length > 0 && 
-        item.carrier.length > 0 && 
-        item.recommended_delivery_from != '' && 
-        item.recommended_delivery_to != ''
-      );
+      const hasInvalidSeaItem = recommendCheckedSeaList.value.some(item => {
+        const hasValidDeliveryTime = 
+          item.recommended_delivery_from && 
+          item.recommended_delivery_to;
+        
+        const hasRequiredFields = item.rule_type !== 'Single Dimension'
+          ? item.ports.length > 0 && item.carrier.length > 0
+          : item.ports.length > 0 || item.carrier.length > 0;
+        
+        return !hasValidDeliveryTime || !hasRequiredFields;
+      });
       
-      if (!isSeaValid) return true;
+      if (hasInvalidSeaItem) return true;
     }
   }
   // 4. 所有条件都满足,返回 false(不禁用)

+ 16 - 15
src/views/DestinationDelivery/src/components/ConfiguRations/src/components/SelectValue.vue

@@ -35,16 +35,19 @@ const value = ref<string[]>(props.SelectedValue)
 const SelectNumber = ref(props.SelectIndex)
 const typeisDisabled = ref(props.typeisDisabled)
 const PortList = ref(props.PortList)
+let isUpdating = false
 
 watch(
   () => props.SelectedValue,
   (val) => {
+    if (isUpdating || JSON.stringify(val) === JSON.stringify(value.value)) return
+    isUpdating = true
     value.value = val
-    if(val[0] == 'ALL') {
-      checkAll.value = true
-    }
-  }
-, { immediate: true, deep: true })
+    checkAll.value = val[0] === 'ALL'
+    isUpdating = false
+  },
+  { immediate: true, deep: true }
+)
 
 watch(
   () => props.PortList,
@@ -113,17 +116,15 @@ const remoteMethod = (query: string) => {
 const emits = defineEmits(['changeSelectedValue', 'handelremovetag'])
 
 watch(value, (val) => {
-  if (val.length === 0) {
-    checkAll.value = false
-  } else if (val.length === PortList.value.length) {
-    checkAll.value = true
-    value.value = ['ALL']
-  }else if (val.length == 1 && val[0] == 'ALL') {
-    checkAll.value = true
-  } else {
-    checkAll.value = false
-  }
+  if (isUpdating) return
+  isUpdating = true
+  
+  const allChecked = val.length === PortList.value.length || 
+                    (val.length === 1 && val[0] === 'ALL')
+  checkAll.value = allChecked
+  
   emits('changeSelectedValue', val, SelectNumber.value)
+  isUpdating = false
 })
 
 const handleCheckAll = (val) => {