fix:已完成物料分配发货编号完善

This commit is contained in:
shijing 2025-08-06 10:41:19 +08:00
parent bb517ff967
commit 8a445429ad
1 changed files with 61 additions and 20 deletions

View File

@ -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();
})
},
//