Commit 1ce0fd10 authored by Mac's avatar Mac

1

parent 456e105d
...@@ -321,17 +321,39 @@ export default { ...@@ -321,17 +321,39 @@ export default {
data.forEach(x=>{ data.forEach(x=>{
x.Ischeck = false x.Ischeck = false
}) })
this.stagingData = this.dataList // this.stagingData = this.dataList
this.CreateDatelist = this.groupArr(data,'GoodsName') this.CreateDatelist = this.groupArr(data,'GoodsName')
this.dataList = this.CreateDatelist; let alllist = this.CreateDatelist;
this.dataList.forEach(x=>{ alllist.forEach(x=>{
x.list.forEach((j,index)=>{ x.list.forEach((j,index)=>{
j.xuhao = index+1+'/'+x.list.length j.xuhao = index+1+'/'+x.list.length
}) })
}) })
// let list = JSON.parse(JSON.stringify(this.dataList))
console.log(this.dataList) this.dataList = [];
const loading = this.$loading({
lock: true,
text: '数据加载中...',
spinner: 'el-icon-loading',
});
alllist.forEach((x,y)=>{
let obj = {
GoodsName:x.GoodsName,
list:[],
}
this.dataList.push(obj)
x.list.forEach((j,ji)=>{
setTimeout(()=>{//20ms 是1000/25 得到的
this.dataList[y].list.push(j)
if(alllist.length== y+1 && x.list.length == ji+1){
loading.close();
}
},ji*50)
})
})
} else { } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
...@@ -385,19 +407,19 @@ export default { ...@@ -385,19 +407,19 @@ export default {
this.dataList.forEach((x,i)=>{//处理显示问题 this.dataList.forEach((x,i)=>{//处理显示问题
x.list.forEach((j,i2)=>{ x.list.forEach((j,i2)=>{
j.Ischeck = true; j.Ischeck = true;
setTimeout(()=>{//20ms 是1000/25 得到的 setTimeout(()=>{
data.push(j) data.push(j)
if(this.dataList.length == i+1 && x.list.length == i2+1){//最后一个的时候数据处理 if(this.dataList.length == i+1 && x.list.length == i2+1){//最后一个的时候数据处理
this.checkList = data; this.checkList = data;
loading.close();
this.checkList.forEach((x,i)=>{ this.checkList.forEach((x,i)=>{
x.page = 'page'+(i+1) x.page = 'page'+(i+1)
x.xpage = 'xpage'+(i+1) x.xpage = 'xpage'+(i+1)
}) })
} }
},50) },i2*50)
}) })
}) })
loading.close();
...@@ -468,7 +490,6 @@ export default { ...@@ -468,7 +490,6 @@ export default {
setTimeout(()=>{ setTimeout(()=>{
that.batchprint(num) that.batchprint(num)
},200) },200)
}else{ }else{
that.loading = false; that.loading = false;
that.checkList=[]; that.checkList=[];
...@@ -476,8 +497,6 @@ export default { ...@@ -476,8 +497,6 @@ export default {
x.list.forEach((j)=>{ x.list.forEach((j)=>{
j.Ischeck = false; j.Ischeck = false;
}) })
}) })
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment