|
|
@ -4,7 +4,7 @@
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<div class="flex" v-if="!isLockBooking" style="justify-content: space-between">
|
|
|
|
<div class="flex" v-if="!isLockBooking" style="justify-content: space-between">
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<a-button type="link" size="mini" v-show="list.length !== 0" @click="openDialog">
|
|
|
|
<a-button type="link" size="mini" @click="openDialog">
|
|
|
|
<span class="iconfont icon-liebiao1"></span>
|
|
|
|
<span class="iconfont icon-liebiao1"></span>
|
|
|
|
多品名
|
|
|
|
多品名
|
|
|
|
</a-button>
|
|
|
|
</a-button>
|
|
|
@ -88,7 +88,14 @@
|
|
|
|
:indeterminate="someCheck"
|
|
|
|
:indeterminate="someCheck"
|
|
|
|
v-if="list.length !== 0"
|
|
|
|
v-if="list.length !== 0"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<hot-table ref="hotmain" :data="list" :settings="settings"></hot-table>
|
|
|
|
<hot-table ref="hotmain" :data="list" :settings="settings">
|
|
|
|
|
|
|
|
<img
|
|
|
|
|
|
|
|
v-show="!list.length"
|
|
|
|
|
|
|
|
class="hot-tb-no-data"
|
|
|
|
|
|
|
|
src="../../../../../assets/images/nodata.png"
|
|
|
|
|
|
|
|
alt=""
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</hot-table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="table-calc">
|
|
|
|
<div class="table-calc">
|
|
|
|
合计:
|
|
|
|
合计:
|
|
|
@ -117,7 +124,14 @@
|
|
|
|
@cancel="handleModelCancel"
|
|
|
|
@cancel="handleModelCancel"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="model-content">
|
|
|
|
<div class="model-content">
|
|
|
|
<hot-table ref="hotTb" :data="moreTList" :settings="moreTSettings"></hot-table>
|
|
|
|
<hot-table ref="hotTb" :data="moreTList" :settings="moreTSettings">
|
|
|
|
|
|
|
|
<img
|
|
|
|
|
|
|
|
v-show="!moreTList.length"
|
|
|
|
|
|
|
|
class="hot-tb-no-data"
|
|
|
|
|
|
|
|
src="../../../../../assets/images/nodata.png"
|
|
|
|
|
|
|
|
alt=""
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</hot-table>
|
|
|
|
<div class="model-botton-box">
|
|
|
|
<div class="model-botton-box">
|
|
|
|
<a-button class="btn" type="primary" @click="addChildData">新增</a-button>
|
|
|
|
<a-button class="btn" type="primary" @click="addChildData">新增</a-button>
|
|
|
|
<a-button class="btn btn-delete" @click="removeChildData">删除</a-button>
|
|
|
|
<a-button class="btn btn-delete" @click="removeChildData">删除</a-button>
|
|
|
@ -136,7 +150,14 @@
|
|
|
|
:data="moreData[moreSelectNum]"
|
|
|
|
:data="moreData[moreSelectNum]"
|
|
|
|
v-if="moreSelectLoad"
|
|
|
|
v-if="moreSelectLoad"
|
|
|
|
:settings="moreSettings"
|
|
|
|
:settings="moreSettings"
|
|
|
|
></hot-table>
|
|
|
|
>
|
|
|
|
|
|
|
|
<img
|
|
|
|
|
|
|
|
v-show="!moreData[moreSelectNum].length"
|
|
|
|
|
|
|
|
class="hot-tb-no-data"
|
|
|
|
|
|
|
|
src="../../../../../assets/images/nodata.png"
|
|
|
|
|
|
|
|
alt=""
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</hot-table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a-spin>
|
|
|
|
</a-spin>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -918,6 +939,9 @@
|
|
|
|
if (nval !== '') {
|
|
|
|
if (nval !== '') {
|
|
|
|
moreSelectLoad.value = false
|
|
|
|
moreSelectLoad.value = false
|
|
|
|
let ctnId = moreTList.value[nval].id
|
|
|
|
let ctnId = moreTList.value[nval].id
|
|
|
|
|
|
|
|
console.log(ctnId, 'ctnId', nval)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ctnId) {
|
|
|
|
GetOpCtnDetailList({
|
|
|
|
GetOpCtnDetailList({
|
|
|
|
queryCondition: JSON.stringify([
|
|
|
|
queryCondition: JSON.stringify([
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -933,11 +957,15 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}).then((res) => {
|
|
|
|
}).then((res) => {
|
|
|
|
moreData.value[moreSelectNum.value] = res.data
|
|
|
|
moreData.value[moreSelectNum.value] = res.data
|
|
|
|
// res.data.forEach(e=>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
moreSelectLoad.value = true
|
|
|
|
moreSelectLoad.value = true
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
console.log(moreData.value, moreSelectNum.value, moreData.value[moreSelectNum.value])
|
|
|
|
|
|
|
|
moreData.value[moreSelectNum.value].splice(0)
|
|
|
|
|
|
|
|
moreSelectLoad.value = true
|
|
|
|
|
|
|
|
}, 100)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@ -1380,202 +1408,206 @@
|
|
|
|
checkboxOption.value.selectedRowKeys = keys
|
|
|
|
checkboxOption.value.selectedRowKeys = keys
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function importYarn() {
|
|
|
|
function importYarn() {
|
|
|
|
if (!props.details.id) {
|
|
|
|
notification.warning({ message: '功能开发中...', duration: 3 })
|
|
|
|
notification.error({ message: '请先保存订舱信息', duration: 3 })
|
|
|
|
// if (!props.details.id) {
|
|
|
|
return false
|
|
|
|
// notification.error({ message: '请先保存订舱信息', duration: 3 })
|
|
|
|
|
|
|
|
// return false
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// YarnLoading.value = true
|
|
|
|
|
|
|
|
// GetYardData({
|
|
|
|
|
|
|
|
// id: props.details.id,
|
|
|
|
|
|
|
|
// isWeb: false,
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .then((res) => {
|
|
|
|
|
|
|
|
// if (res.succeeded) {
|
|
|
|
|
|
|
|
// const data = JSON.parse(res.data)
|
|
|
|
|
|
|
|
// console.log(data)
|
|
|
|
|
|
|
|
// // const addTable: any[] = []
|
|
|
|
|
|
|
|
// // const kindpkgsOld = list.value[0] ? list.value[0].kindPkgs : ''
|
|
|
|
|
|
|
|
// // list.value = []
|
|
|
|
|
|
|
|
// // const lastNum =
|
|
|
|
|
|
|
|
// // list.value.length > 0 ? Number(list.value[list.value.length - 1].rowKey) + 1 : 0
|
|
|
|
|
|
|
|
// // data.map((item, index) => {
|
|
|
|
|
|
|
|
// // const _data = {
|
|
|
|
|
|
|
|
// // rowKey: lastNum + index,
|
|
|
|
|
|
|
|
// // ctnall: item.CTNALL,
|
|
|
|
|
|
|
|
// // ctnnum: '1',
|
|
|
|
|
|
|
|
// // cntrno: item.CNTRNO,
|
|
|
|
|
|
|
|
// // sealno: item.SEALNO,
|
|
|
|
|
|
|
|
// // ctncode: item.CtnCode,
|
|
|
|
|
|
|
|
// // pkgs: item.PKGS,
|
|
|
|
|
|
|
|
// // kindpkgs: kindpkgsOld || item.KINDPKGS,
|
|
|
|
|
|
|
|
// // kgs: item.KGS,
|
|
|
|
|
|
|
|
// // cbm: item.CBM,
|
|
|
|
|
|
|
|
// // tareweight: item.TAREWEIGHT,
|
|
|
|
|
|
|
|
// // weightype: '',
|
|
|
|
|
|
|
|
// // weighkgs: '',
|
|
|
|
|
|
|
|
// // weighdate: item.WEIGHDATE,
|
|
|
|
|
|
|
|
// // }
|
|
|
|
|
|
|
|
// // addTable.push(_data)
|
|
|
|
|
|
|
|
// // })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // tableData.value = [...tableData.value, ...addTable]
|
|
|
|
|
|
|
|
// // that.$forceUpdate()
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// notification.error({ message: res.message, duration: 3 })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// YarnLoading.value = false
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .catch((err) => {
|
|
|
|
|
|
|
|
// YarnLoading.value = false
|
|
|
|
|
|
|
|
// })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
YarnLoading.value = true
|
|
|
|
function importsealno() {
|
|
|
|
GetYardData({
|
|
|
|
notification.warning({ message: '功能开发中...', duration: 3 })
|
|
|
|
id: props.details.id,
|
|
|
|
// sealnoLoading.value = true
|
|
|
|
isWeb: false,
|
|
|
|
// GetYardData({
|
|
|
|
})
|
|
|
|
// id: props.details.id,
|
|
|
|
.then((res) => {
|
|
|
|
// isWeb: false,
|
|
|
|
if (res.succeeded) {
|
|
|
|
// })
|
|
|
|
const data = JSON.parse(res.data)
|
|
|
|
// .then((res) => {
|
|
|
|
console.log(data)
|
|
|
|
// if (res.succeeded) {
|
|
|
|
|
|
|
|
// let type = true
|
|
|
|
|
|
|
|
// tableData.value.forEach((item) => {
|
|
|
|
|
|
|
|
// if (item.sealno || item.cntrno) {
|
|
|
|
|
|
|
|
// notification.error({ message: '请清空所有箱封号后再引入', duration: 3 })
|
|
|
|
|
|
|
|
// type = false
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// if (type) {
|
|
|
|
|
|
|
|
// const data = JSON.parse(res.data)
|
|
|
|
|
|
|
|
// if (data.length == tableData.value.length) {
|
|
|
|
|
|
|
|
// data.forEach((item, index) => {
|
|
|
|
|
|
|
|
// tableData.value[index].sealno = item.SEALNO
|
|
|
|
|
|
|
|
// tableData.value[index].cntrno = item.CNTRNO
|
|
|
|
|
|
|
|
// tableData.value[index].ctnnum = 1
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// const map = {}
|
|
|
|
|
|
|
|
// const dest: any[] = []
|
|
|
|
|
|
|
|
// for (var i = 0; i < tableData.value.length; i++) {
|
|
|
|
|
|
|
|
// var ai = tableData.value[i]
|
|
|
|
|
|
|
|
// if (!map[ai.ctnall]) {
|
|
|
|
|
|
|
|
// dest.push({
|
|
|
|
|
|
|
|
// ctnall: ai.ctnall,
|
|
|
|
|
|
|
|
// ctnnum: ai.ctnnum,
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// map[ai.ctnall] = ai
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// for (var j = 0; j < dest.length; j++) {
|
|
|
|
|
|
|
|
// var dj = dest[j]
|
|
|
|
|
|
|
|
// if (dj.ctnall == ai.ctnall) {
|
|
|
|
|
|
|
|
// dj.ctnnum = (parseFloat(dj.ctnnum) + parseFloat(ai.ctnnum)).toString()
|
|
|
|
|
|
|
|
// break
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// changeEmit1(dest)
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// notification.error({ message: '箱量与场站不一致', duration: 3 })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// notification.error({ message: res.message, duration: 3 })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// sealnoLoading.value = false
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .catch((err) => {
|
|
|
|
|
|
|
|
// sealnoLoading.value = false
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function importWeight() {
|
|
|
|
|
|
|
|
notification.warning({ message: '功能开发中...', duration: 3 })
|
|
|
|
|
|
|
|
// if (!props.details.id) {
|
|
|
|
|
|
|
|
// notification.error({ message: '请先保存订舱信息', duration: 3 })
|
|
|
|
|
|
|
|
// return false
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// WeightLoading.value = true
|
|
|
|
|
|
|
|
// GetYardData({
|
|
|
|
|
|
|
|
// id: props.details.id,
|
|
|
|
|
|
|
|
// isWeb: false,
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .then((res) => {
|
|
|
|
|
|
|
|
// if (res.succeeded) {
|
|
|
|
|
|
|
|
// const data = JSON.parse(res.data)
|
|
|
|
// const addTable: any[] = []
|
|
|
|
// const addTable: any[] = []
|
|
|
|
// const kindpkgsOld = list.value[0] ? list.value[0].kindPkgs : ''
|
|
|
|
// const cntrnoArr: any[] = []
|
|
|
|
// list.value = []
|
|
|
|
// tableData.value.map((item: any, index) => {
|
|
|
|
|
|
|
|
// if (!item.cntrno) {
|
|
|
|
|
|
|
|
// // delete tableData.value[index]
|
|
|
|
|
|
|
|
// tableData.value.splice(index, 1)
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// cntrnoArr.push(item.cntrno)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// for (let i = tableData.value.length - 1; i >= 0; i--) {
|
|
|
|
|
|
|
|
// if (!tableData.value[i].cntrno) {
|
|
|
|
|
|
|
|
// tableData.value.splice(i, 1)
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// cntrnoArr.push(tableData.value[i].cntrno)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
// const lastNum =
|
|
|
|
// const lastNum =
|
|
|
|
// list.value.length > 0 ? Number(list.value[list.value.length - 1].rowKey) + 1 : 0
|
|
|
|
// tableData.value.length > 0
|
|
|
|
|
|
|
|
// ? Number(tableData.value[tableData.value.length - 1].rowKey) + 1
|
|
|
|
|
|
|
|
// : 0
|
|
|
|
// data.map((item, index) => {
|
|
|
|
// data.map((item, index) => {
|
|
|
|
|
|
|
|
// if (cntrnoArr.includes(item.CNTRNO)) {
|
|
|
|
|
|
|
|
// const setWeighkgs = calc(
|
|
|
|
|
|
|
|
// Number(tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kgs),
|
|
|
|
|
|
|
|
// Number(item.TAREWEIGHT),
|
|
|
|
|
|
|
|
// '+',
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// tableData.value[cntrnoArr.indexOf(item.CNTRNO)] = {
|
|
|
|
|
|
|
|
// rowKey: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].rowKey,
|
|
|
|
|
|
|
|
// ctnall: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].ctnall,
|
|
|
|
|
|
|
|
// ctnnum: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].ctnnum,
|
|
|
|
|
|
|
|
// cntrno: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].cntrno,
|
|
|
|
|
|
|
|
// sealno: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].sealno,
|
|
|
|
|
|
|
|
// pkgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].pkgs,
|
|
|
|
|
|
|
|
// kindpkgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kindpkgs,
|
|
|
|
|
|
|
|
// kgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kgs,
|
|
|
|
|
|
|
|
// cbm: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].cbm,
|
|
|
|
|
|
|
|
// tareweight: item.TAREWEIGHT,
|
|
|
|
|
|
|
|
// weightype: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].weightype,
|
|
|
|
|
|
|
|
// weighkgs: setWeighkgs,
|
|
|
|
|
|
|
|
// weighdate: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].weighdate,
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
// const _data = {
|
|
|
|
// const _data = {
|
|
|
|
// rowKey: lastNum + index,
|
|
|
|
// rowKey: lastNum + index,
|
|
|
|
// ctnall: item.CTNALL,
|
|
|
|
// ctnall: '',
|
|
|
|
// ctnnum: '1',
|
|
|
|
// ctnnum: '1',
|
|
|
|
// cntrno: item.CNTRNO,
|
|
|
|
// cntrno: '',
|
|
|
|
// sealno: item.SEALNO,
|
|
|
|
// sealno: '',
|
|
|
|
// ctncode: item.CtnCode,
|
|
|
|
// pkgs: '',
|
|
|
|
// pkgs: item.PKGS,
|
|
|
|
// kindpkgs: '',
|
|
|
|
// kindpkgs: kindpkgsOld || item.KINDPKGS,
|
|
|
|
// kgs: '',
|
|
|
|
// kgs: item.KGS,
|
|
|
|
// cbm: '',
|
|
|
|
// cbm: item.CBM,
|
|
|
|
|
|
|
|
// tareweight: item.TAREWEIGHT,
|
|
|
|
// tareweight: item.TAREWEIGHT,
|
|
|
|
// weightype: '',
|
|
|
|
// weightype: '',
|
|
|
|
// weighkgs: '',
|
|
|
|
// weighkgs: '',
|
|
|
|
// weighdate: item.WEIGHDATE,
|
|
|
|
// weighdate: '',
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// addTable.push(_data)
|
|
|
|
// addTable.push(_data)
|
|
|
|
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
// tableData.value = [...tableData.value, ...addTable]
|
|
|
|
// tableData.value = [...tableData.value, ...addTable]
|
|
|
|
// that.$forceUpdate()
|
|
|
|
// that.$forceUpdate()
|
|
|
|
} else {
|
|
|
|
// } else {
|
|
|
|
notification.error({ message: res.message, duration: 3 })
|
|
|
|
// notification.error({ message: res.message, duration: 3 })
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
YarnLoading.value = false
|
|
|
|
// WeightLoading.value = false
|
|
|
|
})
|
|
|
|
// })
|
|
|
|
.catch((err) => {
|
|
|
|
// .catch((err) => {
|
|
|
|
YarnLoading.value = false
|
|
|
|
// WeightLoading.value = false
|
|
|
|
})
|
|
|
|
// })
|
|
|
|
}
|
|
|
|
|
|
|
|
function importsealno() {
|
|
|
|
|
|
|
|
sealnoLoading.value = true
|
|
|
|
|
|
|
|
GetYardData({
|
|
|
|
|
|
|
|
id: props.details.id,
|
|
|
|
|
|
|
|
isWeb: false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
|
|
|
let type = true
|
|
|
|
|
|
|
|
tableData.value.forEach((item) => {
|
|
|
|
|
|
|
|
if (item.sealno || item.cntrno) {
|
|
|
|
|
|
|
|
notification.error({ message: '请清空所有箱封号后再引入', duration: 3 })
|
|
|
|
|
|
|
|
type = false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
if (type) {
|
|
|
|
|
|
|
|
const data = JSON.parse(res.data)
|
|
|
|
|
|
|
|
if (data.length == tableData.value.length) {
|
|
|
|
|
|
|
|
data.forEach((item, index) => {
|
|
|
|
|
|
|
|
tableData.value[index].sealno = item.SEALNO
|
|
|
|
|
|
|
|
tableData.value[index].cntrno = item.CNTRNO
|
|
|
|
|
|
|
|
tableData.value[index].ctnnum = 1
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
const map = {}
|
|
|
|
|
|
|
|
const dest: any[] = []
|
|
|
|
|
|
|
|
for (var i = 0; i < tableData.value.length; i++) {
|
|
|
|
|
|
|
|
var ai = tableData.value[i]
|
|
|
|
|
|
|
|
if (!map[ai.ctnall]) {
|
|
|
|
|
|
|
|
dest.push({
|
|
|
|
|
|
|
|
ctnall: ai.ctnall,
|
|
|
|
|
|
|
|
ctnnum: ai.ctnnum,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
map[ai.ctnall] = ai
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
for (var j = 0; j < dest.length; j++) {
|
|
|
|
|
|
|
|
var dj = dest[j]
|
|
|
|
|
|
|
|
if (dj.ctnall == ai.ctnall) {
|
|
|
|
|
|
|
|
dj.ctnnum = (parseFloat(dj.ctnnum) + parseFloat(ai.ctnnum)).toString()
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
changeEmit1(dest)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
notification.error({ message: '箱量与场站不一致', duration: 3 })
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
notification.error({ message: res.message, duration: 3 })
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sealnoLoading.value = false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
|
|
|
sealnoLoading.value = false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function changeEmit1(arr) {
|
|
|
|
function changeEmit1(arr) {
|
|
|
|
emit('changectnall', arr)
|
|
|
|
emit('changectnall', arr)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function importWeight() {
|
|
|
|
|
|
|
|
if (!props.details.id) {
|
|
|
|
|
|
|
|
notification.error({ message: '请先保存订舱信息', duration: 3 })
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
WeightLoading.value = true
|
|
|
|
|
|
|
|
GetYardData({
|
|
|
|
|
|
|
|
id: props.details.id,
|
|
|
|
|
|
|
|
isWeb: false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
|
|
|
const data = JSON.parse(res.data)
|
|
|
|
|
|
|
|
const addTable: any[] = []
|
|
|
|
|
|
|
|
const cntrnoArr: any[] = []
|
|
|
|
|
|
|
|
tableData.value.map((item: any, index) => {
|
|
|
|
|
|
|
|
if (!item.cntrno) {
|
|
|
|
|
|
|
|
// delete tableData.value[index]
|
|
|
|
|
|
|
|
tableData.value.splice(index, 1)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
cntrnoArr.push(item.cntrno)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
for (let i = tableData.value.length - 1; i >= 0; i--) {
|
|
|
|
|
|
|
|
if (!tableData.value[i].cntrno) {
|
|
|
|
|
|
|
|
tableData.value.splice(i, 1)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
cntrnoArr.push(tableData.value[i].cntrno)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const lastNum =
|
|
|
|
|
|
|
|
tableData.value.length > 0
|
|
|
|
|
|
|
|
? Number(tableData.value[tableData.value.length - 1].rowKey) + 1
|
|
|
|
|
|
|
|
: 0
|
|
|
|
|
|
|
|
data.map((item, index) => {
|
|
|
|
|
|
|
|
if (cntrnoArr.includes(item.CNTRNO)) {
|
|
|
|
|
|
|
|
const setWeighkgs = calc(
|
|
|
|
|
|
|
|
Number(tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kgs),
|
|
|
|
|
|
|
|
Number(item.TAREWEIGHT),
|
|
|
|
|
|
|
|
'+',
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
tableData.value[cntrnoArr.indexOf(item.CNTRNO)] = {
|
|
|
|
|
|
|
|
rowKey: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].rowKey,
|
|
|
|
|
|
|
|
ctnall: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].ctnall,
|
|
|
|
|
|
|
|
ctnnum: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].ctnnum,
|
|
|
|
|
|
|
|
cntrno: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].cntrno,
|
|
|
|
|
|
|
|
sealno: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].sealno,
|
|
|
|
|
|
|
|
pkgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].pkgs,
|
|
|
|
|
|
|
|
kindpkgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kindpkgs,
|
|
|
|
|
|
|
|
kgs: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].kgs,
|
|
|
|
|
|
|
|
cbm: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].cbm,
|
|
|
|
|
|
|
|
tareweight: item.TAREWEIGHT,
|
|
|
|
|
|
|
|
weightype: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].weightype,
|
|
|
|
|
|
|
|
weighkgs: setWeighkgs,
|
|
|
|
|
|
|
|
weighdate: tableData.value[cntrnoArr.indexOf(item.CNTRNO)].weighdate,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
const _data = {
|
|
|
|
|
|
|
|
rowKey: lastNum + index,
|
|
|
|
|
|
|
|
ctnall: '',
|
|
|
|
|
|
|
|
ctnnum: '1',
|
|
|
|
|
|
|
|
cntrno: '',
|
|
|
|
|
|
|
|
sealno: '',
|
|
|
|
|
|
|
|
pkgs: '',
|
|
|
|
|
|
|
|
kindpkgs: '',
|
|
|
|
|
|
|
|
kgs: '',
|
|
|
|
|
|
|
|
cbm: '',
|
|
|
|
|
|
|
|
tareweight: item.TAREWEIGHT,
|
|
|
|
|
|
|
|
weightype: '',
|
|
|
|
|
|
|
|
weighkgs: '',
|
|
|
|
|
|
|
|
weighdate: '',
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
addTable.push(_data)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tableData.value = [...tableData.value, ...addTable]
|
|
|
|
|
|
|
|
that.$forceUpdate()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
notification.error({ message: res.message, duration: 3 })
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
WeightLoading.value = false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
|
|
|
WeightLoading.value = false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function calc(num1, num2, calcStr) {
|
|
|
|
function calc(num1, num2, calcStr) {
|
|
|
|
var str1 // 转换为字符串的数字
|
|
|
|
var str1 // 转换为字符串的数字
|
|
|
|
var str2
|
|
|
|
var str2
|
|
|
|