|
|
|
@ -188,6 +188,27 @@ export default {
|
|
|
|
|
this.tableData[rowIndex].ctnall = data.name
|
|
|
|
|
this.tableData[rowIndex].ctncode = data.code
|
|
|
|
|
row['ctnall'] = data.name
|
|
|
|
|
var map = {};
|
|
|
|
|
var dest = [];
|
|
|
|
|
for (var i = 0; i < this.tableData.length; i++) {
|
|
|
|
|
var ai = this.tableData[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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
this.changeEmit1(dest)
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
} else {
|
|
|
|
|
row['ctnall'] = ''
|
|
|
|
@ -322,7 +343,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.$emit('changeCtnInfo', { type: 'kindpkgs', val: row['kindpkgs'] })
|
|
|
|
|
this.changeEmit(row)
|
|
|
|
|
}}
|
|
|
|
|
on-focus={(val) => {
|
|
|
|
|
this.kindpkgsViewIndex = rowIndex
|
|
|
|
@ -798,6 +819,29 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (column.field === 'ctnnum') {
|
|
|
|
|
const map = {};
|
|
|
|
|
const dest = [];
|
|
|
|
|
for (var i = 0; i < this.tableData.length; i++) {
|
|
|
|
|
var ai = this.tableData[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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
this.changeEmit1(dest)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
cellValueChange: ({ row, column }) => { }
|
|
|
|
|
},
|
|
|
|
@ -1178,9 +1222,9 @@ export default {
|
|
|
|
|
this.id = this.$route.query.id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.$route.name === 'BookingDetail') {
|
|
|
|
|
if (this.$route.name === 'BookingDetail') {
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
totalKgs() {
|
|
|
|
@ -1256,9 +1300,9 @@ export default {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
if (document.getElementsByClassName('ve-table-cell-selection')) {
|
|
|
|
|
const activeDom = document.getElementsByClassName('ve-table-cell-selection')[0].firstChild
|
|
|
|
|
if (this.isDOM(activeDom)) {
|
|
|
|
|
activeDom.click()
|
|
|
|
|
}
|
|
|
|
|
if (this.isDOM(activeDom)) {
|
|
|
|
|
activeDom.click()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, 200)
|
|
|
|
|
}
|
|
|
|
@ -1272,6 +1316,9 @@ export default {
|
|
|
|
|
keydown(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
},
|
|
|
|
|
changeEmit(row) {
|
|
|
|
|
this.$emit('changeCtnInfo', { type: 'kindpkgs', val: row['kindpkgs'] })
|
|
|
|
|
},
|
|
|
|
|
isDOM(item) {
|
|
|
|
|
// 首先判断是否支持HTMLELement,如果支持,使用HTMLElement,如果不支持,通过判断DOM的特征,如果拥有这些特征说明就是ODM节点,特征使用的越多越准确
|
|
|
|
|
return typeof HTMLElement === 'function'
|
|
|
|
@ -1533,6 +1580,9 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
this.childTableData.push(data)
|
|
|
|
|
},
|
|
|
|
|
changeEmit1(arr) {
|
|
|
|
|
this.$emit('changectnall', arr)
|
|
|
|
|
},
|
|
|
|
|
removeChildData() {
|
|
|
|
|
this.selectChildArr.map((item, index) => {
|
|
|
|
|
this.childTableData.map((oitem, oindex) => {
|
|
|
|
@ -1588,11 +1638,32 @@ export default {
|
|
|
|
|
if (type) {
|
|
|
|
|
const data = JSON.parse(res.data)
|
|
|
|
|
if (data.length == this.tableData.length) {
|
|
|
|
|
console.log(this.tableData, data)
|
|
|
|
|
data.forEach((item, index) => {
|
|
|
|
|
this.tableData[index].sealno = item.SEALNO
|
|
|
|
|
this.tableData[index].cntrno = item.CNTRNO
|
|
|
|
|
this.tableData[index].ctnnum = 1
|
|
|
|
|
})
|
|
|
|
|
const map = {};
|
|
|
|
|
const dest = [];
|
|
|
|
|
for (var i = 0; i < this.tableData.length; i++) {
|
|
|
|
|
var ai = this.tableData[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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
this.changeEmit1(dest)
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('箱量与场站不一致')
|
|
|
|
|
}
|
|
|
|
@ -1622,27 +1693,27 @@ export default {
|
|
|
|
|
const data = JSON.parse(res.data)
|
|
|
|
|
const addTable = []
|
|
|
|
|
const cntrnoArr = []
|
|
|
|
|
let kindpkgsOld = ''
|
|
|
|
|
const kindpkgsOld = ''
|
|
|
|
|
this.tableData = []
|
|
|
|
|
const lastNum = this.tableData.length > 0 ? Number(this.tableData[this.tableData.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)
|
|
|
|
|
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)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.tableData = [...this.tableData, ...addTable]
|
|
|
|
@ -1778,7 +1849,7 @@ export default {
|
|
|
|
|
} else {
|
|
|
|
|
cntrnoArr.push(this.tableData[i].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)) {
|
|
|
|
@ -1821,7 +1892,7 @@ export default {
|
|
|
|
|
addTable.push(_data)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log(this.tableData,addTable)
|
|
|
|
|
console.log(this.tableData, addTable)
|
|
|
|
|
this.tableData = [...this.tableData, ...addTable]
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
} else {
|
|
|
|
|