fix:辅料库借用、归还、退货

This commit is contained in:
shijing 2025-07-29 13:42:04 +08:00
parent fd154547f2
commit 1f52ccc540
3 changed files with 57 additions and 21 deletions

View File

@ -6,20 +6,27 @@
type="primary"
@click="add('do_out')"
v-auth="'mio.do'"
>生产领料</el-button
>
>生产领料</el-button>
<el-button
type="primary"
@click="add('pur_in')"
v-auth="'mio.pur'"
>采购入库</el-button
>
>采购入库</el-button>
<el-button
type="primary"
@click="add('other_out')"
@click="add('borrow_out')"
v-auth="'mio.pur'"
>退货</el-button
>
>领用出库</el-button>
<el-button
type="primary"
@click="add('return_in')"
v-auth="'mio.pur'"
>退还入库</el-button>
<el-button
type="primary"
@click="add('pur_out')"
v-auth="'mio.pur'"
>退货</el-button>
<el-select
v-model="query.type"
clearable
@ -183,16 +190,24 @@ export default {
typeDict: {
pur_in: "采购入库",
do_out: "领料出库",
other_out: "退货",
pur_out: "退货",
borrow_out: "领用出库",
return_in: "退还入库",
},
cateOptions: [{ id: "pur_in", name: "采购入库" }, { id: "do_out", name: "领料出库" }, { id: "other_out", name: "退货"}],
cateOptions: [
{ id: "pur_in", name: "采购入库" },
{ id: "do_out", name: "领料出库" },
{ id: "borrow_out", name: "领用出库" },
{ id: "return_in", name: "退还入库" },
{ id: "other_out", name: "退货"},
],
dialog: {
save: false,
record: false,
},
query: {},
params: {
type__in: "pur_in,do_out,other_out",
type__in: "pur_in,pur_out,do_out,other_out,borrow_out,return_in",
materials__type__in: "40, 50, 60, 70",
},
form: {},

View File

@ -41,7 +41,7 @@
</el-form-item>
<el-form-item
label="供应商"
v-if="form.type == 'other_in' || form.type == 'pur_in'"
v-if="form.type == 'other_in' || form.type == 'pur_in'||form.type == 'pur_out'"
>
<el-select
v-model="form.supplier"
@ -96,7 +96,7 @@
</el-form-item>
<el-form-item
label="执行部门"
v-if="form.type == 'do_in' || form.type == 'do_out'"
v-if="form.type == 'do_in' || form.type == 'do_out' || form.type == 'borrow_out' || form.type == 'return_in'"
>
<el-select
v-model="form.belong_dept"
@ -114,7 +114,7 @@
</el-form-item>
<el-form-item
label="工段"
v-if="form.type == 'do_in' || form.type == 'do_out'"
v-if="form.type == 'do_in' || form.type == 'do_out'|| form.type == 'borrow_out' || form.type == 'return_in'"
>
<el-select
v-model="form.mgroup"
@ -132,7 +132,7 @@
</el-form-item>
<el-form-item
label="部门执行人"
v-if="form.type == 'do_in' || form.type == 'do_out'"
v-if="form.type == 'do_in' || form.type == 'do_out'|| form.type == 'borrow_out' || form.type == 'return_in'"
>
<el-select v-model="form.do_user" clearable style="width: 100%">
<el-option
@ -185,9 +185,12 @@ export default {
do_out: "生产领料",
sale_out: "销售发货",
pur_in: "采购入库",
pur_out: "退货",
do_in: "生产入库",
other_in: "其他入库",
other_out: "其他出库",
borrow_out: "领用出库",
return_in: "退还入库",
},
form: {},
rules: {
@ -226,7 +229,7 @@ export default {
} else if (type == "sale_out") {
this.getOrderOptions();
this.getCustomerOptions();
} else if (type == "do_in" || type == "do_out") {
} else if (type == "do_in" || type == "do_out" || type == "borrow_out" || type == "return_in") {
this.getDeptOptions();
this.getmgroupOptions();
this.getgetDeptUsers();

View File

@ -73,7 +73,7 @@
/>
</el-form-item>
</el-col>
<el-col v-if="form.type == 'pur_in'||form.type == 'other_in'||form.type == 'do_out'||form.type=='sale_out'||form.type=='other_out'">
<el-col v-if="form.type == 'pur_in'||form.type == 'pur_out'||form.type == 'other_in'||form.type == 'do_out'||form.type=='sale_out'||form.type=='other_out'||form.type=='pur_out'||form.type=='borrow_out'">
<el-form-item label="仓库已有批次">
<el-select
v-model="selectBatch"
@ -314,11 +314,18 @@ export default {
//
getWBatchs() {
let that = this;
let params = {material: this.form.material,page: 0};
if (this.mgroup != null) {
this.$API.wpm.wmaterial.list.req({mgroup: this.mgroup,material: this.form.material,state:10,page: 0}).then((res) => {
params.mgroup= this.mgroup;
if(that.type=='do_in'){
params.state = 10;
}
}else if (this.mioObj.belong_dept != null){
params.belong_dept = this.mioObj.belong_dept;
}
this.$API.wpm.wmaterial.list.req(params).then((res) => {
this.wbatchOptions = res;
});
}
},
getMaterialOptions() {
var type = this.form.type;
@ -376,9 +383,20 @@ export default {
this.inputBatchDisable = true;
} else if (type == "other_out") {
this.inputBatchDisable = true;
} else if (type == "pur_out"||type == "borrow_out"||type == "return_in") {
query = {
page: 0,
type__in: 40,
is_hidden: false,
orderitem_material__order: this.mioObj.order?this.mioObj.order:null,
};
this.inputBatchDisable = true;
}else {
query = { page: 0 ,is_hidden:false};
}
if(type == "return_in"){
this.inputBatchDisable = false;
}
this.query = query;
this.apiObj=this.$API.mtm.material.list;
// this.$API.mtm.material.list.req(query).then((res) => {
@ -436,7 +454,7 @@ export default {
that.form.material = that.selectObj.id;
that.form.unit = that.selectObj.unit;
that.form.unit_price = that.selectObj.unit_price;
that.form.batch = that.cate=='helpso'?that.selectObj.bin_number_main:that.selectObj.batch;
that.form.batch = that.cate=='helpso'?that.selectObj.bin_number_main:'';
that.mTracking = that.selectObj.tracking;
if (type == "do_in") {
if (that.selectObj.is_assemb) {