|
@@ -7,19 +7,27 @@ interface RuleOption {
|
|
|
label: string;
|
|
label: string;
|
|
|
value: string;
|
|
value: string;
|
|
|
}
|
|
}
|
|
|
|
|
+interface PortOption {
|
|
|
|
|
+ value: string
|
|
|
|
|
+ label: string
|
|
|
|
|
+ checked: boolean
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
interface RuleItem {
|
|
interface RuleItem {
|
|
|
- Priority: string;
|
|
|
|
|
- RuleType: string;
|
|
|
|
|
- AirPort?: string[];
|
|
|
|
|
- Port?: string[];
|
|
|
|
|
- Carrier?: string[];
|
|
|
|
|
- FromDate: string | number;
|
|
|
|
|
- ToDate: string | number;
|
|
|
|
|
|
|
+ priority: string;
|
|
|
|
|
+ rule_type: string;
|
|
|
|
|
+ mode_type: string;
|
|
|
|
|
+ ports?: string[];
|
|
|
|
|
+ carrier?: string[];
|
|
|
|
|
+ PortList?:PortOption[];
|
|
|
|
|
+ CarrierList?:PortOption[];
|
|
|
|
|
+ recommended_delivery_from: string | number;
|
|
|
|
|
+ recommended_delivery_to: string | number;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 定义 RuleItem 中数组字段的类型
|
|
// 定义 RuleItem 中数组字段的类型
|
|
|
-type ArrayFields = 'AirPort' | 'Port' | 'Carrier';
|
|
|
|
|
|
|
+type ArrayFields = 'ports' | 'carrier';
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
Recommendradio: {
|
|
Recommendradio: {
|
|
@@ -52,42 +60,52 @@ const RuleTypeoptions = ref<RuleOption[]>([
|
|
|
// 规则数据
|
|
// 规则数据
|
|
|
const AirContentList = ref<RuleItem[]>([
|
|
const AirContentList = ref<RuleItem[]>([
|
|
|
{
|
|
{
|
|
|
- Priority: 'P1',
|
|
|
|
|
- RuleType: '*Default Rule',
|
|
|
|
|
- AirPort: ['All'],
|
|
|
|
|
- FromDate: '',
|
|
|
|
|
- ToDate: ''
|
|
|
|
|
|
|
+ priority: 'P1',
|
|
|
|
|
+ rule_type: '*Default Rule',
|
|
|
|
|
+ ports: ['All'],
|
|
|
|
|
+ recommended_delivery_from: '',
|
|
|
|
|
+ recommended_delivery_to: '',
|
|
|
|
|
+ mode_type: 'air',
|
|
|
|
|
+ PortList:[]
|
|
|
}
|
|
}
|
|
|
])
|
|
])
|
|
|
const SeaContentList = ref<RuleItem[]>([
|
|
const SeaContentList = ref<RuleItem[]>([
|
|
|
{
|
|
{
|
|
|
- Priority: 'P1',
|
|
|
|
|
- RuleType: '*Default Rule',
|
|
|
|
|
- Port: ['All'],
|
|
|
|
|
- Carrier: ['All'],
|
|
|
|
|
- FromDate: '',
|
|
|
|
|
- ToDate: ''
|
|
|
|
|
|
|
+ priority: 'P1',
|
|
|
|
|
+ rule_type: '*Default Rule',
|
|
|
|
|
+ ports: ['All'],
|
|
|
|
|
+ carrier: ['All'],
|
|
|
|
|
+ recommended_delivery_from: '',
|
|
|
|
|
+ recommended_delivery_to: '',
|
|
|
|
|
+ mode_type: 'sea',
|
|
|
|
|
+ PortList:[],
|
|
|
|
|
+ CarrierList: []
|
|
|
}
|
|
}
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
// 创建规则项的工厂函数
|
|
// 创建规则项的工厂函数
|
|
|
function createRuleItem(type: 'Air' | 'Sea', ruleType: string): RuleItem {
|
|
function createRuleItem(type: 'Air' | 'Sea', ruleType: string): RuleItem {
|
|
|
const baseItem = {
|
|
const baseItem = {
|
|
|
- Priority: 'P1',
|
|
|
|
|
- RuleType: ruleType,
|
|
|
|
|
- FromDate: '',
|
|
|
|
|
- ToDate: ''
|
|
|
|
|
|
|
+ priority: 'P1',
|
|
|
|
|
+ rule_type: ruleType,
|
|
|
|
|
+ recommended_delivery_from: '',
|
|
|
|
|
+ recommended_delivery_to: '',
|
|
|
}
|
|
}
|
|
|
if (type === 'Air') {
|
|
if (type === 'Air') {
|
|
|
return {
|
|
return {
|
|
|
...baseItem,
|
|
...baseItem,
|
|
|
- AirPort: ruleType === '*Default Rule' ? ['All'] : []
|
|
|
|
|
|
|
+ ports: ruleType === '*Default Rule' ? ['All'] : [],
|
|
|
|
|
+ mode_type: 'air',
|
|
|
|
|
+ PortList: JSON.parse(JSON.stringify(AirPorList.value))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
|
...baseItem,
|
|
...baseItem,
|
|
|
- Port: ruleType === '*Default Rule' ? ['All'] : [],
|
|
|
|
|
- Carrier: ruleType === '*Default Rule' ? ['All'] : []
|
|
|
|
|
|
|
+ ports: ruleType === '*Default Rule' ? ['All'] : [],
|
|
|
|
|
+ carrier: ruleType === '*Default Rule' ? ['All'] : [],
|
|
|
|
|
+ mode_type: 'sea',
|
|
|
|
|
+ PortList: JSON.parse(JSON.stringify(SeaPortList.value)),
|
|
|
|
|
+ CarrierList: JSON.parse(JSON.stringify(SeaCarrierList.value))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -120,7 +138,7 @@ const ChangeFrequency = (val: number) => {
|
|
|
emits('chackchangerecommend', RecommendCheckedList.value, AirContentList.value, SeaContentList.value, Recommendradio.value)
|
|
emits('chackchangerecommend', RecommendCheckedList.value, AirContentList.value, SeaContentList.value, Recommendradio.value)
|
|
|
}
|
|
}
|
|
|
// 修复后的 handleInput 函数
|
|
// 修复后的 handleInput 函数
|
|
|
-const handleInput = (val: string, index: number, type: 'FromDate' | 'ToDate', list: RuleItem[]) => {
|
|
|
|
|
|
|
+const handleInput = (val: string, index: number, type: 'recommended_delivery_from' | 'recommended_delivery_to', list: RuleItem[]) => {
|
|
|
// 移除非数字字符
|
|
// 移除非数字字符
|
|
|
const numStr = val.replace(/[^\d]/g, '');
|
|
const numStr = val.replace(/[^\d]/g, '');
|
|
|
// 转换为整数,处理NaN情况
|
|
// 转换为整数,处理NaN情况
|
|
@@ -147,7 +165,7 @@ const handleDelete = (index: number, list: RuleItem[], type: 'Air' | 'Sea') => {
|
|
|
// 添加数据
|
|
// 添加数据
|
|
|
const AddRuleItem = (list: RuleItem[], type: 'Air' | 'Sea') => {
|
|
const AddRuleItem = (list: RuleItem[], type: 'Air' | 'Sea') => {
|
|
|
// 检查是否已存在默认规则
|
|
// 检查是否已存在默认规则
|
|
|
- const hasDefaultRule = list.some(item => item.RuleType === '*Default Rule')
|
|
|
|
|
|
|
+ const hasDefaultRule = list.some(item => item.rule_type === '*Default Rule')
|
|
|
// 如果已经有默认规则,则创建特定规则
|
|
// 如果已经有默认规则,则创建特定规则
|
|
|
const ruleType = hasDefaultRule ? 'Specific Rule' : '*Default Rule'
|
|
const ruleType = hasDefaultRule ? 'Specific Rule' : '*Default Rule'
|
|
|
list.push(createRuleItem(type, ruleType))
|
|
list.push(createRuleItem(type, ruleType))
|
|
@@ -164,12 +182,12 @@ const updateListPriorities = (list: RuleItem[], type: 'Air' | 'Sea') => {
|
|
|
const length = list.length
|
|
const length = list.length
|
|
|
// 保护默认规则的数据
|
|
// 保护默认规则的数据
|
|
|
list.forEach(item => {
|
|
list.forEach(item => {
|
|
|
- if (item.RuleType === '*Default Rule') {
|
|
|
|
|
|
|
+ if (item.rule_type === '*Default Rule') {
|
|
|
if (type === 'Air') {
|
|
if (type === 'Air') {
|
|
|
- item.AirPort = ['All']
|
|
|
|
|
|
|
+ item.ports = ['All']
|
|
|
} else {
|
|
} else {
|
|
|
- item.Port = ['All']
|
|
|
|
|
- item.Carrier = ['All']
|
|
|
|
|
|
|
+ item.ports = ['All']
|
|
|
|
|
+ item.carrier = ['All']
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -183,38 +201,38 @@ const updateListPriorities = (list: RuleItem[], type: 'Air' | 'Sea') => {
|
|
|
}
|
|
}
|
|
|
// 处理长度为1
|
|
// 处理长度为1
|
|
|
const handleLengthOne = (list: RuleItem[], type: string) => {
|
|
const handleLengthOne = (list: RuleItem[], type: string) => {
|
|
|
- list.forEach(item => item.Priority = 'P1')
|
|
|
|
|
|
|
+ list.forEach(item => item.priority = 'P1')
|
|
|
};
|
|
};
|
|
|
// 处理长度为2
|
|
// 处理长度为2
|
|
|
const handleLengthTwo = (list: RuleItem[], type: string) => {
|
|
const handleLengthTwo = (list: RuleItem[], type: string) => {
|
|
|
- const types = new Set(list.map(i => i.RuleType))
|
|
|
|
|
|
|
+ const types = new Set(list.map(i => i.rule_type))
|
|
|
// 两个都是 *Default Rule
|
|
// 两个都是 *Default Rule
|
|
|
if (types.size === 1 && types.has('*Default Rule')) {
|
|
if (types.size === 1 && types.has('*Default Rule')) {
|
|
|
- list.forEach(item => item.Priority = 'P1')
|
|
|
|
|
|
|
+ list.forEach(item => item.priority = 'P1')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
// 包含 *Default Rule 和其他类型
|
|
// 包含 *Default Rule 和其他类型
|
|
|
if (types.has('*Default Rule')) {
|
|
if (types.has('*Default Rule')) {
|
|
|
list.forEach(item => {
|
|
list.forEach(item => {
|
|
|
- item.Priority = item.RuleType === '*Default Rule' ? 'P2' : 'P1'
|
|
|
|
|
|
|
+ item.priority = item.rule_type === '*Default Rule' ? 'P2' : 'P1'
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
// 同时存在 Specific Rule 和 Single Dimension
|
|
// 同时存在 Specific Rule 和 Single Dimension
|
|
|
if (types.has('Specific Rule') && types.has('Single Dimension')) {
|
|
if (types.has('Specific Rule') && types.has('Single Dimension')) {
|
|
|
list.forEach(item => {
|
|
list.forEach(item => {
|
|
|
- item.Priority = item.RuleType === 'Specific Rule' ? 'P1' : 'P2'
|
|
|
|
|
|
|
+ item.priority = item.rule_type === 'Specific Rule' ? 'P1' : 'P2'
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
// 其他情况
|
|
// 其他情况
|
|
|
- list.forEach(item => item.Priority = 'P1')
|
|
|
|
|
|
|
+ list.forEach(item => item.priority = 'P1')
|
|
|
};
|
|
};
|
|
|
// 处理长度≥3
|
|
// 处理长度≥3
|
|
|
const handleLengthThreePlus = (list: RuleItem[], type: string) => {
|
|
const handleLengthThreePlus = (list: RuleItem[], type: string) => {
|
|
|
// 统计各类型数量
|
|
// 统计各类型数量
|
|
|
const counts = list.reduce((acc, cur) => {
|
|
const counts = list.reduce((acc, cur) => {
|
|
|
- acc[cur.RuleType] = (acc[cur.RuleType] || 0) + 1
|
|
|
|
|
|
|
+ acc[cur.rule_type] = (acc[cur.rule_type] || 0) + 1
|
|
|
return acc
|
|
return acc
|
|
|
}, {} as Record<string, number>)
|
|
}, {} as Record<string, number>)
|
|
|
// 获取所有存在的类型
|
|
// 获取所有存在的类型
|
|
@@ -231,13 +249,13 @@ const handleLengthThreePlus = (list: RuleItem[], type: string) => {
|
|
|
'*Default Rule': 'P3'
|
|
'*Default Rule': 'P3'
|
|
|
}
|
|
}
|
|
|
list.forEach(item => {
|
|
list.forEach(item => {
|
|
|
- item.Priority = priorityMap[item.RuleType]
|
|
|
|
|
|
|
+ item.priority = priorityMap[item.rule_type]
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
// 全为同一种类型的情况
|
|
// 全为同一种类型的情况
|
|
|
if (existingTypes.length === 1) {
|
|
if (existingTypes.length === 1) {
|
|
|
- list.forEach(item => item.Priority = 'P1')
|
|
|
|
|
|
|
+ list.forEach(item => item.priority = 'P1')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
// 处理 Specific + Default 组合
|
|
// 处理 Specific + Default 组合
|
|
@@ -245,14 +263,14 @@ const handleLengthThreePlus = (list: RuleItem[], type: string) => {
|
|
|
existingTypes.includes('Specific Rule') &&
|
|
existingTypes.includes('Specific Rule') &&
|
|
|
existingTypes.includes('*Default Rule')) {
|
|
existingTypes.includes('*Default Rule')) {
|
|
|
list.forEach(item => {
|
|
list.forEach(item => {
|
|
|
- item.Priority = item.RuleType === 'Specific Rule' ? 'P1' : 'P2'
|
|
|
|
|
|
|
+ item.priority = item.rule_type === 'Specific Rule' ? 'P1' : 'P2'
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
// 存在两个Default Rule
|
|
// 存在两个Default Rule
|
|
|
if (counts['*Default Rule'] === 2 && existingTypes.length === 2) {
|
|
if (counts['*Default Rule'] === 2 && existingTypes.length === 2) {
|
|
|
list.forEach(item => {
|
|
list.forEach(item => {
|
|
|
- item.Priority = item.RuleType === '*Default Rule' ? 'P2' : 'P1'
|
|
|
|
|
|
|
+ item.priority = item.rule_type === '*Default Rule' ? 'P2' : 'P1'
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -261,12 +279,12 @@ const handleLengthThreePlus = (list: RuleItem[], type: string) => {
|
|
|
if (existingTypes.includes('*Default Rule')) {
|
|
if (existingTypes.includes('*Default Rule')) {
|
|
|
// 两个Single + 一个Default
|
|
// 两个Single + 一个Default
|
|
|
list.forEach(item => {
|
|
list.forEach(item => {
|
|
|
- item.Priority = item.RuleType === '*Default Rule' ? 'P2' : 'P1'
|
|
|
|
|
|
|
+ item.priority = item.rule_type === '*Default Rule' ? 'P2' : 'P1'
|
|
|
})
|
|
})
|
|
|
} else if (existingTypes.includes('Specific Rule')) {
|
|
} else if (existingTypes.includes('Specific Rule')) {
|
|
|
// 两个Single + 一个Specific
|
|
// 两个Single + 一个Specific
|
|
|
list.forEach(item => {
|
|
list.forEach(item => {
|
|
|
- item.Priority = item.RuleType === 'Specific Rule' ? 'P1' : 'P2'
|
|
|
|
|
|
|
+ item.priority = item.rule_type === 'Specific Rule' ? 'P1' : 'P2'
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
return
|
|
return
|
|
@@ -278,7 +296,7 @@ const handleLengthThreePlus = (list: RuleItem[], type: string) => {
|
|
|
'*Default Rule': 'P3'
|
|
'*Default Rule': 'P3'
|
|
|
}
|
|
}
|
|
|
list.forEach(item => {
|
|
list.forEach(item => {
|
|
|
- item.Priority = defaultPriorityMap[item.RuleType] || 'P3'
|
|
|
|
|
|
|
+ item.priority = defaultPriorityMap[item.rule_type] || 'P3'
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
// 修复:改变选项值 - 使用类型保护
|
|
// 修复:改变选项值 - 使用类型保护
|
|
@@ -291,20 +309,64 @@ const changeSelectedValue = (val: string[], index: number, field: ArrayFields, l
|
|
|
const changeRuleType = (val: string, index: number, list: RuleItem[]) => {
|
|
const changeRuleType = (val: string, index: number, list: RuleItem[]) => {
|
|
|
const item = list[index]
|
|
const item = list[index]
|
|
|
// 保护默认规则
|
|
// 保护默认规则
|
|
|
- if (item.RuleType === '*Default Rule' && val !== '*Default Rule') {
|
|
|
|
|
|
|
+ if (item.rule_type === '*Default Rule' && val !== '*Default Rule') {
|
|
|
// 从默认规则切换到其他规则时重置选项
|
|
// 从默认规则切换到其他规则时重置选项
|
|
|
- if ('AirPort' in item) item.AirPort = []
|
|
|
|
|
- if ('Port' in item) item.Port = []
|
|
|
|
|
- if ('Carrier' in item) item.Carrier = []
|
|
|
|
|
|
|
+ if ('ports' in item) item.ports = []
|
|
|
|
|
+ if ('carrier' in item) item.carrier = []
|
|
|
} else if (val === '*Default Rule') {
|
|
} else if (val === '*Default Rule') {
|
|
|
// 切换到默认规则时设置默认值
|
|
// 切换到默认规则时设置默认值
|
|
|
- if ('AirPort' in item) item.AirPort = ['All']
|
|
|
|
|
- if ('Port' in item) item.Port = ['All']
|
|
|
|
|
- if ('Carrier' in item) item.Carrier = ['All']
|
|
|
|
|
|
|
+ if ('ports' in item) item.ports = ['All']
|
|
|
|
|
+ if ('carrier' in item) item.carrier = ['All']
|
|
|
}
|
|
}
|
|
|
- item.RuleType = val
|
|
|
|
|
|
|
+ item.rule_type = val
|
|
|
updatePriorities()
|
|
updatePriorities()
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// 获取Air Port/Port/Carrier的值
|
|
|
|
|
+const AirPorList = ref([])
|
|
|
|
|
+const SeaPortList = ref([])
|
|
|
|
|
+const SeaCarrierList = ref([])
|
|
|
|
|
+const getPortList = (type: any) => {
|
|
|
|
|
+ $api.getPortList({
|
|
|
|
|
+ term: '',
|
|
|
|
|
+ mode: type
|
|
|
|
|
+ }).then((res: any) => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ if(type === 'air') {
|
|
|
|
|
+ AirPorList.value = res.data
|
|
|
|
|
+ // 更新现有行的列表
|
|
|
|
|
+ AirContentList.value.forEach(item => {
|
|
|
|
|
+ item.PortList = JSON.parse(JSON.stringify(res.data))
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ if(type === 'sea') {
|
|
|
|
|
+ SeaPortList.value = res.data
|
|
|
|
|
+ // 更新现有行的列表
|
|
|
|
|
+ SeaContentList.value.forEach(item => {
|
|
|
|
|
+ item.PortList = JSON.parse(JSON.stringify(res.data))
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 获取Carrier列表
|
|
|
|
|
+const getCarrierList = () => {
|
|
|
|
|
+ $api.getCarrierList({
|
|
|
|
|
+ term: '',
|
|
|
|
|
+ }).then((res: any) => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ SeaCarrierList.value = res.data
|
|
|
|
|
+ // 更新现有行的列表
|
|
|
|
|
+ SeaContentList.value.forEach(item => {
|
|
|
|
|
+ item.CarrierList = JSON.parse(JSON.stringify(res.data))
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+getPortList('air')
|
|
|
|
|
+getPortList('sea')
|
|
|
|
|
+getCarrierList()
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -323,7 +385,7 @@ const changeRuleType = (val: string, index: number, list: RuleItem[]) => {
|
|
|
</div>
|
|
</div>
|
|
|
<div v-if="isAir" class="radiocheckbox" style="margin-top: 16px">
|
|
<div v-if="isAir" class="radiocheckbox" style="margin-top: 16px">
|
|
|
<div class="AirCoulumn">
|
|
<div class="AirCoulumn">
|
|
|
- <div class="AicoulumnTitile" style="width: 10%;">Priority</div>
|
|
|
|
|
|
|
+ <div class="AicoulumnTitile" style="width: 10%;">priority</div>
|
|
|
<div class="AicoulumnTitile" style="width: 20%;">Rule Type</div>
|
|
<div class="AicoulumnTitile" style="width: 20%;">Rule Type</div>
|
|
|
<div class="AicoulumnTitile" style="width: 40%;">Air Port</div>
|
|
<div class="AicoulumnTitile" style="width: 40%;">Air Port</div>
|
|
|
<div style="display: flex;flex-direction: column;border-right: 1px solid var(--color-system-border);width: 20%;">
|
|
<div style="display: flex;flex-direction: column;border-right: 1px solid var(--color-system-border);width: 20%;">
|
|
@@ -336,11 +398,11 @@ const changeRuleType = (val: string, index: number, list: RuleItem[]) => {
|
|
|
<div class="AirCoumlulnAdd" style="width: 10%;" @click="AddRuleItem(AirContentList, 'Air')">+ Add</div>
|
|
<div class="AirCoumlulnAdd" style="width: 10%;" @click="AddRuleItem(AirContentList, 'Air')">+ Add</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="AirContent" v-for="(item, index) in AirContentList" :key="index">
|
|
<div class="AirContent" v-for="(item, index) in AirContentList" :key="index">
|
|
|
- <div class="AirCoumlumn" style="width: 10%;">{{ item.Priority }}</div>
|
|
|
|
|
|
|
+ <div class="AirCoumlumn" style="width: 10%;">{{ item.priority }}</div>
|
|
|
<div class="AirCoumlumn" style="width: 20%;">
|
|
<div class="AirCoumlumn" style="width: 20%;">
|
|
|
<el-select
|
|
<el-select
|
|
|
- v-model="item.RuleType"
|
|
|
|
|
- :disabled="item.RuleType === '*Default Rule'"
|
|
|
|
|
|
|
+ v-model="item.rule_type"
|
|
|
|
|
+ :disabled="item.rule_type === '*Default Rule'"
|
|
|
style="width: 100%;"
|
|
style="width: 100%;"
|
|
|
@change="val => changeRuleType(val, index, AirContentList)"
|
|
@change="val => changeRuleType(val, index, AirContentList)"
|
|
|
>
|
|
>
|
|
@@ -355,28 +417,30 @@ const changeRuleType = (val: string, index: number, list: RuleItem[]) => {
|
|
|
<div class="AirCoumlumn" style="width: 40%;">
|
|
<div class="AirCoumlumn" style="width: 40%;">
|
|
|
<SelectValue
|
|
<SelectValue
|
|
|
:SelectIndex="index"
|
|
:SelectIndex="index"
|
|
|
- :SelectedValue="item.AirPort"
|
|
|
|
|
- :typeisDisabled="item.RuleType"
|
|
|
|
|
- @changeSelectedValue="val => changeSelectedValue(val, index, 'AirPort', AirContentList)"
|
|
|
|
|
|
|
+ :SelectedValue="item.ports"
|
|
|
|
|
+ :typeisDisabled="item.rule_type"
|
|
|
|
|
+ :PortList="item.PortList"
|
|
|
|
|
+ SelectType="Air"
|
|
|
|
|
+ @changeSelectedValue="val => changeSelectedValue(val, index, 'ports', AirContentList)"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="AirCoumlumn" style="width: 10%;">
|
|
<div class="AirCoumlumn" style="width: 10%;">
|
|
|
<el-input
|
|
<el-input
|
|
|
- @input="val => handleInput(val, index, 'FromDate', AirContentList)"
|
|
|
|
|
|
|
+ @input="val => handleInput(val, index, 'recommended_delivery_from', AirContentList)"
|
|
|
placeholder="Input"
|
|
placeholder="Input"
|
|
|
- v-model="item.FromDate"
|
|
|
|
|
|
|
+ v-model="item.recommended_delivery_from"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="AirCoumlumn" style="width: 10%;">
|
|
<div class="AirCoumlumn" style="width: 10%;">
|
|
|
<el-input
|
|
<el-input
|
|
|
- @input="val => handleInput(val, index, 'ToDate', AirContentList)"
|
|
|
|
|
|
|
+ @input="val => handleInput(val, index, 'recommended_delivery_to', AirContentList)"
|
|
|
placeholder="Input"
|
|
placeholder="Input"
|
|
|
- v-model="item.ToDate"
|
|
|
|
|
|
|
+ v-model="item.recommended_delivery_to"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="AirDelete" style="width: 10%;">
|
|
<div class="AirDelete" style="width: 10%;">
|
|
|
<el-button
|
|
<el-button
|
|
|
- v-if="item.RuleType !== '*Default Rule'"
|
|
|
|
|
|
|
+ v-if="item.rule_type !== '*Default Rule'"
|
|
|
@click="handleDelete(index, AirContentList, 'Air')"
|
|
@click="handleDelete(index, AirContentList, 'Air')"
|
|
|
class="el-button--blue"
|
|
class="el-button--blue"
|
|
|
style="height: 24px"
|
|
style="height: 24px"
|
|
@@ -395,10 +459,10 @@ const changeRuleType = (val: string, index: number, list: RuleItem[]) => {
|
|
|
</div>
|
|
</div>
|
|
|
<div v-if="isSea" style="margin-top: 16px">
|
|
<div v-if="isSea" style="margin-top: 16px">
|
|
|
<div class="AirCoulumn">
|
|
<div class="AirCoulumn">
|
|
|
- <div class="AicoulumnTitile" style="width: 10%;">Priority</div>
|
|
|
|
|
- <div class="AicoulumnTitile" style="width: 20%;">Rule Type</div>
|
|
|
|
|
- <div class="AicoulumnTitile" style="width: 20%;">Port</div>
|
|
|
|
|
- <div class="AicoulumnTitile" style="width: 20%;">Carrier</div>
|
|
|
|
|
|
|
+ <div class="AicoulumnTitile" style="width: 10%;">priority</div>
|
|
|
|
|
+ <div class="AicoulumnTitile" style="width: 14%;">Rule Type</div>
|
|
|
|
|
+ <div class="AicoulumnTitile" style="width: 23%;">Port</div>
|
|
|
|
|
+ <div class="AicoulumnTitile" style="width: 23%;">Carrier</div>
|
|
|
<div style="display: flex;flex-direction: column;border-right: 1px solid var(--color-system-border);width: 20%;">
|
|
<div style="display: flex;flex-direction: column;border-right: 1px solid var(--color-system-border);width: 20%;">
|
|
|
<div class="AicoulumnTitile2">Recommended Delivery Date</div>
|
|
<div class="AicoulumnTitile2">Recommended Delivery Date</div>
|
|
|
<div style="display: flex;height: 24px;align-items: center;">
|
|
<div style="display: flex;height: 24px;align-items: center;">
|
|
@@ -409,11 +473,11 @@ const changeRuleType = (val: string, index: number, list: RuleItem[]) => {
|
|
|
<div class="AirCoumlulnAdd" style="width: 10%;" @click="AddRuleItem(SeaContentList, 'Sea')">+ Add</div>
|
|
<div class="AirCoumlulnAdd" style="width: 10%;" @click="AddRuleItem(SeaContentList, 'Sea')">+ Add</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="AirContent" v-for="(item, index) in SeaContentList" :key="index">
|
|
<div class="AirContent" v-for="(item, index) in SeaContentList" :key="index">
|
|
|
- <div class="AirCoumlumn" style="width: 10%;">{{ item.Priority }}</div>
|
|
|
|
|
- <div class="AirCoumlumn" style="width: 20%;">
|
|
|
|
|
|
|
+ <div class="AirCoumlumn" style="width: 10%;">{{ item.priority }}</div>
|
|
|
|
|
+ <div class="AirCoumlumn" style="width: 14%;">
|
|
|
<el-select
|
|
<el-select
|
|
|
- v-model="item.RuleType"
|
|
|
|
|
- :disabled="item.RuleType === '*Default Rule'"
|
|
|
|
|
|
|
+ v-model="item.rule_type"
|
|
|
|
|
+ :disabled="item.rule_type === '*Default Rule'"
|
|
|
style="width: 100%;"
|
|
style="width: 100%;"
|
|
|
@change="val => changeRuleType(val, index, SeaContentList)"
|
|
@change="val => changeRuleType(val, index, SeaContentList)"
|
|
|
>
|
|
>
|
|
@@ -425,39 +489,43 @@ const changeRuleType = (val: string, index: number, list: RuleItem[]) => {
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="AirCoumlumn" style="width: 20%;">
|
|
|
|
|
|
|
+ <div class="AirCoumlumn" style="width: 23%;">
|
|
|
<SelectValue
|
|
<SelectValue
|
|
|
:SelectIndex="index"
|
|
:SelectIndex="index"
|
|
|
- :SelectedValue="item.Port"
|
|
|
|
|
- :typeisDisabled="item.RuleType"
|
|
|
|
|
- @changeSelectedValue="val => changeSelectedValue(val, index, 'Port', SeaContentList)"
|
|
|
|
|
|
|
+ :SelectedValue="item.ports"
|
|
|
|
|
+ :typeisDisabled="item.rule_type"
|
|
|
|
|
+ :PortList="item.PortList"
|
|
|
|
|
+ SelectType="Sea"
|
|
|
|
|
+ @changeSelectedValue="val => changeSelectedValue(val, index, 'ports', SeaContentList)"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="AirCoumlumn" style="width: 20%;">
|
|
|
|
|
|
|
+ <div class="AirCoumlumn" style="width: 23%;">
|
|
|
<SelectValue
|
|
<SelectValue
|
|
|
:SelectIndex="index"
|
|
:SelectIndex="index"
|
|
|
- :SelectedValue="item.Carrier"
|
|
|
|
|
- :typeisDisabled="item.RuleType"
|
|
|
|
|
- @changeSelectedValue="val => changeSelectedValue(val, index, 'Carrier', SeaContentList)"
|
|
|
|
|
|
|
+ :SelectedValue="item.carrier"
|
|
|
|
|
+ :typeisDisabled="item.rule_type"
|
|
|
|
|
+ :PortList="item.CarrierList"
|
|
|
|
|
+ SelectType="Sea"
|
|
|
|
|
+ @changeSelectedValue="val => changeSelectedValue(val, index, 'carrier', SeaContentList)"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="AirCoumlumn" style="width: 10%;">
|
|
<div class="AirCoumlumn" style="width: 10%;">
|
|
|
<el-input
|
|
<el-input
|
|
|
- @input="val => handleInput(val, index, 'FromDate', SeaContentList)"
|
|
|
|
|
|
|
+ @input="val => handleInput(val, index, 'recommended_delivery_from', SeaContentList)"
|
|
|
placeholder="Input"
|
|
placeholder="Input"
|
|
|
- v-model="item.FromDate"
|
|
|
|
|
|
|
+ v-model="item.recommended_delivery_from"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="AirCoumlumn" style="width: 10%;">
|
|
<div class="AirCoumlumn" style="width: 10%;">
|
|
|
<el-input
|
|
<el-input
|
|
|
- @input="val => handleInput(val, index, 'ToDate', SeaContentList)"
|
|
|
|
|
|
|
+ @input="val => handleInput(val, index, 'recommended_delivery_to', SeaContentList)"
|
|
|
placeholder="Input"
|
|
placeholder="Input"
|
|
|
- v-model="item.ToDate"
|
|
|
|
|
|
|
+ v-model="item.recommended_delivery_to"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="AirDelete" style="width: 10%;">
|
|
<div class="AirDelete" style="width: 10%;">
|
|
|
<el-button
|
|
<el-button
|
|
|
- v-if="item.RuleType !== '*Default Rule'"
|
|
|
|
|
|
|
+ v-if="item.rule_type !== '*Default Rule'"
|
|
|
@click="handleDelete(index, SeaContentList, 'Sea')"
|
|
@click="handleDelete(index, SeaContentList, 'Sea')"
|
|
|
class="el-button--blue"
|
|
class="el-button--blue"
|
|
|
style="height: 24px"
|
|
style="height: 24px"
|