Przeglądaj źródła

feat:修改system

AmandaG 8 miesięcy temu
rodzic
commit
0b3c04d1fc

+ 47 - 12
src/components/AddRules/src/AddRules.vue

@@ -225,6 +225,23 @@ const handleCloseRadio = (val: any) => {
   }
 }
 
+// 删除 Frequency tag
+const NotimethodsMil = ref()
+const NotimethodsCon = ref()
+const NotimethodsDep = ref()
+const NotimethodsETD = ref()
+const handleCloseMethods = (val: any) => {
+  if (val == 'Mil') {
+    NotimethodsMil.value.handleCloseMethods()
+  } else if (val == 'Con') {
+    NotimethodsCon.value.handleCloseMethods()
+  } else if (val == 'Dep') {
+    NotimethodsDep.value.handleCloseMethods()
+  } else {
+    NotimethodsETD.value.handleCloseMethods()
+  }
+}
+
 // methods 切换
 const MilMethodsList = ref()
 const ChangeMethodsAddMil = (val: any, type: any) => {
@@ -358,24 +375,28 @@ const SaveSuceessful = () => {
 }
 const Savesubscribe = () => {
   let str = ''
+  missingmessage.value = ''
   if (props.TitleType == 'Milestone') {
     savesubscribeobj.rules_type = 'Milestone_Update'
     if (
       OceanCheckList.value == undefined ||
       AirCheckList.value == undefined ||
+      OceanCheckList.value.length == 0 ||
+      AirCheckList.value.length == 0 ||
       MilFrequencyList.value.length == 0 ||
+      MilMethodsList.value == undefined ||
       MilMethodsList.value.length == 0
     ) {
-      if (OceanCheckList.value == undefined) {
+      if (OceanCheckList.value == undefined || OceanCheckList.value.length == 0) {
         missingmessage.value += 'Ocean Shipments, '
       }
-      if (AirCheckList.value == undefined) {
+      if (AirCheckList.value == undefined || AirCheckList.value.length == 0) {
         missingmessage.value += 'Air Shipments, '
       }
       if (MilFrequencyList.value.length == 0) {
         missingmessage.value += 'Notification Frequency, '
       }
-      if (MilMethodsList.value.length == 0) {
+      if (MilMethodsList.value.length == 0 || MilMethodsList.value == undefined) {
         missingmessage.value += 'Notification Method, '
       }
       missingmessage.value = missingmessage.value.substring(0, missingmessage.value.length - 2)
@@ -396,22 +417,24 @@ const Savesubscribe = () => {
     savesubscribeobj.rules_type = 'Container_Status_Update'
     if (
       ContainerOceanList.value == undefined ||
+      ContainerOceanList.value.length == 0 ||
       ConFrequencyList.value.length == 0 ||
+      ConMethodsList.value == undefined ||
       ConMethodsList.value.length == 0
     ) {
-      if (ContainerOceanList.value == undefined) {
+      if (ContainerOceanList.value == undefined || ContainerOceanList.value.length == 0) {
         missingmessage.value += 'Ocean Shipments, '
       }
       if (ConFrequencyList.value.length == 0) {
         missingmessage.value += 'Notification Frequency, '
       }
-      if (ConMethodsList.value.length == 0) {
+      if (ConMethodsList.value.length == 0 || ConMethodsList.value == undefined) {
         missingmessage.value += 'Notification Method, '
       }
       missingmessage.value = missingmessage.value.substring(0, missingmessage.value.length - 2)
       UnableSaveVisible.value = true
     } else {
-      savesubscribeobj.ocean_ctnr_status = ContainerOceanList.value
+      savesubscribeobj.ocean_ctnr_status = ContainerOceanCode.value
       str = 'Ocean Container: ' + ContainerOceanList.value.join(',')
       savesubscribeobj.event_details = str
       SaveSuceessful()
@@ -420,20 +443,23 @@ const Savesubscribe = () => {
     savesubscribeobj.rules_type = 'Departure/Arrival_Delay'
     if (
       DelayedDeparturedList.value == undefined ||
+      DelayedDeparturedList.value.length == 0 ||
       DelayedAirdList.value == undefined ||
+      DelayedAirdList.value.length == 0 ||
       DepFrequencyList.value.length == 0 ||
+      DepMethodsList.value == undefined ||
       DepMethodsList.value.length == 0
     ) {
-      if (DelayedDeparturedList.value == undefined) {
+      if (DelayedDeparturedList.value == undefined || DelayedDeparturedList.value.length == 0) {
         missingmessage.value += 'Ocean Shipments, '
       }
-      if (DelayedAirdList.value == undefined) {
+      if (DelayedAirdList.value == undefined || DelayedAirdList.value.length == 0) {
         missingmessage.value += 'Air Shipments, '
       }
       if (DepFrequencyList.value.length == 0) {
         missingmessage.value += 'Notification Frequency, '
       }
-      if (DepMethodsList.value.length == 0) {
+      if (DepMethodsList.value.length == 0 || DepMethodsList.value == undefined) {
         missingmessage.value += 'Notification Method, '
       }
       missingmessage.value = missingmessage.value.substring(0, missingmessage.value.length - 2)
@@ -451,18 +477,19 @@ const Savesubscribe = () => {
       ETDAirList.value == undefined ||
       ETDAirList.value.length == 0 ||
       ETDFrequencyList.value.length == 0 ||
+      ETDMethodsList.value == undefined ||
       ETDMethodsList.value.length == 0
     ) {
-      if (ETDOceanList.value == undefined) {
+      if (ETDOceanList.value == undefined || ETDOceanList.value.length == 0) {
         missingmessage.value += 'Ocean Shipments, '
       }
-      if (ETDAirList.value == undefined) {
+      if (ETDAirList.value == undefined || ETDAirList.value.length == 0) {
         missingmessage.value += 'Air Shipments, '
       }
       if (ETDFrequencyList.value.length == 0) {
         missingmessage.value += 'Notification Frequency, '
       }
-      if (ETDMethodsList.value.length == 0) {
+      if (ETDMethodsList.value.length == 0 || ETDMethodsList.value == undefined) {
         missingmessage.value += 'Notification Method, '
       }
       missingmessage.value = missingmessage.value.substring(0, missingmessage.value.length - 2)
@@ -485,12 +512,14 @@ const clearData = (val: any) => {
     MilestoneOceanListChecked.value = []
     MilestoneAirListChecked.value = []
     handleCloseRadio('Mil')
+    handleCloseMethods('Mil')
   } else if (val == 'Container_Status_Update') {
     ContainerOceanList.value = []
     ConFrequencyList.value = []
     ConMethodsList.value = []
     ContainerOceanListChecked.value = []
     handleCloseRadio('Con')
+    handleCloseMethods('Con')
   } else if (val == 'Departure/Arrival_Delay') {
     DelayedDeparturedList.value = []
     DelayedAirdList.value = []
@@ -499,12 +528,14 @@ const clearData = (val: any) => {
     OceanDelayed.value.ClearData()
     AirDelayed.value.ClearData()
     handleCloseRadio('Dep')
+    handleCloseMethods('Dep')
   } else {
     ETDOceanList.value = []
     ETDAirList.value = []
     ETDFrequencyList.value = []
     ETDMethodsList.value = []
     handleCloseRadio('ETD')
+    handleCloseMethods('ETD')
     OceanETD.value.ClearData()
     AirETD.value.ClearData()
   }
@@ -719,21 +750,25 @@ defineExpose({
             <NotiMethods
               v-if="props.TitleType == 'Milestone'"
               :MethodsData="MethodsDataMil"
+              ref="NotimethodsMil"
               @ChangeMethodsAdd="ChangeMethodsAddMil"
             ></NotiMethods>
             <NotiMethods
               v-if="props.TitleType == 'Container'"
               :MethodsData="MethodsDataCon"
+              ref="NotimethodsCon"
               @ChangeMethodsAdd="ChangeMethodsAddCon"
             ></NotiMethods>
             <NotiMethods
               v-if="props.TitleType == 'Departure'"
               :MethodsData="MethodsDataDep"
+              ref="NotimethodsDep"
               @ChangeMethodsAdd="ChangeMethodsAddDep"
             ></NotiMethods>
             <NotiMethods
               v-if="props.TitleType == 'ETDChange'"
               :MethodsData="MethodsDataETD"
+              ref="NotimethodsETD"
               @ChangeMethodsAdd="ChangeMethodsAddETD"
             ></NotiMethods>
           </el-collapse-item>

+ 9 - 0
src/components/AddRules/src/components/NotiMethods.vue

@@ -60,6 +60,15 @@ const changeMethod = (val: any) => {
   emits('ChangeMethodsAdd', checkMethodList.value, savesubscribeobj)
 }
 const user_type = localStorage.getItem('user_type')
+
+// 删除 Frequency tag
+const handleCloseMethods = () => {
+  checkMethodList.value = []
+}
+
+defineExpose({
+  handleCloseMethods
+})
 </script>
 <template>
   <div style="margin-top: 11px">

+ 13 - 8
src/components/CreateAddRules/src/CreateAddRules.vue

@@ -588,6 +588,8 @@ const Savesubscribe = () => {
     if (
       OceanCheckList.value == undefined ||
       AirCheckList.value == undefined ||
+      OceanCheckList.value.length == 0 ||
+      AirCheckList.value.length == 0 ||
       MilFrequencyList.value.length == 0 ||
       MilMethodsList.value.length == 0 ||
       createObj.Transportstr == '' ||
@@ -599,10 +601,10 @@ const Savesubscribe = () => {
       if (createObj.Timestr == '') {
         missingmessage.value += 'Time, '
       }
-      if (OceanCheckList.value == undefined) {
+      if (OceanCheckList.value == undefined || OceanCheckList.value.length == 0) {
         missingmessage.value += 'Ocean Shipments, '
       }
-      if (AirCheckList.value == undefined) {
+      if (AirCheckList.value == undefined || AirCheckList.value.length == 0) {
         missingmessage.value += 'Air Shipments, '
       }
       if (MilFrequencyList.value.length == 0) {
@@ -629,10 +631,11 @@ const Savesubscribe = () => {
     savesubscribeobj.rules_type = 'Container_Status_Update'
     if (
       ContainerOceanList.value == undefined ||
+      ContainerOceanList.value.length == 0 ||
       ConFrequencyList.value.length == 0 ||
       ConMethodsList.value.length == 0
     ) {
-      if (ContainerOceanList.value == undefined) {
+      if (ContainerOceanList.value == undefined || ContainerOceanList.value.length == 0) {
         missingmessage.value += 'Ocean Shipments, '
       }
       if (ConFrequencyList.value.length == 0) {
@@ -644,7 +647,7 @@ const Savesubscribe = () => {
       missingmessage.value = missingmessage.value.substring(0, missingmessage.value.length - 2)
       UnableSaveVisible.value = true
     } else {
-      savesubscribeobj.ocean_ctnr_status = ContainerOceanList.value
+      savesubscribeobj.ocean_ctnr_status = ContainerOceanCode.value
       str = 'Ocean Container: ' + ContainerOceanList.value.join(',')
       savesubscribeobj.event_details = str
       SaveSuceessful()
@@ -653,14 +656,16 @@ const Savesubscribe = () => {
     savesubscribeobj.rules_type = 'Departure/Arrival_Delay'
     if (
       DelayedDeparturedList.value == undefined ||
+      DelayedDeparturedList.value.length == 0 ||
       DelayedAirdList.value == undefined ||
+      DelayedAirdList.value.length == 0 ||
       DepFrequencyList.value.length == 0 ||
       DepMethodsList.value.length == 0
     ) {
-      if (DelayedDeparturedList.value == undefined) {
+      if (DelayedDeparturedList.value == undefined || DelayedDeparturedList.value.length == 0) {
         missingmessage.value += 'Ocean Shipments, '
       }
-      if (DelayedAirdList.value == undefined) {
+      if (DelayedAirdList.value == undefined || DelayedAirdList.value.length == 0) {
         missingmessage.value += 'Air Shipments, '
       }
       if (DepFrequencyList.value.length == 0) {
@@ -686,10 +691,10 @@ const Savesubscribe = () => {
       ETDFrequencyList.value.length == 0 ||
       ETDMethodsList.value.length == 0
     ) {
-      if (ETDOceanList.value == undefined) {
+      if (ETDOceanList.value == undefined || ETDOceanList.value.length == 0) {
         missingmessage.value += 'Ocean Shipments, '
       }
-      if (ETDAirList.value == undefined) {
+      if (ETDAirList.value == undefined || ETDAirList.value.length == 0) {
         missingmessage.value += 'Air Shipments, '
       }
       if (ETDFrequencyList.value.length == 0) {

+ 2 - 1
src/components/CreateAddRules/src/components/ShipmentRange.vue

@@ -90,12 +90,13 @@ const CheckChange = (val: any) => {
 const changeTime = (val: any) => {
   if (val == 1) {
     Timestr = 'ETD within ' + clampedETDValue.value + ' Day(s)'
+  emit('ChangeCheckTimeRules', Timestr, clampedETDValue.value)
   } else if (val == 2) {
     Timestr = 'ETA within ' + clampedETAValue.value + ' Day(s)'
+  emit('ChangeCheckTimeRules', Timestr, clampedETAValue.value)
   } else {
     Timestr = ''
   }
-  emit('ChangeCheckTimeRules', Timestr, clampedETDValue.value)
 }
 
 const handleCloseCreateRule = (val: any) => {

+ 1 - 1
src/views/SystemSettings/src/SystemSettings.vue

@@ -160,7 +160,7 @@ const SavedAddedRules = (val: any, type: any) => {
     isMilestoneAdded.value = true
   } else if (type == 'Container_Status_Update') {
     isContainerAdded.value = true
-  } else if (type == 'Arrival_Delay') {
+  } else if (type == 'Departure/Arrival_Delay') {
     isDepartureAdded.value = true
   } else {
     isETDChangeAdded.value = true