CreateAddRules.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346
  1. <script lang="ts" setup>
  2. import { ref, watch, onMounted } from 'vue'
  3. import RulesShipments from './components/RulesShipments.vue'
  4. import AddedrluesTag from './components/AddedrluesTag.vue'
  5. import DelayedType from './components/DelayedType.vue'
  6. import ETDShipments from './components/ETDShipments.vue'
  7. import NotiFrequency from './components/NotiFrequency.vue'
  8. import ShipmentRange from './components/ShipmentRange.vue'
  9. import NotiMethods from './components/NotiMethods.vue'
  10. import submitsucessful from './images/submit_successful.png'
  11. import { useRouter } from 'vue-router'
  12. const router = useRouter()
  13. interface CheckboxItem {
  14. value: string
  15. label: string
  16. }
  17. interface Props {
  18. TitleType: String
  19. }
  20. const MilestoneOceanListInit = ref<CheckboxItem[]>([])
  21. const MilestoneOceanListChecked = ref([])
  22. const MilestoneAirListInit = ref<CheckboxItem[]>([])
  23. const MilestoneAirListChecked = ref([])
  24. const ContainerOceanListInit = ref<CheckboxItem[]>([])
  25. const ContainerOceanListChecked = ref([])
  26. const props = defineProps<Props>()
  27. let savesubscribeobj: any = {}
  28. const RulesActive = ref([
  29. 'ShipmentRange',
  30. 'SelectMilestone',
  31. 'NotificationFrequency',
  32. 'NotificationMethod'
  33. ])
  34. const OceanCheckList = ref()
  35. const OceanCheckListCode = ref()
  36. const AirCheckList = ref()
  37. const AirCheckListCode = ref()
  38. const ContainerOceanList = ref()
  39. const ContainerOceanCode = ref()
  40. const IsFirstActive = ref(true)
  41. const IsTwoActive = ref(true)
  42. const IsThreeActive = ref(true)
  43. const IsFourActive = ref(true)
  44. const UnableSaveVisible = ref(false)
  45. const SaveVisibleError = ref(false)
  46. const SaveVisibleDetected = ref(false)
  47. const SaveedVisible = ref(false)
  48. const DelayedDeparturedList = ref()
  49. const DelayedAirdList = ref()
  50. const ETDOceanList = ref()
  51. const ETDAirList = ref()
  52. const FrequencyDataMil = ref()
  53. const FrequencyDataCon = ref()
  54. const FrequencyDataDep = ref()
  55. const FrequencyDataETD = ref()
  56. const MethodsDataMil = ref()
  57. const MethodsDataCon = ref()
  58. const MethodsDataDep = ref()
  59. const MethodsDataETD = ref()
  60. const DelayedDataInit = ref()
  61. const DelayedDataInitAir = ref()
  62. const OceanETDInit = ref()
  63. const AirETDInit = ref()
  64. const ShipmentRangeMil = ref()
  65. const ShipmentRangeCon = ref()
  66. const ShipmentRangeDep = ref()
  67. const ShipmentRangeETD = ref()
  68. const MonitoringList = ref()
  69. const getInitMonitoring = () => {
  70. $api
  71. .MonitoringInit({})
  72. .then((res: any) => {
  73. if (res.code === 200) {
  74. MonitoringList.value = res.data
  75. MilestoneOceanListInit.value = res.data.OceanCheckBoxList
  76. MilestoneAirListInit.value = res.data.AirCheckBoxList
  77. ContainerOceanListInit.value = res.data.CtnrCheckBoxList
  78. }
  79. })
  80. .finally(() => {})
  81. }
  82. onMounted(() => {
  83. getInitMonitoring()
  84. Initdata()
  85. })
  86. // 初始赋值
  87. const editTableidtwo = ref('')
  88. const Initdata = () => {
  89. if (sessionStorage.getItem('editTableid') != null) {
  90. const editTableid = sessionStorage.getItem('editTableid')
  91. editTableidtwo.value = sessionStorage.getItem('editTableid')
  92. const editTablerules_type = sessionStorage.getItem('editTablerules_type')
  93. $api
  94. .EditMonitoringTable({
  95. id: editTableid,
  96. rules_type: editTablerules_type
  97. })
  98. .then((res: any) => {
  99. if (res.code === 200) {
  100. if (editTablerules_type == 'Milestone_Update') {
  101. FrequencyDataMil.value = res.data.Milestone_Update
  102. MethodsDataMil.value = res.data.Milestone_Update
  103. ShipmentRangeMil.value = res.data.Milestone_Update
  104. MilestoneOceanListInit.value = res.data.Milestone_Update.OceanCheckBoxList
  105. MilestoneOceanListChecked.value = res.data.Milestone_Update.OceanCheckedList
  106. OceanCheckList.value = []
  107. // 遍历选中的value值,找到对应的label值
  108. MilestoneOceanListChecked.value.forEach((value) => {
  109. const option = MilestoneOceanListInit.value.find((item) => item.value === value)
  110. if (option) {
  111. OceanCheckList.value.push(option.label)
  112. }
  113. })
  114. MilestoneAirListInit.value = res.data.Milestone_Update.AirCheckBoxList
  115. MilestoneAirListChecked.value = res.data.Milestone_Update.AirCheckedList
  116. AirCheckList.value = []
  117. // 遍历选中的value值,找到对应的label值
  118. MilestoneAirListChecked.value.forEach((value) => {
  119. const option = MilestoneAirListInit.value.find((item) => item.value === value)
  120. if (option) {
  121. AirCheckList.value.push(option.label)
  122. }
  123. })
  124. createListMilestone.value = res.data.Milestone_Update.shipment_details
  125. } else if (editTablerules_type == 'Container_Status_Update') {
  126. ContainerOceanListInit.value = res.data.Container_Status_Update.CtnrCheckBoxList
  127. ContainerOceanListChecked.value = res.data.Container_Status_Update.CtnrCheckedList
  128. ContainerOceanList.value = []
  129. // 遍历选中的value值,找到对应的label值
  130. ContainerOceanListChecked.value.forEach((value) => {
  131. const option = ContainerOceanListInit.value.find((item) => item.value === value)
  132. if (option) {
  133. ContainerOceanList.value.push(option.label)
  134. }
  135. })
  136. FrequencyDataCon.value = res.data.Container_Status_Update
  137. MethodsDataCon.value = res.data.Container_Status_Update
  138. ShipmentRangeCon.value = res.data.Container_Status_Update
  139. } else if (editTablerules_type == 'Departure/Arrival_Delay') {
  140. let OceanObj: any = {}
  141. OceanObj.atd_etd = res.data['Departure/Arrival_Delay'].ocean_atd_sub_etd
  142. OceanObj.atd_etd_unit = res.data['Departure/Arrival_Delay'].ocean_atd_sub_etd_unit
  143. OceanObj.ata_eta = res.data['Departure/Arrival_Delay'].ocean_ata_sub_eta
  144. OceanObj.ata_eta_unit = res.data['Departure/Arrival_Delay'].ocean_ata_sub_eta_unit
  145. DelayedDataInit.value = OceanObj
  146. let AirObj: any = {}
  147. AirObj.atd_etd = res.data['Departure/Arrival_Delay'].air_atd_sub_etd
  148. AirObj.atd_etd_unit = res.data['Departure/Arrival_Delay'].air_atd_sub_etd_unit
  149. AirObj.ata_eta = res.data['Departure/Arrival_Delay'].air_ata_sub_eta
  150. AirObj.ata_eta_unit = res.data['Departure/Arrival_Delay'].air_ata_sub_eta_unit
  151. DelayedDataInitAir.value = AirObj
  152. FrequencyDataDep.value = res.data['Departure/Arrival_Delay']
  153. MethodsDataDep.value = res.data['Departure/Arrival_Delay']
  154. ShipmentRangeDep.value = res.data['Departure/Arrival_Delay']
  155. } else if (editTablerules_type == 'ETD/ETA_Change') {
  156. let OceanChange: any = {}
  157. OceanChange.ETDradio = res.data['ETD/ETA_Change'].ocean_etd_change
  158. OceanChange.etd_old_sub_new = res.data['ETD/ETA_Change'].ocean_etd_old_sub_new
  159. OceanChange.etd_old_sub_new_unit = res.data['ETD/ETA_Change'].ocean_etd_old_sub_new_unit
  160. OceanChange.ETAradio = res.data['ETD/ETA_Change'].ocean_eta_change
  161. OceanChange.eta_old_sub_new = res.data['ETD/ETA_Change'].ocean_eta_old_sub_new
  162. OceanChange.eta_old_sub_new_unit = res.data['ETD/ETA_Change'].ocean_eta_old_sub_new_unit
  163. OceanETDInit.value = OceanChange
  164. let AirChange: any = {}
  165. AirChange.ETDradio = res.data['ETD/ETA_Change'].air_etd_change
  166. AirChange.etd_old_sub_new = res.data['ETD/ETA_Change'].air_etd_old_sub_new
  167. AirChange.etd_old_sub_new_unit = res.data['ETD/ETA_Change'].air_etd_old_sub_new_unit
  168. AirChange.ETAradio = res.data['ETD/ETA_Change'].air_eta_change
  169. AirChange.eta_old_sub_new = res.data['ETD/ETA_Change'].air_eta_old_sub_new
  170. AirChange.eta_old_sub_new_unit = res.data['ETD/ETA_Change'].air_eta_old_sub_new_unit
  171. AirETDInit.value = AirChange
  172. FrequencyDataETD.value = res.data['ETD/ETA_Change']
  173. MethodsDataETD.value = res.data['ETD/ETA_Change']
  174. ShipmentRangeETD.value = res.data['ETD/ETA_Change']
  175. }
  176. }
  177. })
  178. setTimeout(() => {
  179. sessionStorage.removeItem('editTableid')
  180. sessionStorage.removeItem('editTablerules_type')
  181. }, 1000)
  182. }
  183. }
  184. // 给tag list赋值
  185. const ChangeCheckOceanRules = (val: any, value: any) => {
  186. OceanCheckList.value = val
  187. OceanCheckListCode.value = value
  188. }
  189. const ChangeContainerRules = (val: any, value: any) => {
  190. ContainerOceanList.value = val
  191. ContainerOceanCode.value = value
  192. }
  193. // delayed赋值
  194. const ChangeDeayedRules = (val: any) => {
  195. DelayedDeparturedList.value = []
  196. if (val.Departure != '') {
  197. DelayedDeparturedList.value.push(val.Departure)
  198. savesubscribeobj.ocean_atd_sub_etd = val.Departure.split(' ')[3]
  199. savesubscribeobj.ocean_atd_sub_etd_unit = val.Departure.split(' ')[4]
  200. } else {
  201. delete savesubscribeobj.ocean_atd_sub_etd
  202. delete savesubscribeobj.ocean_atd_sub_etd_unit
  203. }
  204. if (val.Arrival != '') {
  205. DelayedDeparturedList.value.push(val.Arrival)
  206. savesubscribeobj.ocean_ata_sub_eta = val.Arrival.split(' ')[4]
  207. savesubscribeobj.ocean_ata_sub_eta_unit = val.Arrival.split(' ')[5]
  208. } else {
  209. delete savesubscribeobj.ocean_ata_sub_eta
  210. delete savesubscribeobj.ocean_ata_sub_eta_unit
  211. }
  212. }
  213. const ChangeAirRules = (val: any) => {
  214. DelayedAirdList.value = []
  215. if (val.Departure != '') {
  216. DelayedAirdList.value.push(val.Departure)
  217. savesubscribeobj.air_atd_sub_etd = val.Departure.split(' ')[3]
  218. savesubscribeobj.air_atd_sub_etd_unit = val.Departure.split(' ')[4]
  219. } else {
  220. delete savesubscribeobj.air_atd_sub_etd
  221. delete savesubscribeobj.air_atd_sub_etd_unit
  222. }
  223. if (val.Arrival != '') {
  224. DelayedAirdList.value.push(val.Arrival)
  225. savesubscribeobj.air_ata_sub_eta = val.Arrival.split(' ')[4]
  226. savesubscribeobj.air_ata_sub_eta_unit = val.Arrival.split(' ')[5]
  227. } else {
  228. delete savesubscribeobj.air_ata_sub_eta
  229. delete savesubscribeobj.air_ata_sub_eta_unit
  230. }
  231. }
  232. const ChangeCheckAirRules = (val: any, value: any) => {
  233. AirCheckList.value = val
  234. AirCheckListCode.value = value
  235. }
  236. //选择create new rules
  237. const createListMilestone = ref()
  238. const createListContainer = ref()
  239. const createListDeparture = ref()
  240. const createListETDChange = ref()
  241. let createObj: any = {
  242. Transportstr: '',
  243. Timestr: ''
  244. }
  245. const changecheckCreateRulesMilestone = (val: any, value: any) => {
  246. createListMilestone.value = []
  247. createObj.Transportstr = val
  248. if (createObj.Transportstr != '') {
  249. createListMilestone.value.push(createObj.Transportstr)
  250. }
  251. if (createObj.Timestr != '') {
  252. createListMilestone.value.push(createObj.Timestr)
  253. }
  254. savesubscribeobj.shipment_transport_mode = value
  255. savesubscribeobj.shipment_details = createListMilestone.value.join(';\n')
  256. }
  257. const ChangeCheckTimeRulesMilestone = (val: any, time: any) => {
  258. createListMilestone.value = []
  259. createObj.Timestr = val
  260. if (val.includes('ETD')) {
  261. savesubscribeobj.shipment_etd_limit = time
  262. savesubscribeobj.shipment_eta_limit = ''
  263. }
  264. if (val.includes('ETA')) {
  265. savesubscribeobj.shipment_eta_limit = time
  266. savesubscribeobj.shipment_etd_limit = ''
  267. }
  268. if (createObj.Transportstr != '') {
  269. createListMilestone.value.push(createObj.Transportstr)
  270. }
  271. if (createObj.Timestr != '') {
  272. createListMilestone.value.push(createObj.Timestr)
  273. }
  274. savesubscribeobj.shipment_details = createListMilestone.value.join(';\n')
  275. }
  276. const changecheckCreateRulesContainer = (val: any, value: any) => {
  277. createListContainer.value = []
  278. createObj.Transportstr = val
  279. if (createObj.Transportstr != '') {
  280. createListContainer.value.push(createObj.Transportstr)
  281. }
  282. if (createObj.Timestr != '') {
  283. createListContainer.value.push(createObj.Timestr)
  284. }
  285. savesubscribeobj.shipment_transport_mode = value
  286. savesubscribeobj.shipment_details = createListContainer.value.join(';\n')
  287. }
  288. const ChangeCheckTimeRulesContainer = (val: any, time: any) => {
  289. createListContainer.value = []
  290. createObj.Timestr = val
  291. if (val.includes('ETD')) {
  292. savesubscribeobj.shipment_etd_limit = time
  293. savesubscribeobj.shipment_eta_limit = ''
  294. }
  295. if (val.includes('ETA')) {
  296. savesubscribeobj.shipment_eta_limit = time
  297. savesubscribeobj.shipment_etd_limit = ''
  298. }
  299. if (createObj.Transportstr != '') {
  300. createListContainer.value.push(createObj.Transportstr)
  301. }
  302. if (createObj.Timestr != '') {
  303. createListContainer.value.push(createObj.Timestr)
  304. }
  305. savesubscribeobj.shipment_details = createListContainer.value.join(';\n')
  306. }
  307. const changecheckCreateRulesDeparture = (val: any, value: any) => {
  308. createListDeparture.value = []
  309. createObj.Transportstr = val
  310. if (createObj.Transportstr != '') {
  311. createListDeparture.value.push(createObj.Transportstr)
  312. }
  313. if (createObj.Timestr != '') {
  314. createListDeparture.value.push(createObj.Timestr)
  315. }
  316. savesubscribeobj.shipment_transport_mode = value
  317. savesubscribeobj.shipment_details = createListDeparture.value.join(';\n')
  318. }
  319. const ChangeCheckTimeRulesDeparture = (val: any, time: any) => {
  320. createListDeparture.value = []
  321. createObj.Timestr = val
  322. if (val.includes('ETD')) {
  323. savesubscribeobj.shipment_etd_limit = time
  324. savesubscribeobj.shipment_eta_limit = ''
  325. }
  326. if (val.includes('ETA')) {
  327. savesubscribeobj.shipment_eta_limit = time
  328. savesubscribeobj.shipment_etd_limit = ''
  329. }
  330. if (createObj.Transportstr != '') {
  331. createListDeparture.value.push(createObj.Transportstr)
  332. }
  333. if (createObj.Timestr != '') {
  334. createListDeparture.value.push(createObj.Timestr)
  335. }
  336. savesubscribeobj.shipment_details = createListDeparture.value.join(';\n')
  337. }
  338. const changecheckCreateRulesETDChange = (val: any, value: any) => {
  339. createListETDChange.value = []
  340. createObj.Transportstr = val
  341. if (createObj.Transportstr != '') {
  342. createListETDChange.value.push(createObj.Transportstr)
  343. }
  344. if (createObj.Timestr != '') {
  345. createListETDChange.value.push(createObj.Timestr)
  346. }
  347. savesubscribeobj.shipment_transport_mode = value
  348. savesubscribeobj.shipment_details = createListETDChange.value.join(';\n')
  349. }
  350. const ChangeCheckTimeRulesETDChange = (val: any, time: any) => {
  351. createListETDChange.value = []
  352. createObj.Timestr = val
  353. if (val.includes('ETD')) {
  354. savesubscribeobj.shipment_etd_limit = time
  355. savesubscribeobj.shipment_eta_limit = ''
  356. }
  357. if (val.includes('ETA')) {
  358. savesubscribeobj.shipment_eta_limit = time
  359. savesubscribeobj.shipment_etd_limit = ''
  360. }
  361. if (createObj.Transportstr != '') {
  362. createListETDChange.value.push(createObj.Transportstr)
  363. }
  364. if (createObj.Timestr != '') {
  365. createListETDChange.value.push(createObj.Timestr)
  366. }
  367. savesubscribeobj.shipment_details = createListETDChange.value.join(';\n')
  368. }
  369. // 删除create tag
  370. const ShipmentRangeRef = ref()
  371. const handleCloseCreateRule = (val: any) => {
  372. if (val.indexOf('ETD') != -1 || val.indexOf('ETA') != -1) {
  373. createObj.Timestr = ''
  374. } else if (val.indexOf('Transport') != -1) {
  375. createObj.Transportstr = ''
  376. }
  377. ShipmentRangeRef.value.handleCloseCreateRule(val)
  378. }
  379. // 更改Frequency时间
  380. const MilFrequencyList = ref([])
  381. const ChangeMilFrequency = (val: any, type: any) => {
  382. MilFrequencyList.value = val
  383. savesubscribeobj = { ...savesubscribeobj, ...type }
  384. }
  385. const ConFrequencyList = ref([])
  386. const ChangeConFrequency = (val: any, type: any) => {
  387. ConFrequencyList.value = val
  388. savesubscribeobj = { ...savesubscribeobj, ...type }
  389. }
  390. const DepFrequencyList = ref([])
  391. const ChangeDepFrequency = (val: any, type: any) => {
  392. DepFrequencyList.value = val
  393. savesubscribeobj = { ...savesubscribeobj, ...type }
  394. }
  395. const ETDFrequencyList = ref([])
  396. const ChangeETDFrequency = (val: any, type: any) => {
  397. ETDFrequencyList.value = val
  398. savesubscribeobj = { ...savesubscribeobj, ...type }
  399. }
  400. // 删除 Frequency tag
  401. const NotiFrequencyDeleteMil = ref()
  402. const NotiFrequencyDeleteCon = ref()
  403. const NotiFrequencyDeleteDep = ref()
  404. const NotiFrequencyDeleteETD = ref()
  405. const handleCloseRadio = (val: any) => {
  406. if (val == 'Mil') {
  407. NotiFrequencyDeleteMil.value.handleCloseRadioFrequency()
  408. } else if (val == 'Con') {
  409. NotiFrequencyDeleteCon.value.handleCloseRadioFrequency()
  410. } else if (val == 'Dep') {
  411. NotiFrequencyDeleteDep.value.handleCloseRadioFrequency()
  412. } else {
  413. NotiFrequencyDeleteETD.value.handleCloseRadioFrequency()
  414. }
  415. }
  416. // methods 切换
  417. const MilMethodsList = ref([])
  418. const ChangeMethodsAddMil = (val: any, type: any) => {
  419. MilMethodsList.value = val
  420. savesubscribeobj = { ...savesubscribeobj, ...type }
  421. }
  422. const ConMethodsList = ref([])
  423. const ChangeMethodsAddCon = (val: any, type: any) => {
  424. ConMethodsList.value = val
  425. savesubscribeobj = { ...savesubscribeobj, ...type }
  426. }
  427. const DepMethodsList = ref([])
  428. const ChangeMethodsAddDep = (val: any, type: any) => {
  429. DepMethodsList.value = val
  430. savesubscribeobj = { ...savesubscribeobj, ...type }
  431. }
  432. const ETDMethodsList = ref([])
  433. const ChangeMethodsAddETD = (val: any, type: any) => {
  434. ETDMethodsList.value = val
  435. savesubscribeobj = { ...savesubscribeobj, ...type }
  436. }
  437. const OceanDelayed = ref()
  438. const AirDelayed = ref()
  439. const handleCloseDelayed = (val: any) => {
  440. OceanDelayed.value.closeDelayed(val)
  441. }
  442. const handleCloseAirDelayed = (val: any) => {
  443. AirDelayed.value.closeDelayed(val)
  444. }
  445. // ETD Change
  446. const ChangeETDOceanRules = (val: any) => {
  447. ETDOceanList.value = []
  448. if (val.ETD != '') {
  449. if (val.ETD.indexOf('≥') != -1) {
  450. savesubscribeobj.ocean_etd_change = false
  451. savesubscribeobj.ocean_etd_old_sub_new = val.ETD.split(' ')[6]
  452. savesubscribeobj.ocean_etd_old_sub_new_unit = val.ETD.split(' ')[7]
  453. } else {
  454. savesubscribeobj.ocean_etd_change = true
  455. }
  456. ETDOceanList.value.push(val.ETD)
  457. } else {
  458. delete savesubscribeobj.ocean_etd_change
  459. delete savesubscribeobj.ocean_etd_old_sub_new
  460. delete savesubscribeobj.ocean_etd_old_sub_new_unit
  461. }
  462. if (val.ETA != '') {
  463. if (val.ETA.indexOf('≥') != -1) {
  464. savesubscribeobj.ocean_eta_change = false
  465. savesubscribeobj.ocean_eta_old_sub_new = val.ETA.split(' ')[6]
  466. savesubscribeobj.ocean_eta_old_sub_new_unit = val.ETA.split(' ')[7]
  467. } else {
  468. savesubscribeobj.ocean_eta_change = true
  469. }
  470. ETDOceanList.value.push(val.ETA)
  471. } else {
  472. delete savesubscribeobj.ocean_eta_change
  473. delete savesubscribeobj.ocean_eta_old_sub_new
  474. delete savesubscribeobj.ocean_eta_old_sub_new_unit
  475. }
  476. }
  477. // 删除ETD tag
  478. const OceanETD = ref()
  479. const closeOceanETD = (val: any) => {
  480. OceanETD.value.closeETD(val)
  481. }
  482. // ETA Change
  483. const ChangeETDAirRules = (val: any) => {
  484. ETDAirList.value = []
  485. if (val.ETD != '') {
  486. if (val.ETD.indexOf('≥') != -1) {
  487. savesubscribeobj.air_etd_change = false
  488. savesubscribeobj.air_etd_old_sub_new = val.ETD.split(' ')[6]
  489. savesubscribeobj.air_etd_old_sub_new_unit = val.ETD.split(' ')[7]
  490. } else {
  491. savesubscribeobj.air_etd_change = true
  492. }
  493. ETDAirList.value.push(val.ETD)
  494. } else {
  495. delete savesubscribeobj.air_etd_change
  496. delete savesubscribeobj.air_etd_old_sub_new
  497. delete savesubscribeobj.air_etd_old_sub_new_unit
  498. }
  499. if (val.ETA != '') {
  500. if (val.ETA.indexOf('≥') != -1) {
  501. savesubscribeobj.air_eta_change = false
  502. savesubscribeobj.air_eta_old_sub_new = val.ETA.split(' ')[6]
  503. savesubscribeobj.air_eta_old_sub_new_unit = val.ETA.split(' ')[7]
  504. } else {
  505. savesubscribeobj.air_eta_change = true
  506. }
  507. ETDAirList.value.push(val.ETA)
  508. } else {
  509. delete savesubscribeobj.air_eta_change
  510. delete savesubscribeobj.air_eta_old_sub_new
  511. delete savesubscribeobj.air_eta_old_sub_new_unit
  512. }
  513. }
  514. // 删除ETA tag
  515. const AirETD = ref()
  516. const closeAirETD = (val: any) => {
  517. AirETD.value.closeETD(val)
  518. }
  519. // 保存subscribe配置
  520. const missingmessage = ref('')
  521. // 保存成功调用接口
  522. const SaveSuceessful = () => {
  523. $api
  524. .MonitoringSave({
  525. ...savesubscribeobj,
  526. is_similar_rule: false,
  527. id: editTableidtwo.value
  528. })
  529. .then((res: any) => {
  530. if (res.code === 200) {
  531. console.log(res.data)
  532. if(res.data.msg == 'Update Successful') {
  533. SaveedVisible.value = true
  534. setTimeout(() => {
  535. SaveedVisible.value = false
  536. sessionStorage.setItem('activeTab', 'Monitoring Settings')
  537. router.push({
  538. path: '/SystemSettings',
  539. query: {}
  540. })
  541. }, 3000)
  542. } else if(res.data.msg == 'Similar Rule Detected') {
  543. SaveVisibleDetected.value = true
  544. } else if(res.data.msg == 'Unable to Save')
  545. SaveVisibleError.value = true
  546. }
  547. })
  548. }
  549. const HandelSaveVisibleDetected = () => {
  550. SaveVisibleDetected.value = false
  551. $api
  552. .MonitoringSave({
  553. ...savesubscribeobj,
  554. is_similar_rule: true,
  555. id: editTableidtwo.value
  556. })
  557. .then((res: any) => {
  558. if (res.code === 200) {
  559. SaveedVisible.value = true
  560. setTimeout(() => {
  561. SaveedVisible.value = false
  562. sessionStorage.setItem('activeTab', 'Monitoring Settings')
  563. router.push({
  564. path: '/SystemSettings',
  565. query: {}
  566. })
  567. }, 3000)
  568. }
  569. })
  570. }
  571. const Savesubscribe = () => {
  572. missingmessage.value = ''
  573. let str = ''
  574. if (props.TitleType == 'Milestone') {
  575. savesubscribeobj.rules_type = 'Milestone_Update'
  576. if (
  577. OceanCheckList.value == undefined ||
  578. AirCheckList.value == undefined ||
  579. MilFrequencyList.value.length == 0 ||
  580. MilMethodsList.value.length == 0 ||
  581. createObj.Transportstr == '' ||
  582. createObj.Timestr == ''
  583. ) {
  584. if (createObj.Transportstr == '') {
  585. missingmessage.value += 'Transport Mode, '
  586. }
  587. if (createObj.Timestr == '') {
  588. missingmessage.value += 'Time, '
  589. }
  590. if (OceanCheckList.value == undefined) {
  591. missingmessage.value += 'Ocean Shipments, '
  592. }
  593. if (AirCheckList.value == undefined) {
  594. missingmessage.value += 'Air Shipments, '
  595. }
  596. if (MilFrequencyList.value.length == 0) {
  597. missingmessage.value += 'Notification Frequency, '
  598. }
  599. if (MilMethodsList.value.length == 0) {
  600. missingmessage.value += 'Notification Method, '
  601. }
  602. missingmessage.value = missingmessage.value.substring(0, missingmessage.value.length - 2)
  603. UnableSaveVisible.value = true
  604. } else {
  605. savesubscribeobj.ocean_milestone = OceanCheckListCode.value
  606. savesubscribeobj.air_milestone = AirCheckListCode.value
  607. str =
  608. 'Ocean Milestones: ' +
  609. OceanCheckList.value.join(',') +
  610. ';\nAir Milestones: ' +
  611. AirCheckList.value.join(',') +
  612. ';'
  613. savesubscribeobj.event_details = str
  614. SaveSuceessful()
  615. }
  616. } else if (props.TitleType == 'Container') {
  617. savesubscribeobj.rules_type = 'Container_Status_Update'
  618. if (
  619. ContainerOceanList.value == undefined ||
  620. ConFrequencyList.value.length == 0 ||
  621. ConMethodsList.value.length == 0
  622. ) {
  623. if (ContainerOceanList.value == undefined) {
  624. missingmessage.value += 'Ocean Shipments, '
  625. }
  626. if (ConFrequencyList.value.length == 0) {
  627. missingmessage.value += 'Notification Frequency, '
  628. }
  629. if (ConMethodsList.value.length == 0) {
  630. missingmessage.value += 'Notification Method, '
  631. }
  632. missingmessage.value = missingmessage.value.substring(0, missingmessage.value.length - 2)
  633. UnableSaveVisible.value = true
  634. } else {
  635. savesubscribeobj.ocean_ctnr_status = ContainerOceanList.value
  636. str = 'Ocean Container: ' + ContainerOceanList.value.join(',')
  637. savesubscribeobj.event_details = str
  638. SaveSuceessful()
  639. }
  640. } else if (props.TitleType == 'Departure') {
  641. savesubscribeobj.rules_type = 'Departure/Arrival_Delay'
  642. if (
  643. DelayedDeparturedList.value == undefined ||
  644. DelayedAirdList.value == undefined ||
  645. DepFrequencyList.value.length == 0 ||
  646. DepMethodsList.value.length == 0
  647. ) {
  648. if (DelayedDeparturedList.value == undefined) {
  649. missingmessage.value += 'Ocean Shipments, '
  650. }
  651. if (DelayedAirdList.value == undefined) {
  652. missingmessage.value += 'Air Shipments, '
  653. }
  654. if (DepFrequencyList.value.length == 0) {
  655. missingmessage.value += 'Notification Frequency, '
  656. }
  657. if (DepMethodsList.value.length == 0) {
  658. missingmessage.value += 'Notification Method, '
  659. }
  660. missingmessage.value = missingmessage.value.substring(0, missingmessage.value.length - 2)
  661. UnableSaveVisible.value = true
  662. } else {
  663. str = DelayedDeparturedList.value.join(';\n') + ';\n' + DelayedAirdList.value.join(';\n')
  664. savesubscribeobj.event_details = str
  665. SaveSuceessful()
  666. }
  667. } else {
  668. savesubscribeobj.rules_type = 'ETD/ETA_Change'
  669. if (
  670. ETDOceanList.value == undefined ||
  671. ETDOceanList.value.length == 0 ||
  672. ETDAirList.value == undefined ||
  673. ETDAirList.value.length == 0 ||
  674. ETDFrequencyList.value.length == 0 ||
  675. ETDMethodsList.value.length == 0
  676. ) {
  677. if (ETDOceanList.value == undefined) {
  678. missingmessage.value += 'Ocean Shipments, '
  679. }
  680. if (ETDAirList.value == undefined) {
  681. missingmessage.value += 'Air Shipments, '
  682. }
  683. if (ETDFrequencyList.value.length == 0) {
  684. missingmessage.value += 'Notification Frequency, '
  685. }
  686. if (ETDMethodsList.value.length == 0) {
  687. missingmessage.value += 'Notification Method, '
  688. }
  689. missingmessage.value = missingmessage.value.substring(0, missingmessage.value.length - 2)
  690. UnableSaveVisible.value = true
  691. } else {
  692. str = ETDOceanList.value.join(';\n') + ';\n' + ETDAirList.value.join(';\n')
  693. savesubscribeobj.event_details = str
  694. SaveSuceessful()
  695. }
  696. }
  697. }
  698. // 删除表格数据后清空所有数据
  699. const clearData = (val: any) => {
  700. if (val == 'Milestone') {
  701. OceanCheckList.value = []
  702. AirCheckList.value = []
  703. MilFrequencyList.value = []
  704. MilMethodsList.value = []
  705. MilestoneOceanListChecked.value = []
  706. MilestoneAirListChecked.value = []
  707. createListMilestone.value = []
  708. } else if (val == 'Container') {
  709. ContainerOceanList.value = []
  710. createListContainer.value = []
  711. ConFrequencyList.value = []
  712. ConMethodsList.value = []
  713. ContainerOceanListChecked.value = []
  714. } else if (val == 'Departure') {
  715. DelayedDeparturedList.value = []
  716. DelayedAirdList.value = []
  717. DepFrequencyList.value = []
  718. DepMethodsList.value = []
  719. createListDeparture.value = []
  720. } else {
  721. ETDOceanList.value = []
  722. ETDAirList.value = []
  723. ETDFrequencyList.value = []
  724. ETDMethodsList.value = []
  725. createListETDChange.value = []
  726. }
  727. }
  728. defineExpose({
  729. clearData,
  730. Savesubscribe,
  731. Initdata
  732. })
  733. </script>
  734. <template>
  735. <div class="Rules_flex">
  736. <div class="Rules_left">
  737. <div class="Rules_collapse">
  738. <el-collapse v-model="RulesActive" @change="IsFourActive = !IsFourActive">
  739. <el-collapse-item name="ShipmentRange">
  740. <template #title>
  741. <div class="Rules_Title">
  742. <span class="iconfont_icon icon_dark">
  743. <svg class="iconfont" aria-hidden="true">
  744. <use
  745. :xlink:href="IsFourActive ? '#icon-icon_dropdown_b' : '#icon-icon_up_b'"
  746. ></use>
  747. </svg>
  748. </span>
  749. <span class="stars_red">*</span>Shipment Range
  750. </div>
  751. </template>
  752. <div>
  753. <ShipmentRange
  754. ref="ShipmentRangeRef"
  755. v-if="props.TitleType == 'Milestone'"
  756. :ShipmentRangeData="ShipmentRangeMil"
  757. @ChangeCheckRules="changecheckCreateRulesMilestone"
  758. @ChangeCheckTimeRules="ChangeCheckTimeRulesMilestone"
  759. ></ShipmentRange>
  760. <ShipmentRange
  761. ref="ShipmentRangeRef"
  762. v-if="props.TitleType == 'Container'"
  763. :ShipmentRangeData="ShipmentRangeCon"
  764. @ChangeCheckRules="changecheckCreateRulesContainer"
  765. @ChangeCheckTimeRules="ChangeCheckTimeRulesContainer"
  766. ></ShipmentRange>
  767. <ShipmentRange
  768. ref="ShipmentRangeRef"
  769. v-if="props.TitleType == 'Departure'"
  770. :ShipmentRangeData="ShipmentRangeDep"
  771. @ChangeCheckRules="changecheckCreateRulesDeparture"
  772. @ChangeCheckTimeRules="ChangeCheckTimeRulesDeparture"
  773. ></ShipmentRange>
  774. <ShipmentRange
  775. ref="ShipmentRangeRef"
  776. v-if="props.TitleType == 'ETDChange'"
  777. :ShipmentRangeData="ShipmentRangeETD"
  778. @ChangeCheckRules="changecheckCreateRulesETDChange"
  779. @ChangeCheckTimeRules="ChangeCheckTimeRulesETDChange"
  780. ></ShipmentRange>
  781. </div>
  782. </el-collapse-item>
  783. </el-collapse>
  784. <el-collapse
  785. v-model="RulesActive"
  786. @change="IsFirstActive = !IsFirstActive"
  787. v-if="props.TitleType == 'Milestone'"
  788. >
  789. <el-collapse-item name="SelectMilestone">
  790. <template #title>
  791. <div class="Rules_Title">
  792. <span class="iconfont_icon icon_dark">
  793. <svg class="iconfont" aria-hidden="true">
  794. <use
  795. :xlink:href="IsFirstActive ? '#icon-icon_dropdown_b' : '#icon-icon_up_b'"
  796. ></use>
  797. </svg>
  798. </span>
  799. <span class="stars_red">*</span>Select Milestone
  800. </div>
  801. </template>
  802. <div>
  803. <RulesShipments
  804. Title="Ocean shipments"
  805. @ChangeCheckRules="ChangeCheckOceanRules"
  806. :CheckboxList="MilestoneOceanListInit"
  807. :CheckedList="MilestoneOceanListChecked"
  808. ></RulesShipments>
  809. </div>
  810. <div>
  811. <RulesShipments
  812. Title="Air shipments"
  813. @ChangeCheckRules="ChangeCheckAirRules"
  814. :CheckboxList="MilestoneAirListInit"
  815. :CheckedList="MilestoneAirListChecked"
  816. ></RulesShipments>
  817. </div>
  818. </el-collapse-item>
  819. </el-collapse>
  820. <el-collapse
  821. v-model="RulesActive"
  822. @change="IsFirstActive = !IsFirstActive"
  823. v-if="props.TitleType == 'Container'"
  824. >
  825. <el-collapse-item name="SelectMilestone">
  826. <template #title>
  827. <div class="Rules_Title">
  828. <span class="iconfont_icon icon_dark">
  829. <svg class="iconfont" aria-hidden="true">
  830. <use
  831. :xlink:href="IsFirstActive ? '#icon-icon_dropdown_b' : '#icon-icon_up_b'"
  832. ></use>
  833. </svg>
  834. </span>
  835. <span class="stars_red">*</span>Select Container Status
  836. </div>
  837. </template>
  838. <div>
  839. <RulesShipments
  840. Title="Ocean shipments"
  841. @ChangeCheckRules="ChangeContainerRules"
  842. :CheckboxList="ContainerOceanListInit"
  843. :CheckedList="ContainerOceanListChecked"
  844. ></RulesShipments>
  845. </div>
  846. </el-collapse-item>
  847. </el-collapse>
  848. <el-collapse
  849. v-model="RulesActive"
  850. @change="IsFirstActive = !IsFirstActive"
  851. v-if="props.TitleType == 'Departure'"
  852. >
  853. <el-collapse-item name="SelectMilestone">
  854. <template #title>
  855. <div class="Rules_Title">
  856. <span class="iconfont_icon icon_dark">
  857. <svg class="iconfont" aria-hidden="true">
  858. <use
  859. :xlink:href="IsFirstActive ? '#icon-icon_dropdown_b' : '#icon-icon_up_b'"
  860. ></use>
  861. </svg>
  862. </span>
  863. <span class="stars_red">*</span>Select Delayed Type
  864. </div>
  865. </template>
  866. <div>
  867. <DelayedType
  868. Title="Ocean shipments"
  869. ref="OceanDelayed"
  870. :DelayedData="DelayedDataInit"
  871. @ChangeCheckRules="ChangeDeayedRules"
  872. ></DelayedType>
  873. </div>
  874. <div>
  875. <DelayedType
  876. Title="Air shipments"
  877. ref="AirDelayed"
  878. :DelayedData="DelayedDataInitAir"
  879. @ChangeCheckRules="ChangeAirRules"
  880. ></DelayedType>
  881. </div>
  882. </el-collapse-item>
  883. </el-collapse>
  884. <el-collapse
  885. v-model="RulesActive"
  886. @change="IsFirstActive = !IsFirstActive"
  887. v-if="props.TitleType == 'ETDChange'"
  888. >
  889. <el-collapse-item name="SelectMilestone">
  890. <template #title>
  891. <div class="Rules_Title">
  892. <span class="iconfont_icon icon_dark">
  893. <svg class="iconfont" aria-hidden="true">
  894. <use
  895. :xlink:href="IsFirstActive ? '#icon-icon_dropdown_b' : '#icon-icon_up_b'"
  896. ></use>
  897. </svg>
  898. </span>
  899. <span class="stars_red">*</span>Select Delayed Type
  900. </div>
  901. </template>
  902. <div>
  903. <ETDShipments
  904. Title="Ocean shipments"
  905. ref="OceanETD"
  906. :ETDData="OceanETDInit"
  907. @ChangeCheckRules="ChangeETDOceanRules"
  908. ></ETDShipments>
  909. </div>
  910. <div>
  911. <ETDShipments
  912. Title="Air shipments"
  913. ref="AirETD"
  914. :ETDData="AirETDInit"
  915. @ChangeCheckRules="ChangeETDAirRules"
  916. ></ETDShipments>
  917. </div>
  918. </el-collapse-item>
  919. </el-collapse>
  920. <el-collapse
  921. style="margin-top: 17px; margin-right: 16px"
  922. v-model="RulesActive"
  923. @change="IsTwoActive = !IsTwoActive"
  924. >
  925. <el-collapse-item name="NotificationFrequency">
  926. <template #title>
  927. <div class="Rules_Title">
  928. <span class="iconfont_icon icon_dark">
  929. <svg class="iconfont" aria-hidden="true">
  930. <use
  931. :xlink:href="IsTwoActive ? '#icon-icon_dropdown_b' : '#icon-icon_up_b'"
  932. ></use>
  933. </svg>
  934. </span>
  935. <span class="stars_red">*</span>Notification Frequency
  936. </div>
  937. </template>
  938. <NotiFrequency
  939. v-if="props.TitleType == 'Milestone'"
  940. ref="NotiFrequencyDeleteMil"
  941. :FrequencyData="FrequencyDataMil"
  942. @ChangeFrequencyAdd="ChangeMilFrequency"
  943. ></NotiFrequency>
  944. <NotiFrequency
  945. v-if="props.TitleType == 'Container'"
  946. ref="NotiFrequencyDeleteCon"
  947. :FrequencyData="FrequencyDataCon"
  948. @ChangeFrequencyAdd="ChangeConFrequency"
  949. ></NotiFrequency>
  950. <NotiFrequency
  951. v-if="props.TitleType == 'Departure'"
  952. ref="NotiFrequencyDeleteDep"
  953. :FrequencyData="FrequencyDataDep"
  954. @ChangeFrequencyAdd="ChangeDepFrequency"
  955. ></NotiFrequency>
  956. <NotiFrequency
  957. v-if="props.TitleType == 'ETDChange'"
  958. ref="NotiFrequencyDeleteETD"
  959. :FrequencyData="FrequencyDataETD"
  960. @ChangeFrequencyAdd="ChangeETDFrequency"
  961. ></NotiFrequency>
  962. </el-collapse-item>
  963. </el-collapse>
  964. <el-collapse
  965. style="margin: 17px 0"
  966. v-model="RulesActive"
  967. @change="IsThreeActive = !IsThreeActive"
  968. >
  969. <el-collapse-item name="NotificationMethod">
  970. <template #title>
  971. <div class="Rules_Title">
  972. <span class="iconfont_icon icon_dark">
  973. <svg class="iconfont" aria-hidden="true">
  974. <use
  975. :xlink:href="IsThreeActive ? '#icon-icon_dropdown_b' : '#icon-icon_up_b'"
  976. ></use>
  977. </svg>
  978. </span>
  979. <span class="stars_red">*</span>Notification Method
  980. </div>
  981. </template>
  982. <NotiMethods
  983. v-if="props.TitleType == 'Milestone'"
  984. :MethodsData="MethodsDataMil"
  985. @ChangeMethodsAdd="ChangeMethodsAddMil"
  986. ></NotiMethods>
  987. <NotiMethods
  988. v-if="props.TitleType == 'Container'"
  989. :MethodsData="MethodsDataCon"
  990. @ChangeMethodsAdd="ChangeMethodsAddCon"
  991. ></NotiMethods>
  992. <NotiMethods
  993. v-if="props.TitleType == 'Departure'"
  994. :MethodsData="MethodsDataDep"
  995. @ChangeMethodsAdd="ChangeMethodsAddDep"
  996. ></NotiMethods>
  997. <NotiMethods
  998. v-if="props.TitleType == 'ETDChange'"
  999. :MethodsData="MethodsDataETD"
  1000. @ChangeMethodsAdd="ChangeMethodsAddETD"
  1001. ></NotiMethods>
  1002. </el-collapse-item>
  1003. </el-collapse>
  1004. </div>
  1005. </div>
  1006. <div class="Rules_right">
  1007. <div class="right_Title">Added Rules</div>
  1008. <AddedrluesTag
  1009. v-if="props.TitleType == 'Milestone'"
  1010. :CheckedList="createListMilestone"
  1011. Title="Shipment Range"
  1012. @handleCloseRadio="handleCloseCreateRule"
  1013. ></AddedrluesTag>
  1014. <AddedrluesTag
  1015. v-if="props.TitleType == 'Container'"
  1016. :CheckedList="createListContainer"
  1017. Title="Shipment Range"
  1018. @handleCloseRadio="handleCloseCreateRule"
  1019. ></AddedrluesTag>
  1020. <AddedrluesTag
  1021. v-if="props.TitleType == 'Departure'"
  1022. :CheckedList="createListDeparture"
  1023. Title="Shipment Range"
  1024. @handleCloseRadio="handleCloseCreateRule"
  1025. ></AddedrluesTag>
  1026. <AddedrluesTag
  1027. v-if="props.TitleType == 'ETDChange'"
  1028. :CheckedList="createListETDChange"
  1029. Title="Shipment Range"
  1030. @handleCloseRadio="handleCloseCreateRule"
  1031. ></AddedrluesTag>
  1032. <AddedrluesTag
  1033. :CheckedList="DelayedDeparturedList"
  1034. v-if="props.TitleType == 'Departure'"
  1035. @handleCloseRadio="handleCloseDelayed"
  1036. Title="Ocean Shipments"
  1037. ></AddedrluesTag>
  1038. <AddedrluesTag
  1039. v-if="props.TitleType == 'Milestone'"
  1040. :CheckedList="OceanCheckList"
  1041. Title="Ocean Shipments"
  1042. ></AddedrluesTag>
  1043. <AddedrluesTag
  1044. v-if="props.TitleType == 'Container'"
  1045. :CheckedList="ContainerOceanList"
  1046. Title="Ocean Shipments"
  1047. ></AddedrluesTag>
  1048. <AddedrluesTag
  1049. :CheckedList="ETDOceanList"
  1050. v-if="props.TitleType == 'ETDChange'"
  1051. Title="Ocean Shipments"
  1052. @handleCloseRadio="closeOceanETD"
  1053. ></AddedrluesTag>
  1054. <AddedrluesTag
  1055. :CheckedList="ETDAirList"
  1056. v-if="props.TitleType == 'ETDChange'"
  1057. @handleCloseRadio="closeAirETD"
  1058. Title="Air Shipments"
  1059. ></AddedrluesTag>
  1060. <AddedrluesTag
  1061. :CheckedList="DelayedAirdList"
  1062. v-if="props.TitleType == 'Departure'"
  1063. @handleCloseRadio="handleCloseAirDelayed"
  1064. Title="Air Shipments"
  1065. ></AddedrluesTag>
  1066. <AddedrluesTag
  1067. v-if="props.TitleType == 'Milestone'"
  1068. :CheckedList="AirCheckList"
  1069. Title="Air Shipments"
  1070. ></AddedrluesTag>
  1071. <AddedrluesTag
  1072. v-if="props.TitleType == 'Milestone'"
  1073. :CheckedList="MilFrequencyList"
  1074. Title="Notification Frequency"
  1075. @handleCloseRadio="handleCloseRadio('Mil')"
  1076. ></AddedrluesTag>
  1077. <AddedrluesTag
  1078. v-if="props.TitleType == 'Container'"
  1079. :CheckedList="ConFrequencyList"
  1080. Title="Notification Frequency"
  1081. @handleCloseRadio="handleCloseRadio('Con')"
  1082. ></AddedrluesTag>
  1083. <AddedrluesTag
  1084. v-if="props.TitleType == 'Departure'"
  1085. :CheckedList="DepFrequencyList"
  1086. Title="Notification Frequency"
  1087. @handleCloseRadio="handleCloseRadio('Dep')"
  1088. ></AddedrluesTag>
  1089. <AddedrluesTag
  1090. v-if="props.TitleType == 'ETDChange'"
  1091. :CheckedList="ETDFrequencyList"
  1092. Title="Notification Frequency"
  1093. @handleCloseRadio="handleCloseRadio('ETD')"
  1094. ></AddedrluesTag>
  1095. <AddedrluesTag
  1096. v-if="props.TitleType == 'Milestone'"
  1097. :CheckedList="MilMethodsList"
  1098. Title="Notification Method"
  1099. ></AddedrluesTag>
  1100. <AddedrluesTag
  1101. v-if="props.TitleType == 'Container'"
  1102. :CheckedList="ConMethodsList"
  1103. Title="Notification Method"
  1104. ></AddedrluesTag>
  1105. <AddedrluesTag
  1106. v-if="props.TitleType == 'Departure'"
  1107. :CheckedList="DepMethodsList"
  1108. Title="Notification Method"
  1109. ></AddedrluesTag>
  1110. <AddedrluesTag
  1111. v-if="props.TitleType == 'ETDChange'"
  1112. :CheckedList="ETDMethodsList"
  1113. Title="Notification Method"
  1114. ></AddedrluesTag>
  1115. </div>
  1116. </div>
  1117. <el-dialog v-model="UnableSaveVisible" width="480">
  1118. <div>{{ missingmessage }} missing.</div>
  1119. <div>Please complete all required fields.</div>
  1120. <template #footer>
  1121. <div class="dialog-footer">
  1122. <el-button
  1123. class="el-button--danger"
  1124. @click="UnableSaveVisible = false"
  1125. style="width: 100px"
  1126. >
  1127. OK
  1128. </el-button>
  1129. </div>
  1130. </template>
  1131. <template #header>
  1132. <div class="cancel_header">
  1133. <span class="iconfont_icon iconfont_warning">
  1134. <svg class="iconfont icon_danger" aria-hidden="true">
  1135. <use xlink:href="#icon-icon_fail_fill_b"></use>
  1136. </svg>
  1137. </span>
  1138. Unable to Save
  1139. </div>
  1140. </template>
  1141. </el-dialog>
  1142. <!-- 保存成功 -->
  1143. <el-dialog v-model="SaveedVisible" width="320" style="height: 212px">
  1144. <div style="text-align: center"><el-image :src="submitsucessful" /></div>
  1145. <div style="text-align: center; margin-top: 20px">Saved successfully</div>
  1146. </el-dialog>
  1147. <!-- 保存失败 -->
  1148. <el-dialog v-model="SaveVisibleError" width="480">
  1149. <div>Duplicate Rule Error.</div>
  1150. <div>This rule exactly matches an existing rule.</div>
  1151. <template #footer>
  1152. <div class="dialog-footer">
  1153. <el-button
  1154. class="el-button--danger"
  1155. @click="SaveVisibleError = false"
  1156. style="width: 100px"
  1157. >
  1158. OK
  1159. </el-button>
  1160. </div>
  1161. </template>
  1162. <template #header>
  1163. <div class="cancel_header">
  1164. <span class="iconfont_icon iconfont_warning">
  1165. <svg class="iconfont icon_danger" aria-hidden="true">
  1166. <use xlink:href="#icon-icon_fail_fill_b"></use>
  1167. </svg>
  1168. </span>
  1169. Unable to Save
  1170. </div>
  1171. </template>
  1172. </el-dialog>
  1173. <!-- 三项重合提示 -->
  1174. <el-dialog v-model="SaveVisibleDetected" width="480">
  1175. <div>A similar configuration rule already exists.</div>
  1176. <div>Would you like to proceed with creating this rule?</div>
  1177. <template #footer>
  1178. <div class="dialog-footer">
  1179. <el-button
  1180. class="el-button--default"
  1181. @click="SaveVisibleDetected = false"
  1182. style="width: 100px"
  1183. >
  1184. Cancel
  1185. </el-button>
  1186. <el-button
  1187. class="el-button--warning"
  1188. @click="HandelSaveVisibleDetected"
  1189. style="width: 100px"
  1190. >
  1191. Save
  1192. </el-button>
  1193. </div>
  1194. </template>
  1195. <template #header>
  1196. <div class="cancel_header">
  1197. <span class="iconfont_icon iconfont_warning">
  1198. <svg class="iconfont icon_warning" aria-hidden="true">
  1199. <use xlink:href="#icon-icon_tipsfilled_b"></use>
  1200. </svg>
  1201. </span>
  1202. Similar Rule Detected
  1203. </div>
  1204. </template>
  1205. </el-dialog>
  1206. </template>
  1207. <style lang="scss" scoped>
  1208. .Rules_flex {
  1209. padding: 0 0 0 8px;
  1210. display: flex;
  1211. }
  1212. .Rules_left {
  1213. width: 60%;
  1214. border-right: 1px solid var(--color-user-config-title-bottom-border);
  1215. }
  1216. .Rules_right {
  1217. width: 40%;
  1218. background-color: var(--more-filters-background-color);
  1219. }
  1220. .right_Title {
  1221. color: var(--color-neutral-1);
  1222. padding: 9px 8px;
  1223. font-size: 18px;
  1224. font-weight: 700;
  1225. border-bottom: 1px solid var(--color-user-config-title-bottom-border);
  1226. background-color: var(--color-drawer-body-bg);
  1227. }
  1228. .iconfont {
  1229. width: 16px;
  1230. height: 16px;
  1231. margin-right: 8px;
  1232. }
  1233. .icon_danger {
  1234. fill: var(--color-btn-danger-bg);
  1235. }
  1236. :deep(.Rules_Title) {
  1237. color: var(--color-neutral-1);
  1238. font-size: 14px;
  1239. font-weight: 700;
  1240. height: 22px;
  1241. display: flex;
  1242. align-items: center;
  1243. }
  1244. .stars_red {
  1245. color: var(--color-danger);
  1246. }
  1247. :deep(.el-collapse-item__header) {
  1248. height: 25px !important;
  1249. margin: 14px 0 0 0 !important;
  1250. border: none !important;
  1251. padding: 0 !important;
  1252. }
  1253. :deep(.el-collapse-item__header):hover {
  1254. background-color: var(--color-system-color-bg) !important;
  1255. border: none !important;
  1256. }
  1257. :deep(.el-collapse-item__arrow) {
  1258. width: 0 !important;
  1259. height: 0 !important;
  1260. }
  1261. :deep(.el-icon svg) {
  1262. width: 0 !important;
  1263. }
  1264. :deep(.el-collapse-item__header.is-active) {
  1265. background-color: transparent !important;
  1266. border-color: transparent !important;
  1267. }
  1268. :deep(.el-collapse-item__arrow.is-active) {
  1269. transform: rotate(-180deg) !important;
  1270. }
  1271. :deep(.Ocean_collapse .el-collapse-item__arrow) {
  1272. width: 16px !important;
  1273. height: 16px !important;
  1274. background-image: url('../src/images/icon_expand.png') !important;
  1275. background-size: contain;
  1276. background-repeat: no-repeat;
  1277. transform: rotate(0);
  1278. }
  1279. :deep(.Ocean_collapse .el-collapse-item__header) {
  1280. background-color: var(--color-system-color-bg) !important;
  1281. padding: 0 8px !important;
  1282. height: 40px !important;
  1283. }
  1284. :deep(.Ocean_collapse .el-collapse-item) {
  1285. background-color: var(--color-system-color-bg);
  1286. border-radius: 12px;
  1287. }
  1288. :deep(.Ocean_collapse .el-collapse-item__wrap) {
  1289. padding: 0 8px !important;
  1290. }
  1291. :deep(.Ocean_collapse .el-collapse-item__header.is-active) {
  1292. background-color: var(--color-system-color-bg) !important;
  1293. }
  1294. :deep(.el-checkbox__input.is-checked + .el-checkbox__label) {
  1295. color: var(--color-neutral-1);
  1296. }
  1297. .Rules_buttom {
  1298. padding: 8px;
  1299. border-top: 1px solid var(--color-system-border-1);
  1300. }
  1301. .rules_button {
  1302. width: 100px;
  1303. height: 40px;
  1304. }
  1305. .cancel_header {
  1306. font-size: 18px;
  1307. font-weight: 700;
  1308. color: var(--color-neutral-1);
  1309. display: flex;
  1310. align-items: center;
  1311. }
  1312. .icon_warning {
  1313. width: 22px;
  1314. height: 22px;
  1315. margin-right: 0;
  1316. fill: var(--color-btn-warning-bg);
  1317. }
  1318. .iconfont_warning {
  1319. display: flex;
  1320. align-items: center;
  1321. }
  1322. :deep(header.el-dialog__header) {
  1323. background-color: var(--color-system-body-bg);
  1324. }
  1325. :deep(footer.el-dialog__footer) {
  1326. border-top: none;
  1327. }
  1328. :deep(.el-collapse) {
  1329. margin-right: 8px;
  1330. }
  1331. </style>