|
|
@ -2,7 +2,7 @@ import Konva from "konva";
|
|
|
|
import QRCode from 'qrcode'
|
|
|
|
import QRCode from 'qrcode'
|
|
|
|
|
|
|
|
|
|
|
|
export default function (width,height){
|
|
|
|
export default function (width,height){
|
|
|
|
const x=width*0.66+40,y=45,_width=width*0.30,_height=height*0.945
|
|
|
|
const x=width*0.66+40,y=40,_width=width*0.30,_height=height*0.945
|
|
|
|
|
|
|
|
|
|
|
|
const container=function (){
|
|
|
|
const container=function (){
|
|
|
|
const group=new Konva.Group({
|
|
|
|
const group=new Konva.Group({
|
|
|
@ -12,25 +12,42 @@ export default function (width,height){
|
|
|
|
height:_height
|
|
|
|
height:_height
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const rect=new Konva.Rect({
|
|
|
|
const bgObj = new Image();
|
|
|
|
x:0,
|
|
|
|
bgObj.src = require('@/assets/pwan/pgdbg.png');
|
|
|
|
y:0,
|
|
|
|
bgObj.onload = function () {
|
|
|
|
width:_width,
|
|
|
|
const shape = new Konva.Image({
|
|
|
|
|
|
|
|
x: 0,
|
|
|
|
|
|
|
|
y: 0,
|
|
|
|
|
|
|
|
width: _width,
|
|
|
|
height:_height,
|
|
|
|
height:_height,
|
|
|
|
stroke:'black',
|
|
|
|
image: this,
|
|
|
|
strokeWidth:1,
|
|
|
|
});
|
|
|
|
})
|
|
|
|
group.add(shape)
|
|
|
|
|
|
|
|
shape.zIndex(0)
|
|
|
|
group.add(rect)
|
|
|
|
}
|
|
|
|
return group
|
|
|
|
return group
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let workers=[]
|
|
|
|
|
|
|
|
const setWorkers=function (persons){
|
|
|
|
|
|
|
|
workers=persons
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const formatWorker=function (code){
|
|
|
|
|
|
|
|
for (const item of workers) {
|
|
|
|
|
|
|
|
if(item.userCode===code){
|
|
|
|
|
|
|
|
return item.userName
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const drawGd=function (data){
|
|
|
|
const drawGd=function (data){
|
|
|
|
// this.layer.destroyChildren();
|
|
|
|
// this.layer.destroyChildren();
|
|
|
|
|
|
|
|
window.localStorage.setItem('zyjh',JSON.stringify(data))
|
|
|
|
|
|
|
|
|
|
|
|
const group=new Konva.Group({
|
|
|
|
const group=new Konva.Group({
|
|
|
|
x:0,
|
|
|
|
x:13,
|
|
|
|
y:0,
|
|
|
|
y:12,
|
|
|
|
width:_width,
|
|
|
|
width:_width,
|
|
|
|
height:_height
|
|
|
|
height:_height
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -38,9 +55,8 @@ export default function (width,height){
|
|
|
|
const rect=new Konva.Rect({
|
|
|
|
const rect=new Konva.Rect({
|
|
|
|
x:0,
|
|
|
|
x:0,
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:_width,
|
|
|
|
width:_width-25,
|
|
|
|
height:_height,
|
|
|
|
height:_height-20,
|
|
|
|
fill:'white'
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(rect)
|
|
|
|
group.add(rect)
|
|
|
|
|
|
|
|
|
|
|
@ -49,9 +65,7 @@ export default function (width,height){
|
|
|
|
y:10,
|
|
|
|
y:10,
|
|
|
|
width:_width,
|
|
|
|
width:_width,
|
|
|
|
height:35,
|
|
|
|
height:35,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:1.2,
|
|
|
|
|
|
|
|
text:'大连重工大连钢材加工配送有限公司',
|
|
|
|
text:'大连重工大连钢材加工配送有限公司',
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
|
fontSize:22,
|
|
|
|
fontSize:22,
|
|
|
@ -64,7 +78,7 @@ export default function (width,height){
|
|
|
|
width:_width,
|
|
|
|
width:_width,
|
|
|
|
height:25,
|
|
|
|
height:25,
|
|
|
|
lineHeight:1,
|
|
|
|
lineHeight:1,
|
|
|
|
stroke:'black',
|
|
|
|
fill:'#fff',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
text:'抛丸施工单',
|
|
|
|
text:'抛丸施工单',
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
@ -73,13 +87,13 @@ export default function (width,height){
|
|
|
|
group.add(sgdTitle)
|
|
|
|
group.add(sgdTitle)
|
|
|
|
|
|
|
|
|
|
|
|
const dhTitle=new Konva.Text({
|
|
|
|
const dhTitle=new Konva.Text({
|
|
|
|
x:0,
|
|
|
|
x:_width*0.7,
|
|
|
|
y:50,
|
|
|
|
y:50,
|
|
|
|
width:_width-48,
|
|
|
|
width:_width-48,
|
|
|
|
height:15,
|
|
|
|
height:15,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
text:'单号:PW_'+data.gdh,
|
|
|
|
text:`单号:${data.gdh?'PW_'+data.gdh:''}`,
|
|
|
|
align:'right',
|
|
|
|
align:'left',
|
|
|
|
fontSize:12,
|
|
|
|
fontSize:12,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(dhTitle)
|
|
|
|
group.add(dhTitle)
|
|
|
@ -108,7 +122,6 @@ export default function (width,height){
|
|
|
|
group0.add(group7)
|
|
|
|
group0.add(group7)
|
|
|
|
const group8=drawQz(data)
|
|
|
|
const group8=drawQz(data)
|
|
|
|
group0.add(group8)
|
|
|
|
group0.add(group8)
|
|
|
|
console.log(data)
|
|
|
|
|
|
|
|
generateQRCode(data.gdh,group0)
|
|
|
|
generateQRCode(data.gdh,group0)
|
|
|
|
return group
|
|
|
|
return group
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -126,9 +139,7 @@ export default function (width,height){
|
|
|
|
y:1,
|
|
|
|
y:1,
|
|
|
|
width:(_width-60),
|
|
|
|
width:(_width-60),
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
|
|
|
text:'负责人:',
|
|
|
|
text:'负责人:',
|
|
|
|
fontSize:18,
|
|
|
|
fontSize:18,
|
|
|
|
verticalAlign:'middle'
|
|
|
|
verticalAlign:'middle'
|
|
|
@ -149,7 +160,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-60),
|
|
|
|
width:(_width-60),
|
|
|
|
height:180,
|
|
|
|
height:180,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(rect)
|
|
|
|
group.add(rect)
|
|
|
@ -168,7 +179,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-60),
|
|
|
|
width:(_width-60),
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(jsRect)
|
|
|
|
group.add(jsRect)
|
|
|
@ -178,9 +189,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-60),
|
|
|
|
width:(_width-60),
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
|
|
|
text:'回报',
|
|
|
|
text:'回报',
|
|
|
|
fontSize:18,
|
|
|
|
fontSize:18,
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
@ -193,7 +202,7 @@ export default function (width,height){
|
|
|
|
y:30,
|
|
|
|
y:30,
|
|
|
|
width:(_width-60),
|
|
|
|
width:(_width-60),
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(plRect)
|
|
|
|
group.add(plRect)
|
|
|
@ -203,9 +212,7 @@ export default function (width,height){
|
|
|
|
y:30,
|
|
|
|
y:30,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
|
|
|
text:data.jsr,
|
|
|
|
text:data.jsr,
|
|
|
|
fontSize:18,
|
|
|
|
fontSize:18,
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
@ -217,7 +224,7 @@ export default function (width,height){
|
|
|
|
y:30,
|
|
|
|
y:30,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(fdRect)
|
|
|
|
group.add(fdRect)
|
|
|
@ -227,10 +234,8 @@ export default function (width,height){
|
|
|
|
y:30,
|
|
|
|
y:30,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
text:data.pwfkrq,
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
|
|
|
text:data.jssj,
|
|
|
|
|
|
|
|
fontSize:18,
|
|
|
|
fontSize:18,
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
|
verticalAlign:'middle'
|
|
|
|
verticalAlign:'middle'
|
|
|
@ -254,7 +259,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-60),
|
|
|
|
width:(_width-60),
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(jsRect)
|
|
|
|
group.add(jsRect)
|
|
|
@ -264,9 +269,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-60),
|
|
|
|
width:(_width-60),
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
|
|
|
text:'接收',
|
|
|
|
text:'接收',
|
|
|
|
fontSize:18,
|
|
|
|
fontSize:18,
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
@ -279,7 +282,7 @@ export default function (width,height){
|
|
|
|
y:30,
|
|
|
|
y:30,
|
|
|
|
width:(_width-60),
|
|
|
|
width:(_width-60),
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(plRect)
|
|
|
|
group.add(plRect)
|
|
|
@ -289,10 +292,8 @@ export default function (width,height){
|
|
|
|
y:30,
|
|
|
|
y:30,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
text:formatWorker(data.pwry),
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
|
|
|
text:data.jsr,
|
|
|
|
|
|
|
|
fontSize:18,
|
|
|
|
fontSize:18,
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
|
verticalAlign:'middle'
|
|
|
|
verticalAlign:'middle'
|
|
|
@ -303,7 +304,7 @@ export default function (width,height){
|
|
|
|
y:30,
|
|
|
|
y:30,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(fdRect)
|
|
|
|
group.add(fdRect)
|
|
|
@ -313,10 +314,8 @@ export default function (width,height){
|
|
|
|
y:30,
|
|
|
|
y:30,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
width:(_width-60)/2,
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
text:data.pwpgrq||'',
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
|
|
|
text:data.jssj,
|
|
|
|
|
|
|
|
fontSize:18,
|
|
|
|
fontSize:18,
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
|
verticalAlign:'middle'
|
|
|
|
verticalAlign:'middle'
|
|
|
@ -340,7 +339,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-60),
|
|
|
|
width:(_width-60),
|
|
|
|
height:200,
|
|
|
|
height:200,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(rect)
|
|
|
|
group.add(rect)
|
|
|
@ -359,7 +358,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-60),
|
|
|
|
width:(_width-60),
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(rect)
|
|
|
|
group.add(rect)
|
|
|
@ -369,9 +368,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-60),
|
|
|
|
width:(_width-60),
|
|
|
|
height:30,
|
|
|
|
height:30,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
|
|
|
text:data.tzbh,
|
|
|
|
text:data.tzbh,
|
|
|
|
fontSize:18,
|
|
|
|
fontSize:18,
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
@ -393,7 +390,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-188)/2,
|
|
|
|
width:(_width-188)/2,
|
|
|
|
height:60,
|
|
|
|
height:60,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(plRect)
|
|
|
|
group.add(plRect)
|
|
|
@ -403,9 +400,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-188)/2,
|
|
|
|
width:(_width-188)/2,
|
|
|
|
height:60,
|
|
|
|
height:60,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
|
|
|
text:'批量:'+data.dcPl,
|
|
|
|
text:'批量:'+data.dcPl,
|
|
|
|
fontSize:18,
|
|
|
|
fontSize:18,
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
@ -418,7 +413,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-188)/2,
|
|
|
|
width:(_width-188)/2,
|
|
|
|
height:60,
|
|
|
|
height:60,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(fdRect)
|
|
|
|
group.add(fdRect)
|
|
|
@ -428,9 +423,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(-width-188)/2,
|
|
|
|
width:(-width-188)/2,
|
|
|
|
height:60,
|
|
|
|
height:60,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
|
|
|
text:'分段:'+data.dcFd,
|
|
|
|
text:'分段:'+data.dcFd,
|
|
|
|
fontSize:18,
|
|
|
|
fontSize:18,
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
@ -454,7 +447,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-188),
|
|
|
|
width:(_width-188),
|
|
|
|
height:60,
|
|
|
|
height:60,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
czbhGroup.add(czbhRect)
|
|
|
|
czbhGroup.add(czbhRect)
|
|
|
@ -464,9 +457,7 @@ export default function (width,height){
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:(_width-188),
|
|
|
|
width:(_width-188),
|
|
|
|
height:60,
|
|
|
|
height:60,
|
|
|
|
lineHeight:1,
|
|
|
|
fill:'#fff',
|
|
|
|
stroke:'black',
|
|
|
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
|
|
|
text:'船号:'+data.dcCh,
|
|
|
|
text:'船号:'+data.dcCh,
|
|
|
|
fontSize:18,
|
|
|
|
fontSize:18,
|
|
|
|
align:'center',
|
|
|
|
align:'center',
|
|
|
@ -475,14 +466,14 @@ export default function (width,height){
|
|
|
|
czbhGroup.add(czbhText)
|
|
|
|
czbhGroup.add(czbhText)
|
|
|
|
return czbhGroup
|
|
|
|
return czbhGroup
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const generateQRCode=function (text,group) {
|
|
|
|
const generateQRCode=function (text='',group) {
|
|
|
|
const imgSize=118
|
|
|
|
const imgSize=118
|
|
|
|
const rect=new Konva.Rect({
|
|
|
|
const rect=new Konva.Rect({
|
|
|
|
x:385,
|
|
|
|
x:385,
|
|
|
|
y:0,
|
|
|
|
y:0,
|
|
|
|
width:128.7,
|
|
|
|
width:128.7,
|
|
|
|
height:120,
|
|
|
|
height:120,
|
|
|
|
stroke:'black',
|
|
|
|
stroke:'#4991E5',
|
|
|
|
strokeWidth:1,
|
|
|
|
strokeWidth:1,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
group.add(rect)
|
|
|
|
group.add(rect)
|
|
|
@ -508,6 +499,6 @@ export default function (width,height){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
container,drawGd
|
|
|
|
container,drawGd,setWorkers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|