From 786a139a5855dfec193dc3e7b794127ed3e62fe2 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期五, 12 四月 2024 15:26:45 +0800 Subject: [PATCH] 优化 --- src/views/plan/customerorder/index.vue | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/views/plan/customerorder/index.vue b/src/views/plan/customerorder/index.vue index 70957f3..a1667e2 100644 --- a/src/views/plan/customerorder/index.vue +++ b/src/views/plan/customerorder/index.vue @@ -11,7 +11,6 @@ :toolbarMaxLength="4" :paramArr="type" ref="customerOrderTable" - :expandRowKeys="expandRowKeys" > <template #toolbar> <el-dropdown @@ -415,7 +414,7 @@ selectTime: null, exportTime: null, }, - expandRowKeys: [], + expandRowKeys: null, dataRule: { exportTime: [ { required: true, message: '瀵煎嚭鏃ユ湡涓嶈兘涓虹┖', trigger: 'change' }, @@ -1201,8 +1200,12 @@ this.getData() }, - getData() { - this.$refs.customerOrderTable.getDataList() + async getData() { + await this.$refs.customerOrderTable.getDataList() + this.$refs.customerOrderTable.tableData.forEach((ele) => { + this.$refs.customerOrderTable.$refs.lmesTable.toggleRowExpansion(ele,false) + }) + this.expandRowKeys && this.$refs.customerOrderTable.$refs.lmesTable.toggleRowExpansion(this.expandRowKeys,true) }, // 鑾峰彇鏁版嵁鍒楄〃鍘婚櫎宸插畬鎴愮姸鎬佺殑 handleDataList(command) { @@ -1282,7 +1285,11 @@ this.$refs.addSampleForm.init(row ? row.contractNo : null) }) } - this.expandRowKeys=[row.id] + this.$refs.customerOrderTable.tableData.forEach((item) => { + if(item.children&&item.children.find(m=>m.id==row.id)){ + this.expandRowKeys = item; + } + }) }, // 鏂板鏍峰搧璁㈠崟 addSampleCustomerOrder() { -- Gitblit v1.9.3