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