1.划线和切割报工增加设备选择,报工时必须选择加工设备

master
董哲奇 4 months ago
parent 1cb9e49d55
commit 4815753a24

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 KiB

@ -15,6 +15,10 @@ export default {
type:Function,
default:function (){}
},
getSelectSbbm:{
type:Function,
default:function (){}
},
workers:{
type:Array,
default:[]
@ -37,6 +41,12 @@ export default {
if (this.deviceId!==data.msg.deviceId&&data.msg.actionType!=='开始报工'){
return
}
const sbbm=this.$props.getSelectSbbm()
if (!sbbm){
this.$message.warning('请选择设备')
this.$refs.hxPgd.clearCheckboxRow()
return
}
//
const djhWhLengh=4
const tmpList=this.list.filter(item=>item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber)
@ -52,7 +62,8 @@ export default {
const tmpArr=[{
id:item.id,
hxfkry:this.$props.worker().userCode,
zt:item.zt
zt:item.zt,
hxsb:sbbm
}]
this.baogong(tmpArr,item)
errorFlag=false
@ -125,6 +136,12 @@ export default {
})
},
fankgui(worker) {
const sbbm=this.$props.getSelectSbbm()
if (!sbbm){
this.$message.warning('请选择设备')
this.$refs.hxPgd.clearCheckboxRow()
return
}
VXETable.modal.confirm('您确定报工吗?').then(async res => {
if (res === 'confirm') {
const list = this.$refs.hxPgd.getCheckboxRecords()
@ -133,7 +150,8 @@ export default {
const data = {
id: item.id,
hxfkry: worker.userCode,
zt:item.zt
zt:item.zt,
hxsb:sbbm
}
tmpArr.push(data)
let ycldwInfo=null
@ -157,7 +175,6 @@ export default {
this.initData(this.$props.worker().userCode, '51')
}
})
},
initData(worker,zt){
getDw({type:'llj'}).then(res=>{

@ -24,18 +24,86 @@ export default function (width,height){
shape.zIndex(0)
}
const text=new Konva.Text({
x: 0,
y: 0,
width: _width,
height:_height,
fill:'white',
text:'划线设备',
align:'center',
verticalAlign:'middle',
})
const sbList=[
{name:"划线设备1",sbbm:'1'},
{name:"划线设备2",sbbm:'2'},
{name:"划线设备3",sbbm:'3'},
{name:"划线设备4",sbbm:'4'},
]
let selectedShape=null;
let selectSbbm=null;
const getSelectSbbm=function (){
return selectSbbm
}
sbList.forEach((item,index)=>{
const sbGroup=new Konva.Group({
x: 5,
y: 5+index*_height/4-10,
width: _width-10,
height:_height/4-10,
})
sbGroup.on('click touchstart',function (){
selected()
})
container.add(text)
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.15,
y: 10,
width: _width*0.12,
height:_width*0.12,
image: this,
visible:false
});
sbGroup.add(shape)
setSelectShape(shape)
}
function selected(){
if (selectedShape){
selectedShape.hide()
if (selectedShape===selectShape){
selectedShape=null
return
}
}
selectSbbm=item.sbbm
selectedShape=selectShape
selectedShape.show()
}
const sb = new Image();
sb.src = require('@/assets/sb/xc2.png');
sb.onload = function () {
const shape = new Konva.Image({
x: 0,
y: 0,
width: _width-10,
height:_height/4-10,
image: this,
});
const text=new Konva.Text({
x: 0,
y: 0,
width: _width/4,
height:_height/8-40,
fill:'white',
text:item.name,
align:'center',
verticalAlign:'middle',
})
sbGroup.add(text)
sbGroup.add(shape)
container.add(sbGroup)
}
})
return container
return {container,getSelectSbbm}
}

@ -1,7 +1,7 @@
<template>
<div class="container">
<div id="pwpg" class="pwpg" ref="pwpg"></div>
<HxianPgd id="hxpgd" ref="hxpgd" @initPgd="initPgd" :pgd="pgd" :workers="workers" :worker="getWorker" :dw="dw" @pgdClick="pgdClick"/>
<HxianPgd id="hxpgd" ref="hxpgd" @initPgd="initPgd" :pgd="pgd" :workers="workers" :worker="getWorker" :dw="dw" :getSelectSbbm="getSelectSbbm" @pgdClick="pgdClick"/>
<ZyjhSelectComp id="selectComp" ref="selRef" @initWorkers="initWorkers"/>
<TipsComp />
<Drawer ref="drawer"/>
@ -47,6 +47,7 @@ export default {
dwGroup:null,
workerGroup:null,
person:null,
getSelectSbbm:null,
}
},
mounted() {
@ -207,7 +208,8 @@ export default {
this.pgdGroup=pgdContainer()
this.layer.add(this.pgdGroup)
const csdGroup = drawSb(this.width, this.height)
const {container:csdGroup,getSelectSbbm} = drawSb(this.width, this.height)
this.getSelectSbbm=getSelectSbbm
this.layer.add(csdGroup)
this.initBaiFang()

@ -15,6 +15,10 @@ export default {
type:Function,
default:function (){}
},
getSelectSbbm:{
type:Function,
default:function (){}
},
workers:{
type:Array,
default:[]
@ -39,6 +43,12 @@ export default {
if (this.deviceId!==data.msg.deviceId&&data.msg.actionType!=='开始报工'){
return
}
const sbbm=this.$props.getSelectSbbm()
if (!sbbm){
this.$message.warning('请选择设备')
this.$refs.qgpgd.clearCheckboxRow()
return
}
//
const djhWhLengh=4
const tmpList=this.list.filter(item=>item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber)
@ -58,7 +68,8 @@ export default {
dcCh:item.dcCh,
dcPl:item.dcPl,
tzbh:item.tzbh,
sllph:item.sllph
sllph:item.sllph,
qgsb:sbbm
}]
this.baogong(tmpArr,item)
errorFlag=false
@ -149,6 +160,12 @@ export default {
}
},
fankgui(worker) {
const sbbm=this.$props.getSelectSbbm()
if (!sbbm){
this.$message.warning('请选择设备')
this.$refs.qgpgd.clearCheckboxRow()
return
}
VXETable.modal.confirm('您确定报工吗?').then(async res => {
if (res === 'confirm') {
const list = this.$refs.qgpgd.getCheckboxRecords()
@ -161,7 +178,8 @@ export default {
dcCh:item.dcCh,
dcPl:item.dcPl,
tzbh:item.tzbh,
sllph:item.sllph
sllph:item.sllph,
qgsb:sbbm
}
tmpArr.push(data)
let ycldwInfo = null

@ -4,7 +4,7 @@ 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 _width=width*0.28,_height=height*0.713
const x=width*0.16+25,y=260
const bg=function (){
const group=new Konva.Group({

@ -1,7 +1,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 x=width*0.455,y=260,_width=width*0.227,_height=height*0.713
const container=new Konva.Group({
id:'sb',
x:x,
@ -24,18 +24,86 @@ export default function (width,height){
shape.zIndex(0)
}
const text=new Konva.Text({
x: 0,
y: 0,
width: _width,
height:_height,
fill:'white',
text:'设备',
align:'center',
verticalAlign:'middle',
})
const sbList=[
{name:"切割设备1",sbbm:'1'},
{name:"切割设备2",sbbm:'2'},
{name:"切割设备3",sbbm:'3'},
{name:"切割设备4",sbbm:'4'},
]
let selectedShape=null;
let selectSbbm=null;
const getSelectSbbm=function (){
return selectSbbm
}
sbList.forEach((item,index)=>{
const sbGroup=new Konva.Group({
x: 5,
y: 5+index*_height/4-10,
width: _width-10,
height:_height/4-10,
})
sbGroup.on('click touchstart',function (){
selected()
})
container.add(text)
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.15,
y: 10,
width: _width*0.12,
height:_width*0.12,
image: this,
visible:false
});
sbGroup.add(shape)
setSelectShape(shape)
}
function selected(){
if (selectedShape){
selectedShape.hide()
if (selectedShape===selectShape){
selectedShape=null
return
}
}
selectSbbm=item.sbbm
selectedShape=selectShape
selectedShape.show()
}
const sb = new Image();
sb.src = require('@/assets/sb/xc2.png');
sb.onload = function () {
const shape = new Konva.Image({
x: 0,
y: 0,
width: _width-10,
height:_height/4-10,
image: this,
});
const text=new Konva.Text({
x: 0,
y: 0,
width: _width/4,
height:_height/8-40,
fill:'white',
text:item.name,
align:'center',
verticalAlign:'middle',
})
sbGroup.add(text)
sbGroup.add(shape)
container.add(sbGroup)
}
})
return container
return {container,getSelectSbbm}
}

@ -1,7 +1,7 @@
<template>
<div class="container">
<div id="pwpg" class="pwpg" ref="pwpg"></div>
<QgePgd id="qgfkpgd" v-if="pgdShow" ref="hxpgd" @initPgd="initPgd" :pgd="pgd" :worker="getWorker" :dw="dw" :workers="workers" @pgdClick="pgdClick"/>
<QgePgd id="qgfkpgd" v-if="pgdShow" ref="hxpgd" @initPgd="initPgd" :pgd="pgd" :worker="getWorker" :dw="dw" :workers="workers" :getSelectSbbm="getSelectSbbm" @pgdClick="pgdClick"/>
<ZyjhSelectComp id="selectComp" ref="selRef" @initWorkers="initWorkers" @clear="clear"/>
<TipsComp />
<Drawer ref="drawer"/>
@ -49,6 +49,7 @@ export default {
dwGroup:null,
workerGroup:null,
person:null,
getSelectSbbm:null,
}
},
mounted() {
@ -208,7 +209,8 @@ export default {
this.pgdGroup = pgdContainer()
this.layer.add(this.pgdGroup)
const csdGroup = drawSb(this.width, this.height)
const {container:csdGroup,getSelectSbbm} = drawSb(this.width, this.height)
this.getSelectSbbm=getSelectSbbm
this.layer.add(csdGroup)
this.initBaiFang()

Loading…
Cancel
Save