diff --git a/src/views/wpm_gx/handover_form.vue b/src/views/wpm_gx/handover_form.vue
index 4432ab6a..30e3d04e 100644
--- a/src/views/wpm_gx/handover_form.vue
+++ b/src/views/wpm_gx/handover_form.vue
@@ -187,15 +187,7 @@
-
-
-
-
+
@@ -394,19 +386,19 @@ export default {
//获取交接物料
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=='废品库'){
//废品出库
- that.paramsM = {page: 0,state : 50,state_all: 1};
+ that.paramsM = {state : 50,state_all: 1};
}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){
//改版交接
- that.paramsM = {mgroupx: that.mgroupId,page: 0};
+ that.paramsM = {mgroupx: that.mgroupId};
}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;
if(that.type==40||that.type==20){
@@ -675,24 +667,31 @@ export default {
that.form.mtype=30;
that.mtype==30
}
- if(that.mtype==30&&that.form.new_batch==null&&that.form.new_batch==undefined&&that.new_batch!=''){
- let arr = that.batchList.filter(item=>{
- return item.batch == that.new_batch;
+ if(that.mtype==30){
+ let params = {};
+ 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){
- 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){
+ }else if(that.mtype==20||that.type==40){
that.$API.wpm.handover.createsubmit.req(that.form).then((res) => {
that.isSaveing = false;
that.$emit("success");