diff --git a/src/views/main/BookingLedger/detail/modules/goodsTable.vue b/src/views/main/BookingLedger/detail/modules/goodsTable.vue index 8a37356..fd5d1e5 100644 --- a/src/views/main/BookingLedger/detail/modules/goodsTable.vue +++ b/src/views/main/BookingLedger/detail/modules/goodsTable.vue @@ -1597,58 +1597,6 @@ export default { this.$message.error('箱量与场站不一致') } } - - { - /* const addTable = [] - const cntrnoArr = [] - this.tableData.map((item, index) => { - if (!item.cntrno) { - this.tableData.splice(index, 1) - } else { - cntrnoArr.push(item.cntrno) - } - }) - const lastNum = this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0 - data.map((item, index) => { - if (cntrnoArr.includes(item.CNTRNO)) { - this.tableData[cntrnoArr.indexOf(item.CNTRNO)] = { - rowKey: lastNum + index, - ctnall: item.CTNALL, - ctnnum: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].ctnnum, - cntrno: item.CNTRNO, - sealno: item.SEALNO, - pkgs: item.PKGS, - kindpkgs: item.KINDPKGS, - kgs: item.KGS, - cbm: item.CBM, - tareweight: item.TAREWEIGHT, - weightype: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].weightype, - weighkgs: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].weighkgs, - weighdate: item.WEIGHDATE - } - } else { - const _data = { - rowKey: lastNum + index, - ctnall: item.CTNALL, - ctnnum: '1', - cntrno: item.CNTRNO, - sealno: item.SEALNO, - pkgs: item.PKGS, - kindpkgs: item.KINDPKGS, - kgs: item.KGS, - cbm: item.CBM, - tareweight: item.TAREWEIGHT, - weightype: '', - weighkgs: '', - weighdate: item.WEIGHDATE - } - addTable.push(_data) - } - }) - - this.tableData = [...this.tableData, ...addTable] - this.$forceUpdate() */ - } } else { this.$message.error(res.message) } diff --git a/src/views/main/BookingLedger/detail/modules/preOrder.vue b/src/views/main/BookingLedger/detail/modules/preOrder.vue index ab7a229..1beea80 100644 --- a/src/views/main/BookingLedger/detail/modules/preOrder.vue +++ b/src/views/main/BookingLedger/detail/modules/preOrder.vue @@ -1984,7 +1984,9 @@ export default { item.ediCtn.forEach(ite => { arr.push({ cntrno: ite.cntrno, - pkgs: ite.pkgs + pkgs: ite.pkgs, + cbm: ite.cbm, + kgs: ite.kgs }) }) } @@ -1994,35 +1996,81 @@ export default { item.haveFlag = true item.pkgsFlag = false arr.forEach(ite => { - if (ite.cntrno === item.cntrno && ite.pkgs === item.pkgs) { + if (ite.cntrno === item.cntrno && (ite.pkgs == item.pkgs && ite.cbm == item.cbm && ite.kgs == item.kgs)) { item.haveFlag = false item.pkgsFlag = false } - if (ite.cntrno === item.cntrno && ite.pkgs != item.pkgs) { + if (ite.cntrno === item.cntrno) { item.haveFlag = false - item.pkgsFlag = true + item.pkgsFlag = false + item.cbmFlag = false + item.kgsFlag = false + if (ite.pkgs != item.pkgs) { + item.pkgsFlag = true + } + if (ite.cbm != item.cbm) { + item.cbmFlag = true + } + if (ite.kgs != item.kgs) { + item.kgsFlag = true + } } }) }) main.forEach((item, index) => { + delete item.id + delete item.pId if (item.haveFlag) { $data.ediCtn.push(item) } - if (item.pkgsFlag) { - let total = 0 - this.orderList.forEach(ite => { - if (ite.isHBL) { - ite.ediCtn.forEach(it => { - if (it.cntrno === item.cntrno) { - it.pkgs = Number(it.pkgs) - total += it.pkgs - } - }) - } - }) - const pkgs = Number(item.pkgs) - total - item.pkgs = pkgs - if (item.pkgs > 0) { + if (item.pkgsFlag || item.cbmFlag || item.kgsFlag) { + if (item.pkgsFlag) { + let total = 0 + this.orderList.forEach(ite => { + if (ite.isHBL) { + ite.ediCtn.forEach(it => { + if (it.cntrno === item.cntrno) { + it.pkgs = Number(it.pkgs) + total += it.pkgs + } + }) + } + }) + const pkgs = Number(item.pkgs) - total + item.pkgs = pkgs + } + if (item.cbmFlag) { + let total = 0 + this.orderList.forEach(ite => { + if (ite.isHBL) { + ite.ediCtn.forEach(it => { + if (it.cntrno === item.cntrno) { + it.cbm = Number(it.cbm) + total += it.cbm + } + }) + } + }) + const cbm = Number(item.cbm) - total + item.cbm = cbm + } + if (item.kgsFlag) { + let total = 0 + this.orderList.forEach(ite => { + if (ite.isHBL) { + ite.ediCtn.forEach(it => { + if (it.cntrno === item.cntrno) { + it.kgs = Number(it.kgs) + total += it.kgs + } + }) + } + }) + const kgs = Number(item.kgs) - total + item.kgs = kgs + } + + if (item.pkgs > 0 || item.cbm > 0 || item.kgs > 0) { $data.ediCtn.push(item) } } diff --git a/src/views/system/ServiceFlow/addForm.vue b/src/views/system/ServiceFlow/addForm.vue index baa2961..b0d39ef 100644 --- a/src/views/system/ServiceFlow/addForm.vue +++ b/src/views/system/ServiceFlow/addForm.vue @@ -201,7 +201,7 @@