1.完善抛丸反馈

master
董哲奇 8 months ago
parent fe2c8efaaf
commit 2cc22f4f7e

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -7,13 +7,21 @@ import paoWanPgdConfig from './pgdTable'
import {getPgd} from "@/api/zyjh";
export default {
name:'PwanPgd',
props:{
workers:{
type:Array,
default:[]
}
},
data(){
return{
gridOptions:{},
setExt:null,
}
},
created(){
const {options,columns}=paoWanPgdConfig()
const {options,columns,setExt}=paoWanPgdConfig()
this.setExt=setExt
this.gridOptions=options
this.gridOptions.columns=columns
},
@ -21,6 +29,7 @@ export default {
initData(worker,zt){
getPgd({user:worker,zt:zt,field:'pwry'}).then(res=>{
this.gridOptions.data=res.data
this.setExt('workers',this.$props.workers)
})
},
cellClick({row}){

@ -1,5 +1,6 @@
import Konva from "konva";
import {shangLiao} from "@/api/zyjh";
import {zx} from "@/api/zyjh";
import { VXETable } from 'vxe-table'
const baifang=function (option={}) {
const width=option.width,height=option.height,slList=option.dw,image=require('@/assets/gb.png')
@ -28,6 +29,21 @@ const baifang=function (option={}) {
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)
}
return group
}
@ -42,6 +58,7 @@ const baifang=function (option={}) {
})
group.setAttr('index',index)
group.setAttr('item',item)
slGroup.add(group)
const {x}=group.absolutePosition()
@ -55,7 +72,6 @@ const baifang=function (option={}) {
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(()=>{
@ -80,24 +96,47 @@ const baifang=function (option={}) {
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)
const worker=JSON.parse(window.localStorage.getItem('worker'))
if ((thisX>=x&&thisY>=y)&&!!worker){
const info=this.getAttr('item')
const zyjh=JSON.parse(window.localStorage.getItem('zyjh'))
if (!zyjh){
VXETable.modal.message({content: '请先选择待反馈的派工单', status: 'warning'})
this.remove()
that.visible(true)
return
}
zx({
field:'pwfkrq',
zxZtName:'PWFK',
list:[{
id:zyjh.id,
pwfkry: worker.userCode
}],
ycldwInfo:info
}).then(res=>{
if (res.success){
window.localStorage.removeItem('zyjh')
}
})
this.scaleX(0.7)
const image=this.find('Image')[0]
image.x(5)
image.y(800)
image.scaleX(0.90)
image.moveTo(item.children[0].children[0])
// this.moveTo(item.children[0].children[0])
image.zIndex(2)
image.setAttr('_ad','sdf')
this.remove()
that.remove()
}else{
this.remove()
that.visible(true)
}
}
}
//const {x,y}=that.slGroup.absolutePosition()
})
this.visible(false)
}
}

@ -106,7 +106,7 @@ export default function (width,height){
csdGroup.to({
x: 0,
y: -700,
y: -876,
duration: 20, //持续时间
onFinish() {
csdGroup.remove()

@ -30,6 +30,7 @@ export default function (width,height,callback){
return group
}
let selectedShape=null;
const dw=function (index,item=[]){
const alignSize=2
@ -42,7 +43,16 @@ export default function (width,height,callback){
height:height
})
group.on('click touchstart',function (){
callback(index,item.list)
if (selectedShape){
selectedShape.hide()
if (selectedShape===selectShape){
selectedShape=null
return
}
}
selectedShape=selectShape
selectedShape.show()
callback(index,item)
})
const bgObj = new Image();
@ -60,6 +70,26 @@ export default function (width,height,callback){
shape.zIndex(0)
}
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.31,
y: 4,
width: width*0.25,
height:width*0.25,
image: this,
visible:false
});
group.add(shape)
shape.zIndex(0)
setSelectShape(shape)
}
const text=new Konva.Text({
x:0,
y:0,

@ -87,6 +87,7 @@ export default function (width,height){
group.on('click touchstart',function (){
currentWork=persons
window.localStorage.setItem('worker',JSON.stringify(currentWork))
if (selectedShape){
selectedShape.hide()
if (selectedShape===selectShape){
@ -131,9 +132,9 @@ export default function (width,height){
const text=new Konva.Text({
x:0,
y:62,
y:height,
width:width,
height:height,
height:height*0.1,
text: persons.userName,
align: 'center',
verticalAlign:'middle',

@ -28,8 +28,22 @@ export default function (width,height){
return group
}
let workers=[]
const setWorkers=function (persons){
workers=persons
}
const formatWorker=function (code){
for (const item of workers) {
if(item.userCode===code){
return item.userName
}
}
}
const drawGd=function (data){
// this.layer.destroyChildren();
window.localStorage.setItem('zyjh',JSON.stringify(data))
const group=new Konva.Group({
x:13,
@ -108,7 +122,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
}
@ -280,7 +293,7 @@ export default function (width,height){
width:(_width-60)/2,
height:30,
fill:'#fff',
text:data.pwry,
text:formatWorker(data.pwry),
fontSize:18,
align:'center',
verticalAlign:'middle'
@ -486,6 +499,6 @@ export default function (width,height){
}
return {
container,drawGd
container,drawGd,setWorkers
}
}

@ -11,12 +11,31 @@ export default function () {
scrollY:{enable:true},
data:[]
}
const ext={}
const setExt=function (key,value){
ext[key]=value
}
const gdhFormat=function ({cellValue}){
if (cellValue){
return 'PW'+cellValue
}
return ''
}
const nameFormat=function ({cellValue}){
const workers=ext.workers
for (const item of workers) {
if(item.userCode===cellValue){
return item.userName
}
}
}
const ztFormat=function ({cellValue}){
return ztEnmu[cellValue]
}
const ztEnmu={
'31':'派工',
'32':'反馈'
}
const columns = [
{ type: 'checkbox', width: 40 },
{ type: 'seq',title:'序号', width: 60 },
@ -30,15 +49,16 @@ export default function () {
{field: '', title: '规格', width: 100},
{field: '', title: '炉批号', width: 100},
{field: 'tzbh', title: '套料图号', width: 100},
{field: '', title: '接收人', width: 80},
{field: '', title: '接收时间', width: 100},
{field: '', title: '反馈人', width: 80},
{field: '', title: '反馈时间', width: 100},
{field: '', title: '状态', width: 60},
{field: 'pwry', title: '接收人', width: 80,formatter:nameFormat},
{field: 'pwpgrq', title: '接收时间', width: 100},
{field: 'pwfkr', title: '反馈人', width: 80,formatter:nameFormat},
{field: 'pwfkrq', title: '反馈时间', width: 100},
{field: 'zt', title: '状态', width: 60,formatter:ztFormat},
]
return {
options,
columns,
setExt
}
}

@ -1,7 +1,7 @@
<template>
<div class="container">
<div id="pwpg" class="pwpg" ref="pwpg"></div>
<PWanPgd id="pwpgd" ref="pwpgd" @initPgd="initPgd" :pgd="pgd" />
<PWanPgd id="pwpgd" ref="pwpgd" @initPgd="initPgd" :pgd="pgd" :workers="workers" />
</div>
</template>
@ -14,8 +14,7 @@ import drawDw from './comps/dw'
import drawPgd from './comps/pgd'
import baifang from "./comps/baifang";
import drawCsd from './comps/csd'
import {getPgd, getYcldw} from "@/api/zyjh";
import liliao from "@/views/zyjhzx/sliao/comps/liliao";
import { getYcldw} from "@/api/zyjh";
import {getBzryList} from "@/api/sjzx/bzzGL";
export default {
@ -32,27 +31,56 @@ export default {
drawGd:null,
dw:[],
pgd:[],
currentDw:'',
currentDwIndex:'',
currentWorker:null,
setWorkers:null,
workers:null,
slGroup:null,
}
},
mounted() {
this.$socket.open()
this.wsSubscribe()
this.initKonvaStage();
},
sockets:{},
created(){
window.addEventListener('resize', this.initKonvaStage)
},
methods:{
wsSubscribe(){
this.sockets.subscribe('pwComplete', data => {
if (this.currentDw&&this.currentDw.id===data.dwId) {
if (this.slGroup){
this.slGroup.destroyChildren()
}
for (let i = 0; i < this.dw[this.currentDwIndex].list.length; i++) {
const item=this.dw[this.currentDwIndex].list[i]
console.log(123)
console.log(item.czbh===data.czbh&&item.pl===data.pl&&item.tlth===data.tlth)
if (item.czbh===data.czbh&&item.pl===data.pl&&item.tlth===data.tlth){
this.dw[this.currentDwIndex].list.splice(i,1)
console.log(this.dw[this.currentDwIndex].list)
break
}
}
this.drawBaiFang(this.dw[this.currentDwIndex].list)
}
})
},
initPgd(pgd={}){
const group=this.drawGd(pgd)
this.pgdGroup.add(group)
},
initBaiFang(index,list){
initBaiFang(index,dw){
if (this.slGroup){
this.slGroup.destroyChildren()
}
this.canSl=true
this.currentDw=dw
this.currentDwIndex=index
const {slGroup,handler}= baifang({width:this.width,height:this.height,dw:list})
const {slGroup,handler}= baifang({width:this.width,height:this.height,dw:dw.list})
this.slGroup=slGroup
this.drawBaiFang=handler
this.layer.add(slGroup)
@ -65,6 +93,7 @@ export default {
this.layer.add(group)
this.dw=res.data
for (let i=0;i<res.data.length;i++){
const item=res.data[i]
const dwGroup=dw(i,item)
@ -78,7 +107,9 @@ export default {
const {container,person}=workers(this.width,this.height)
const group=container()
this.layer.add(group)
this.workers=res.data
that.setWorkers(res.data)
for (let i=0;i<res.data.length;i++){
const item=res.data[i]
const worker=person(i,item)
@ -101,17 +132,18 @@ export default {
const titel=drawTitle(this.width,this.height,this.title)
this.layer.add(titel)
this.initWorkers()
this.initDw()
const {container:pgdContainer,drawGd}=drawPgd(this.width,this.height)
const {container:pgdContainer,drawGd,setWorkers}=drawPgd(this.width,this.height)
this.setWorkers=setWorkers
this.drawGd=drawGd
this.pgdGroup=pgdContainer()
this.layer.add(this.pgdGroup)
const csdGroup=drawCsd(this.width,this.height)
this.layer.add(csdGroup)
this.initWorkers()
},
}
}

@ -28,6 +28,19 @@ export default function (width,height){
return group
}
let workers=[]
const setWorkers=function (persons){
workers=persons
}
const formatWorker=function (code){
for (const item of workers) {
if(item.userCode===code){
return item.userName
}
}
}
const drawGd=function (data){
// this.layer.destroyChildren();
@ -108,7 +121,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
}
@ -274,13 +286,15 @@ export default function (width,height){
})
group.add(plRect)
const name=formatWorker(data.pwry)
const plText=new Konva.Text({
x:0,
y:30,
width:(_width-60)/2,
height:30,
fill:'#fff',
text:data.pwry,
text:name,
fontSize:18,
align:'center',
verticalAlign:'middle'
@ -486,6 +500,6 @@ export default function (width,height){
}
return {
container,drawGd
container,drawGd,setWorkers
}
}

@ -28,6 +28,7 @@ export default {
pgdGroup:null,
drawGd:null,
getCurrentWorker:null,
setWorkers:null,
}
},
mounted() {
@ -64,6 +65,7 @@ export default {
const {layer,group}=container()
this.stage.add(layer)
this.setWorkers(res.data)
for (let i=0;i<res.data.length;i++){
const item=res.data[i]
const worker=person(i,item)
@ -81,14 +83,15 @@ export default {
const titel=drawTitle(this.width,this.height,this.title)
this.layer.add(titel)
this.initWorkers()
this.initDw()
const {container:pgdContainer,drawGd}=drawPgd(this.width,this.height)
const {container:pgdContainer,drawGd,setWorkers}=drawPgd(this.width,this.height)
this.setWorkers=setWorkers
this.drawGd=drawGd
this.pgdGroup=pgdContainer()
this.layer.add(this.pgdGroup)
this.initWorkers()
},
}

@ -63,6 +63,15 @@ const liliao=function (width,height,dw,callback) {
height:height
})
group.on('click touchstart',function (){
if (selectedShape){
selectedShape.hide()
if (selectedShape===selectShape){
selectedShape=null
return
}
}
selectedShape=selectShape
selectedShape.show()
currentDw=item
callback(index,dw[index])
})
@ -82,6 +91,27 @@ const liliao=function (width,height,dw,callback) {
shape.zIndex(0)
}
const selectObj = new Image();
let selectedShape=null;
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.30,
y: 4,
width: width*0.25,
height:width*0.25,
image: this,
visible:false
});
group.add(shape)
shape.zIndex(0)
setSelectShape(shape)
}
const text=new Konva.Text({
x:0,
y:0,

@ -53,7 +53,7 @@ export default {
methods:{
wsSubscribe(){
this.sockets.subscribe('slComplete', data => {
if (this.currentDw&&this.currentDwIndex&&this.currentDw.id===data.dwId) {
if (this.currentDw&&this.currentDw.id===data.dwId) {
if (this.slGroup){
this.slGroup.destroyChildren()
}

Loading…
Cancel
Save