领料办理添加标准化配置

This commit is contained in:
bb_pan 2025-07-05 13:48:09 +08:00
parent 9f43098dbf
commit d5951ebbb9
1 changed files with 54 additions and 0 deletions

View File

@ -90,6 +90,22 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="标准配置" prop="standardConfig">
<treeselect
v-model="maForm.standardConfig"
:options="standardConfigList"
:normalizer="normalizer"
:show-count="true"
style="width: 240px"
:disable-branch-nodes="true"
noChildrenText="没有数据了"
noOptionsText="没有数据"
noResultsText="没有搜索结果"
placeholder="请选择标准配置"
@select="standardConfigChange"
/>
</el-form-item>
<el-form-item label="类型规格" prop="deviceType"> <el-form-item label="类型规格" prop="deviceType">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="15"> <el-col :span="15">
@ -296,6 +312,7 @@ import {
uploadPurchaseFile, uploadPurchaseFile,
getPurchaseFileList, getPurchaseFileList,
} from "@/api/purchase/goodsAccept"; } from "@/api/purchase/goodsAccept";
import { getStandardConfigList, getListsByConfigId } from "@/api/business/index"
import {downloadFile, downloadFileData} from '@/utils/download' import {downloadFile, downloadFileData} from '@/utils/download'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -377,6 +394,7 @@ export default {
purchaseNumber: "", purchaseNumber: "",
bmFileInfos: [], bmFileInfos: [],
}, },
standardConfigList: [],
// //
form: {}, form: {},
defaultProps: { defaultProps: {
@ -492,6 +510,7 @@ export default {
mounted() { mounted() {
this.projectInfoList();// this.projectInfoList();//
this.equipmentType();// this.equipmentType();//
this.getStandardConfigListFn() //
if (this.isEdit) { if (this.isEdit) {
console.log("isEdit", this.isEdit); console.log("isEdit", this.isEdit);
this.taskId = this.editTaskId; 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) { processTypeData(data) {
const result = []; const result = [];