fix:已完成物料分配发货编号完善
This commit is contained in:
parent
bb517ff967
commit
8a445429ad
|
@ -270,6 +270,17 @@
|
|||
<el-button @click="showBatch=false">取消</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="设置发货流水位数" v-model="showDigit">
|
||||
<h4>没有找到该前缀的发货编号,请完善发货流水号位数(填整数)</h4>
|
||||
<el-form :model="wprParams" label-width="80px">
|
||||
<el-form-item label="流水位数">
|
||||
<el-input-number controls-position="right" precision="0" v-model="digitNum"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="digitSure">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-drawer v-model="limitedWatch" title="工艺路线流程图" size="80%" @closeDialog="limitedWatch = false">
|
||||
<scDegra
|
||||
v-if="limitedWatch"
|
||||
|
@ -368,7 +379,9 @@ export default {
|
|||
route_code:"",
|
||||
wmMaterial:'',
|
||||
cate_type:'',
|
||||
digitNum:null,
|
||||
materialType: "wm",
|
||||
showDigit: false,
|
||||
showBatch: false,
|
||||
limitedWatch:false,
|
||||
materialsVisible:false,
|
||||
|
@ -548,32 +561,60 @@ export default {
|
|||
params0.prefix = that.prefix;
|
||||
that.$API.wpm.wpr.numberOutLast.req(params0).then((res) => {
|
||||
let number_out_last = '';
|
||||
if(res.number_out_last==null){
|
||||
number_out_last = that.prefix+'000';
|
||||
}else{
|
||||
number_out_last = res.number_out_last;
|
||||
}
|
||||
that.number_out_last = number_out_last;
|
||||
let num = number_out_last.slice(-3)
|
||||
let str = number_out_last.slice(0,-3)
|
||||
if(res.number_out_last==null){//没有该前缀的发货编号
|
||||
number_out_last = null;
|
||||
that.showBatch=false;
|
||||
that.showDigit = true;
|
||||
}else{//有该前缀的发货编号
|
||||
let items = [];
|
||||
number_out_last = res.number_out_last;
|
||||
let str = number_out_last.replace(/[^a-zA-Z]/g, ''); // 提取字母
|
||||
let num = number_out_last.replace(/[^0-9]/g, ''); // 提取数字
|
||||
let length = num.length;//流水号的长度
|
||||
for(let i=0;i< that.wprList.length;i++){
|
||||
let obj = {};
|
||||
let numb = Number(num)+i+1;
|
||||
if(numb<10){
|
||||
numb = '00'+numb;
|
||||
}else if(numb<100){
|
||||
numb = '0'+numb;
|
||||
let numbs = numb+'';
|
||||
let len = numbs.length;
|
||||
let zoreStr = '';
|
||||
for(let j=0;j<length-len;j++){
|
||||
zoreStr+='0';
|
||||
}
|
||||
let obj = {};
|
||||
obj.id = that.wprList[i].id;
|
||||
obj.number_out = str+numb;
|
||||
obj.number_out = str + zoreStr + numb;
|
||||
items.push(obj)
|
||||
}
|
||||
let params = {};
|
||||
params.items = items;
|
||||
that.$API.wpm.wpr.assginNumberOut.req(params).then((res) => {
|
||||
that.showBatch=false;
|
||||
that.getRowWpr();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//没有找到前缀的发货编号,从1开始编号时
|
||||
digitSure(){
|
||||
let that = this;
|
||||
//根据前缀和流水位数获取编号
|
||||
let items = [];
|
||||
for(let i=0;i< that.wprList.length;i++){
|
||||
let numb = i+1,zoreStr = '';
|
||||
numb+= '';
|
||||
let len = numb.length;
|
||||
for(let j=0;j<that.digitNum-len;j++){
|
||||
zoreStr+='0';
|
||||
}
|
||||
let obj = {};
|
||||
obj.id = that.wprList[i].id;
|
||||
obj.number_out = that.prefix + zoreStr + numb;
|
||||
items.push(obj)
|
||||
}
|
||||
let params = {};
|
||||
params.items = items;
|
||||
that.$API.wpm.wpr.assginNumberOut.req(params).then((res) => {
|
||||
that.showDigit = false;
|
||||
that.getRowWpr();
|
||||
})
|
||||
},
|
||||
//本地更新数据
|
||||
|
|
Loading…
Reference in New Issue