diff --git a/src/views/jhzx/ydjhzxXF.vue b/src/views/jhzx/ydjhzxXF.vue index e4a122f..1189575 100644 --- a/src/views/jhzx/ydjhzxXF.vue +++ b/src/views/jhzx/ydjhzxXF.vue @@ -1010,7 +1010,6 @@ export default { return; } } - console.log(this.queryParam) ydjhxf(this.checkedList).then(res => { if (res.success) { this.initList() diff --git a/src/views/zyjhzx/hxianfkui/comps/baifang.js b/src/views/zyjhzx/hxianfkui/comps/baifang.js index 92b3b10..949fe5d 100644 --- a/src/views/zyjhzx/hxianfkui/comps/baifang.js +++ b/src/views/zyjhzx/hxianfkui/comps/baifang.js @@ -44,6 +44,8 @@ const baifang=function (option={}) { bgGroup.add(slGroup) slGroup.zIndex(1) + let currSlist=null + const thatHeight=height const gangban=function (index,item){ const group=new Konva.Group({ @@ -66,9 +68,7 @@ const baifang=function (option={}) { let _index=0 let touchingFlag=false; group.on('mousedown touchstart',function (evt){ - console.log(evt) - const layer=evt.currentTarget.parent.parent - console.log(layer) + const layer=this.parent.parent.parent touchingFlag=true const {x,y}=evt.evt setTimeout(()=>{ @@ -78,7 +78,7 @@ const baifang=function (option={}) { this.draggable(false) const tmpGroup=this.clone() - tmpGroup.x(x-10) + tmpGroup.x(x-50) tmpGroup.y(y-10) layer.add(tmpGroup) tmpGroup.draggable(true) @@ -97,7 +97,6 @@ const baifang=function (option={}) { if ((thisX>=x&&thisY>=y&&thisX<=(x+item.attrs.width)&&thisY<=(y+item.attrs.height))&&!!worker){ const info=this.getAttr('item') const zyjh=JSON.parse(window.localStorage.getItem('hxfk')) - console.log(zyjh) if (!zyjh){ VXETable.modal.message({content: '请先选择待反馈的派工单', status: 'warning'}) this.remove() @@ -180,16 +179,14 @@ const baifang=function (option={}) { } }) - let slList=null - group.on('dragend',function (){ const index=this.getAttr('index') - const element = slList.splice(index-1, 1)[0]; - slList.splice(_index-1, 0, element); + const element = currSlist.splice(index-1, 1)[0]; + currSlist.splice(_index-1, 0, element); this.setAttr('index',_index) _index=0 slGroup.destroyChildren() - handler(slList) + handler(currSlist) }) const indexRect=new Konva.Rect({ @@ -256,7 +253,7 @@ const baifang=function (option={}) { } function handler(slList){ - + currSlist=slList; for (let i = 1; i <= slList.length; i++) { const item=slList[i-1] const _group=gangban(i,item,item.length) diff --git a/src/views/zyjhzx/hxianpgong/comps/pgd.js b/src/views/zyjhzx/hxianpgong/comps/pgd.js index 49b3081..692547d 100644 --- a/src/views/zyjhzx/hxianpgong/comps/pgd.js +++ b/src/views/zyjhzx/hxianpgong/comps/pgd.js @@ -108,7 +108,6 @@ export default function (width,height){ group0.add(group7) const group8=drawQz(data) group0.add(group8) - console.log(data) generateQRCode(data.gdh,group0) return group } diff --git a/src/views/zyjhzx/lliaofkui/index.vue b/src/views/zyjhzx/lliaofkui/index.vue index f9b09fc..4e5d1ae 100644 --- a/src/views/zyjhzx/lliaofkui/index.vue +++ b/src/views/zyjhzx/lliaofkui/index.vue @@ -164,6 +164,7 @@ export default { const item=this.getAttr('item') const data={ ydjh:item, + ydid:item.id, dwId:that.currentDw.id, ceng:that.dw[that.currentDwIndex].list.length+1, czbh:item.dcCh, diff --git a/src/views/zyjhzx/pwanfkui/comps/baifang.js b/src/views/zyjhzx/pwanfkui/comps/baifang.js index 8b76003..0fece22 100644 --- a/src/views/zyjhzx/pwanfkui/comps/baifang.js +++ b/src/views/zyjhzx/pwanfkui/comps/baifang.js @@ -46,11 +46,13 @@ const baifang=function (option={}) { slGroup.zIndex(1) const thatHeight=height + + let currSllist=null const gangban=function (index,item,slList){ const group=new Konva.Group({ x:0, y:thatHeight-310-index*40, - draggable:true + // draggable:true }) group.setAttr('index',index) @@ -67,9 +69,7 @@ const baifang=function (option={}) { let _index=0 let touchingFlag=false; group.on('mousedown touchstart',function (evt){ - console.log(evt) - const layer=evt.currentTarget.parent.parent - console.log(layer) + const layer=this.parent.parent.parent touchingFlag=true const {x,y}=evt.evt setTimeout(()=>{ @@ -188,23 +188,13 @@ const baifang=function (option={}) { group.on('dragend',function (){ const index=this.getAttr('index') - const element = slList.splice(index-1, 1)[0]; - slList.splice(_index-1, 0, element); + const element = currSllist.splice(index-1, 1)[0]; + currSllist.splice(_index-1, 0, element); this.setAttr('index',_index) _index=0 slGroup.destroyChildren() - handler(slList) - }) - - const indexRect=new Konva.Rect({ - x:0, - y:0, - width:40, - height:40, - stroke:'black', - strokeWidth:1, + handler(currSllist) }) - //group.add(indexRect) const indexText=new Konva.Text({ x:0, @@ -260,6 +250,7 @@ const baifang=function (option={}) { } function handler(slList){ + currSllist=slList for (let i = 1; i <= slList.length; i++) { const item=slList[i-1] const _group=gangban(i,item,item.length,slList) diff --git a/src/views/zyjhzx/pwanfkui/index.vue b/src/views/zyjhzx/pwanfkui/index.vue index f3f65c9..7764734 100644 --- a/src/views/zyjhzx/pwanfkui/index.vue +++ b/src/views/zyjhzx/pwanfkui/index.vue @@ -63,6 +63,7 @@ export default { } } this.drawBaiFang(this.dw[this.currentDwIndex].list) + this.$refs.pwpgd.initData(this.currentWorker.userCode,'31') } }) this.sockets.subscribe('zyjhzx', data => { diff --git a/src/views/zyjhzx/qgefkui/comps/baifang.js b/src/views/zyjhzx/qgefkui/comps/baifang.js index 07fbdbe..8404f34 100644 --- a/src/views/zyjhzx/qgefkui/comps/baifang.js +++ b/src/views/zyjhzx/qgefkui/comps/baifang.js @@ -5,9 +5,8 @@ import { VXETable } from 'vxe-table' const baifang=function (option={}) { const width=option.width,height=option.height,slList=option.dw,image=require('@/assets/gb.png') const _width=width*0.32,_height=height*0.713 - const container=function (){ - const x=width*0.16+25,y=260 - + const x=width*0.16+25,y=260 + const bg=function (){ const group=new Konva.Group({ x:x, y:y, @@ -25,36 +24,34 @@ const baifang=function (option={}) { height:_height, image: this, }); - group.add(shape) - shape.zIndex(0) - } - - const selectObj = new Image(); - selectObj.src = require('@/assets/pwan/gbSelectBg.png'); - selectObj.onload = function () { - const shape = new Konva.Image({ - x: 0, - y: 0, - width: _width, - height:_height, - image: this, - visible:false - }); - group.add(shape) + bgGroup.add(shape) shape.zIndex(0) } - return group } + const container=function (){ + return new Konva.Group({ + x:0, + y:0, + width:_width, + height:_height + }) + } + + const bgGroup=bg(); const slGroup=container() + bgGroup.add(slGroup) + slGroup.zIndex(1) + + let currSlist=null const thatHeight=height const gangban=function (index,item){ const group=new Konva.Group({ x:0, y:thatHeight-310-index*40, - draggable:true + // draggable:true }) group.setAttr('index',index) @@ -71,7 +68,7 @@ const baifang=function (option={}) { let _index=0 let touchingFlag=false; group.on('mousedown touchstart',function (evt){ - const layer=evt.currentTarget.parent.parent + const layer=this.parent.parent.parent touchingFlag=true const {x,y}=evt.evt setTimeout(()=>{ @@ -81,7 +78,7 @@ const baifang=function (option={}) { this.draggable(false) const tmpGroup=this.clone() - tmpGroup.x(x-10) + tmpGroup.x(x-50) tmpGroup.y(y-10) layer.add(tmpGroup) tmpGroup.draggable(true) @@ -94,7 +91,7 @@ const baifang=function (option={}) { tmpGroup.on('dragend',function (){ const {x:thisX,y:thisY}=this.absolutePosition() for (const item of layer.children) { - if(item.attrs.id==='csd'){ + if(item.attrs.id==='sb'){ const {x,y}=item.absolutePosition() const worker=JSON.parse(window.localStorage.getItem('worker')) if ((thisX>=x&&thisY>=y&&thisX<=(x+item.attrs.width)&&thisY<=(y+item.attrs.height))&&!!worker){ @@ -184,24 +181,14 @@ const baifang=function (option={}) { group.on('dragend',function (){ const index=this.getAttr('index') - const element = slList.splice(index-1, 1)[0]; - slList.splice(_index-1, 0, element); + const element = currSlist.splice(index-1, 1)[0]; + currSlist.splice(_index-1, 0, element); this.setAttr('index',_index) _index=0 slGroup.destroyChildren() - handler(slList) + handler(currSlist) }) - const indexRect=new Konva.Rect({ - x:0, - y:0, - width:40, - height:40, - stroke:'black', - strokeWidth:1, - }) - //group.add(indexRect) - const indexText=new Konva.Text({ x:0, y:0, @@ -256,7 +243,7 @@ const baifang=function (option={}) { } function handler(slList){ - console.log(slList) + currSlist=slList; for (let i = 1; i <= slList.length; i++) { const item=slList[i-1] const _group=gangban(i,item,item.length) @@ -264,10 +251,8 @@ const baifang=function (option={}) { } } - handler(slList) - return { - container,slGroup,handler + container,slGroup,handler,bgGroup } } diff --git a/src/views/zyjhzx/qgefkui/comps/sb.js b/src/views/zyjhzx/qgefkui/comps/sb.js index 691d933..22b8eff 100644 --- a/src/views/zyjhzx/qgefkui/comps/sb.js +++ b/src/views/zyjhzx/qgefkui/comps/sb.js @@ -3,6 +3,7 @@ import Konva from "konva"; export default function (width,height){ const x=width*0.5,y=260,_width=width*0.186,_height=height*0.713 const container=new Konva.Group({ + id:'sb', x:x, y:y, width:_width, diff --git a/src/views/zyjhzx/qgefkui/index.vue b/src/views/zyjhzx/qgefkui/index.vue index abe2a48..8e0c9c9 100644 --- a/src/views/zyjhzx/qgefkui/index.vue +++ b/src/views/zyjhzx/qgefkui/index.vue @@ -18,7 +18,7 @@ import {getBzryList} from "@/api/sjzx/bzzGL"; import QgePgd from "@/views/zyjhzx/qgefkui/comps/QgePgd.vue"; export default { - name: 'PWanFKui', + name: 'QGeFKui', components: {QgePgd}, data() { return { @@ -33,7 +33,6 @@ export default { dw:[], pgd:[], slGroup:null, - dw:[], currentDw:null, currentDwIndex:null, currentWorker:null, @@ -105,8 +104,8 @@ export default { getYcldw({type:'llj'}).then(res => { const {container, dw} = drawDw(this.width, this.height, that.initDwInfo) const {bgGroup,group} = container() - this.layer.add(bgGroup) + this.dw=res.data for (let i = 0; i < res.data.length; i++) { const item = res.data[i] diff --git a/src/views/zyjhzx/qgepgong/comps/pgd.js b/src/views/zyjhzx/qgepgong/comps/pgd.js index 49b3081..692547d 100644 --- a/src/views/zyjhzx/qgepgong/comps/pgd.js +++ b/src/views/zyjhzx/qgepgong/comps/pgd.js @@ -108,7 +108,6 @@ export default function (width,height){ group0.add(group7) const group8=drawQz(data) group0.add(group8) - console.log(data) generateQRCode(data.gdh,group0) return group } diff --git a/src/views/zyjhzx/sliao/index.vue b/src/views/zyjhzx/sliao/index.vue index 76305dc..cb6146a 100644 --- a/src/views/zyjhzx/sliao/index.vue +++ b/src/views/zyjhzx/sliao/index.vue @@ -326,6 +326,7 @@ export default { const item=this.getAttr('item') const data={ ydjh:item, + ydid:item.id, dwId:that.currentDw.id, ceng:that.dw[that.currentDwIndex].list.length+1, czbh:item.dcCh,