1.修复划线切割界面操作时板材图片错位问题

2.上料理料反馈时增加作业计划id数据
master
董哲奇 8 months ago
parent eb74af7d0b
commit 72748d1d7f

@ -1010,7 +1010,6 @@ export default {
return; return;
} }
} }
console.log(this.queryParam)
ydjhxf(this.checkedList).then(res => { ydjhxf(this.checkedList).then(res => {
if (res.success) { if (res.success) {
this.initList() this.initList()

@ -44,6 +44,8 @@ const baifang=function (option={}) {
bgGroup.add(slGroup) bgGroup.add(slGroup)
slGroup.zIndex(1) slGroup.zIndex(1)
let currSlist=null
const thatHeight=height const thatHeight=height
const gangban=function (index,item){ const gangban=function (index,item){
const group=new Konva.Group({ const group=new Konva.Group({
@ -66,9 +68,7 @@ const baifang=function (option={}) {
let _index=0 let _index=0
let touchingFlag=false; let touchingFlag=false;
group.on('mousedown touchstart',function (evt){ group.on('mousedown touchstart',function (evt){
console.log(evt) const layer=this.parent.parent.parent
const layer=evt.currentTarget.parent.parent
console.log(layer)
touchingFlag=true touchingFlag=true
const {x,y}=evt.evt const {x,y}=evt.evt
setTimeout(()=>{ setTimeout(()=>{
@ -78,7 +78,7 @@ const baifang=function (option={}) {
this.draggable(false) this.draggable(false)
const tmpGroup=this.clone() const tmpGroup=this.clone()
tmpGroup.x(x-10) tmpGroup.x(x-50)
tmpGroup.y(y-10) tmpGroup.y(y-10)
layer.add(tmpGroup) layer.add(tmpGroup)
tmpGroup.draggable(true) 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){ if ((thisX>=x&&thisY>=y&&thisX<=(x+item.attrs.width)&&thisY<=(y+item.attrs.height))&&!!worker){
const info=this.getAttr('item') const info=this.getAttr('item')
const zyjh=JSON.parse(window.localStorage.getItem('hxfk')) const zyjh=JSON.parse(window.localStorage.getItem('hxfk'))
console.log(zyjh)
if (!zyjh){ if (!zyjh){
VXETable.modal.message({content: '请先选择待反馈的派工单', status: 'warning'}) VXETable.modal.message({content: '请先选择待反馈的派工单', status: 'warning'})
this.remove() this.remove()
@ -180,16 +179,14 @@ const baifang=function (option={}) {
} }
}) })
let slList=null
group.on('dragend',function (){ group.on('dragend',function (){
const index=this.getAttr('index') const index=this.getAttr('index')
const element = slList.splice(index-1, 1)[0]; const element = currSlist.splice(index-1, 1)[0];
slList.splice(_index-1, 0, element); currSlist.splice(_index-1, 0, element);
this.setAttr('index',_index) this.setAttr('index',_index)
_index=0 _index=0
slGroup.destroyChildren() slGroup.destroyChildren()
handler(slList) handler(currSlist)
}) })
const indexRect=new Konva.Rect({ const indexRect=new Konva.Rect({
@ -256,7 +253,7 @@ const baifang=function (option={}) {
} }
function handler(slList){ function handler(slList){
currSlist=slList;
for (let i = 1; i <= slList.length; i++) { for (let i = 1; i <= slList.length; i++) {
const item=slList[i-1] const item=slList[i-1]
const _group=gangban(i,item,item.length) const _group=gangban(i,item,item.length)

@ -108,7 +108,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
} }

@ -164,6 +164,7 @@ export default {
const item=this.getAttr('item') const item=this.getAttr('item')
const data={ const data={
ydjh:item, ydjh:item,
ydid:item.id,
dwId:that.currentDw.id, dwId:that.currentDw.id,
ceng:that.dw[that.currentDwIndex].list.length+1, ceng:that.dw[that.currentDwIndex].list.length+1,
czbh:item.dcCh, czbh:item.dcCh,

@ -46,11 +46,13 @@ const baifang=function (option={}) {
slGroup.zIndex(1) slGroup.zIndex(1)
const thatHeight=height const thatHeight=height
let currSllist=null
const gangban=function (index,item,slList){ const gangban=function (index,item,slList){
const group=new Konva.Group({ const group=new Konva.Group({
x:0, x:0,
y:thatHeight-310-index*40, y:thatHeight-310-index*40,
draggable:true // draggable:true
}) })
group.setAttr('index',index) group.setAttr('index',index)
@ -67,9 +69,7 @@ const baifang=function (option={}) {
let _index=0 let _index=0
let touchingFlag=false; let touchingFlag=false;
group.on('mousedown touchstart',function (evt){ group.on('mousedown touchstart',function (evt){
console.log(evt) const layer=this.parent.parent.parent
const layer=evt.currentTarget.parent.parent
console.log(layer)
touchingFlag=true touchingFlag=true
const {x,y}=evt.evt const {x,y}=evt.evt
setTimeout(()=>{ setTimeout(()=>{
@ -188,23 +188,13 @@ const baifang=function (option={}) {
group.on('dragend',function (){ group.on('dragend',function (){
const index=this.getAttr('index') const index=this.getAttr('index')
const element = slList.splice(index-1, 1)[0]; const element = currSllist.splice(index-1, 1)[0];
slList.splice(_index-1, 0, element); currSllist.splice(_index-1, 0, element);
this.setAttr('index',_index) this.setAttr('index',_index)
_index=0 _index=0
slGroup.destroyChildren() slGroup.destroyChildren()
handler(slList) handler(currSllist)
})
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({ const indexText=new Konva.Text({
x:0, x:0,
@ -260,6 +250,7 @@ const baifang=function (option={}) {
} }
function handler(slList){ function handler(slList){
currSllist=slList
for (let i = 1; i <= slList.length; i++) { for (let i = 1; i <= slList.length; i++) {
const item=slList[i-1] const item=slList[i-1]
const _group=gangban(i,item,item.length,slList) const _group=gangban(i,item,item.length,slList)

@ -63,6 +63,7 @@ export default {
} }
} }
this.drawBaiFang(this.dw[this.currentDwIndex].list) this.drawBaiFang(this.dw[this.currentDwIndex].list)
this.$refs.pwpgd.initData(this.currentWorker.userCode,'31')
} }
}) })
this.sockets.subscribe('zyjhzx', data => { this.sockets.subscribe('zyjhzx', data => {

@ -5,9 +5,8 @@ import { VXETable } from 'vxe-table'
const baifang=function (option={}) { const baifang=function (option={}) {
const width=option.width,height=option.height,slList=option.dw,image=require('@/assets/gb.png') 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 _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({ const group=new Konva.Group({
x:x, x:x,
y:y, y:y,
@ -25,36 +24,34 @@ const baifang=function (option={}) {
height:_height, height:_height,
image: this, image: this,
}); });
group.add(shape) bgGroup.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)
shape.zIndex(0) shape.zIndex(0)
} }
return group return group
} }
const container=function (){
return new Konva.Group({
x:0,
y:0,
width:_width,
height:_height
})
}
const bgGroup=bg();
const slGroup=container() const slGroup=container()
bgGroup.add(slGroup)
slGroup.zIndex(1)
let currSlist=null
const thatHeight=height const thatHeight=height
const gangban=function (index,item){ const gangban=function (index,item){
const group=new Konva.Group({ const group=new Konva.Group({
x:0, x:0,
y:thatHeight-310-index*40, y:thatHeight-310-index*40,
draggable:true // draggable:true
}) })
group.setAttr('index',index) group.setAttr('index',index)
@ -71,7 +68,7 @@ const baifang=function (option={}) {
let _index=0 let _index=0
let touchingFlag=false; let touchingFlag=false;
group.on('mousedown touchstart',function (evt){ group.on('mousedown touchstart',function (evt){
const layer=evt.currentTarget.parent.parent const layer=this.parent.parent.parent
touchingFlag=true touchingFlag=true
const {x,y}=evt.evt const {x,y}=evt.evt
setTimeout(()=>{ setTimeout(()=>{
@ -81,7 +78,7 @@ const baifang=function (option={}) {
this.draggable(false) this.draggable(false)
const tmpGroup=this.clone() const tmpGroup=this.clone()
tmpGroup.x(x-10) tmpGroup.x(x-50)
tmpGroup.y(y-10) tmpGroup.y(y-10)
layer.add(tmpGroup) layer.add(tmpGroup)
tmpGroup.draggable(true) tmpGroup.draggable(true)
@ -94,7 +91,7 @@ const baifang=function (option={}) {
tmpGroup.on('dragend',function (){ tmpGroup.on('dragend',function (){
const {x:thisX,y:thisY}=this.absolutePosition() const {x:thisX,y:thisY}=this.absolutePosition()
for (const item of layer.children) { for (const item of layer.children) {
if(item.attrs.id==='csd'){ if(item.attrs.id==='sb'){
const {x,y}=item.absolutePosition() const {x,y}=item.absolutePosition()
const worker=JSON.parse(window.localStorage.getItem('worker')) const worker=JSON.parse(window.localStorage.getItem('worker'))
if ((thisX>=x&&thisY>=y&&thisX<=(x+item.attrs.width)&&thisY<=(y+item.attrs.height))&&!!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 (){ group.on('dragend',function (){
const index=this.getAttr('index') const index=this.getAttr('index')
const element = slList.splice(index-1, 1)[0]; const element = currSlist.splice(index-1, 1)[0];
slList.splice(_index-1, 0, element); currSlist.splice(_index-1, 0, element);
this.setAttr('index',_index) this.setAttr('index',_index)
_index=0 _index=0
slGroup.destroyChildren() 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({ const indexText=new Konva.Text({
x:0, x:0,
y:0, y:0,
@ -256,7 +243,7 @@ const baifang=function (option={}) {
} }
function handler(slList){ function handler(slList){
console.log(slList) currSlist=slList;
for (let i = 1; i <= slList.length; i++) { for (let i = 1; i <= slList.length; i++) {
const item=slList[i-1] const item=slList[i-1]
const _group=gangban(i,item,item.length) const _group=gangban(i,item,item.length)
@ -264,10 +251,8 @@ const baifang=function (option={}) {
} }
} }
handler(slList)
return { return {
container,slGroup,handler container,slGroup,handler,bgGroup
} }
} }

@ -3,6 +3,7 @@ import Konva from "konva";
export default function (width,height){ export default function (width,height){
const x=width*0.5,y=260,_width=width*0.186,_height=height*0.713 const x=width*0.5,y=260,_width=width*0.186,_height=height*0.713
const container=new Konva.Group({ const container=new Konva.Group({
id:'sb',
x:x, x:x,
y:y, y:y,
width:_width, width:_width,

@ -18,7 +18,7 @@ import {getBzryList} from "@/api/sjzx/bzzGL";
import QgePgd from "@/views/zyjhzx/qgefkui/comps/QgePgd.vue"; import QgePgd from "@/views/zyjhzx/qgefkui/comps/QgePgd.vue";
export default { export default {
name: 'PWanFKui', name: 'QGeFKui',
components: {QgePgd}, components: {QgePgd},
data() { data() {
return { return {
@ -33,7 +33,6 @@ export default {
dw:[], dw:[],
pgd:[], pgd:[],
slGroup:null, slGroup:null,
dw:[],
currentDw:null, currentDw:null,
currentDwIndex:null, currentDwIndex:null,
currentWorker:null, currentWorker:null,
@ -105,8 +104,8 @@ export default {
getYcldw({type:'llj'}).then(res => { getYcldw({type:'llj'}).then(res => {
const {container, dw} = drawDw(this.width, this.height, that.initDwInfo) const {container, dw} = drawDw(this.width, this.height, that.initDwInfo)
const {bgGroup,group} = container() const {bgGroup,group} = container()
this.layer.add(bgGroup) this.layer.add(bgGroup)
this.dw=res.data
for (let i = 0; i < res.data.length; i++) { for (let i = 0; i < res.data.length; i++) {
const item = res.data[i] const item = res.data[i]

@ -108,7 +108,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
} }

@ -326,6 +326,7 @@ export default {
const item=this.getAttr('item') const item=this.getAttr('item')
const data={ const data={
ydjh:item, ydjh:item,
ydid:item.id,
dwId:that.currentDw.id, dwId:that.currentDw.id,
ceng:that.dw[that.currentDwIndex].list.length+1, ceng:that.dw[that.currentDwIndex].list.length+1,
czbh:item.dcCh, czbh:item.dcCh,

Loading…
Cancel
Save