From d5951ebbb91968e9a74980725dc421f4049e8feb Mon Sep 17 00:00:00 2001 From: bb_pan Date: Sat, 5 Jul 2025 13:48:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E5=8A=9E=E7=90=86=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=A0=87=E5=87=86=E5=8C=96=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lease/apply/component/addToolsApply.vue | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/views/material/lease/apply/component/addToolsApply.vue b/src/views/material/lease/apply/component/addToolsApply.vue index 729906db..26fbb43c 100644 --- a/src/views/material/lease/apply/component/addToolsApply.vue +++ b/src/views/material/lease/apply/component/addToolsApply.vue @@ -90,6 +90,22 @@ /> + + + + @@ -296,6 +312,7 @@ import { uploadPurchaseFile, getPurchaseFileList, } from "@/api/purchase/goodsAccept"; +import { getStandardConfigList, getListsByConfigId } from "@/api/business/index" import {downloadFile, downloadFileData} from '@/utils/download' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' @@ -377,6 +394,7 @@ export default { purchaseNumber: "", bmFileInfos: [], }, + standardConfigList: [], // 表单参数 form: {}, defaultProps: { @@ -492,6 +510,7 @@ export default { mounted() { this.projectInfoList();//单位工程下拉选 this.equipmentType();//机具类型下拉选 + this.getStandardConfigListFn() // 获取标准配置 if (this.isEdit) { console.log("isEdit", this.isEdit); this.taskId = this.editTaskId; @@ -595,6 +614,41 @@ export default { } }); }, + // 获取标准配置 + async getStandardConfigListFn() { + try { + const res = await getStandardConfigList() + console.log('🚀 ~ getStandardConfigList ~ res:', res) + this.standardConfigList = res.data + } catch (error) { + console.log('🚀 ~ error:', error) + } + }, + // 标准配置 + async standardConfigChange(val) { + console.log('🚀 ~ standardConfigChange ~ val:', val) + const loading = this.$loading() + try { + const params = { + configId: val.id + } + const res = await getListsByConfigId(params) + // console.log('🚀 ~ standardConfigChange ~ res:', res) + res.data.forEach(newItem => { + const existingItem = this.equipmentList.find(item => item.typeId === newItem.typeId) + if (existingItem) { + existingItem.preNum += newItem.preNum + } else { + this.equipmentList.unshift(newItem) + } + }) + + loading.close() + } catch (error) { + console.log('🚀 ~ error:', error) + loading.close() + } + }, // 处理类型数据 processTypeData(data) { const result = [];