1.完善抛丸派工

master
董哲奇 10 months ago
parent 1657283447
commit 978c45094f

@ -60,7 +60,7 @@ export default {
for (const item of list) { for (const item of list) {
const data={ const data={
id:item.id, id:item.id,
pwsgr:worker.userCode,// pwry:worker.userCode,//
} }
tmpArr.push(data) tmpArr.push(data)
} }

@ -38,9 +38,6 @@ export default function (width,height){
width:width, width:width,
height:height height:height
}) })
group.on('click touchstart',function (){
callback(index,dw[index].list)
})
const rect=new Konva.Rect({ const rect=new Konva.Rect({
x:0, x:0,
@ -59,10 +56,10 @@ export default function (width,height){
width: width, width: width,
height: height, height: height,
fill:'black', fill:'black',
text:item.name, text:`${item.name}\n${item.list.length}`,
align:'center', align:'center',
verticalAlign:'middle', verticalAlign:'middle',
fontSize:20 fontSize:18
}) })
group.add(text) group.add(text)

@ -9,8 +9,6 @@ export default function (width,height){
const layer=new Konva.Layer({ const layer=new Konva.Layer({
x:x, x:x,
y:y, y:y,
width:_width,
height:_height
}) })
const group=new Konva.Group({ const group=new Konva.Group({
@ -32,7 +30,7 @@ export default function (width,height){
y:0, y:0,
}) })
bgGroup.clipFunc(function(ctx) { bgGroup.clipFunc(function(ctx) {
ctx.rect(0, 0, width-929, 182); ctx.rect(6, 0, width*0.5+1, 182);
}); });
const imageObj = new Image(); const imageObj = new Image();
@ -41,9 +39,9 @@ export default function (width,height){
const shape = new Konva.Image({ const shape = new Konva.Image({
x: 0, x: 0,
y: 0, y: 0,
offsetX:7, offsetX:6,
width: 996*0.986, width: width*0.52-14,
height:182*0.986, height:182*0.8,
image: this, image: this,
}); });
bgGroup.add(shape) bgGroup.add(shape)
@ -67,7 +65,7 @@ export default function (width,height){
const person=function (index,persons={}){ const person=function (index,persons={}){
const width=120,height=110 const width=120,height=110
const x=index*120+(index+1)*5,y=5 const x=index*125+(index+1)+14,y=5
const group=new Konva.Group({ const group=new Konva.Group({
x:x, x:x,
y:y, y:y,
@ -100,7 +98,7 @@ export default function (width,height){
} }
group.on('click touchstart',function (){ group.on('click touchstart',function (){
currentWork=item currentWork=persons
if (selectedShape){ if (selectedShape){
selectedShape.hide() selectedShape.hide()
if (selectedShape===selectShape){ if (selectedShape===selectShape){
@ -143,7 +141,7 @@ export default function (width,height){
} }
const text=new Konva.Text({ const text=new Konva.Text({
x:0, x:0,
y:0, y:75,
width:width, width:width,
height:height, height:height,
text: persons.userName, text: persons.userName,

@ -73,13 +73,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, lineHeight:1,
text:'单号:PW_'+data.gdh, text:`单号:${data.gdh?'PW_'+data.gdh:''}`,
align:'right', align:'left',
fontSize:12, fontSize:12,
}) })
group.add(dhTitle) group.add(dhTitle)
@ -230,7 +230,7 @@ export default function (width,height){
lineHeight:1, lineHeight:1,
stroke:'black', stroke:'black',
strokeWidth:0.8, strokeWidth:0.8,
text:data.jssj, text:data.pwfkrq,
fontSize:18, fontSize:18,
align:'center', align:'center',
verticalAlign:'middle' verticalAlign:'middle'
@ -316,7 +316,7 @@ export default function (width,height){
lineHeight:1, lineHeight:1,
stroke:'black', stroke:'black',
strokeWidth:0.8, strokeWidth:0.8,
text:data.jssj, text:data.pwpgrq,
fontSize:18, fontSize:18,
align:'center', align:'center',
verticalAlign:'middle' verticalAlign:'middle'
@ -475,7 +475,7 @@ 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,
@ -485,6 +485,7 @@ export default function (width,height){
stroke:'black', stroke:'black',
strokeWidth:1, strokeWidth:1,
}) })
console.log(text)
group.add(rect) group.add(rect)
QRCode.toDataURL(text,{width:600,height:600,margin:1}) QRCode.toDataURL(text,{width:600,height:600,margin:1})
.then(url => { .then(url => {

@ -33,6 +33,9 @@ export default {
mounted() { mounted() {
this.initKonvaStage(); this.initKonvaStage();
}, },
created(){
window.addEventListener('resize', this.initKonvaStage)
},
methods:{ methods:{
initPgd(pgd={}){ initPgd(pgd={}){
const group=this.drawGd(pgd) const group=this.drawGd(pgd)
@ -98,7 +101,7 @@ export default {
width:50%; width:50%;
height: auto; height: auto;
position: absolute; position: absolute;
top:230px; top:200px;
left:20px; left:20px;
border: none; border: none;
margin: 0; margin: 0;

Loading…
Cancel
Save