修改BUG

dev
lilu 2 years ago
parent 5947f93f82
commit 3486d16b75

@ -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: '',

@ -273,7 +273,7 @@
<a-date-picker
style="min-width:100px"
show-time
format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH:mm"
v-model="details.closingdate"
@change="closingdateChange"
>
@ -293,7 +293,7 @@
<a-date-picker
style="min-width:100px"
show-time
format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH:mm"
v-model="details.closedocdate"
@change="closedocdateChange"
>
@ -313,7 +313,7 @@
<a-date-picker
style="min-width:100px"
show-time
format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH:mm"
v-model="details.closevgmdate"
@change="closevgmdateChange"
>
@ -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) {

Loading…
Cancel
Save