fix:光芯合批时新批次号改动
This commit is contained in:
parent
5e24ad9c66
commit
00b3af30c1
|
|
@ -187,15 +187,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24" v-if="change_batch">
|
<el-col :md="12" :sm="24" v-if="change_batch">
|
||||||
<el-form-item label="新批次号" required>
|
<el-form-item label="新批次号" required>
|
||||||
<el-select filterable remote :remote-method="remoFun" v-model="new_batch" @selsect="new_batch_change">
|
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input>
|
||||||
<el-option
|
|
||||||
v-for="item in batchList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.batch"
|
|
||||||
:value="item.id"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
<!-- <el-input v-model="form.new_batch" placeholder="新批次号"></el-input> -->
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24" v-if="route_code=='tuihuo' || form.oinfo_json.test_file">
|
<el-col :md="12" :sm="24" v-if="route_code=='tuihuo' || form.oinfo_json.test_file">
|
||||||
|
|
@ -394,19 +386,19 @@ export default {
|
||||||
//获取交接物料
|
//获取交接物料
|
||||||
if(that.type==20&&that.mgroupName!=='废品库'){
|
if(that.type==20&&that.mgroupName!=='废品库'){
|
||||||
//返工交接
|
//返工交接
|
||||||
that.paramsM = {mgroup: that.mgroupId,page: 0,state__in:'20,34',tag : 'done'};
|
that.paramsM = {mgroup: that.mgroupId,state__in:'20,34',tag : 'done'};
|
||||||
}else if(that.type==20&&that.mgroupName=='废品库'){
|
}else if(that.type==20&&that.mgroupName=='废品库'){
|
||||||
//废品出库
|
//废品出库
|
||||||
that.paramsM = {page: 0,state : 50,state_all: 1};
|
that.paramsM = {state : 50,state_all: 1};
|
||||||
}else if(that.type==40){
|
}else if(that.type==40){
|
||||||
//报废交接
|
//报废交接
|
||||||
that.paramsM = {mgroupx: that.mgroupId,page: 0,state:20};
|
that.paramsM = {mgroupx: that.mgroupId,state:20};
|
||||||
}else if(that.type==50){
|
}else if(that.type==50){
|
||||||
//改版交接
|
//改版交接
|
||||||
that.paramsM = {mgroupx: that.mgroupId,page: 0};
|
that.paramsM = {mgroupx: that.mgroupId};
|
||||||
}else{
|
}else{
|
||||||
//其他
|
//其他
|
||||||
that.paramsM = {mgroup: that.mgroupId,page: 0,state:10,tag : 'done'};
|
that.paramsM = {mgroup: that.mgroupId,state:10,tag : 'done'};
|
||||||
}
|
}
|
||||||
that.apiObjM = this.$API.wpm.wmaterial.list;
|
that.apiObjM = this.$API.wpm.wmaterial.list;
|
||||||
if(that.type==40||that.type==20){
|
if(that.type==40||that.type==20){
|
||||||
|
|
@ -675,24 +667,31 @@ export default {
|
||||||
that.form.mtype=30;
|
that.form.mtype=30;
|
||||||
that.mtype==30
|
that.mtype==30
|
||||||
}
|
}
|
||||||
if(that.mtype==30&&that.form.new_batch==null&&that.form.new_batch==undefined&&that.new_batch!=''){
|
if(that.mtype==30){
|
||||||
let arr = that.batchList.filter(item=>{
|
let params = {};
|
||||||
return item.batch == that.new_batch;
|
params.material = that.form.handoverb[0].material;
|
||||||
|
params.batch = that.form.new_batch;
|
||||||
|
params.mgroup = that.mgroupId;
|
||||||
|
params.count_all = 1;
|
||||||
|
params.defect = that.form.handoverb[0].defect!=null?that.form.handoverb[0].defect:'';
|
||||||
|
params.defect__isnull = that.form.handoverb[0].defect!=null?false:true;
|
||||||
|
params.page = 0;
|
||||||
|
that.$API.wpm.wmaterial.list.req(params).then(res=>{
|
||||||
|
if(res.length>0){
|
||||||
|
that.form.new_wm = res[0].id;
|
||||||
|
}
|
||||||
|
console.log('that.form.new_wm',that.form.new_wm);
|
||||||
|
console.log('that.form.new_batch',that.form.new_batch);
|
||||||
|
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
|
||||||
|
that.isSaveing = false;
|
||||||
|
that.$emit("success");
|
||||||
|
that.$message.success("操作成功");
|
||||||
|
}).catch((err) => {
|
||||||
|
that.isSaveing = false;
|
||||||
|
return err;
|
||||||
|
});
|
||||||
})
|
})
|
||||||
if(arr.length>0){
|
}else if(that.mtype==20||that.type==40){
|
||||||
that.form.new_batch = arr[0].batch;
|
|
||||||
}else{
|
|
||||||
that.batchList.forEach(item=>{
|
|
||||||
if(item.id == that.new_batch){
|
|
||||||
that.form.new_batch = item.batch;
|
|
||||||
that.form.new_wm = item.id;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log('that.form.new_wm',that.form.new_wm);
|
|
||||||
console.log('that.form.new_batch',that.form.new_batch);
|
|
||||||
if(that.mtype==20||that.mtype==30||that.type==40){
|
|
||||||
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
|
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
|
||||||
that.isSaveing = false;
|
that.isSaveing = false;
|
||||||
that.$emit("success");
|
that.$emit("success");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue