退料入库

This commit is contained in:
binbin_pan 2024-04-07 15:32:29 +08:00
parent 22b8403eaf
commit 816857a29d
1 changed files with 125 additions and 6 deletions

View File

@ -171,6 +171,7 @@
placeholder="请选择入库来源" placeholder="请选择入库来源"
clearable filterable clearable filterable
style="width: 220px" style="width: 220px"
@change="changePutInType"
> >
<el-option <el-option
v-for="item in codeInStoreOptions" v-for="item in codeInStoreOptions"
@ -210,6 +211,19 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7">
<el-form-item label="备注" label-width="130px" prop="remarks" v-if="isNumCheck">
<el-input
v-model="codeForm.remarks"
type="textarea"
placeholder="请输入备注"
maxlength="200"
rows="3"
show-word-limit
style="width: 13vw;"
/>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
@ -299,6 +313,42 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20">
<el-col :span="7">
<el-form-item label="领料单位" label-width="130px" prop="unitId" v-show="isPutInType">
<el-select v-model="codeForm.unitId" placeholder="请选择领料单位" style="width: 220px;"
@change="changeUnitData" clearable filterable>
<el-option
v-for="item in unitList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="领料工程" label-width="130px" prop="proId" v-show="isPutInType">
<el-select v-model="codeForm.proId" placeholder="请选择领料工程" style="width: 400px;"
@change="changeProList" clearable filterable>
<el-option
v-for="item in proList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label=" " label-width="130px" v-show="isPutInType">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="fillCodeForm">点击填充</el-button>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="7"> <el-col :span="7">
<el-form-item label="检验人" label-width="130px" prop="checkMan" v-if="!isNumCheck"> <el-form-item label="检验人" label-width="130px" prop="checkMan" v-if="!isNumCheck">
@ -306,8 +356,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="isNumCheck ? 7 : 10"> <el-col :span="10">
<el-form-item label="备注" label-width="130px" prop="remarks"> <el-form-item label="备注" label-width="130px" prop="remarks" v-if="!isNumCheck">
<el-input <el-input
v-model="codeForm.remarks" v-model="codeForm.remarks"
type="textarea" type="textarea"
@ -315,14 +365,14 @@
maxlength="200" maxlength="200"
rows="4" rows="4"
show-word-limit show-word-limit
:style="{ width: isNumCheck ? '220px' : '400px' }" style="width: 400px;"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item style="margin-left: 200px;"> <el-form-item label=" " label-width="130px" v-show="!isPutInType">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="fillCodeForm">点击填充</el-button> <el-button type="primary" icon="el-icon-edit" size="mini" @click="fillCodeForm">点击填充</el-button>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -512,6 +562,7 @@ import {
} from "@/api/store/putInStore"; } from "@/api/store/putInStore";
import { getInfo } from '@/api/login' import { getInfo } from '@/api/login'
import { supplierInfoList } from "@/api/store/tools"; import { supplierInfoList } from "@/api/store/tools";
import { getUnitData, getProData } from "@/api/claimAndRefund/receive";
export default { export default {
name: "DevicesWarehousing", name: "DevicesWarehousing",
@ -590,6 +641,11 @@ export default {
remark: '', // remark: '', //
preNum: 1, // preNum: 1, //
}, },
//
unitList: [],
//
proList: [],
isPutInType: false,
// / // /
numberForm: {}, numberForm: {},
codeForm: { codeForm: {
@ -605,6 +661,8 @@ export default {
codeFactory: undefined, codeFactory: undefined,
thisCheckTime: undefined, thisCheckTime: undefined,
nextCheckTime: undefined, nextCheckTime: undefined,
unitId: null,
proId: null,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}, },
@ -627,6 +685,12 @@ export default {
num: [ num: [
{ required: true, message: "待入库总数不能为空", trigger: "blur" } { required: true, message: "待入库总数不能为空", trigger: "blur" }
], ],
unitId: [
{ required: true, message: "领料单位不能为空", trigger: "change" }
],
proId: [
{ required: true, message: "领料工程不能为空", trigger: "change" }
],
} }
}; };
}, },
@ -808,10 +872,12 @@ export default {
/** 新增数量盘点按钮操作 */ /** 新增数量盘点按钮操作 */
handleNumberAdd() { handleNumberAdd() {
this.isNumCheck = true; this.isNumCheck = true;
this.isPutInType = false;
this.reset(); this.reset();
this.codeOpen = true; this.codeOpen = true;
this.title = "数量盘点入库"; this.title = "数量盘点入库";
this.resetCodeForm() this.resetCodeForm()
this.getUnitData();
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['codeForm'].clearValidate() this.$refs['codeForm'].clearValidate()
}) })
@ -819,10 +885,12 @@ export default {
/** 新增编号盘点按钮操作 */ /** 新增编号盘点按钮操作 */
handleCodeAdd() { handleCodeAdd() {
this.isNumCheck = false; this.isNumCheck = false;
this.isPutInType = false;
this.reset(); this.reset();
this.codeOpen = true; this.codeOpen = true;
this.title = "编码盘点入库"; this.title = "编码盘点入库";
this.resetCodeForm() this.resetCodeForm()
this.getUnitData();
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['codeForm'].clearValidate() this.$refs['codeForm'].clearValidate()
}) })
@ -858,6 +926,8 @@ export default {
putInType: this.codeForm.putInType, putInType: this.codeForm.putInType,
remarks: this.codeForm.remarks || '', remarks: this.codeForm.remarks || '',
machIneDtoList: this.numTableList, machIneDtoList: this.numTableList,
unitId: this.codeForm.unitId,
proId: this.codeForm.proId,
} }
console.log('🚀 ~ submitForm: ~ SavePutInfoDto-isNum', SavePutInfoDto) console.log('🚀 ~ submitForm: ~ SavePutInfoDto-isNum', SavePutInfoDto)
// //
@ -892,6 +962,8 @@ export default {
remarks: this.codeForm.remarks || '', remarks: this.codeForm.remarks || '',
machIneDtoList: this.codeTableList, machIneDtoList: this.codeTableList,
checkMan: this.codeForm.checkMan || '', checkMan: this.codeForm.checkMan || '',
unitId: this.codeForm.unitId,
proId: this.codeForm.proId,
} }
console.log('🚀 ~ submitForm: ~ SavePutInfoDto', SavePutInfoDto) 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);
}
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>