diff --git a/src/views/wpm_gx/handover_form2.vue b/src/views/wpm_gx/handover_form2.vue index 9455924f..fa95d0c8 100644 --- a/src/views/wpm_gx/handover_form2.vue +++ b/src/views/wpm_gx/handover_form2.vue @@ -22,12 +22,11 @@ {{saveCount}} - - + @@ -46,7 +45,7 @@ - + @@ -92,7 +91,6 @@ export default { process:{ type:String, default:"" - } }, components: { @@ -134,6 +132,7 @@ export default { batchOrign:{}, totalCount: 0, materialOptions: [], + first_batch_num:0, visible: false, isSaveing: false, setFiltersVisible: false, @@ -162,19 +161,31 @@ export default { this.saveCount = 0; this.form.handoverb.push(obj) this.visible = true; + this.getbatchesTo(); return this; }, + getbatchesTo(){ + let that = this; + let obj = {}; + obj.batch= that.codeText; + that.$API.wpm.batchlog.batchesTo.req(obj).then((res) => { + console.log('res',res); + that.last_batch_num = res.last_batch_num; + let batch_num = that.first_batch_num = res.last_batch_num+1; + that.form.handoverb[0].batch = that.codeText+"-"+batch_num; + }); + }, batchAdd(){ let that = this; if(that.saveCount>0){ - let indexs = that.form.handoverb.length+1; + let indexs = that.first_batch_num + that.form.handoverb.length; let count = 0; that.form.handoverb.forEach(item=>{ count+=item.count; }) let obj = { }; obj.wm = that.batchOrign.id; - obj.batch = that.codeText+"-"+indexs; + obj.batch = that.codeText+"-"+indexs; obj.count = that.batchOrign.count - count; that.saveCount = 0; that.form.handoverb.push(obj) @@ -205,9 +216,7 @@ export default { that.saveCount = 0; }else{ that.saveCount = that.batchOrign.count-totalCount; - } - } }, //提交 @@ -234,7 +243,6 @@ export default { that.$message.success("操作成功"); }); }).catch((err) => { - //可以处理校验错误 that.isSaveing = false; return err; });