From 19d93086de89e651985d185e919c11f7dc368786 Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Mon, 30 Dec 2024 10:33:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99=E5=8D=95=E4=BD=8D=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E6=A0=91=E7=8A=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/back/component/addReturn.vue | 189 +++++++----------- src/views/material/back/component/home.vue | 125 ++++-------- 2 files changed, 112 insertions(+), 202 deletions(-) diff --git a/src/views/material/back/component/addReturn.vue b/src/views/material/back/component/addReturn.vue index f46e1a66..7c29184a 100644 --- a/src/views/material/back/component/addReturn.vue +++ b/src/views/material/back/component/addReturn.vue @@ -11,7 +11,14 @@ > - + + > --> - + + > --> + :options="unitList" :normalizer="normalizer" + :show-count="true" style="width: 240px" :disable-branch-nodes="true" + noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果" + placeholder="请选择退料单位" @select="unitChange" + /> - - + :options="proList" :normalizer="normalizer" + :show-count="true" style="width: 240px" :disable-branch-nodes="true" + noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果" + placeholder="请选择退料工程" @select="proChange" + /> { - // this.companyId = res.user.companyId - // this.getList() - // }) - }, + /** 转换菜单数据结构 */ + normalizer(node) { + if (node.children && !node.children.length) { + delete node.children; + } + return { + id: node.id, + label: node.name, + children: node.children, + }; + }, initSelectData() { this.GetUnitData() this.GetProData() @@ -508,37 +478,30 @@ export default { // 获取 来往单位 列表数据 async GetUnitData() { const params = { - projectId: this.queryParams.proId /* */, + // projectId: this.queryParams.proId /* */, } const res = await getUnitList(params) - this.unitList = res.data + this.unitList = res.data }, - unitChange(val){ - if(val&&val.length>0){ - this.queryParams.unitId=this.unitId[this.unitId.length - 1] - }else if(val&&val.length==0){ - this.queryParams.unitId="" - } - this.GetProData() - }, - + unitChange(val){ + setTimeout(()=>{ + this.GetProData() + },500) + }, // 获取 工程名称 列表数据 async GetProData() { const params = { unitId: this.queryParams.unitId, } const res = await getProjectList(params) - this.proList = res.data + this.proList = res.data; + this.queryParams.proId=null }, - proChange(val){ - if(val&&val.length>0){ - this.queryParams.proId=this.projectId[this.projectId.length - 1] - }else if(val&&val.length==0){ - this.queryParams.proId="" - } - this.GetUnitData() - }, - + proChange(val){ + setTimeout(()=>{ + this.GetUnitData() + },500) + }, /** 查询列表 startTime,结束日期endTime */ async getList() { this.loading = true