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) {