diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index 4d679b5..6310136 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -92,6 +92,7 @@ isParent="parent" @changeDetail="changeDetailFun" @changeTotal="changeTotalFun" + @changeCtnInfo="changeCtnInfoFun" v-if="!inPageLoading" > @@ -779,13 +780,13 @@ export default { console.log('initData ----', label) if (Object.keys(initDetail).includes(label)) { initDetail[label] = item.code - this.bookingDetails[label] = this.bookingDetails[label] ? this.bookingDetails[label] : item.code + this.bookingDetails[label] = this.bookingDetails[label] && this.bookingDetails[label] !== '' ? this.bookingDetails[label] : item.code } } else if (field[0] === 'ctn') { if (['CTNALL', 'CTNNUM', 'CNTRNO', 'SEALNO', 'PKGS', 'KINDPKGS', 'KGS', 'CBM', 'TAREWEIGHT', 'WEIGHTYPE', 'WEIGHKGS'].includes(field[1])) { this.ctnDefaultData[label] = item.code this.bookingDetails.ctnInputs.map((citem, cindex) => { - this.bookingDetails.ctnInputs[cindex][label] = citem[label] ? citem[label] : item.code + this.bookingDetails.ctnInputs[cindex][label] = citem[label] && citem[label] !== '' ? citem[label] : item.code }) } } else if (field[0] === 'edi') { @@ -806,7 +807,7 @@ export default { console.log('edi --- ', label) initDetail.bookingEDIExt[label] = item.code bookingEDIExt[label] = item.code - this.bookingDetails.bookingEDIExt[label] = this.bookingDetails.bookingEDIExt[label] ? this.bookingDetails.bookingEDIExt[label] : item.code + this.bookingDetails.bookingEDIExt[label] = this.bookingDetails.bookingEDIExt[label] && this.bookingDetails.bookingEDIExt[label] !== '' ? this.bookingDetails.bookingEDIExt[label] : item.code } }) }).catch(err => { @@ -1573,6 +1574,12 @@ export default { this.Showtabs = false this.tabActiveKey = '1' } + }, + changeCtnInfoFun ({ type, val }) { + console.log('获取数据') + if (type === 'kindpkgs') { + this.bookingDetails.kindpkgs = val + } } } } diff --git a/src/views/main/BookingLedger/detail/modules/billInfo.vue b/src/views/main/BookingLedger/detail/modules/billInfo.vue index 2d71c4c..70ed321 100644 --- a/src/views/main/BookingLedger/detail/modules/billInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/billInfo.vue @@ -443,10 +443,15 @@ export default { if (['issuetype', 'blfrt'].includes(type)) { this.details[type] = res.enName || '' if (type === 'blfrt') { - this.details.prepardat = this.details.prepardat ? this.details.prepardat : this.details.portload || '' - this.details.placereceiptid = this.details.placereceiptid ? this.details.placereceiptid : this.details.portloadid || '' - this.details.payableat = this.details.payableat ? this.details.payableat : this.details.portdischarge || '' - this.details.payableatid = this.details.payableatid ? this.details.payableatid : this.details.portdischargeid || '' + if (this.details.blfrt === 'FREIGHT COLLECT') { + // 到付 payableat + this.details.payableat = this.details.payableat ? this.details.payableat : this.details.portdischarge || '' + this.details.payableatid = this.details.payableatid ? this.details.payableatid : this.details.portdischargeid || '' + } else { + // 预付 prepardat + this.details.prepardat = this.details.prepardat ? this.details.prepardat : this.details.portload || '' + this.details.prepardatid = this.details.prepardatid ? this.details.prepardatid : this.details.portloadid || '' + } } } else if (['issueplace', 'prepardat', 'payableat'].includes(type)) { this.details[type] = res.enName || '' diff --git a/src/views/main/BookingLedger/detail/modules/goodsTable.vue b/src/views/main/BookingLedger/detail/modules/goodsTable.vue index 8d5f2bd..03ef12d 100644 --- a/src/views/main/BookingLedger/detail/modules/goodsTable.vue +++ b/src/views/main/BookingLedger/detail/modules/goodsTable.vue @@ -303,23 +303,23 @@ export default { this.tableData[rowIndex].kindpkgs = data.name row['kindpkgs'] = data.name console.log('== 设置了包装内容 ==', row['kindpkgs']) - this.tableData.map((item, index) => { - item.kindpkgs = this.packageList[val].name || '' - console.log('== 设置其他箱 - 包装 ==', index, item.kindpkgs) - if ( - document - .getElementsByClassName('kindpkgsView') - [index].getElementsByClassName('ant-select-selection-selected-value')[0] - ) { - document - .getElementsByClassName('kindpkgsView') - [index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = - this.packageList[val].name || '' - } else { - document.getElementsByClassName('kindpkgsView')[index].getElementsByTagName('input')[0].val = - this.packageList[val].name || '' - } - }) + setTimeout(() => { + this.tableData.map((item, index) => { + item.kindpkgs = this.packageList[val].name || '' + console.log('== 设置其他箱 - 包装 ==', index, item.kindpkgs) + if ( + document + .getElementsByClassName('kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0] + ) { + document + .getElementsByClassName('kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = + this.packageList[val].name || '' + } else { + document.getElementsByClassName('kindpkgsView')[index].getElementsByTagName('input')[0].val = + this.packageList[val].name || '' + } + }) + }, 300) this.$forceUpdate() } else { row['kindpkgs'] = '' @@ -328,11 +328,14 @@ export default { if (index !== rowIndex) { item.kindpkgs = '' document - .getElementsByClassName('kindpkgsView') - [index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = '' + .getElementsByClassName('kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = '' } }) } + this.$emit('changeCtnInfo', { + type: 'kindpkgs', + val: row['kindpkgs'] + }) }} on-focus={val => { this.kindpkgsViewIndex = rowIndex diff --git a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue index 35f0433..833d8e5 100644 --- a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue @@ -1433,12 +1433,12 @@ export default { if (type === 'portloadid') { // 装货港 this.details.issueplace = res['enName'] || '' this.details.issueplaceid = res['ediCode'] || '' - this.details.prepardat = this.details.prepardat ? this.details.prepardat : res['enName'] || '' + // this.details.prepardat = this.details.prepardat ? this.details.prepardat : res['enName'] || '' this.details.placereceiptid = this.details.placereceiptid ? this.details.placereceiptid : res['ediCode'] || '' this.details.placereceipt = this.details.placereceipt ? this.details.placereceipt : res['enName'] || '' } else if (type === 'portdischargeid') { // 卸货港 - this.details.payableat = this.details.payableat ? this.details.payableat : res['enName'] || '' - this.details.payableatid = this.details.payableatid ? this.details.payableatid : res['ediCode'] || '' + // this.details.payableat = this.details.payableat ? this.details.payableat : res['enName'] || '' + // this.details.payableatid = this.details.payableatid ? this.details.payableatid : res['ediCode'] || '' } else if (type === 'placereceiptid') { this.details.portloadid = this.details.portloadid ? this.details.portloadid : res['ediCode'] || '' this.details.portload = this.details.portload ? this.details.portload : res['enName'] || '' diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index f20337d..059c6c4 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -733,7 +733,7 @@ export default { this.formAllData = JSON.parse(JSON.stringify(initData.condAllData)) this.fromTableAllData = JSON.parse(JSON.stringify(initData.columnsAllData)) this.tableHeight = document.body.clientHeight - 230 - this.getList({}, true) + // this.getList({}, true) this.getConfigUser(true) this.getCarrier() }, @@ -896,7 +896,7 @@ export default { getConfigUser(isInit = false) { // 请求自定义: 查询表单 表头 页码 const query = { - typeArr: ['booking_list_cond', 'booking_list_column'] + typeArr: ['booking_list_cond', 'booking_list_column', 'booking_list_page'] } DjyUserConfigMulti(this.$qs.stringify(query, { arrayFormat: 'repeat' })).then(res => { const $data = {} @@ -910,9 +910,9 @@ export default { this.$set($data, 'booking_list_column', item) // this.setTableList(item) break - // case 'booking_list_page': - // this.setPageSize(item) - // break + case 'booking_list_page': + this.setPageSize(item) + break } }) console.log('==获取数据,表单 ==', $data.booking_list_cond) @@ -1086,6 +1086,7 @@ export default { setPageSize(data) { if (data && JSON.parse(data.configJson)) { this.gridOptions.pagerConfig.pageSize = JSON.parse(data.configJson).pageSize + this.getList({}, true, 'add') this.$forceUpdate() } }, @@ -1123,9 +1124,9 @@ export default { }) }, handlePageChange({ currentPage, pageSize }) { - // if (this.gridOptions.pagerConfig.pageSize !== pageSize) { - // this.editPageSizeSave(pageSize) - // } + if (this.gridOptions.pagerConfig.pageSize !== pageSize) { + this.editPageSizeSave(pageSize) + } this.gridOptions.pagerConfig.currentPage = currentPage this.gridOptions.pagerConfig.pageSize = pageSize console.log('== 当前搜索内容 ==', this.searchData) @@ -1133,15 +1134,15 @@ export default { }, editPageSizeSave(pageSize = 10) { - // const data = { - // pageSize: pageSize - // } - // DjyUserConfigAdd({ - // type: 'booking_list_page', - // configJson: JSON.stringify(data) - // }).then(res => { - // console.log('页码设置成功') - // }) + const data = { + pageSize: pageSize + } + DjyUserConfigAdd({ + type: 'booking_list_page', + configJson: JSON.stringify(data) + }).then(res => { + console.log('页码设置成功') + }) }, // form @@ -1306,7 +1307,7 @@ export default { editColumns(row) { this.$router.push({ name: 'BookingDetail', query: { id: row.id, type: row.carrierid, mblno: row.mblno } }) }, - getList(queryParam = {}, isInit = false) { + getList(queryParam = {}, isInit = false, isAdd = 'normal') { this.$set(this.gridOptions, 'loading', true) const { currentPage, pageSize } = this.gridOptions.pagerConfig const query = { @@ -1377,6 +1378,7 @@ export default { this.$set(this.gridOptions.pagerConfig, 'columns', JSON.parse(JSON.stringify(initData.columns))) // debugger // this.$set(this.gridOptions, 'data', [..._data]) + console.log('== 即将渲染列表 ==', isAdd) this.$refs.xGrid.reloadData(_data).then(() => { this.$set(this.gridOptions, 'loading', false) })