From 6d68fcd260075e8b6bbb7c7d63748bdb0e11b633 Mon Sep 17 00:00:00 2001 From: lilu Date: Tue, 6 Dec 2022 18:00:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A1=A8=E5=A4=B4=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/setFormModel/index.vue | 15 +- src/store/getters.js | 3 +- src/store/modules/user.js | 41 +++-- src/views/main/BookingLedger/detail/index.vue | 15 +- src/views/main/BookingLedger/list/index.vue | 75 ++++++--- .../BookingLedger/list/modules/initData.js | 148 +++++++++++------- 6 files changed, 200 insertions(+), 97 deletions(-) diff --git a/src/components/setFormModel/index.vue b/src/components/setFormModel/index.vue index 4884e42..a857eb1 100644 --- a/src/components/setFormModel/index.vue +++ b/src/components/setFormModel/index.vue @@ -66,6 +66,10 @@ export default { default: () => { return [] } + }, + type: { + type: String, + default: '' } }, data() { @@ -102,9 +106,14 @@ export default { }, addFrom(item, index) { console.log(item) - item.field = item.label.toLowerCase() - this.fromLabel.push(item) - this.fromAllLabel.splice(index, 1) + if (this.type === 'from') { + item.field = item.label.toLowerCase() + this.fromLabel.push(item) + this.fromAllLabel.splice(index, 1) + } else if (this.type === 'table') { + this.fromLabel.push(item) + this.fromAllLabel.splice(index, 1) + } }, removeFrom(item, index) { this.fromAllLabel.push(item) diff --git a/src/store/getters.js b/src/store/getters.js index 4ad47e3..adf28aa 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -16,7 +16,8 @@ const getters = { addRouters: state => state.permission.addRouters, multiTab: state => state.app.multiTab, lang: state => state.i18n.lang, - bookingList: state => state.user.bookingList + bookingList: state => state.user.bookingList, + needSavePages: state => state.user.needSavePages } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 731e528..bfa4751 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -23,7 +23,7 @@ import { unReadNotice } from '@/api/modular/system/noticeReceivedManage' import { - welcome,dateFormat + welcome, dateFormat } from '@/utils/util' import store from '../index' import router from '../../router' @@ -39,7 +39,8 @@ const user = { roles: [], info: {}, notices: [], // 接收的通知公告 - bookingList: {} // 订舱台账列表 + bookingList: {}, // 订舱台账列表 + needSavePages: [] // 需要保存的页面 }, mutations: { @@ -71,26 +72,29 @@ const user = { SET_NOTICES: (state, notices) => { state.notices = notices }, - APPEND_NOTICE:(state,notice)=>{ - notice.publicTime=dateFormat(notice.publicTime,'YYYY-mm-dd HH:MM:SS') - let notices=state.notices; - let temp=notices.rows.filter(m=>{return m.value==notice.type})[0] - let other=notices.rows.filter(m=>{return m.value!=notice.type}) + APPEND_NOTICE: (state, notice) => { + notice.publicTime = dateFormat(notice.publicTime, 'YYYY-mm-dd HH:MM:SS') + let notices = state.notices; + let temp = notices.rows.filter(m => { return m.value == notice.type })[0] + let other = notices.rows.filter(m => { return m.value != notice.type }) temp.noticeData.unshift(notice); notices.totalRows++; - if(temp.noticeData.length>6){ + if (temp.noticeData.length > 6) { temp.noticeData.pop(); } - notices.rows=[]; + notices.rows = []; notices.rows.push(temp); - notices.rows.push.apply(notices.rows,other); - notices.rows.sort((obj1,obj2)=>{ - return obj1.index-obj2.index + notices.rows.push.apply(notices.rows, other); + notices.rows.sort((obj1, obj2) => { + return obj1.index - obj2.index }) - state.notices=notices; + state.notices = notices; }, SET_BOOKINGLIST: (state, list) => { state.bookingList = list + }, + SET_NEEDSAVEPAGES: (state, list) => { + state.needSavePages = list } }, @@ -271,11 +275,20 @@ const user = { commit }, obj) { return new Promise((resolve) => { - console.log('设置订舱列表', obj) commit('SET_BOOKINGLIST', obj) resolve() }) }, + + // 设置需要保存页面 + setNeedSavePages({ + commit + }, obj) { + return new Promise((resolve) => { + commit('SET_NEEDSAVEPAGES', obj) + resolve() + }) + }, } } diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index 1d9f22f..17f3d85 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -106,7 +106,7 @@ import { BookingOrderAdd, BookingOrderAddOrUpdate } from '@/api/modular/main/BookingLedger' -import { mapGetters } from 'vuex' +import { mapActions, mapGetters } from 'vuex' export default { name: 'BookingDetail', inject: ['reload'], @@ -139,11 +139,12 @@ export default { isAdd: false, moreStr: '', tabActiveKey: '1', - historyData: {} + historyData: {}, + noSave: false } }, computed: { - ...mapGetters(['bookingList']), + ...mapGetters(['bookingList', 'needSavePages']), Showtabs() { console.log(this.bookingDetails, 'bookingDetails') let Rdata = true @@ -158,6 +159,7 @@ export default { watch: { bookingDetails: { handler(nval, oval) { + this.noSave = true // console.log('父级 -- 数据改变', nval) }, deep: true @@ -209,6 +211,7 @@ export default { }) }, methods: { + ...mapActions(['setNeedSavePages']), getRouterHis() { const newId = this.$route.query.id if (Object.keys(this.historyData).includes(newId)) { @@ -397,6 +400,7 @@ export default { ediAttnMail: '' } } + this.noSave = false this.$set(this, 'bookingDetails', res.data) this.$forceUpdate() }) @@ -424,6 +428,7 @@ export default { if (res.success) { this.isCopy = false this.isAdd = false + this.noSave = false this.$message.success('保存成功') this.init() this.$forceUpdate() @@ -449,6 +454,7 @@ export default { if (res.success) { this.isAdd = false this.id = res.data + this.noSave = false this.$message.success('保存成功') this.$router.replace({ name: 'BookingDetail', @@ -531,6 +537,9 @@ export default { this.bookingDetails.hbList = [data] this.tabActiveKey = '2' } + }, + deactivated () { + console.log('页面销毁', this.noSave) } } diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index 4629d44..caa8d59 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -138,6 +138,7 @@ ref="setForm" :formData="formData" :formAllData="formMoreData" + type="from" @ok="submitForm" v-if="formMoreData" > @@ -146,6 +147,7 @@ ref="setTableForm" :formData="formTableData" :formAllData="formMoreTableData" + type="table" @ok="submitTableForm" v-if="formMoreTableData" > @@ -219,6 +221,7 @@ export default { }, // 表格编辑 formTableData: JSON.parse(JSON.stringify(initData.columns)), + fromTableAllData: null, formMoreTableData: null, // 新增弹窗 addVisible: false, @@ -236,6 +239,7 @@ export default { created() { this.showColumns = JSON.parse(JSON.stringify(initData.columns)) this.formAllData = JSON.parse(JSON.stringify(initData.condAllData)) + this.fromTableAllData = JSON.parse(JSON.stringify(initData.columnsAllData)) this.getList() this.getFormData() this.getTableList() @@ -313,16 +317,38 @@ export default { }) }, getTableList() { - const nowTableArr = this.formTableData.map((item, index) => { - return item.field - }) - const moreTableArr = [] - this.formAllData.map((item, index) => { - if (!nowTableArr.includes(item.label.toLowerCase())) { - moreTableArr.push(item) + DjyUserConfigGet({ type: 'booking_list_column' }).then(res => { + if (res.data && JSON.parse(res.data.configJson).length) { + this.gridOptions.columns = JSON.parse(res.data.configJson) + this.formTableData = JSON.parse(res.data.configJson) + const nowTableArr = this.formTableData.map((item, index) => { + return item.field + }) + const moreTableArr = [] + this.fromTableAllData.map((item, index) => { + if (!nowTableArr.includes(item.field)) { + moreTableArr.push(item) + } + }) + this.formMoreTableData = moreTableArr + this.$forceUpdate() + console.log(this.gridOptions.columns) + } else { + const nowTableArr = this.formTableData.map((item, index) => { + return item.field + }) + const moreTableArr = [] + this.fromTableAllData.map((item, index) => { + if (!nowTableArr.includes(item.field)) { + moreTableArr.push(item) + } + }) + this.formMoreTableData = moreTableArr + this.$forceUpdate() } }) - this.formMoreTableData = moreTableArr + // === 历史内容 === + console.log('表格自定义数据 - 更多: ', this.formMoreTableData) }, handlePageChange({ currentPage, pageSize }) { console.log(currentPage, pageSize) @@ -380,7 +406,6 @@ export default { Object.keys(this.formRes).map((item, index) => { this.formRes[item] = '' }) - debugger this.init() }, @@ -421,17 +446,24 @@ export default { this.$refs.setTableForm.open() }, submitTableForm(data) { - const newColumns = [ - // ...[{ type: 'checkbox', width: 60, noDraggable: true }], - ...JSON.parse(JSON.stringify(data)) - // ...[{ title: '操作', width: 80, noDraggable: true, slots: { default: 'operate' }, fixed: 'right' }] - ] - this.gridOptions.columns = newColumns - const arr = data.map((item, index) => { - return item.label - }) + this.gridOptions.columns = JSON.parse(JSON.stringify(data)) this.$refs.setTableForm.handleCancel() - console.log(data, arr) + this.editColumnsSave(this.gridOptions.columns) + }, + + resizableChange (e) { + this.gridOptions.columns[e.columnIndex].width = e.resizeWidth + console.log('==== 列宽拖动 =====', e.resizeWidth, this.gridOptions.columns[e.columnIndex]) + this.editColumnsSave(this.gridOptions.columns) + }, + editColumnsSave(data = {}) { + DjyUserConfigAdd({ + type: 'booking_list_column', + configJson: JSON.stringify(data) + }).then(res => { + console.log('保存成功') + this.$refs.setForm.handleCancel() + }) }, columnChange(data) { @@ -549,11 +581,8 @@ export default { }, moreNumCancel() { this.moreNumVisible = false - }, - - resizableChange () { - console.log('==== 列宽拖动 =====') } + } } diff --git a/src/views/main/BookingLedger/list/modules/initData.js b/src/views/main/BookingLedger/list/modules/initData.js index 121cc41..120537b 100644 --- a/src/views/main/BookingLedger/list/modules/initData.js +++ b/src/views/main/BookingLedger/list/modules/initData.js @@ -1,61 +1,103 @@ export default { columns: [ { type: 'checkbox', width: 60, noDraggable: true }, - { field: 'carrier', title: '船公司', showHeaderOverflow: true, sortable: true }, - { field: 'yard', title: '场站', showHeaderOverflow: true, sortable: true }, - { title: '提单号', showHeaderOverflow: true, showOverflow: false, sortable: true, slots: { default: 'mblno' } }, - { title: '船名航次', showHeaderOverflow: true, sortable: true, slots: { default: 'vessel' } }, - { field: 'etd', title: '开船日期', showHeaderOverflow: true, sortable: true }, - { field: 'voyno', title: '海关航次', showHeaderOverflow: true }, - { field: 'bookingStatus', title: '定舱状态', showHeaderOverflow: true }, - { field: 'vgm', title: 'VGM', showHeaderOverflow: true }, - { field: 'billStatus', title: '提单状态', showHeaderOverflow: true }, - { field: 'portdischarge', title: '卸货港', showHeaderOverflow: true, sortable: true }, - { field: 'createdUserName', title: '创建人', showHeaderOverflow: true, sortable: true }, - { field: 'createdTime', title: '创建时间', showHeaderOverflow: true, sortable: true }, - { field: 'cntrtotal', title: '箱型箱量', showHeaderOverflow: true, sortable: true }, - { title: '操作', width: 80, noDraggable: true, slots: { default: 'operate' }, fixed: 'right' } + { field: 'carrier', width: 120, title: '船公司', showHeaderOverflow: true, sortable: true }, + { field: 'yard', width: 120, title: '场站', showHeaderOverflow: true, sortable: true }, + { field: 'mblno', width: 160, title: '提单号', showHeaderOverflow: true, showOverflow: false, sortable: true, slots: { default: 'mblno' } }, + { field: 'vessel', width: 120, title: '船名航次', showHeaderOverflow: true, sortable: true, slots: { default: 'vessel' } }, + { field: 'etd', width: 160, title: '开船日期', showHeaderOverflow: true, sortable: true }, + { field: 'voyno', width: 120, title: '海关航次', showHeaderOverflow: true }, + { field: 'bookingStatus', width: 120, title: '定舱状态', showHeaderOverflow: true }, + { field: 'vgm', width: 120, title: 'VGM', showHeaderOverflow: true }, + { field: 'billStatus', width: 120, title: '提单状态', showHeaderOverflow: true }, + { field: 'portdischarge', width: 120, title: '卸货港', showHeaderOverflow: true, sortable: true }, + { field: 'createdUserName', width: 120, title: '创建人', showHeaderOverflow: true, sortable: true }, + { field: 'createdTime', width: 160, title: '创建时间', showHeaderOverflow: true, sortable: true }, + { field: 'cntrtotal', width: 120, title: '箱型箱量', showHeaderOverflow: true, sortable: true }, + { field: 'operate', title: '操作', width: 80, noDraggable: true, slots: { default: 'operate' }, fixed: 'right' } + ], + columnsAllData: [ + { field: 'carrier', width: 120, title: '船公司', showHeaderOverflow: true, sortable: true }, + { field: 'yard', width: 120, title: '场站', showHeaderOverflow: true, sortable: true }, + { field: 'mblno', width: 160, title: '提单号', showHeaderOverflow: true, showOverflow: false, sortable: true, slots: { default: 'mblno' } }, + { field: 'vessel', width: 120, title: '船名航次', showHeaderOverflow: true, sortable: true, slots: { default: 'vessel' } }, + { field: 'etd', width: 160, title: '开船日期', showHeaderOverflow: true, sortable: true }, + { field: 'voyno', width: 120, title: '海关航次', showHeaderOverflow: true }, + { field: 'bookingStatus', width: 120, title: '定舱状态', showHeaderOverflow: true }, + { field: 'vgm', width: 120, title: 'VGM', showHeaderOverflow: true }, + { field: 'billStatus', width: 120, title: '提单状态', showHeaderOverflow: true }, + { field: 'portdischarge', width: 120, title: '卸货港', showHeaderOverflow: true, sortable: true }, + { field: 'createdUserName', width: 120, title: '创建人', showHeaderOverflow: true, sortable: true }, + { field: 'createdTime', width: 160, title: '创建时间', showHeaderOverflow: true, sortable: true }, + { field: 'cntrtotal', width: 120, title: '箱型箱量', showHeaderOverflow: true, sortable: true }, + { field: 'atd', width: 160, title: '实际开船日期', showHeaderOverflow: true, sortable: true }, + { field: 'blfrt', width: 120, title: '付费方式', showHeaderOverflow: true, sortable: true }, + { field: 'cargoid', width: 120, title: '货物标识', showHeaderOverflow: true, sortable: true }, + { field: 'cbm', width: 90, title: '尺码', showHeaderOverflow: true, sortable: true }, + { field: 'consignee', width: 120, title: '收货人', showHeaderOverflow: true, sortable: true }, + { field: 'contractno', width: 120, title: '合约号', showHeaderOverflow: true, sortable: true }, + { field: 'customername', width: 120, title: '客户', showHeaderOverflow: true, sortable: true }, + { field: 'customser', width: 120, title: '报关行', showHeaderOverflow: true, sortable: true }, + { field: 'custservice', width: 120, title: '客服', showHeaderOverflow: true, sortable: true }, + { field: 'doc', width: 120, title: '单证', showHeaderOverflow: true, sortable: true }, + { field: 'dunno', width: 120, title: '危险品编号', showHeaderOverflow: true, sortable: true }, + { field: 'forwarder', width: 120, title: '订舱代理', showHeaderOverflow: true, sortable: true }, + { field: 'freightpayer', width: 120, title: '付款方', showHeaderOverflow: true, sortable: true }, + { field: 'hblno', width: 120, title: '分提单号', showHeaderOverflow: true, sortable: true }, + { field: 'hscode', width: 120, title: 'HS代码', showHeaderOverflow: true, sortable: true }, + { field: 'issueplace', width: 120, title: '签单地点', showHeaderOverflow: true, sortable: true }, + { field: 'issueplace', width: 120, title: '签单地点', showHeaderOverflow: true, sortable: true }, + { field: 'issuetype', width: 120, title: '签单方式', showHeaderOverflow: true, sortable: true }, + { field: 'kgs', width: 120, title: '毛重', showHeaderOverflow: true, sortable: true }, + { field: 'kindpkgs', width: 120, title: '包装', showHeaderOverflow: true, sortable: true }, + { field: 'pkgs', width: 120, title: '件数', showHeaderOverflow: true, sortable: true }, + { field: 'marks', width: 120, title: '唛头', showHeaderOverflow: true, sortable: true }, + { field: 'nobill', width: 120, title: '提单分数', showHeaderOverflow: true, sortable: true }, + { field: 'notifyparty', width: 120, title: '通知人', showHeaderOverflow: true, sortable: true }, + { field: 'op', width: 120, title: '操作人', showHeaderOverflow: true, sortable: true }, + { field: 'payableat', width: 120, title: '到付地点', showHeaderOverflow: true, sortable: true }, + { field: 'placedelivery', width: 120, title: '交货地', showHeaderOverflow: true, sortable: true }, ], condAllData: [ - { title: '业务编号', align: 'center', width: '90', label: 'BSNO', type: 'input' }, - { title: '船公司', align: 'center', width: '90', label: 'CARRIER', type: 'input' }, - { title: '业务状态', align: 'center', width: '90', label: 'BSSTATUS', type: 'input' }, - { title: '业务状态名称', align: 'center', width: '90', label: 'BSSTATUSNAME', type: 'input' }, - { title: '业务日期', align: 'center', width: '90', label: 'BSDATE', type: 'date' }, - { title: '主提单号', align: 'center', width: '90', label: 'MBLNO', type: 'input' }, - { title: '分提单号', align: 'center', width: '90', label: 'HBLNO', type: 'input' }, - { title: '订舱编号', align: 'center', width: '90', label: 'BOOKINGNO', type: 'input' }, - { title: '合约号', align: 'center', width: '90', label: 'CONTRACTNO', type: 'input' }, - { title: '客户合同号', align: 'center', width: '90', label: 'SERVICECONTRACTNO', type: 'input' }, - { title: '发货人代码', align: 'center', width: '90', label: 'SHIPPERID', type: 'input' }, - { title: '收货人代码', align: 'center', width: '90', label: 'CONSIGNEEID', type: 'input' }, - { title: '通知人代码', align: 'center', width: '90', label: 'NOTIFYPARTYID', type: 'input' }, - { title: '发货人', align: 'center', width: '90', label: 'SHIPPER', type: 'input' }, - { title: '收货人', align: 'center', width: '90', label: 'CONSIGNEE', type: 'input' }, - { title: '通知人', align: 'center', width: '90', label: 'NOTIFYPARTY', type: 'input' }, - { title: '第二通知人', align: 'center', width: '90', label: 'NOTIFYPARTY2', type: 'input' }, - { title: '场站代码', align: 'center', width: '90', label: 'YARDID', type: 'input' }, - { title: '场站', align: 'center', width: '90', label: 'YARD', type: 'input' }, - { title: '船舶呼号', align: 'center', width: '90', label: 'VESSELID', type: 'input' }, - { title: '船名', align: 'center', width: '90', label: 'VESSEL', type: 'input' }, - { title: '海关航次', align: 'center', width: '90', label: 'VOYNO', type: 'input' }, - { title: '内部航次', align: 'center', width: '90', label: 'VOYNOINNER', type: 'input' }, - { title: '开船日期', align: 'center', width: '90', label: 'ETD', type: 'dateRange' }, - { title: '实际开船日期', align: 'center', width: '90', label: 'ATD', type: 'date' }, - { title: '截港日期', align: 'center', width: '90', label: 'CLOSINGDATE', type: 'date' }, - { title: '截单日期', align: 'center', width: '90', label: 'CLOSEDOCDATE', type: 'date' }, - { title: '截VGM时间', align: 'center', width: '90', label: 'CLOSEVGMDATE', type: 'date' }, - { title: '预计到港日期', align: 'center', width: '90', label: 'ETA', type: 'date' }, - { title: '收货地代码', align: 'center', width: '90', label: 'PLACERECEIPTID', type: 'input' }, - { title: '收货地', align: 'center', width: '90', label: 'PLACERECEIPT', type: 'input' }, - { title: '起运港代码', align: 'center', width: '90', label: 'PORTLOADID', type: 'input' }, - { title: '起运港', align: 'center', width: '90', label: 'PORTLOAD', type: 'input' }, - { title: '卸货港代码', align: 'center', width: '90', label: 'PORTDISCHARGEID', type: 'input' }, - { title: '卸货港', align: 'center', width: '90', label: 'PORTDISCHARGE', type: 'input' }, - { title: '交货地代码', align: 'center', width: '90', label: 'PLACEDELIVERYID', type: 'input' }, - { title: '交货地', align: 'center', width: '90', label: 'PLACEDELIVERY', type: 'input' }, - { title: '目的地代码', align: 'center', width: '90', label: 'DESTINATIONID', type: 'input' }, - { title: '目的地', align: 'center', width: '90', label: 'DESTINATION', type: 'input' } + { title: '业务编号', align: 'center', width: 120, label: 'BSNO', type: 'input' }, + { title: '船公司', align: 'center', width: 120, label: 'CARRIER', type: 'input' }, + { title: '业务状态', align: 'center', width: 120, label: 'BSSTATUS', type: 'input' }, + { title: '业务状态名称', align: 'center', width: 120, label: 'BSSTATUSNAME', type: 'input' }, + { title: '业务日期', align: 'center', width: 120, label: 'BSDATE', type: 'date' }, + { title: '主提单号', align: 'center', width: 160, label: 'MBLNO', type: 'input' }, + { title: '分提单号', align: 'center', width: 160, label: 'HBLNO', type: 'input' }, + { title: '订舱编号', align: 'center', width: 120, label: 'BOOKINGNO', type: 'input' }, + { title: '合约号', align: 'center', width: 120, label: 'CONTRACTNO', type: 'input' }, + { title: '客户合同号', align: 'center', width: 120, label: 'SERVICECONTRACTNO', type: 'input' }, + { title: '发货人代码', align: 'center', width: 120, label: 'SHIPPERID', type: 'input' }, + { title: '收货人代码', align: 'center', width: 120, label: 'CONSIGNEEID', type: 'input' }, + { title: '通知人代码', align: 'center', width: 120, label: 'NOTIFYPARTYID', type: 'input' }, + { title: '发货人', align: 'center', width: 120, label: 'SHIPPER', type: 'input' }, + { title: '收货人', align: 'center', width: 120, label: 'CONSIGNEE', type: 'input' }, + { title: '通知人', align: 'center', width: 120, label: 'NOTIFYPARTY', type: 'input' }, + { title: '第二通知人', align: 'center', width: 120, label: 'NOTIFYPARTY2', type: 'input' }, + { title: '场站代码', align: 'center', width: 120, label: 'YARDID', type: 'input' }, + { title: '场站', align: 'center', width: 120, label: 'YARD', type: 'input' }, + { title: '船舶呼号', align: 'center', width: 120, label: 'VESSELID', type: 'input' }, + { title: '船名', align: 'center', width: 120, label: 'VESSEL', type: 'input' }, + { title: '海关航次', align: 'center', width: 120, label: 'VOYNO', type: 'input' }, + { title: '内部航次', align: 'center', width: 120, label: 'VOYNOINNER', type: 'input' }, + { title: '开船日期', align: 'center', width: 160, label: 'ETD', type: 'dateRange' }, + { title: '实际开船日期', align: 'center', width: 160, label: 'ATD', type: 'date' }, + { title: '截港日期', align: 'center', width: 160, label: 'CLOSINGDATE', type: 'date' }, + { title: '截单日期', align: 'center', width: 160, label: 'CLOSEDOCDATE', type: 'date' }, + { title: '截VGM时间', align: 'center', width: 160, label: 'CLOSEVGMDATE', type: 'date' }, + { title: '预计到港日期', align: 'center', width: 160, label: 'ETA', type: 'date' }, + { title: '收货地代码', align: 'center', width: 120, label: 'PLACERECEIPTID', type: 'input' }, + { title: '收货地', align: 'center', width: 120, label: 'PLACERECEIPT', type: 'input' }, + { title: '起运港代码', align: 'center', width: 120, label: 'PORTLOADID', type: 'input' }, + { title: '起运港', align: 'center', width: 120, label: 'PORTLOAD', type: 'input' }, + { title: '卸货港代码', align: 'center', width: 120, label: 'PORTDISCHARGEID', type: 'input' }, + { title: '卸货港', align: 'center', width: 120, label: 'PORTDISCHARGE', type: 'input' }, + { title: '交货地代码', align: 'center', width: 120, label: 'PLACEDELIVERYID', type: 'input' }, + { title: '交货地', align: 'center', width: 120, label: 'PLACEDELIVERY', type: 'input' }, + { title: '目的地代码', align: 'center', width: 120, label: 'DESTINATIONID', type: 'input' }, + { title: '目的地', align: 'center', width: 120, label: 'DESTINATION', type: 'input' }, // 此处省略部分数据 ] } From 3e67cbe5758c169872965951ba873dc86bfba3ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com> Date: Wed, 7 Dec 2022 10:42:24 +0800 Subject: [PATCH 2/2] 12/7 --- src/views/main/BookingLedger/list/index.vue | 31 +++++++++---- .../BookingLedger/list/modules/initData.js | 46 +++++++++++++++---- 2 files changed, 60 insertions(+), 17 deletions(-) diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index ef1bf10..1d25bed 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -34,12 +34,12 @@ > 查询 重置 - 多提单号查询 - + + 多提单号查询 + + + + {{ advanced ? '收起查询' : '更多查询' }} @@ -444,7 +444,7 @@ export default { this.editColumnsSave(this.gridOptions.columns) }, - resizableChange (e) { + resizableChange(e) { this.gridOptions.columns[e.columnIndex].width = e.resizeWidth console.log('==== 列宽拖动 =====', e.resizeWidth, this.gridOptions.columns[e.columnIndex]) this.editColumnsSave(this.gridOptions.columns) @@ -563,7 +563,21 @@ export default { // 多表单 moreNumSubmit() { - this.formRes.MBLNO = this.moreNumVal.replace(/\n|\r/g, ',') + let data = '' + this.moreNumVal + .replace(/\n|\r/g, ',') + .split(',') + .forEach(item => { + if (item.replace(/\s*/g, '')) { + if (data) { + data = `${data},${item}` + } else { + data = item + } + } + }) + + this.formRes.MBLNO = data this.$refs['fromlabel-MBLNO'][0].$data.value = this.formRes.MBLNO this.$forceUpdate() this.moreNumCancel() @@ -571,7 +585,6 @@ export default { moreNumCancel() { this.moreNumVisible = false } - } } diff --git a/src/views/main/BookingLedger/list/modules/initData.js b/src/views/main/BookingLedger/list/modules/initData.js index 120537b..b4e46e4 100644 --- a/src/views/main/BookingLedger/list/modules/initData.js +++ b/src/views/main/BookingLedger/list/modules/initData.js @@ -3,11 +3,26 @@ export default { { type: 'checkbox', width: 60, noDraggable: true }, { field: 'carrier', width: 120, title: '船公司', showHeaderOverflow: true, sortable: true }, { field: 'yard', width: 120, title: '场站', showHeaderOverflow: true, sortable: true }, - { field: 'mblno', width: 160, title: '提单号', showHeaderOverflow: true, showOverflow: false, sortable: true, slots: { default: 'mblno' } }, - { field: 'vessel', width: 120, title: '船名航次', showHeaderOverflow: true, sortable: true, slots: { default: 'vessel' } }, + { + field: 'mblno', + width: 160, + title: '主提单号', + showHeaderOverflow: true, + showOverflow: false, + sortable: true, + slots: { default: 'mblno' } + }, + { + field: 'vessel', + width: 120, + title: '船名航次', + showHeaderOverflow: true, + sortable: true, + slots: { default: 'vessel' } + }, { field: 'etd', width: 160, title: '开船日期', showHeaderOverflow: true, sortable: true }, { field: 'voyno', width: 120, title: '海关航次', showHeaderOverflow: true }, - { field: 'bookingStatus', width: 120, title: '定舱状态', showHeaderOverflow: true }, + { field: 'bookingStatus', width: 120, title: '订舱状态', showHeaderOverflow: true }, { field: 'vgm', width: 120, title: 'VGM', showHeaderOverflow: true }, { field: 'billStatus', width: 120, title: '提单状态', showHeaderOverflow: true }, { field: 'portdischarge', width: 120, title: '卸货港', showHeaderOverflow: true, sortable: true }, @@ -19,11 +34,26 @@ export default { columnsAllData: [ { field: 'carrier', width: 120, title: '船公司', showHeaderOverflow: true, sortable: true }, { field: 'yard', width: 120, title: '场站', showHeaderOverflow: true, sortable: true }, - { field: 'mblno', width: 160, title: '提单号', showHeaderOverflow: true, showOverflow: false, sortable: true, slots: { default: 'mblno' } }, - { field: 'vessel', width: 120, title: '船名航次', showHeaderOverflow: true, sortable: true, slots: { default: 'vessel' } }, + { + field: 'mblno', + width: 160, + title: '主提单号', + showHeaderOverflow: true, + showOverflow: false, + sortable: true, + slots: { default: 'mblno' } + }, + { + field: 'vessel', + width: 120, + title: '船名航次', + showHeaderOverflow: true, + sortable: true, + slots: { default: 'vessel' } + }, { field: 'etd', width: 160, title: '开船日期', showHeaderOverflow: true, sortable: true }, { field: 'voyno', width: 120, title: '海关航次', showHeaderOverflow: true }, - { field: 'bookingStatus', width: 120, title: '定舱状态', showHeaderOverflow: true }, + { field: 'bookingStatus', width: 120, title: '订舱状态', showHeaderOverflow: true }, { field: 'vgm', width: 120, title: 'VGM', showHeaderOverflow: true }, { field: 'billStatus', width: 120, title: '提单状态', showHeaderOverflow: true }, { field: 'portdischarge', width: 120, title: '卸货港', showHeaderOverflow: true, sortable: true }, @@ -56,7 +86,7 @@ export default { { field: 'notifyparty', width: 120, title: '通知人', showHeaderOverflow: true, sortable: true }, { field: 'op', width: 120, title: '操作人', showHeaderOverflow: true, sortable: true }, { field: 'payableat', width: 120, title: '到付地点', showHeaderOverflow: true, sortable: true }, - { field: 'placedelivery', width: 120, title: '交货地', showHeaderOverflow: true, sortable: true }, + { field: 'placedelivery', width: 120, title: '交货地', showHeaderOverflow: true, sortable: true } ], condAllData: [ { title: '业务编号', align: 'center', width: 120, label: 'BSNO', type: 'input' }, @@ -97,7 +127,7 @@ export default { { title: '交货地代码', align: 'center', width: 120, label: 'PLACEDELIVERYID', type: 'input' }, { title: '交货地', align: 'center', width: 120, label: 'PLACEDELIVERY', type: 'input' }, { title: '目的地代码', align: 'center', width: 120, label: 'DESTINATIONID', type: 'input' }, - { title: '目的地', align: 'center', width: 120, label: 'DESTINATION', type: 'input' }, + { title: '目的地', align: 'center', width: 120, label: 'DESTINATION', type: 'input' } // 此处省略部分数据 ] }