diff --git a/src/views/main/BookingLedger/detail/components/sedOrder.vue b/src/views/main/BookingLedger/detail/components/sedOrder.vue index 9af85e7..e0ab26e 100644 --- a/src/views/main/BookingLedger/detail/components/sedOrder.vue +++ b/src/views/main/BookingLedger/detail/components/sedOrder.vue @@ -178,6 +178,8 @@ export default { data.shipper = '' data.consignee = '' data.notifyparty = '' + data.pid = this.$route.query.id + data.id = 0 if (!data.bookingEDIExt) { data.bookingEDIExt = { weiTuoFang: '', @@ -211,7 +213,8 @@ export default { // this.init() }, saveFun () { - if (this.editDetails.id !== 0) { + debugger + if (this.editDetails.id !== 0 && Number(this.editDetails.id) !== Number(this.$route.query.id)) { this.bookingOrderUpdate() } else { this.bookingOrderAdd() @@ -249,12 +252,18 @@ export default { } let data = JSON.parse(JSON.stringify(this.editDetails)) delete data.isNoSave + data.pid = this.$route.query.id + data.id = 0 + data.ctnInputs.map((item, index) => { + item.id = 0 + }) BookingOrderAdd(data) .then((res) => { if (res.success) { this.sedOrderList[this.editIndex].isNoSave = false this.editDetails.isNoSave = false this.sedOrderList[this.editIndex].id = res.data + debugger this.$message.success('保存成功') this.$emit('changeHB', this.sedOrderList) this.$forceUpdate() @@ -288,6 +297,8 @@ export default { const _data = JSON.parse(JSON.stringify(this.editDetails)) _data.isNoSave = true _data.hblno = '' + _data.pid = this.$route.query.id + _data.id = 0 if (!_data.bookingEDIExt) { _data.bookingEDIExt = { weiTuoFang: '', diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index d380288..45a1235 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -108,6 +108,7 @@ import { BookingOrderAddOrUpdate } from '@/api/modular/main/BookingLedger' import { mapActions, mapGetters } from 'vuex' +import { string } from 'clipboard' const initDetail = { id: 0, parentId: 0, @@ -571,7 +572,11 @@ export default { // this.init() this.$forceUpdate() } else { - this.$message.error(res.message) + if (typeof (res.message) === 'string') { + this.$message.error(res.message) + } else { + this.$message.error('保存失败') + } } }) .catch(err => { @@ -598,7 +603,11 @@ export default { }) this.$forceUpdate() } else { - this.$message.error(res.message) + if (typeof (res.message) === 'string') { + this.$message.error(res.message) + } else { + this.$message.error('保存失败') + } } }) .catch(err => { @@ -923,7 +932,7 @@ export default { // margin-top: 4px !important; } .ant-form-item-label{ - line-height: 30px !important; + // line-height: 30px !important; // border: 1px solid #f00; } .ant-form-item-control-wrapper{ diff --git a/src/views/main/BookingLedger/detail/modules/goodsTable.vue b/src/views/main/BookingLedger/detail/modules/goodsTable.vue index 1cf4e3a..fded984 100644 --- a/src/views/main/BookingLedger/detail/modules/goodsTable.vue +++ b/src/views/main/BookingLedger/detail/modules/goodsTable.vue @@ -120,9 +120,8 @@ export default { renderBodyCell: ({ row, column, rowIndex }, h) => { return ( { const data = this.ctnList[val] @@ -177,8 +176,8 @@ export default { renderBodyCell: ({ row, column, rowIndex }, h) => { return ( { @@ -413,22 +412,63 @@ export default { this.$message.error(`输入的${this.enmuErrorLabel(column.field)}不符合规则`) setTimeout(() => { this.$message.destroy() + this.$message.config({ + top: `100px`, + duration: 2, + maxCount: 3 + }) }, 2000) return false } if (column.field === 'cntrno') { const res = this.checkCntrno(changeValue) if (res !== '') { + const height = document.body.clientHeight - 100 + this.$message.config({ + top: `${height}px`, + duration: 2, + maxCount: 3 + }) this.$message.error(res) - row['cntrno'] = '' + // row['cntrno'] = '' setTimeout(() => { this.$message.destroy() + this.$message.config({ + top: `100px`, + duration: 2, + maxCount: 3 + }) }, 2000) return false } } }, afterCellValueChange: ({ row, column, changeValue }) => { + if (['kgs', 'cbm', 'tareweight', 'weighkgs'].includes(column.field)) { + changeValue = changeValue + '' + const valIndex = changeValue.indexOf('.') + 1 + const valCount = changeValue.length - valIndex + console.log(valCount) + // 判断是不是大于4位小数 + if (valCount > 4) { + const height = document.body.clientHeight - 100 + this.$message.config({ + top: `${height}px`, + duration: 2, + maxCount: 3 + }) + this.$message.error('仅支持小数点后四位') + row[column.field] = changeValue.substr(0, valIndex + 4) + setTimeout(() => { + this.$message.destroy() + this.$message.config({ + top: `100px`, + duration: 2, + maxCount: 3 + }) + }, 2000) + } + } if (column.field === 'pkgs') { let num = 0 this.tableData.map((item, index) => { @@ -460,8 +500,13 @@ export default { // this.tableData[nowIndex]['weighkgs'] = Number(this.tableData[nowIndex].kgs) + Number(this.tableData[nowIndex].tareweight) // row['weighkgs'] = Number(row['kgs']) + Number(row['tareweight']) row['weighkgs'] = this.calc(Number(row['kgs']), Number(row['tareweight']), '+') + const kgsVal = row['weighkgs'] + '' + const kgsIndex = kgsVal.indexOf('.') + 1 + const kgsCount = kgsVal.length - kgsIndex + if (kgsCount > 4) { + row['weighkgs'] = kgsVal.substr(0, kgsIndex + 4) + } } - }, cellValueChange: ({ row, column }) => { console.log('编辑', row, column) @@ -483,6 +528,11 @@ export default { row['cntrno'] = '' setTimeout(() => { this.$message.destroy() + this.$message.config({ + top: `100px`, + duration: 2, + maxCount: 3 + }) }, 2000) return false } @@ -769,6 +819,7 @@ export default { rowKey: this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0 } this.tableData.push(data) + console.log('== 新增 ==', this.tableData) }, removeLine() { this.selectArr.map((item, index) => { @@ -886,28 +937,49 @@ export default { if (res.success) { const data = JSON.parse(res.data) const addTable = [] + const cntrnoArr = [] this.tableData.map((item, index) => { if (!item.cntrno) { - delete this.tableData[index] + // delete this.tableData[index] + 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) => { - 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: '' + 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 + } + } 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: '' + } + addTable.push(_data) } - addTable.push(_data) }) this.tableData = [...this.tableData, ...addTable] diff --git a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue index 6ba007f..d32fe49 100644 --- a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue @@ -34,9 +34,10 @@
- + - + + @select="portloadSelect" + @change="portloadChange" + @focus="portloadChange" + > - + - + - + - + + @select="placedeliverySelect" + @change="placedeliveryChange" + @focus="placedeliveryChange" + /> - + @@ -495,7 +498,7 @@ :wrapperCol="wrapperCol" has-feedback > - + @@ -527,7 +530,9 @@ :wrapperCol="wrapperCol" has-feedback > - +
+ KGS +
@@ -538,7 +543,9 @@ :wrapperCol="wrapperCol" has-feedback > - +
+ CBM +
@@ -1395,6 +1402,10 @@ export default { this.details[type] = subValue this.$forceUpdate() + }, + textareaChange (e, type) { + this.details[type] = e.target.value + console.log(type, this.details[type]) } } } @@ -1572,6 +1583,17 @@ export default { border-bottom: none; } +.line-box{ + display: flex; + span.unit{ + font-size: 12px; + color: #999; + display: inline-block; + text-align: center; + line-height: 28px; + padding-left: 5px; + } +} @media (max-width: 1700px) { .feeself{ top: 15px !important; diff --git a/src/views/main/BookingLedger/detail/modules/operationArea.vue b/src/views/main/BookingLedger/detail/modules/operationArea.vue index fc5d181..ba88b41 100644 --- a/src/views/main/BookingLedger/detail/modules/operationArea.vue +++ b/src/views/main/BookingLedger/detail/modules/operationArea.vue @@ -69,7 +69,7 @@ - + - + - +