|
|
@ -123,7 +123,7 @@
|
|
|
|
</BasicForm>
|
|
|
|
</BasicForm>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hot-table style="margin-left: 14px;" ref="hotmain" :data="ctnList" :settings="settings">
|
|
|
|
<hot-table style="margin-left: 14px;" ref="hotpreOrder" :data="ctnList" :settings="settings">
|
|
|
|
</hot-table>
|
|
|
|
</hot-table>
|
|
|
|
<div class="table-calc">
|
|
|
|
<div class="table-calc">
|
|
|
|
合计:
|
|
|
|
合计:
|
|
|
@ -271,7 +271,7 @@ watch(() => ctnList.value, (val) => {
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
function initTable() {
|
|
|
|
function initTable() {
|
|
|
|
const hot = hotmain.value.hotInstance
|
|
|
|
const hot = hotpreOrder.value.hotInstance
|
|
|
|
hot.addHook('beforeKeyDown', function (event) {
|
|
|
|
hot.addHook('beforeKeyDown', function (event) {
|
|
|
|
if (event.key === 'ArrowDown') {
|
|
|
|
if (event.key === 'ArrowDown') {
|
|
|
|
if (hot.getSelected()[0][0] == ctnList.value.length - 1 && !hot.getActiveEditor()?._opened) {
|
|
|
|
if (hot.getSelected()[0][0] == ctnList.value.length - 1 && !hot.getActiveEditor()?._opened) {
|
|
|
@ -353,6 +353,7 @@ function FngetPageESeaeEdi() {
|
|
|
|
if (!res.data) {
|
|
|
|
if (!res.data) {
|
|
|
|
res.data = []
|
|
|
|
res.data = []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 有数据直接回显
|
|
|
|
if (res.data.length > 0) {
|
|
|
|
if (res.data.length > 0) {
|
|
|
|
res.data.map((item, index) => {
|
|
|
|
res.data.map((item, index) => {
|
|
|
|
item.checked = false
|
|
|
|
item.checked = false
|
|
|
@ -369,7 +370,7 @@ function FngetPageESeaeEdi() {
|
|
|
|
setFieldsValueMail(item)
|
|
|
|
setFieldsValueMail(item)
|
|
|
|
setFieldsValueYard(item)
|
|
|
|
setFieldsValueYard(item)
|
|
|
|
ctnList.value = item.ctnInfo ? item.ctnInfo : []
|
|
|
|
ctnList.value = item.ctnInfo ? item.ctnInfo : []
|
|
|
|
hotmain.value.hotInstance.loadData(ctnList.value)
|
|
|
|
hotpreOrder.value.hotInstance.loadData(ctnList.value)
|
|
|
|
editIndex.value = index
|
|
|
|
editIndex.value = index
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -377,14 +378,15 @@ function FngetPageESeaeEdi() {
|
|
|
|
console.log(orderList.value);
|
|
|
|
console.log(orderList.value);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//处理接口没数据的情况
|
|
|
|
//处理接口没数据的情况
|
|
|
|
props.details.id = '0'
|
|
|
|
const propsDetail = JSON.parse(JSON.stringify(props.details))
|
|
|
|
props.details.isPart = false
|
|
|
|
propsDetail.id = '0'
|
|
|
|
|
|
|
|
propsDetail.isPart = false
|
|
|
|
//处理基础信息
|
|
|
|
//处理基础信息
|
|
|
|
setFieldsValueBase(props.details)
|
|
|
|
setFieldsValueBase(propsDetail)
|
|
|
|
// 拆分主单的收发通 发货人国家默认是中国 通知人和收货人为卸货港的国家
|
|
|
|
//拆分主单的收发通 发货人国家默认是中国 通知人和收货人为卸货港的国家
|
|
|
|
const arr = props.details.shipperContent ? props.details.shipperContent.split('\n') : []
|
|
|
|
const arr = propsDetail.shipperContent ? propsDetail.shipperContent.split('\n') : []
|
|
|
|
const arr1 = props.details.consigneeContent ? props.details.consigneeContent.split('\n') : []
|
|
|
|
const arr1 = propsDetail.consigneeContent ? propsDetail.consigneeContent.split('\n') : []
|
|
|
|
const arr2 = props.details.notifyPartyContent ? props.details.notifyPartyContent.split('\n') : []
|
|
|
|
const arr2 = propsDetail.notifyPartyContent ? propsDetail.notifyPartyContent.split('\n') : []
|
|
|
|
setFieldsValueMail({
|
|
|
|
setFieldsValueMail({
|
|
|
|
shipperName: arr[0],
|
|
|
|
shipperName: arr[0],
|
|
|
|
shipperAddress: arr[1],
|
|
|
|
shipperAddress: arr[1],
|
|
|
@ -395,7 +397,7 @@ function FngetPageESeaeEdi() {
|
|
|
|
shipperCountryName: '中国(CHINA)',
|
|
|
|
shipperCountryName: '中国(CHINA)',
|
|
|
|
shipperCountry: 'CN'
|
|
|
|
shipperCountry: 'CN'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
GetClientPortInfoByCode({ queryKey: props.details.dischargePortCode }).then(res => {
|
|
|
|
GetClientPortInfoByCode({ queryKey: propsDetail.dischargePortCode }).then(res => {
|
|
|
|
const arr = localStorage.getItem('ds-country') ? JSON.parse(localStorage.getItem('ds-country')) : []
|
|
|
|
const arr = localStorage.getItem('ds-country') ? JSON.parse(localStorage.getItem('ds-country')) : []
|
|
|
|
if (res.data) {
|
|
|
|
if (res.data) {
|
|
|
|
arr.forEach(item => {
|
|
|
|
arr.forEach(item => {
|
|
|
@ -410,25 +412,25 @@ function FngetPageESeaeEdi() {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// 处理货物信息
|
|
|
|
//处理货物信息
|
|
|
|
if (!props.details.cargoId) {
|
|
|
|
if (!propsDetail.cargoId) {
|
|
|
|
props.details.cargoId = 'S'
|
|
|
|
propsDetail.cargoId = 'S'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RefcargoInfo.value.preOrderInit(props.details)
|
|
|
|
RefcargoInfo.value.preOrderInit(propsDetail)
|
|
|
|
// 处理场站
|
|
|
|
// 处理场站
|
|
|
|
setFieldsValueYard({
|
|
|
|
setFieldsValueYard({
|
|
|
|
yardId: props.details.yardId,
|
|
|
|
yardId: propsDetail.yardId,
|
|
|
|
yard: props.details.yard
|
|
|
|
yard: propsDetail.yard
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// 处理箱信息
|
|
|
|
// 处理箱信息
|
|
|
|
ctnList.value = props.details.ctnInfo ? props.details.ctnInfo : []
|
|
|
|
ctnList.value = propsDetail.ctnInfo ? propsDetail.ctnInfo : []
|
|
|
|
ctnList.value.forEach(item => {
|
|
|
|
ctnList.value.forEach(item => {
|
|
|
|
delete item.id
|
|
|
|
delete item.id
|
|
|
|
})
|
|
|
|
})
|
|
|
|
hotmain.value.hotInstance.loadData(ctnList.value)
|
|
|
|
hotpreOrder.value.hotInstance.loadData(ctnList.value)
|
|
|
|
console.log(props.details,111111);
|
|
|
|
console.log(propsDetail,111111);
|
|
|
|
const data = JSON.parse(JSON.stringify(props.details))
|
|
|
|
const data = JSON.parse(JSON.stringify(propsDetail))
|
|
|
|
data.mblno = props.details.mblno
|
|
|
|
data.mblno = propsDetail.mblno
|
|
|
|
data.isPart = false
|
|
|
|
data.isPart = false
|
|
|
|
data.checked = false
|
|
|
|
data.checked = false
|
|
|
|
orderList.value[0] = data
|
|
|
|
orderList.value[0] = data
|
|
|
@ -536,7 +538,7 @@ function calcCtnInfo(mblData, hblList) {
|
|
|
|
setFieldsValueMail(mblData)
|
|
|
|
setFieldsValueMail(mblData)
|
|
|
|
setFieldsValueYard(mblData)
|
|
|
|
setFieldsValueYard(mblData)
|
|
|
|
ctnList.value = mblData.ctnInfo ? mblData.ctnInfo : []
|
|
|
|
ctnList.value = mblData.ctnInfo ? mblData.ctnInfo : []
|
|
|
|
hotmain.value.hotInstance.loadData(ctnList.value)
|
|
|
|
hotpreOrder.value.hotInstance.loadData(ctnList.value)
|
|
|
|
mblData.isPart = true
|
|
|
|
mblData.isPart = true
|
|
|
|
orderList.value.push({ checked: true, isPart: true, ...mblData })
|
|
|
|
orderList.value.push({ checked: true, isPart: true, ...mblData })
|
|
|
|
editIndex.value = orderList.value.length - 1
|
|
|
|
editIndex.value = orderList.value.length - 1
|
|
|
@ -624,7 +626,7 @@ function delboxLine() {
|
|
|
|
ctnList.value.splice(i, 1)
|
|
|
|
ctnList.value.splice(i, 1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
hotmain.value.hotInstance.loadData(ctnList.value)
|
|
|
|
hotpreOrder.value.hotInstance.loadData(ctnList.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function copyboxLine() {
|
|
|
|
function copyboxLine() {
|
|
|
|
const arr = [] as any
|
|
|
|
const arr = [] as any
|
|
|
@ -639,7 +641,7 @@ function copyboxLine() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (arr.length == 1) {
|
|
|
|
if (arr.length == 1) {
|
|
|
|
ctnList.value.push(JSON.parse(JSON.stringify(arr[0])))
|
|
|
|
ctnList.value.push(JSON.parse(JSON.stringify(arr[0])))
|
|
|
|
hotmain.value.hotInstance.loadData(ctnList.value)
|
|
|
|
hotpreOrder.value.hotInstance.loadData(ctnList.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log(arr);
|
|
|
|
console.log(arr);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -716,7 +718,7 @@ function editOrder(index) {
|
|
|
|
notifyPartyId: '',
|
|
|
|
notifyPartyId: '',
|
|
|
|
})
|
|
|
|
})
|
|
|
|
ctnList.value = data.ctnInfo ? data.ctnInfo : []
|
|
|
|
ctnList.value = data.ctnInfo ? data.ctnInfo : []
|
|
|
|
hotmain.value.hotInstance.loadData(ctnList.value)
|
|
|
|
hotpreOrder.value.hotInstance.loadData(ctnList.value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -724,7 +726,7 @@ function editOrder(index) {
|
|
|
|
const list = ref<any>([])
|
|
|
|
const list = ref<any>([])
|
|
|
|
const ctnDict = ref([])
|
|
|
|
const ctnDict = ref([])
|
|
|
|
const kindPkgsDict = ref([])
|
|
|
|
const kindPkgsDict = ref([])
|
|
|
|
const hotmain = ref(null) as any
|
|
|
|
const hotpreOrder = ref(null) as any
|
|
|
|
const mainPkgs = ref([]) as any
|
|
|
|
const mainPkgs = ref([]) as any
|
|
|
|
const totalPkgs = ref(0)
|
|
|
|
const totalPkgs = ref(0)
|
|
|
|
const totalKgs = ref(0)
|
|
|
|
const totalKgs = ref(0)
|
|
|
@ -817,7 +819,7 @@ const settings = {
|
|
|
|
// 如果通过复制或者填写校验出现错误,清空输入框
|
|
|
|
// 如果通过复制或者填写校验出现错误,清空输入框
|
|
|
|
afterValidate: function (isValid, value, row, prop, source) {
|
|
|
|
afterValidate: function (isValid, value, row, prop, source) {
|
|
|
|
if (!isValid) {
|
|
|
|
if (!isValid) {
|
|
|
|
hotmain.value.hotInstance.setDataAtRowProp(row, prop, '')
|
|
|
|
hotpreOrder.value.hotInstance.setDataAtRowProp(row, prop, '')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
columns: columns,
|
|
|
|
columns: columns,
|
|
|
|