|
|
|
@ -2884,6 +2884,27 @@ const handleComputedPlanPrice = submitData => {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const getTranslationArr = codeArr => { |
|
|
|
|
const _nameArr = []; |
|
|
|
|
let _item = {}; |
|
|
|
|
|
|
|
|
|
_nameArr[0] = details.regionOptione.find(val => val.value === codeArr[0]); |
|
|
|
|
|
|
|
|
|
_nameArr[1] = _nameArr[0].children.find(val => val.value === codeArr[1]); |
|
|
|
|
|
|
|
|
|
if (codeArr.length === 2) { |
|
|
|
|
_item = _nameArr[1]; |
|
|
|
|
} else { |
|
|
|
|
_nameArr[2] = _nameArr[1].children.find(val => val.value === codeArr[2]); |
|
|
|
|
_item = _nameArr[2]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
locationItem: _item, |
|
|
|
|
nameArr: _nameArr, |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 提交 */ |
|
|
|
|
const handleSubmit = async (formEl: FormInstance | undefined) => { |
|
|
|
|
await nextTick(); |
|
|
|
@ -2956,34 +2977,20 @@ const handleSubmit = async (formEl: FormInstance | undefined) => {
|
|
|
|
|
return ElMessage({ message: '请选择正确发站地址', type: 'warning' }); |
|
|
|
|
|
|
|
|
|
// 筛选到站 |
|
|
|
|
const _findeLocation = details.regionOptione |
|
|
|
|
.find(val => val.value === destination[0]) |
|
|
|
|
.children.find(val => val.value === destination[1]); |
|
|
|
|
|
|
|
|
|
let _item: any = {}; |
|
|
|
|
if (destination.length === 2) { |
|
|
|
|
_item = _findeLocation; |
|
|
|
|
} else { |
|
|
|
|
_item = _findeLocation.children.find(val => val.value === destination[2]); |
|
|
|
|
} |
|
|
|
|
const { locationItem: _itemDestination, nameArr: dest_nameArr } = |
|
|
|
|
getTranslationArr(destination); |
|
|
|
|
|
|
|
|
|
submitData.destination = _item.label; |
|
|
|
|
submitData.destinationCode = _item.value; |
|
|
|
|
submitData.destination = _itemDestination.label; |
|
|
|
|
submitData.destinationCode = _itemDestination.value; |
|
|
|
|
submitData.completeDestination = dest_nameArr.map(val => val.label).join('/'); |
|
|
|
|
|
|
|
|
|
// 筛选发站 |
|
|
|
|
const _findeDeparture = details.regionOptione |
|
|
|
|
.find(val => val.value === departure[0]) |
|
|
|
|
.children.find(val => val.value === departure[1]); |
|
|
|
|
|
|
|
|
|
let _itemDeparture: any = {}; |
|
|
|
|
if (departure.length === 2) { |
|
|
|
|
_itemDeparture = _findeDeparture; |
|
|
|
|
} else { |
|
|
|
|
_itemDeparture = _findeDeparture.children.find(val => val.value === departure[2]); |
|
|
|
|
} |
|
|
|
|
const { locationItem: _itemDeparture, nameArr: de_nameArr } = |
|
|
|
|
getTranslationArr(departure); |
|
|
|
|
|
|
|
|
|
submitData.departure = _itemDeparture.label; |
|
|
|
|
submitData.departureCode = _itemDeparture.value; |
|
|
|
|
submitData.completeDeparture = de_nameArr.map(val => val.label).join('/'); |
|
|
|
|
|
|
|
|
|
// let numFlag = false; |
|
|
|
|
|
|
|
|
|