|
|
|
@ -2,7 +2,7 @@ import Konva from "konva";
|
|
|
|
|
import QRCode from 'qrcode'
|
|
|
|
|
|
|
|
|
|
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 group=new Konva.Group({
|
|
|
|
@ -12,16 +12,19 @@ export default function (width,height){
|
|
|
|
|
height:_height
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const rect=new Konva.Rect({
|
|
|
|
|
x:0,
|
|
|
|
|
y:0,
|
|
|
|
|
width:_width,
|
|
|
|
|
height:_height,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
group.add(rect)
|
|
|
|
|
const bgObj = new Image();
|
|
|
|
|
bgObj.src = require('@/assets/pwan/pgdbg.png');
|
|
|
|
|
bgObj.onload = function () {
|
|
|
|
|
const shape = new Konva.Image({
|
|
|
|
|
x: 0,
|
|
|
|
|
y: 0,
|
|
|
|
|
width: _width,
|
|
|
|
|
height:_height,
|
|
|
|
|
image: this,
|
|
|
|
|
});
|
|
|
|
|
group.add(shape)
|
|
|
|
|
shape.zIndex(0)
|
|
|
|
|
}
|
|
|
|
|
return group
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -29,8 +32,8 @@ export default function (width,height){
|
|
|
|
|
// this.layer.destroyChildren();
|
|
|
|
|
|
|
|
|
|
const group=new Konva.Group({
|
|
|
|
|
x:0,
|
|
|
|
|
y:0,
|
|
|
|
|
x:13,
|
|
|
|
|
y:12,
|
|
|
|
|
width:_width,
|
|
|
|
|
height:_height
|
|
|
|
|
})
|
|
|
|
@ -38,9 +41,8 @@ export default function (width,height){
|
|
|
|
|
const rect=new Konva.Rect({
|
|
|
|
|
x:0,
|
|
|
|
|
y:0,
|
|
|
|
|
width:_width,
|
|
|
|
|
height:_height,
|
|
|
|
|
fill:'white'
|
|
|
|
|
width:_width-25,
|
|
|
|
|
height:_height-20,
|
|
|
|
|
})
|
|
|
|
|
group.add(rect)
|
|
|
|
|
|
|
|
|
@ -49,9 +51,7 @@ export default function (width,height){
|
|
|
|
|
y:10,
|
|
|
|
|
width:_width,
|
|
|
|
|
height:35,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:1.2,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:'大连重工大连钢材加工配送有限公司',
|
|
|
|
|
align:'center',
|
|
|
|
|
fontSize:22,
|
|
|
|
@ -64,7 +64,7 @@ export default function (width,height){
|
|
|
|
|
width:_width,
|
|
|
|
|
height:25,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
text:'抛丸施工单',
|
|
|
|
|
align:'center',
|
|
|
|
@ -73,13 +73,13 @@ export default function (width,height){
|
|
|
|
|
group.add(sgdTitle)
|
|
|
|
|
|
|
|
|
|
const dhTitle=new Konva.Text({
|
|
|
|
|
x:0,
|
|
|
|
|
x:_width*0.7,
|
|
|
|
|
y:50,
|
|
|
|
|
width:_width-48,
|
|
|
|
|
height:15,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
text:'单号:PW_'+data.gdh,
|
|
|
|
|
align:'right',
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:`单号:${data.gdh?'PW_'+data.gdh:''}`,
|
|
|
|
|
align:'left',
|
|
|
|
|
fontSize:12,
|
|
|
|
|
})
|
|
|
|
|
group.add(dhTitle)
|
|
|
|
@ -126,9 +126,7 @@ export default function (width,height){
|
|
|
|
|
y:1,
|
|
|
|
|
width:(_width-60),
|
|
|
|
|
height:30,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:'负责人:',
|
|
|
|
|
fontSize:18,
|
|
|
|
|
verticalAlign:'middle'
|
|
|
|
@ -149,7 +147,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-60),
|
|
|
|
|
height:180,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(rect)
|
|
|
|
@ -168,7 +166,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-60),
|
|
|
|
|
height:30,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(jsRect)
|
|
|
|
@ -178,9 +176,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-60),
|
|
|
|
|
height:30,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:'回报',
|
|
|
|
|
fontSize:18,
|
|
|
|
|
align:'center',
|
|
|
|
@ -193,7 +189,7 @@ export default function (width,height){
|
|
|
|
|
y:30,
|
|
|
|
|
width:(_width-60),
|
|
|
|
|
height:30,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(plRect)
|
|
|
|
@ -203,9 +199,7 @@ export default function (width,height){
|
|
|
|
|
y:30,
|
|
|
|
|
width:(_width-60)/2,
|
|
|
|
|
height:30,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:data.jsr,
|
|
|
|
|
fontSize:18,
|
|
|
|
|
align:'center',
|
|
|
|
@ -217,7 +211,7 @@ export default function (width,height){
|
|
|
|
|
y:30,
|
|
|
|
|
width:(_width-60)/2,
|
|
|
|
|
height:30,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(fdRect)
|
|
|
|
@ -227,10 +221,8 @@ export default function (width,height){
|
|
|
|
|
y:30,
|
|
|
|
|
width:(_width-60)/2,
|
|
|
|
|
height:30,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
text:data.jssj,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:data.pwfkrq,
|
|
|
|
|
fontSize:18,
|
|
|
|
|
align:'center',
|
|
|
|
|
verticalAlign:'middle'
|
|
|
|
@ -254,7 +246,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-60),
|
|
|
|
|
height:30,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(jsRect)
|
|
|
|
@ -264,9 +256,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-60),
|
|
|
|
|
height:30,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:'接收',
|
|
|
|
|
fontSize:18,
|
|
|
|
|
align:'center',
|
|
|
|
@ -279,7 +269,7 @@ export default function (width,height){
|
|
|
|
|
y:30,
|
|
|
|
|
width:(_width-60),
|
|
|
|
|
height:30,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(plRect)
|
|
|
|
@ -289,10 +279,8 @@ export default function (width,height){
|
|
|
|
|
y:30,
|
|
|
|
|
width:(_width-60)/2,
|
|
|
|
|
height:30,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
text:data.jsr,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:data.pwry,
|
|
|
|
|
fontSize:18,
|
|
|
|
|
align:'center',
|
|
|
|
|
verticalAlign:'middle'
|
|
|
|
@ -303,7 +291,7 @@ export default function (width,height){
|
|
|
|
|
y:30,
|
|
|
|
|
width:(_width-60)/2,
|
|
|
|
|
height:30,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(fdRect)
|
|
|
|
@ -313,10 +301,8 @@ export default function (width,height){
|
|
|
|
|
y:30,
|
|
|
|
|
width:(_width-60)/2,
|
|
|
|
|
height:30,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
text:data.jssj,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:data.pwpgrq||'',
|
|
|
|
|
fontSize:18,
|
|
|
|
|
align:'center',
|
|
|
|
|
verticalAlign:'middle'
|
|
|
|
@ -340,7 +326,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-60),
|
|
|
|
|
height:200,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(rect)
|
|
|
|
@ -359,7 +345,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-60),
|
|
|
|
|
height:30,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(rect)
|
|
|
|
@ -369,9 +355,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-60),
|
|
|
|
|
height:30,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:data.tzbh,
|
|
|
|
|
fontSize:18,
|
|
|
|
|
align:'center',
|
|
|
|
@ -393,7 +377,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-188)/2,
|
|
|
|
|
height:60,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(plRect)
|
|
|
|
@ -403,9 +387,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-188)/2,
|
|
|
|
|
height:60,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:'批量:'+data.dcPl,
|
|
|
|
|
fontSize:18,
|
|
|
|
|
align:'center',
|
|
|
|
@ -418,7 +400,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-188)/2,
|
|
|
|
|
height:60,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(fdRect)
|
|
|
|
@ -428,9 +410,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(-width-188)/2,
|
|
|
|
|
height:60,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:'分段:'+data.dcFd,
|
|
|
|
|
fontSize:18,
|
|
|
|
|
align:'center',
|
|
|
|
@ -454,7 +434,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-188),
|
|
|
|
|
height:60,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
czbhGroup.add(czbhRect)
|
|
|
|
@ -464,9 +444,7 @@ export default function (width,height){
|
|
|
|
|
y:0,
|
|
|
|
|
width:(_width-188),
|
|
|
|
|
height:60,
|
|
|
|
|
lineHeight:1,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
strokeWidth:0.8,
|
|
|
|
|
fill:'#fff',
|
|
|
|
|
text:'船号:'+data.dcCh,
|
|
|
|
|
fontSize:18,
|
|
|
|
|
align:'center',
|
|
|
|
@ -475,14 +453,14 @@ export default function (width,height){
|
|
|
|
|
czbhGroup.add(czbhText)
|
|
|
|
|
return czbhGroup
|
|
|
|
|
}
|
|
|
|
|
const generateQRCode=function (text,group) {
|
|
|
|
|
const generateQRCode=function (text='',group) {
|
|
|
|
|
const imgSize=118
|
|
|
|
|
const rect=new Konva.Rect({
|
|
|
|
|
x:385,
|
|
|
|
|
y:0,
|
|
|
|
|
width:128.7,
|
|
|
|
|
height:120,
|
|
|
|
|
stroke:'black',
|
|
|
|
|
stroke:'#4991E5',
|
|
|
|
|
strokeWidth:1,
|
|
|
|
|
})
|
|
|
|
|
group.add(rect)
|
|
|
|
|