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 = [];