From 7d3193f8360a34403d255a47273a89b1fef206c5 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Wed, 17 Sep 2025 20:04:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipment/equipmentRecord/index.vue | 82 ++++++++++++++----- 1 file changed, 63 insertions(+), 19 deletions(-) diff --git a/src/views/materialsStation/equipment/equipmentRecord/index.vue b/src/views/materialsStation/equipment/equipmentRecord/index.vue index 9d87877a..d4bf259b 100644 --- a/src/views/materialsStation/equipment/equipmentRecord/index.vue +++ b/src/views/materialsStation/equipment/equipmentRecord/index.vue @@ -45,7 +45,7 @@ clearable filterable style="width: 240px" - @change="getTeamList" + @change="getTeamListAndSubUnit" > {{ tipForm.countNum || 0 }}
计件类总保有量
-
-
{{ tipForm.ropeNum || 0 }}
-
绳索类总保有量
-
{{ tipForm.inCountNum || 0 }}
计件类站内数量
-
-
{{ tipForm.inRopeNum || 0 }}
-
绳索类站内数量
-
{{ tipForm.useCountNum || 0 }}
计件类在用数量
+ +
+
{{ tipForm.ropeNum || 0 }}
+
绳索类总保有量
+
+ +
+
{{ tipForm.inRopeNum || 0 }}
+
绳索类站内数量
+
+
{{ tipForm.useRopeNum || 0 }}
绳索类在用数量
@@ -357,13 +361,6 @@ export default { this.getDeviceType() }, methods: { - // async getSelect() { - // await this.getImpUnitOptions() - // await this.handleImpUnitChange() - // await this.handleDepartChange() - // await this.getTeamList() - // await this.getSubUnitList() - // }, /** 获取分公司下拉 */ async getImpUnitOptions() { try { @@ -389,7 +386,7 @@ export default { teamName:this.queryParams.teamName, subUnitName:this.queryParams.subUnitName, } - const res = await getDepartListByImpUnitApi({ params }) + const res = await getDepartListByImpUnitApi(params) this.departOptions = res.data.map(item => ({ label: item.departName, // 项目部名称字段 value: item.departName @@ -422,6 +419,48 @@ export default { } }, /** 项目部选择变化,加载工程 */ + async getTeamListAndSubUnit() { + this.queryParams.teamName = null // 清空工程已选 + this.teamOptions = [] // 清空原有下拉 + + try { + // 同时传入分公司和项目部参数 + const params = { + impUnitName: this.queryParams.impUnitName, // 分公司名称 + departName: this.queryParams.departName, // 项目部名称 + proName: this.queryParams.proName, + teamName:this.queryParams.teamName, + subUnitName:this.queryParams.subUnitName, + } + const res = await getTeamList(params) + this.teamOptions = res.data.map(item => ({ + label: item.teamName, // 工程名称字段 + value: item.teamName + })) + } catch (e) { + console.error('获取班组下拉失败:', e) + } + + this.queryParams.subUnitName = null // 清空工程已选 + this.subUnitOptions = [] // 清空原有下拉 + try { + // 同时传入分公司和项目部参数 + const params = { + impUnitName: this.queryParams.impUnitName, // 分公司名称 + departName: this.queryParams.departName, // 项目部名称 + proName: this.queryParams.proName, + teamName:this.queryParams.teamName, + subUnitName:this.queryParams.subUnitName, + } + const res = await getSubUnitList(params) + this.subUnitOptions = res.data.map(item => ({ + label: item.subUnitName, + value: item.subUnitName + })) + } catch (e) { + console.error('获取分包单位下拉失败:', e) + } + }, async getTeamList() { this.queryParams.teamName = null // 清空工程已选 this.teamOptions = [] // 清空原有下拉 @@ -441,7 +480,7 @@ export default { value: item.teamName })) } catch (e) { - console.error('获取工程下拉失败:', e) + console.error('获取班组下拉失败:', e) } }, async getSubUnitList() { @@ -463,7 +502,7 @@ export default { value: item.subUnitName })) } catch (e) { - console.error('获取工程下拉失败:', e) + console.error('获取分包单位下拉失败:', e) } }, getDeviceType() { @@ -536,6 +575,11 @@ export default { this.resetForm('queryForm') this.handleQuery() this.handleMaModel() + this.getImpUnitOptions() + this.handleImpUnitChange() + this.handleDepartChange() + this.getTeamList() + this.getSubUnitList() }, /** 导出按钮操作 */ handleExport() {