diff --git a/src/views/main/BookingLedger/detail/modules/goodsTable.vue b/src/views/main/BookingLedger/detail/modules/goodsTable.vue index 7a82b7f..5312d6d 100644 --- a/src/views/main/BookingLedger/detail/modules/goodsTable.vue +++ b/src/views/main/BookingLedger/detail/modules/goodsTable.vue @@ -644,9 +644,36 @@ export default { maxCount: 3 }) }, 2000) + } else { + const arrayNum = changeValue.split('.') + if (!/\./.test(changeValue)) { + row[column.field] = changeValue + '.00' + } else if (arrayNum[1].length < 2) { + row[column.field] = changeValue + '0' + } } } if (column.field === 'pkgs') { + if (!(/(^[1-9]\d*$)/.test(changeValue))) { + console.log('== 非正整数 ==') + const height = document.body.clientHeight - 100 + this.$message.config({ + top: `${height}px`, + duration: 2, + maxCount: 3 + }) + this.$message.error('件数请输入整数') + const cNum = changeValue.indexOf('.') + row[column.field] = changeValue.substr(0, cNum) + setTimeout(() => { + this.$message.destroy() + this.$message.config({ + top: `100px`, + duration: 2, + maxCount: 3 + }) + }, 2000) + } let num = 0 this.tableData.map((item, index) => { num += Number(item.pkgs) @@ -658,14 +685,30 @@ export default { this.tableData.map((item, index) => { num += Number(item.kgs) }) - this.totalKgs = num + num += '' + const pNum = num.split('.') + if (!/\./.test(num)) { + this.totalKgs = num + '.00' + } else if (pNum[1].length < 2) { + this.totalKgs = num + '0' + } else { + this.totalKgs = num + } } if (column.field === 'cbm') { let num = 0 this.tableData.map((item, index) => { num += Number(item.cbm) }) - this.totalCbm = num + num += '' + const pNum = num.split('.') + if (!/\./.test(num)) { + this.totalCbm = num + '.00' + } else if (pNum[1].length < 2) { + this.totalCbm = num + '0' + } else { + this.totalCbm = num + } } if (column.field === 'kgs' || column.field === 'tareweight') { // let nowIndex = 0 @@ -682,6 +725,13 @@ export default { const kgsCount = kgsVal.length - kgsIndex if (kgsCount > 4) { row['weighkgs'] = kgsVal.substr(0, kgsIndex + 4) + } else { + const arrayNum = kgsVal.split('.') + if (!/\./.test(kgsVal)) { + row['weighkgs'] = kgsVal + '.00' + } else if (arrayNum[1].length < 2) { + row['weighkgs'] = kgsVal + '0' + } } } }, @@ -1033,7 +1083,7 @@ export default { cntrno: '', sealno: '', pkgs: '', - kindpkgs: '', + kindpkgs: this.tableData.length > 0 ? this.tableData[0].kindpkgs : '', kgs: '', cbm: '', tareweight: '', diff --git a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue index f55ed2e..ec17f3a 100644 --- a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue @@ -273,7 +273,7 @@ @@ -293,7 +293,7 @@ @@ -313,7 +313,7 @@ @@ -1148,14 +1148,13 @@ export default { }) }, portloadSelect(value) { - this.details.issueplace = value - if (!this.details.prepardat) { - this.details.prepardat = value - } const index = this.portloadDataArr.indexOf(value) this.details.portloadid = this.portloadData[index].ediCode this.details.portload = this.portloadData[index].enName - + this.details.issueplace = this.portloadData[index].enName + if (!this.details.prepardat) { + this.details.prepardat = this.portloadData[index].enName + } }, portloadChange(value) { if (!value) { @@ -1193,12 +1192,12 @@ export default { }, // 卸货港 portdischargeSelect(value) { - if (!this.details.payableat) { - this.details.payableat = value - } const index = this.portdischargeDataArr.indexOf(value) this.details.portdischargeid = this.portdischargeData[index].ediCode this.details.portdischarge = this.portdischargeData[index].enName + if (!this.details.payableat) { + this.details.payableat = this.portdischargeData[index].enName + } }, portdischargeChange(value) { if (!value) { diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index 3001aed..1558589 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -124,6 +124,9 @@ + diff --git a/src/views/main/BookingLedger/list/modules/initData.js b/src/views/main/BookingLedger/list/modules/initData.js index 2b0a5c1..5a32f63 100644 --- a/src/views/main/BookingLedger/list/modules/initData.js +++ b/src/views/main/BookingLedger/list/modules/initData.js @@ -65,7 +65,7 @@ export default { { field: 'createdUserName', label: 'CREATEDUSERNAME', width: 120, title: '创建人', showHeaderOverflow: true, sortable: true }, { field: 'createdTime', label: 'CREATEDTIME', width: 160, title: '创建时间', showHeaderOverflow: true, sortable: true }, { field: 'cntrtotal', label: 'CNTRTOTAL', width: 120, title: '箱型箱量', showHeaderOverflow: true, sortable: true }, - { field: 'atd', label: 'ATD', width: 160, title: '实际开船日期', showHeaderOverflow: true, sortable: true }, + { field: 'atd', label: 'ATD', width: 160, title: '实际开船日期', showHeaderOverflow: true, sortable: true, slots: { default: 'atd' } }, { field: 'blfrt', label: 'BLFRT', width: 120, title: '付费方式', showHeaderOverflow: true, sortable: true }, { field: 'cargoid', label: 'CARGOID', width: 120, title: '货物标识', showHeaderOverflow: true, sortable: true }, { field: 'cbm', label: 'CBM', width: 90, title: '尺码', showHeaderOverflow: true, sortable: true },