Commit 7a7fea6b authored by Mac's avatar Mac

修改打印页面图片不显示问题

parent 3dfb1c6b
......@@ -4,6 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="referrer" content="never">
<title>微途超级商城</title>
</head>
......
......@@ -218,7 +218,7 @@
</div>
<!-- 小图模式打印 -->
<div class="xuanzhong" id = 'xuanzhong' >
<div class="xuanzhong" id = 'xuanzhong' style="display:none" >
<!-- <div v-for="(item,index) in checkList" :key="index" class="xuanzhong_item" :id = "item.page" > -->
<div v-for="(item,index) in checkList" :key="index" :id = "item.xpage" style=" width: 125px; height: 100px;display: flex;flex-direction: column; justify-content: space-around;">
<!-- <div style=" width:100%; height:20px;text-overflow: ellipsis; display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;overflow: hidden;font-size:12px">
......@@ -332,38 +332,41 @@ export default {
})
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)
let timeout = x.list.length
console.log('tag', timeout)
setTimeout(() => {
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)
})
}, timeout*50);
})
this.afterTime(alllist,0)
} else {
this.Error(res.data.message);
}
})
},
afterTime(alllist,index){
const loading = this.$loading({
lock: true,
text: '数据加载中...',
spinner: 'el-icon-loading',
});
let that = this
let obj = {
GoodsName:alllist[index].GoodsName,
list:[],
}
that.dataList.push(obj)
alllist[index].list.forEach((j,ji)=>{
setTimeout(()=>{
that.dataList[index].list.push(j)
if(alllist.length> index+1 && alllist[index].list.length==ji+1 ){
that.afterTime(alllist,index+1)
}
if(alllist.length==index+1 && alllist[index].list.length==ji+1 ){
loading.close();
}
},ji*50)
})
},
gocheke(j,index){
this.dataList[j].list[index].Ischeck = ! this.dataList[j].list[index].Ischeck;
if(this.dataList[j].list[index].Ischeck==true){//选中
......@@ -399,40 +402,36 @@ export default {
});
this.$forceUpdate()
},
checkafter(index){
const loading = this.$loading({
lock: true,
text: '数据加载中...',
spinner: 'el-icon-loading',
});
let that = this
this.dataList[index].list.forEach((j,i2)=>{
setTimeout(()=>{
j.Ischeck = true;
this.checkList.push(j)
if( this.dataList.length> index+1 && this.dataList[index].list.length==i2+1 ){//循环完并且有下一个
that.checkafter(index+1)
}
if( this.dataList.length==index+1 && this.dataList[index].list.length==i2+1 ){
this.checkList.forEach((x,i)=>{
x.page = 'page'+(i+1)
x.xpage = 'xpage'+(i+1)
})
loading.close();
}
},i2*50)
})
},
allcheckbtn(){
if(this.allchecked==true){
let data = [];
const loading = this.$loading({
lock: true,
text: '数据处理中...',
spinner: 'el-icon-loading',
});
this.dataList.forEach((x,i)=>{//处理显示问题
x.list.forEach((j,i2)=>{
j.Ischeck = true;
setTimeout(()=>{
data.push(j)
if(this.dataList.length == i+1 && x.list.length == i2+1){//最后一个的时候数据处理
this.checkList = data;
loading.close();
this.checkList.forEach((x,i)=>{
x.page = 'page'+(i+1)
x.xpage = 'xpage'+(i+1)
})
}
},i2*50)
})
})
if(this.allchecked==true){
this.checkList=[]
this.checkafter(0)//全选的时候选循环第一个
}else{
this.dataList.forEach(x=>{
x.list.forEach((j)=>{
......@@ -509,8 +508,8 @@ export default {
}else{
}
}
// LODOP.PRINT()
LODOP.PREVIEW()//预览打印
LODOP.PRINT()
// LODOP.PREVIEW()//预览打印
}
// else{
......
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