diff --git a/src/assets/pwan/csd0.png b/src/assets/pwan/csd0.png new file mode 100644 index 0000000..7c83b80 Binary files /dev/null and b/src/assets/pwan/csd0.png differ diff --git a/src/assets/pwan/csd1.png b/src/assets/pwan/csd1.png new file mode 100644 index 0000000..e1899c4 Binary files /dev/null and b/src/assets/pwan/csd1.png differ diff --git a/src/assets/pwan/csdbg.png b/src/assets/pwan/csdbg.png new file mode 100644 index 0000000..5f69714 Binary files /dev/null and b/src/assets/pwan/csdbg.png differ diff --git a/src/assets/pwan/pgdbg.png b/src/assets/pwan/pgdbg.png new file mode 100644 index 0000000..1e604c5 Binary files /dev/null and b/src/assets/pwan/pgdbg.png differ diff --git a/src/views/jhzx/symxCX.vue b/src/views/jhzx/symxCX.vue index d961540..190591a 100644 --- a/src/views/jhzx/symxCX.vue +++ b/src/views/jhzx/symxCX.vue @@ -26,7 +26,7 @@ - +
月度计划排产 获取排产结果 @@ -59,7 +59,7 @@
- +
月度计划排产 生成月度计划 diff --git a/src/views/jhzx/ydjhzxGL.vue b/src/views/jhzx/ydjhzxGL.vue index b2c40bc..e432b9a 100644 --- a/src/views/jhzx/ydjhzxGL.vue +++ b/src/views/jhzx/ydjhzxGL.vue @@ -25,7 +25,7 @@
- 汇总 + 准备检查 import paoWanPgdConfig from './pgdTable' +import {getPgd} from "@/api/zyjh"; export default { name:'PwanPgd', data(){ return{ gridOptions:{}, - list:{}, } }, created(){ @@ -18,6 +18,11 @@ export default { this.gridOptions.columns=columns }, methods:{ + initData(worker,zt){ + getPgd({user:worker,zt:zt,field:'pwry'}).then(res=>{ + this.gridOptions.data=res.data + }) + }, cellClick({row}){ this.$emit('initPgd',row) } diff --git a/src/views/zyjhzx/pwanfkui/comps/baifang.js b/src/views/zyjhzx/pwanfkui/comps/baifang.js index cd20411..1165274 100644 --- a/src/views/zyjhzx/pwanfkui/comps/baifang.js +++ b/src/views/zyjhzx/pwanfkui/comps/baifang.js @@ -1,4 +1,5 @@ import Konva from "konva"; +import {shangLiao} from "@/api/zyjh"; const baifang=function (option={}) { const width=option.width,height=option.height,slList=option.dw,image=require('@/assets/gb.png') @@ -13,16 +14,19 @@ const baifang=function (option={}) { height:_height }) - const rect=new Konva.Rect({ - x:0, - y:0, - width:_width, - height:_height, - stroke:'black', - strokeWidth:1, - }) - - group.add(rect) + const imageObj = new Image(); + imageObj.src = require('@/assets/sliao/personbg.png'); + imageObj.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 } @@ -30,7 +34,7 @@ const baifang=function (option={}) { const slGroup=container() const thatHeight=height - const gangban=function (index,str){ + const gangban=function (index,item){ const group=new Konva.Group({ x:0, y:thatHeight-310-index*40, @@ -48,6 +52,62 @@ const baifang=function (option={}) { } }) let _index=0 + let touchingFlag=false; + group.on('mousedown touchstart',function (evt){ + const layer=evt.currentTarget.parent.parent + console.log(layer) + touchingFlag=true + const {x,y}=evt.evt + setTimeout(()=>{ + const moving=this.isDragging() + if (!moving){ + if (touchingFlag){ + this.draggable(false) + + const tmpGroup=this.clone() + tmpGroup.x(x-10) + tmpGroup.y(y-10) + layer.add(tmpGroup) + tmpGroup.draggable(true) + tmpGroup.dragBoundFunc(function (pos){ + return{...pos} + }) + tmpGroup.startDrag() + + const that=this + tmpGroup.on('dragend',function (){ + const {x:thisX,y:thisY}=this.absolutePosition() + for (const item of layer.children) { + if(item.attrs.id==='csd'){ + const {x,y}=item.absolutePosition() + if (thisX>=x&&thisY>=y){ + this.x(41) + this.y(800) + // this.rotate(-90) + this.scaleX(0.5) + console.log(item.children[0]) + this.moveTo(item.children[0].children[0]) + this.zIndex(1) + }else{ + this.remove() + that.visible(true) + } + } + } + //const {x,y}=that.slGroup.absolutePosition() + + }) + + this.visible(false) + } + } + },500) + + }) + + group.on('mouseup touchend',function (){ + touchingFlag=false + }) group.on('dragstart',function (){ const {x,y}=this.absolutePosition() @@ -60,7 +120,7 @@ const baifang=function (option={}) { if(_index===0){ _index=this.getAttr('index') } - this.zIndex(999) + this.zIndex(7) const {y:thisY}=this.absolutePosition() const dir=thisY-this.startPos.y>0?-40:40 @@ -140,7 +200,7 @@ const baifang=function (option={}) { width: imgSize, height:40, fill:'black', - text:str+',12*2830*13090', + text:`${item.wph||''},${item.wpgg}`, align:'center', verticalAlign:'middle', }) @@ -153,7 +213,7 @@ const baifang=function (option={}) { width: imgSize-20, height:40, fill:'black', - text:'G175K-4,001,2302\n上料:2024/07/01,切割:2024/07/04', + text:`${item.czbh},${item.pl},${item.fd}\n上料:${item.bfrq||''},切割:${item.qgjhrq||''}`, align:'center', verticalAlign:'middle', }) diff --git a/src/views/zyjhzx/pwanfkui/comps/container.js b/src/views/zyjhzx/pwanfkui/comps/container.js index 6df3bde..068159b 100644 --- a/src/views/zyjhzx/pwanfkui/comps/container.js +++ b/src/views/zyjhzx/pwanfkui/comps/container.js @@ -11,6 +11,21 @@ const container=function (width=0,height=0,container){ stage.add(layer) layer.draw(); + const imageObj = new Image(); + const imgSize=width + imageObj.src = require('@/assets/kban/bg.png'); + imageObj.onload = function () { + const shape = new Konva.Image({ + x: 0, + y: 0, + width: imgSize, + height:this.height, + image: imageObj, + }); + layer.add(shape) + shape.zIndex(0) + } + return { stage,layer } diff --git a/src/views/zyjhzx/pwanfkui/comps/csd.js b/src/views/zyjhzx/pwanfkui/comps/csd.js index 858185b..4668239 100644 --- a/src/views/zyjhzx/pwanfkui/comps/csd.js +++ b/src/views/zyjhzx/pwanfkui/comps/csd.js @@ -4,35 +4,115 @@ import Konva from "konva"; export default function (width,height){ const x=width*0.55+40,y=45,_width=width*0.1,_height=height*0.945 const container=new Konva.Group({ + id:'csd', x:x, y:y, width:_width, height:_height }) - const rect=new Konva.Rect({ + // const imageObj = new Image(); + const imgSize=_width + // imageObj.src = require('@/assets/pwan/csdbg.png'); + // imageObj.onload = function () { + // const shape = new Konva.Image({ + // x: 0, + // y: 0, + // width: imgSize, + // height:_height, + // image: imageObj, + // }); + // container.add(shape) + // shape.zIndex(0) + // } + + const imageObj1 = new Image(); + imageObj1.src = require('@/assets/pwan/csd0.png'); + imageObj1.onload = function () { + const shape = new Konva.Image({ + x: 0, + y: 0, + width: imgSize, + height:_height*0.1, + image: this, + }); + container.add(shape) + shape.zIndex(1) + } + + const imageObj3 = new Image(); + imageObj3.src = require('@/assets/pwan/csd0.png'); + imageObj3.onload = function () { + const shape = new Konva.Image({ + x: 0, + y: _height-_height*0.1, + width: imgSize, + height:_height*0.1, + image: this, + }); + container.add(shape) + shape.zIndex(1) + } + + const group=new Konva.Group({ x:0, - y:0, - width:_width, - height:_height, - stroke:'black', - strokeWidth:1, + y:_height*0.1, + width: imgSize, + height:_height-_height*0.1, }) + container.add(group) + group.clipFunc(function(ctx) { + ctx.rect(0, 0, imgSize, _height-_height*0.1); + }); - container.add(rect) - - const text=new Konva.Text({ - x: 0, - y: 0, - width: _width, - height:_height, - fill:'black', - text:'传送带', - align:'center', - verticalAlign:'middle', - }) + initCsd() + + function initCsd() { + const imageObj2 = new Image(); + imageObj2.src = require('@/assets/pwan/csd1.png'); + imageObj2.onload = function () { + play(this,imgSize,_height) + } + } + + function play(img,imgSize,_height){ + const csdGroup=new Konva.Group({ + x: 0, + y: 0, + width: imgSize, + height: _height, + image: img, + }) + group.add(csdGroup) + const shape = new Konva.Image({ + x: 0, + y: 0, + width: imgSize, + height: _height, + image: img, + }); + csdGroup.add(shape) + shape.zIndex(0) - container.add(text) + const shape1 = new Konva.Image({ + x: 0, + y: _height, + width: imgSize, + height: _height, + image: img, + }); + csdGroup.add(shape1) + shape1.zIndex(1) + csdGroup.to({ + x: 0, + y: -700, + duration: 20, //持续时间 + onFinish() { + csdGroup.remove() + play(img,imgSize,_height) + } + }) + } return container } diff --git a/src/views/zyjhzx/pwanfkui/comps/dw.js b/src/views/zyjhzx/pwanfkui/comps/dw.js index 4516c4d..62c2b80 100644 --- a/src/views/zyjhzx/pwanfkui/comps/dw.js +++ b/src/views/zyjhzx/pwanfkui/comps/dw.js @@ -1,7 +1,6 @@ import Konva from "konva"; export default function (width,height,callback){ - console.log(callback) const x=0,y=0,_width=width*0.16,_height=height*0.67 const container=function (){ @@ -14,16 +13,19 @@ export default function (width,height,callback){ height:_height }) - const rect=new Konva.Rect({ - x:0, - y:0, - width:_width, - height:_height, - stroke:'black', - strokeWidth:1, - }) - - group.add(rect) + const imageObj = new Image(); + imageObj.src = require('@/assets/sliao/personbg.png'); + imageObj.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 } @@ -40,20 +42,23 @@ export default function (width,height,callback){ height:height }) group.on('click touchstart',function (){ - console.log(item) callback(index,item.list) }) - 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/sliao/personbg1.png'); + bgObj.onload = function () { + const shape = new Konva.Image({ + x: 0, + y: 0, + offsetX:4, + width: width, + height:height, + image: this, + }); + group.add(shape) + shape.zIndex(0) + } const text=new Konva.Text({ x:0, @@ -61,10 +66,10 @@ export default function (width,height,callback){ width: width, height: height, fill:'black', - text:item.name, + text:`${item.name}\n${item.list.length}张`, align:'center', verticalAlign:'middle', - fontSize:20 + fontSize:18 }) group.add(text) diff --git a/src/views/zyjhzx/pwanfkui/comps/person.js b/src/views/zyjhzx/pwanfkui/comps/person.js index 7528657..6ccd51d 100644 --- a/src/views/zyjhzx/pwanfkui/comps/person.js +++ b/src/views/zyjhzx/pwanfkui/comps/person.js @@ -1,36 +1,63 @@ import Konva from "konva"; export default function (width,height){ - const _width=width*0.134,_height=height*0.67 + const _width=width*0.134,_height=height*0.737 const container=function (){ const x=20,y=300 const group=new Konva.Group({ - x:x, - y:y, + x:0, + y:0, width:_width, - height:_height + height:_height, + draggable:true, + dragBoundFunc:function (pos){ + return { + x:x, + y:pos.y + } + }, }) - const rect=new Konva.Rect({ - x:0, - y:0, + const bgGroup=new Konva.Group({ + x:x, + y:y, width:_width, height:_height, - stroke:'black', - strokeWidth:1, }) + bgGroup.clipFunc(function(ctx) { + ctx.rect(0, 6, _width, _height-11); + }); + bgGroup.add(group) - group.add(rect) + const imageObj = new Image(); + imageObj.src = require('@/assets/sliao/personbg.png'); + imageObj.onload = function () { + const shape = new Konva.Image({ + x: 0, + y: 0, + width: _width, + height:_height, + image: this, + }); + bgGroup.add(shape) + shape.zIndex(0) + } - return group + return bgGroup + } + let currentWork=null; + let selectedShape=null; + + const getCurrentWorker=function (){ + return currentWork } const person=function (index,persons={}){ const alignSize=2 - const width=(_width-20)/alignSize,height=110 - const x=index%alignSize*width+index%alignSize*10+5,y=height*(Math.floor(index/alignSize))+(Math.floor(index/alignSize)+1)*10 + const width=(_width-5)/alignSize,height=110 + const x=index%alignSize*width+index%alignSize+5,y=height*(Math.floor(index/alignSize))+(Math.floor(index/alignSize)+1)*10 const group=new Konva.Group({ x:x, y:y, @@ -38,19 +65,73 @@ export default function (width,height){ height:height }) - const rect=new Konva.Rect({ - x:0, - y:0, - width:width, - height:height, - stroke:'black', - strokeWidth:1, + const selectObj = new Image(); + selectObj.src = require('@/assets/sliao/selected.png'); + let selectShape=null + const setSelectShape=function (shape){ + selectShape=shape + } + selectObj.onload = function () { + const shape = new Konva.Image({ + x: width-width*0.3, + y: 2, + width: width*0.25, + height:height*0.25, + image: this, + visible:false + }); + group.add(shape) + shape.zIndex(0) + setSelectShape(shape) + } + + group.on('click touchstart',function (){ + currentWork=persons + if (selectedShape){ + selectedShape.hide() + if (selectedShape===selectShape){ + selectedShape=null + return + } + } + selectedShape=selectShape + selectedShape.show() }) - group.add(rect) + + const bgObj = new Image(); + bgObj.src = require('@/assets/sliao/personbg1.png'); + bgObj.onload = function () { + const shape = new Konva.Image({ + x: 0, + y: 0, + offsetX:4, + width: width, + height:height, + image: this, + }); + group.add(shape) + shape.zIndex(0) + } + + const imageObj = new Image(); + imageObj.src = require('@/assets/sliao/headImage.png'); + imageObj.onload = function () { + const shape = new Konva.Image({ + x: 0, + y: 0, + offsetX:-4, + offsetY:-10, + width: width*0.89, + height:height*0.85, + image: this, + }); + group.add(shape) + shape.zIndex(0) + } const text=new Konva.Text({ x:0, - y:0, + y:62, width:width, height:height, text: persons.userName, diff --git a/src/views/zyjhzx/pwanfkui/comps/pgd.js b/src/views/zyjhzx/pwanfkui/comps/pgd.js index efd3864..cc0c6e0 100644 --- a/src/views/zyjhzx/pwanfkui/comps/pgd.js +++ b/src/views/zyjhzx/pwanfkui/comps/pgd.js @@ -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) diff --git a/src/views/zyjhzx/pwanfkui/comps/title.js b/src/views/zyjhzx/pwanfkui/comps/title.js index 711a4ae..67e1866 100644 --- a/src/views/zyjhzx/pwanfkui/comps/title.js +++ b/src/views/zyjhzx/pwanfkui/comps/title.js @@ -1,18 +1,40 @@ import Konva from "konva"; const title=function (width,height,title) { - return new Konva.Text({ + const group=new Konva.Group({ + x: 0, + y: 0, + width: width, + height: 20, + }) + + const imageObj = new Image(); + imageObj.src = require('@/assets/kban/logo.png'); + imageObj.onload = function () { + const shape = new Konva.Image({ + x: 0, + y: 0, + width: width*0.86, + height:41, + image: imageObj, + }); + group.add(shape) + } + + const text=new Konva.Text({ x: 0, y: 8, width: width, height: 20, - lineHeight: 1, - stroke: 'blue', - strokeWidth: 2, text: title, align: 'center', + fill:'#fff', fontSize: 32, + fontStyle:'bold' }) + group.add(text) + + return group } export default title diff --git a/src/views/zyjhzx/pwanfkui/index.vue b/src/views/zyjhzx/pwanfkui/index.vue index 20c546c..3ae9a99 100644 --- a/src/views/zyjhzx/pwanfkui/index.vue +++ b/src/views/zyjhzx/pwanfkui/index.vue @@ -38,6 +38,9 @@ export default { mounted() { this.initKonvaStage(); }, + created(){ + window.addEventListener('resize', this.initKonvaStage) + }, methods:{ initPgd(pgd={}){ const group=this.drawGd(pgd) @@ -81,11 +84,10 @@ export default { const worker=person(i,item) worker.on('click touchstart',function (){ that.currentWorker=item - getPgd({field:'pwry',jhrqField:'pwjhrq',user:that.currentWorker.userCode}).then(res=>[ - that.pgd=res.data - ]) + that.$refs.pwpgd.initData(that.currentWorker.userCode,'31') }) group.add(worker) + worker.zIndex(1) } }) }, diff --git a/src/views/zyjhzx/pwanpgong/comps/dw.js b/src/views/zyjhzx/pwanpgong/comps/dw.js index 8b9ab91..5d308bd 100644 --- a/src/views/zyjhzx/pwanpgong/comps/dw.js +++ b/src/views/zyjhzx/pwanpgong/comps/dw.js @@ -4,7 +4,7 @@ export default function (width,height){ const x=0,y=0,_width=width*0.16,_height=height*0.945 const container=function (){ - const x=width*0.5+30,y=45 + const x=width*0.5+30,y=40 const group=new Konva.Group({ x:x, @@ -13,16 +13,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 imageObj = new Image(); + imageObj.src = require('@/assets/sliao/personbg.png'); + imageObj.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 } @@ -39,16 +42,20 @@ 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/sliao/personbg1.png'); + bgObj.onload = function () { + const shape = new Konva.Image({ + x: 0, + y: 0, + offsetX:4, + width: width, + height:height, + image: this, + }); + group.add(shape) + shape.zIndex(0) + } const text=new Konva.Text({ x:0, diff --git a/src/views/zyjhzx/pwanpgong/comps/person.js b/src/views/zyjhzx/pwanpgong/comps/person.js index a36370b..0742999 100644 --- a/src/views/zyjhzx/pwanpgong/comps/person.js +++ b/src/views/zyjhzx/pwanpgong/comps/person.js @@ -102,6 +102,7 @@ export default function (width,height){ if (selectedShape){ selectedShape.hide() if (selectedShape===selectShape){ + selectedShape=null return } } diff --git a/src/views/zyjhzx/pwanpgong/comps/pgd.js b/src/views/zyjhzx/pwanpgong/comps/pgd.js index cd96c26..cc0c6e0 100644 --- a/src/views/zyjhzx/pwanpgong/comps/pgd.js +++ b/src/views/zyjhzx/pwanpgong/comps/pgd.js @@ -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', @@ -77,7 +77,7 @@ export default function (width,height){ y:50, width:_width-48, height:15, - lineHeight:1, + fill:'#fff', text:`单号:${data.gdh?'PW_'+data.gdh:''}`, align:'left', fontSize:12, @@ -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,9 +221,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.pwfkrq, fontSize:18, align:'center', @@ -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.pwpgrq, + 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', @@ -482,10 +460,9 @@ export default function (width,height){ y:0, width:128.7, height:120, - stroke:'black', + stroke:'#4991E5', strokeWidth:1, }) - console.log(text) group.add(rect) QRCode.toDataURL(text,{width:600,height:600,margin:1}) .then(url => { diff --git a/src/views/zyjhzx/pwanpgong/comps/pgdTable.js b/src/views/zyjhzx/pwanpgong/comps/pgdTable.js index 40980eb..2daeed0 100644 --- a/src/views/zyjhzx/pwanpgong/comps/pgdTable.js +++ b/src/views/zyjhzx/pwanpgong/comps/pgdTable.js @@ -1,7 +1,7 @@ export default function () { const options={ - height:685, + height:706, align:'center', border: true, resizable: true, diff --git a/src/views/zyjhzx/qgefkui/index.vue b/src/views/zyjhzx/qgefkui/index.vue index 2fefae6..ce56ef2 100644 --- a/src/views/zyjhzx/qgefkui/index.vue +++ b/src/views/zyjhzx/qgefkui/index.vue @@ -74,7 +74,7 @@ export default { const group=container() group.on('click touchstart',function (){ that.currentWorker=person - getPgd({field:'',jhrqField:'',user:that.currentWorker.userCode}).then(res=>[ + getPgd({user:that.currentWorker.userCode,zt:'6'}).then(res=>[ that.pgd=res.data ]) }) diff --git a/src/views/zyjhzx/sliao/comps/person.js b/src/views/zyjhzx/sliao/comps/person.js index 16cb259..ca9ed44 100644 --- a/src/views/zyjhzx/sliao/comps/person.js +++ b/src/views/zyjhzx/sliao/comps/person.js @@ -96,6 +96,7 @@ const workers=function (width,height,persons) { if (selectedShape){ selectedShape.hide() if (selectedShape===selectShape){ + selectedShape=null return } } diff --git a/src/views/zyjhzx/sliao/index.vue b/src/views/zyjhzx/sliao/index.vue index 5571d7a..9325c98 100644 --- a/src/views/zyjhzx/sliao/index.vue +++ b/src/views/zyjhzx/sliao/index.vue @@ -338,7 +338,6 @@ export default { } _sljhGroup.draggable(true) }) - } } },500)