From 7e94698bdd1331da098e2c747d76768760d386b3 Mon Sep 17 00:00:00 2001 From: sunzehua Date: Thu, 18 May 2023 10:38:07 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/modules/cargoInfo.vue | 2 +- .../detail/modules/goodsTable.vue | 68 +++++------- src/views/main/BookingLedger/list/index.vue | 104 ++++++++++-------- src/views/main/SendCar/addForm.vue | 27 +++-- 4 files changed, 108 insertions(+), 93 deletions(-) diff --git a/src/views/main/BookingLedger/detail/modules/cargoInfo.vue b/src/views/main/BookingLedger/detail/modules/cargoInfo.vue index e50f7e2..b13754a 100644 --- a/src/views/main/BookingLedger/detail/modules/cargoInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/cargoInfo.vue @@ -52,7 +52,7 @@ :defaultVal="details.goodsname" searchApi="getGoodsname" :searchQuery="{ queryItem: '', top: 50 }" - :showLabel="['goodsCode', 'goodsNameEN']" + :showLabel="['goodsNameEN', 'goodsCode']" :openSearch="true" @change="getSelectViewRes" style="width: 75%;max-width:210px;" diff --git a/src/views/main/BookingLedger/detail/modules/goodsTable.vue b/src/views/main/BookingLedger/detail/modules/goodsTable.vue index 28540b2..2a0f4b2 100644 --- a/src/views/main/BookingLedger/detail/modules/goodsTable.vue +++ b/src/views/main/BookingLedger/detail/modules/goodsTable.vue @@ -293,6 +293,7 @@ export default { edit: false, width: 130, renderBodyCell: ({ row, column, rowIndex }, h) => { + this.openEdit = true return ( { - // const activeDom = document.getElementsByClassName('ve-table-cell-selection')[0].firstChild - // if (this.isDOM(activeDom)) { - // const isCtnall = activeDom.classList.contains('ctnallView') - // const isKindpkgs = activeDom.classList.contains('kindpkgsView') - // if (isCtnall) { - // console.log('== 点击到箱型按钮,设置当前table禁止编辑 ==') - // activeDom.click() - // // this.cellSelectionOption.enable = false - // // setTimeout(() => { - // // this.cellAutofillOption = false - // // this.rowKeyName = false - // // this.tableData.map((item, index) => { - // // delete item.rowKey - // // }) - // // }, 300) - // } - // if (isKindpkgs) { - // activeDom.click() - // // this.cellSelectionOption.enable = false - // // setTimeout(() => { - // // this.cellAutofillOption = false - // // this.rowKeyName = false - // // this.tableData.map((item, index) => { - // // delete item.rowKey - // // }) - // // }, 300) - // } - // } - // }, 600) - // } + const arr = [] + if (document.getElementsByClassName('ant-select-dropdown').length > 0) { + document.getElementsByClassName('ant-select-dropdown').forEach((item) => { + const style = item.style + if (style.display !== 'none') { + arr.push(1) + } + }) + } + if (arr.length === 0) { + this.cellSelectionOption.enable = true + if ([37, 38, 39, 40, 9].includes(event.keyCode)) { + if (arr.length === 0) { + // this.openKeyDown = true + + setTimeout(() => { + const activeDom = document.getElementsByClassName('ve-table-cell-selection')[0].firstChild + if (this.isDOM(activeDom)) { + activeDom.click() + } + }, 200) + } + } + } else { + this.cellSelectionOption.enable = false + } } }) } diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index 8f6cfa7..229ba35 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -1,5 +1,5 @@