From 816857a29d2fe2ffb1626132cd8a59b74568fc96 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Sun, 7 Apr 2024 15:32:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/store/warehousing/putInStore.vue | 131 +++++++++++++++++- 1 file changed, 125 insertions(+), 6 deletions(-) diff --git a/sgzb-ui/src/views/store/warehousing/putInStore.vue b/sgzb-ui/src/views/store/warehousing/putInStore.vue index cd60f710..fb777fdb 100644 --- a/sgzb-ui/src/views/store/warehousing/putInStore.vue +++ b/sgzb-ui/src/views/store/warehousing/putInStore.vue @@ -171,6 +171,7 @@ placeholder="请选择入库来源" clearable filterable style="width: 220px" + @change="changePutInType" > + + + + + @@ -298,6 +312,42 @@ + + + + + + + + + + + + + + + + + + + + + 点击填充 + + + @@ -306,8 +356,8 @@ - - + + + - + 点击填充 - @@ -512,6 +562,7 @@ import { } from "@/api/store/putInStore"; import { getInfo } from '@/api/login' import { supplierInfoList } from "@/api/store/tools"; +import { getUnitData, getProData } from "@/api/claimAndRefund/receive"; export default { name: "DevicesWarehousing", @@ -590,6 +641,11 @@ export default { remark: '', //单条备注 preNum: 1, //预领数量 }, + // 领料单位 + unitList: [], + // 领料工程 + proList: [], + isPutInType: false, // 表单参数:编号表单 / 数量表单 numberForm: {}, codeForm: { @@ -605,6 +661,8 @@ export default { codeFactory: undefined, thisCheckTime: undefined, nextCheckTime: undefined, + unitId: null, + proId: null, pageNum: 1, pageSize: 10, }, @@ -627,6 +685,12 @@ export default { num: [ { required: true, message: "待入库总数不能为空", trigger: "blur" } ], + unitId: [ + { required: true, message: "领料单位不能为空", trigger: "change" } + ], + proId: [ + { required: true, message: "领料工程不能为空", trigger: "change" } + ], } }; }, @@ -808,10 +872,12 @@ export default { /** 新增数量盘点按钮操作 */ handleNumberAdd() { this.isNumCheck = true; + this.isPutInType = false; this.reset(); this.codeOpen = true; this.title = "数量盘点入库"; this.resetCodeForm() + this.getUnitData(); this.$nextTick(() => { this.$refs['codeForm'].clearValidate() }) @@ -819,10 +885,12 @@ export default { /** 新增编号盘点按钮操作 */ handleCodeAdd() { this.isNumCheck = false; + this.isPutInType = false; this.reset(); this.codeOpen = true; this.title = "编码盘点入库"; this.resetCodeForm() + this.getUnitData(); this.$nextTick(() => { this.$refs['codeForm'].clearValidate() }) @@ -858,6 +926,8 @@ export default { putInType: this.codeForm.putInType, remarks: this.codeForm.remarks || '', machIneDtoList: this.numTableList, + unitId: this.codeForm.unitId, + proId: this.codeForm.proId, } console.log('🚀 ~ submitForm: ~ SavePutInfoDto-isNum', SavePutInfoDto) // 发送请求 @@ -892,6 +962,8 @@ export default { remarks: this.codeForm.remarks || '', machIneDtoList: this.codeTableList, checkMan: this.codeForm.checkMan || '', + unitId: this.codeForm.unitId, + proId: this.codeForm.proId, } console.log('🚀 ~ submitForm: ~ SavePutInfoDto', SavePutInfoDto) @@ -1032,7 +1104,54 @@ export default { } ); }, - } + changePutInType(val) { + if (val == '退料入库') { + this.isPutInType = true + } else { + this.isPutInType = false + } + }, + // 领料单位 + async getUnitData() { + try { + const res = await getUnitData() + this.unitList = res.data + } catch (error) { + console.log('🚀 ~ getUnitData ~ error:', error) + } + }, + changeUnitData(val) { + // console.log('🚀 ~ changeUnitData ~ val:', val); + this.codeForm.unitId = val + this.proList = [] + this.$set(this.codeForm, 'proId', null) + if(val) { + this.getProList() + } + }, + async getProList() { + const unitId = this.codeForm.unitId + // 领料工程 + try { + const res = await getProData({id: unitId}) + // console.log('🚀 ~ changeUnitData ~ data:', res.data); + this.proList = res.data + if (res.data.length == 0) { + this.proList = [] + this.codeForm.proId = null + } else { + this.proList = res.data + } + // console.log('🚀 ~ changeUnitData ~ this.proList:', this.proList); + } catch (error) { + console.log('🚀 ~ changeUnitData ~ error:', error) + } + }, + changeProList(val) { + this.codeForm.proId = val + // console.log('🚀 ~ changeProList ~ this.codeForm:', this.codeForm.proId); + } + }, };