领料办理添加标准化配置
This commit is contained in:
		
							parent
							
								
									9f43098dbf
								
							
						
					
					
						commit
						d5951ebbb9
					
				| 
						 | 
					@ -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 = [];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue