浏览代码

Merge branch 'master_zyh' of United_Software/k_online_ui into master

Jack Zhou 1 月之前
父节点
当前提交
50d979ab42

+ 0 - 2
.gitignore

@@ -17,8 +17,6 @@ components.d.ts
 package-lock.json
 pnpm-lock.yaml
 auto-imports.d.ts
-*.zip
-*.rar
 
 stats.html
 

+ 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",

+ 2 - 2
src/components/TransportMode/src/TransportMode.vue

@@ -308,7 +308,7 @@ const defaultTransport = () => {
   padding-left: 16px;
 }
 .checkbox {
-  width: 216px;
+  width: 100%;
   font-weight: 400;
   font-size: var(--font-size-3);
   padding: 0 12px;
@@ -319,7 +319,7 @@ const defaultTransport = () => {
   width: 0;
 }
 :deep(.el-checkbox__label) {
-  width: 176px;
+  width: 100%;
   padding-left: 13px;
   display: flex;
   align-items: center;

+ 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) => {

+ 55 - 44
src/views/DestinationDelivery/src/components/CreateNewBooking/src/CreateNewbooking.vue

@@ -8,6 +8,7 @@ import NotShipment from './images/default_no_shipment@2x.png'
 import submitsucessful from './images/icon_success_big@2x.png'
 import { useUserStore } from '@/stores/modules/user'
 import { useRouter } from 'vue-router'
+import { ElMessage } from 'element-plus'
 
 const userStore = useUserStore()
 const router = useRouter()
@@ -26,6 +27,7 @@ const VesselName = ref([])
 const VesselNametest = ref('')
 const ShipperValue = ref('')
 const ConsigneeValue = ref('')
+const DeliveryReference = ref('')
 const getAddressListData = ref({})
 // const isFocused = ref(false)
 const isFocused = ref({
@@ -221,48 +223,39 @@ const Countryloading = ref(false)
 const city = ref<CountryItem[]>([])
 const Cityoptions = ref<CountryItem[]>([])
 const cityloading = ref(false)
-const getAddressCountryCityData = (type: any) => {
-  $api
+const querySearchCountry = (query: string) => {
+  Countryloading.value = true
+  setTimeout(() => {
+    $api
     .getAddressCountryCityData({
-      term: '',
-      term_type: type,
-      limit: type == 'country' ? CityCode.value : CountryCode.value
+      term: query,
+      term_type: 'country',
+      limit: CityCode.value != ''  ? CityCode.value : ''
     })
     .then((res: any) => {
       if (res.code === 200) {
-        if (type == 'country') {
-          countrys.value = res.data
-        } else {
-          city.value = res.data
-        }
+        Countryoptions.value = res.data
+        Countryloading.value = false
       }
     })
-}
-const querySearchCountry = (query: string) => {
-  if (query) {
-    Countryloading.value = true
-    setTimeout(() => {
-      Countryloading.value = false
-      Countryoptions.value = countrys.value.filter((item) => {
-        return item.label.toLowerCase().includes(query.toLowerCase())
-      })
-    }, 1000)
-  } else {
-    Countryoptions.value = []
-  }
+  }, 1000)
 }
 const querySearchCity = (query: string) => {
-  if (query) {
-    cityloading.value = true
-    setTimeout(() => {
-      cityloading.value = false
-      Cityoptions.value = city.value.filter((item) => {
-        return item.label.toLowerCase().includes(query.toLowerCase())
-      })
-    }, 1000)
-  } else {
-    Cityoptions.value = []
-  }
+  cityloading.value = true
+  setTimeout(() => {
+    $api
+    .getAddressCountryCityData({
+      term: query,
+      term_type: 'city',
+      limit: CountryCode.value != ''  ? CountryCode.value : ''
+    })
+    .then((res: any) => {
+      if (res.code === 200) {
+        Cityoptions.value = res.data
+        cityloading.value = false
+      }
+    })
+  }, 1000)
 }
 // 特殊日期样式
 const getCurrentStyle = (current: any) => {
@@ -317,15 +310,15 @@ const AddNewAddressDelivery = () => {
 // 保存新地址
 const SaveNewAddress = () => {
   if (
+    CountryCode.value != '' &&
+    CityCode.value != '' &&
+    PostalCode.value != '' &&
+    ContactPerson.value != '' &&
+    ContactNumber.value != '' &&
     AddressLine1.value != '' ||
     AddressLine2.value != '' ||
     AddressLine3.value != '' ||
-    (AddressLine4.value != '' &&
-      CountryCode.value != '' &&
-      CityCode.value != '' &&
-      PostalCode.value != '' &&
-      ContactPerson.value != '' &&
-      ContactNumber.value != '')
+    AddressLine4.value != ''
   ) {
     const addressData = {
       address_1: AddressLine1.value,
@@ -368,6 +361,11 @@ const SaveNewAddress = () => {
     }
     AddNewAddressVisible.value = false
     currentEditAddress.value = null
+  } else {
+    ElMessage({
+      message: 'Required fields not entered.',
+      type: 'warning'
+    })
   }
 }
 // 点击按钮
@@ -379,9 +377,9 @@ const changeAddressRadio = () => {
   ManageVisible.value = false
   if (Addressradio.value != undefined) {
     isselectedAddress.value = Addressradio.value
+    selectedAddressList.value = ManageAddressList.value[Addressradio.value]
+    delivery_address = `${selectedAddressList.value.contact_person}(${selectedAddressList.value.contact_number})\n${selectedAddressList.value.address_1}\n${selectedAddressList.value.address_2}\n${selectedAddressList.value.address_3}\n${selectedAddressList.value.address_4},${selectedAddressList.value.country},${selectedAddressList.value.city},${selectedAddressList.value.postal_code}`
   }
-  selectedAddressList.value = ManageAddressList.value[Addressradio.value]
-  delivery_address = `${selectedAddressList.value.contact_person}(${selectedAddressList.value.contact_number})\n${selectedAddressList.value.address_1}\n${selectedAddressList.value.address_2}\n${selectedAddressList.value.address_3}\n${selectedAddressList.value.address_4},${selectedAddressList.value.country},${selectedAddressList.value.city},${selectedAddressList.value.postal_code}`
 }
 // 页面初始化
 let checkShipments = []
@@ -411,6 +409,7 @@ const getInitBookingData = () => {
             DeliveryTime.value = res.data.data.delivery_time
             Modification.value = res.data.data.modify_reason
             selectedAddressList.value = res.data.data.delivery_address_detail
+            DeliveryReference.value = res.data.data.delivery_reference
             isselectedAddress.value = ''
             const sync_key = res.data.data.delivery_address_detail.sync_key
             checkShipments = res.data.data.tableData.map((item) => ({
@@ -522,6 +521,7 @@ const getDateRangeArray = (startDateStr, endDateStr) => {
   }
 }
 const selectChangeEvent = (val: any, date: any, submitInfo: any) => {
+  ManageAddressList.value = []
   getAddressListData.value = { ...val }
   checkShipmentsSubmitInfo.value = { ...submitInfo }
   if (date.length != 0) {
@@ -670,6 +670,7 @@ const SubmitBooking = () => {
       ...checkShipmentsSubmitInfoData,
       delivery_time: DeliveryTime.value,
       delivery_mode: modetypeValue.value,
+      delivery_reference: DeliveryReference.value,
       delivery_date: datetwo,
       delivery_address: delivery_address,
       special_requirements: Requirements.value,
@@ -936,6 +937,12 @@ onMounted(() => {
             placeholder="Please Select Time"
           ></el-time-select>
         </div>
+        <div style="margin-left: 12px;">
+          <div class="delivery_type_title">Delivery Reference</div>
+          <el-tooltip class="item" effect="dark" content="Reference to be quoted on arrival at the Warehouse/DC" placement="bottom">
+            <el-input v-model="DeliveryReference" class="delivery_reference"></el-input>
+          </el-tooltip>
+        </div>
       </div>
       <div class="delivery_type_title">Special Requirements</div>
       <div class="flex" style="margin-top: 8px">
@@ -1148,7 +1155,6 @@ onMounted(() => {
             v-model="CountryCode"
             filterable
             remote
-            @focus="getAddressCountryCityData('country')"
             placeholder="Select Country"
             :remote-method="querySearchCountry"
             :loading="Countryloading"
@@ -1168,7 +1174,6 @@ onMounted(() => {
             v-model="CityCode"
             filterable
             remote
-            @focus="getAddressCountryCityData('city')"
             placeholder="Select City"
             :remote-method="querySearchCity"
             :loading="cityloading"
@@ -1599,6 +1604,12 @@ onMounted(() => {
 :deep(.el-input__wrapper) {
   height: 40px;
 }
+.delivery_reference {
+  width: 240px;
+  :deep(.el-input__wrapper) {
+    height: 32px;
+  }
+}
 .inputmargin {
   margin: 4px 0 16px 0;
 }

+ 0 - 1
src/views/DestinationDelivery/src/components/ModifyBooking/src/ModifyBooking.vue

@@ -97,7 +97,6 @@ const handleCancel = () => {
           </div>
           <div class="filetr-item mode-type">
             <div class="label"><span class="require-icon">*</span>Preferred Delivery Date</div>
-
             <el-date-picker v-model="deliveryDate" type="date" placeholder="Pick a day" />
           </div>
           <div class="special-requirements">

+ 4 - 4
src/views/DestinationDelivery/src/components/TableView/src/TableView.vue

@@ -59,7 +59,7 @@ const handleColumns = (columns: any, status?: string) => {
           if (!cellValue) return '--'
           const rangeData = cellValue.split(';')
           const leftDate = rangeData[0] ? formatTimezone(rangeData[0]) : '_'
-          const rightDate = rangeData[1] ? formatTimezone(rangeData[0]) : '_'
+          const rightDate = rangeData[1] ? formatTimezone(rangeData[1]) : '_'
           return leftDate + ' -- ' + rightDate
         }
       }
@@ -394,7 +394,7 @@ defineExpose({
           v-if="
             !isEmployeeRole &&
             row.status === 'Approved' &&
-            row.modify_by === userStore.userInfo.uname
+            row.create_by === userStore.userInfo.uname
           "
           @click="clickEmailBtn(row)"
           class="action-btn el-button--blue"
@@ -410,7 +410,7 @@ defineExpose({
           v-if="
             !isEmployeeRole &&
             (row.status === 'Pending Approval' || row.status === 'Rejected') &&
-            row.modify_by === userStore.userInfo.uname
+            row.create_by === userStore.userInfo.uname
           "
         >
           <span class="font_family icon-icon_edit_b"> </span>
@@ -423,7 +423,7 @@ defineExpose({
           v-if="
             !isEmployeeRole &&
             row.status === 'Pending Approval' &&
-            row.modify_by === userStore.userInfo.uname
+            row.create_by === userStore.userInfo.uname
           "
         >
           <span class="font_family icon-icon_cancelled_b"> </span>