1.完善语音WS及作业计划执行

master
董哲奇 9 months ago
parent 448842af7d
commit eb74af7d0b

@ -2,4 +2,4 @@
ENV = 'development' ENV = 'development'
# base api # base api
VUE_APP_BASE_API = 'http://127.0.0.1:8080/' VUE_APP_BASE_API = 'http://192.168.3.12:8080/'

@ -1,5 +1,13 @@
import request from '@/utils/request' import request from '@/utils/request'
export const dict=function(data){
return request({
url: '/api/sy/getZhbmList',
method: 'post',
data: data
})
}
export const daoduo=function(data){ export const daoduo=function(data){
return request({ return request({
url: '/zyjh/daoduo', url: '/zyjh/daoduo',

@ -50,7 +50,7 @@ export default {
{ field: 'dcCh', title: '船号',width: 100, { field: 'dcCh', title: '船号',width: 100,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }}, filterRender: { name: 'FilterCombination', }},
{ field: 'dcPl', title: '批量',width: 70, { field: 'dcPl', title: '批量',width: 70,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }}, filterRender: { name: 'FilterCombination', }},
{ field: 'dcFd', title: '分段号',width: 100, { field: 'dcFd', title: '分段号',width: 100,

@ -1,7 +1,7 @@
<template> <template>
<el-container> <el-container>
<el-header style="width: 100%; height: 60px;font-size: 12px"> <el-header style="width: 100%; height: 60px;font-size: 12px">
<el-form :inline="true" label-width="65px" label-position="left"> <el-form :inline="true" label-width="45px" label-position="left">
<el-row > <el-row >
<el-col :span="4"> <el-col :span="4">
<el-form-item label="船号:"> <el-form-item label="船号:">
@ -149,7 +149,7 @@ export default {
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }, filterRender: { name: 'FilterCombination', },
}, },
{ field: 'dcPl', title: '批量', minWidth: "70", { field: 'dcPl', title: '批量', minWidth: "70",
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }, filterRender: { name: 'FilterCombination', },
}, },

@ -140,7 +140,7 @@ export default {
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }, filterRender: { name: 'FilterCombination', },
}, },
{ field: 'dcPl', title: '批量', minWidth: "70", { field: 'dcPl', title: '批量', minWidth: "70",
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }, filterRender: { name: 'FilterCombination', },
}, },

@ -154,7 +154,7 @@ export default {
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }, filterRender: { name: 'FilterCombination', },
}, },
{ field: 'dcPl', title: '批量', minWidth: "70", { field: 'dcPl', title: '批量', minWidth: "70",
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }, filterRender: { name: 'FilterCombination', },
}, },

@ -141,7 +141,7 @@ export default {
{ field: 'dcCh', title: '船号',width: 100, { field: 'dcCh', title: '船号',width: 100,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }}, filterRender: { name: 'FilterCombination', }},
{ field: 'dcPl', title: '批量',width: 70, { field: 'dcPl', title: '批量',width: 70,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }}, filterRender: { name: 'FilterCombination', }},
{ field: 'dcFd', title: '分段号',width: 100, { field: 'dcFd', title: '分段号',width: 100,

@ -143,7 +143,7 @@ export default {
{ field: 'dcCh', title: '船号',width: 100, { field: 'dcCh', title: '船号',width: 100,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }}, filterRender: { name: 'FilterCombination', }},
{ field: 'dcPl', title: '批量',width: 70, { field: 'dcPl', title: '批量',width: 70,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }}, filterRender: { name: 'FilterCombination', }},
{ field: 'dcFd', title: '分段号',width: 100, { field: 'dcFd', title: '分段号',width: 100,

@ -143,7 +143,7 @@ export default {
{ field: 'dcCh', title: '船号',width: 100, { field: 'dcCh', title: '船号',width: 100,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }}, filterRender: { name: 'FilterCombination', }},
{ field: 'dcPl', title: '批量',width: 70, { field: 'dcPl', title: '批量',width: 70,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }}, filterRender: { name: 'FilterCombination', }},
{ field: 'dcFd', title: '分段号',width: 100, { field: 'dcFd', title: '分段号',width: 100,

@ -1202,7 +1202,7 @@ export default {
{ field: 'dcCh', title: '船号',width: 100, { field: 'dcCh', title: '船号',width: 100,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }}, filterRender: { name: 'FilterCombination', }},
{ field: 'dcPl', title: '批量',width: 70, { field: 'dcPl', title: '批量',width: 70,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }}, filterRender: { name: 'FilterCombination', }},
{ field: 'dcFd', title: '分段号',width: 100, { field: 'dcFd', title: '分段号',width: 100,

@ -115,10 +115,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "qy", field: "dcPl",
title: "区域", title: "批量",
align: "center", align: "center",
minWidth: "70", minWidth: "80",
filters: [ filters: [
{ {
data: { data: {
@ -157,8 +157,8 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "yzd", field: "dcFd",
title: "预组段", title: "分段号",
align: "center", align: "center",
minWidth: "80", minWidth: "80",
filters: [ filters: [
@ -178,10 +178,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "dcFd", field: "qy",
title: "分段号", title: "区域",
align: "center", align: "center",
minWidth: "80", minWidth: "70",
filters: [ filters: [
{ {
data: { data: {
@ -199,10 +199,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "zl", field: "yzd",
title: "重量", title: "预组段",
align: "center", align: "center",
minWidth: "70", minWidth: "80",
filters: [ filters: [
{ {
data: { data: {
@ -220,10 +220,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "dcPl", field: "zl",
title: "批量号", title: "重量",
align: "center", align: "center",
minWidth: "80", minWidth: "70",
filters: [ filters: [
{ {
data: { data: {

@ -134,10 +134,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "qy", field: "dcPl",
title: "区域", title: "批量",
align: "center", align: "center",
minWidth: "70", minWidth: "80",
filters: [ filters: [
{ {
data: { data: {
@ -176,8 +176,8 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "yzd", field: "dcFd",
title: "预组段", title: "分段号",
align: "center", align: "center",
minWidth: "80", minWidth: "80",
filters: [ filters: [
@ -197,10 +197,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "dcFd", field: "qy",
title: "分段号", title: "区域",
align: "center", align: "center",
minWidth: "80", minWidth: "70",
filters: [ filters: [
{ {
data: { data: {
@ -218,10 +218,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "zl", field: "yzd",
title: "重量", title: "预组段",
align: "center", align: "center",
minWidth: "70", minWidth: "80",
filters: [ filters: [
{ {
data: { data: {
@ -239,10 +239,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "dcPl", field: "zl",
title: "批量号", title: "重量",
align: "center", align: "center",
minWidth: "80", minWidth: "70",
filters: [ filters: [
{ {
data: { data: {

@ -186,10 +186,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "qy", field: "dcPl",
title: "区域", title: "批量",
align: "center", align: "center",
minWidth: "70", minWidth: "80",
filters: [ filters: [
{ {
data: { data: {
@ -228,10 +228,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "yzd", field: "dcFd",
title: "预组段", title: "分段号",
align: "center", align: "center",
minWidth: "80", width: "80",
filters: [ filters: [
{ {
data: { data: {
@ -249,10 +249,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "dcFd", field: "qy",
title: "分段号", title: "区域",
align: "center", align: "center",
minWidth: "80", minWidth: "70",
filters: [ filters: [
{ {
data: { data: {
@ -270,10 +270,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "zl", field: "yzd",
title: "重量", title: "预组段",
align: "center", align: "center",
minWidth: "70", minWidth: "80",
filters: [ filters: [
{ {
data: { data: {
@ -291,10 +291,10 @@ export default {
filterRender: { name: "FilterCombination" }, filterRender: { name: "FilterCombination" },
}, },
{ {
field: "dcPl", field: "zl",
title: "批量号", title: "重量",
align: "center", align: "center",
minWidth: "80", minWidth: "70",
filters: [ filters: [
{ {
data: { data: {

@ -122,7 +122,7 @@ export default {
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }, filterRender: { name: 'FilterCombination', },
}, },
{ field: 'dcPl', title: '批量', width: 120, { field: 'dcPl', title: '批量', width: 120,
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }, filterRender: { name: 'FilterCombination', },
}, },

@ -61,7 +61,7 @@ export default {
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }, filterRender: { name: 'FilterCombination', },
}, },
{ field: 'dcPl', title: '批量', minWidth: "70", { field: 'dcPl', title: '批量', minWidth: "70",
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', }, filterRender: { name: 'FilterCombination', },
}, },

@ -18,7 +18,7 @@
<!-- >添加</el-button--> <!-- >添加</el-button-->
<!-- >--> <!-- >-->
<el-button type="primary" @click="initList()"></el-button> <el-button type="primary" @click="initList()"></el-button>
<el-button type="primary" @click="initList(2)"></el-button> <!-- <el-button type="primary" @click="initList(2)"></el-button>-->
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>

@ -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,32 @@ const baifang=function (option={}) {
height:_height, height:_height,
image: this, image: this,
}); });
group.add(shape) bgGroup.add(shape)
shape.zIndex(0) shape.zIndex(0)
} }
return group
}
const selectObj = new Image(); const container=function (){
selectObj.src = require('@/assets/pwan/gbSelectBg.png'); return new Konva.Group({
selectObj.onload = function () {
const shape = new Konva.Image({
x:0, x:0,
y:0, y:0,
width:_width, width:_width,
height:_height, height:_height
image: this, })
visible:false
});
group.add(shape)
shape.zIndex(0)
}
return group
} }
const bgGroup=bg();
const slGroup=container() const slGroup=container()
bgGroup.add(slGroup)
slGroup.zIndex(1)
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 +66,9 @@ 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=evt.currentTarget.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(()=>{
@ -183,6 +180,8 @@ 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 = slList.splice(index-1, 1)[0];
@ -257,6 +256,7 @@ const baifang=function (option={}) {
} }
function handler(slList){ function handler(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 +264,8 @@ const baifang=function (option={}) {
} }
} }
handler(slList)
return { return {
container,slGroup,handler container,slGroup,handler,bgGroup
} }
} }

@ -65,6 +65,7 @@ export default function (width,height,callback){
selectedShape.hide() selectedShape.hide()
if (selectedShape===selectShape){ if (selectedShape===selectShape){
selectedShape=null selectedShape=null
callback(null,null)
return return
} }
} }
@ -108,8 +109,6 @@ export default function (width,height,callback){
setSelectShape(shape) setSelectShape(shape)
} }
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{ const formatName=()=>{
for (const it of qgkw) { for (const it of qgkw) {
if (it.bm===item.tzbh){ if (it.bm===item.tzbh){
@ -134,6 +133,22 @@ export default function (width,height,callback){
return group return group
} }
const qgkw=[
{"bmsm": "2跨超长超宽曲板", "bmlb": "QGKW", "bm": "10"},
{"bmsm": "2跨T型材腹板", "bmlb": "QGKW", "bm": "11"},
{"bmsm": "2跨激光切割板", "bmlb": "QGKW", "bm": "12"},
{"bmsm": "3跨曲板", "bmlb": "QGKW", "bm": "13"},
{"bmsm": "3跨厚板", "bmlb": "QGKW", "bm": "14"},
{"bmsm": "4跨普通板", "bmlb": "QGKW", "bm": "15"},
{"bmsm": "7跨型板", "bmlb": "QGKW", "bm": "16"},
{"bmsm": "光电", "bmlb": "QGKW", "bm": "17"},
{"bmsm": "2跨T型材面板", "bmlb": "QGKW", "bm": "5"},
{"bmsm": "3跨平铁", "bmlb": "QGKW", "bm": "6"},
{"bmsm": "1跨平直大板", "bmlb": "QGKW", "bm": "7"},
{"bmsm": "1跨进线板", "bmlb": "QGKW", "bm": "8"},
{"bmsm": "2跨超长超宽板", "bmlb": "QGKW", "bm": "9"}
]
return { return {
container,dw container,dw
} }

@ -68,27 +68,41 @@ export default {
this.initDw() this.initDw()
} }
}) })
this.sockets.subscribe('zyjhzx', data => {
if (this.zt===data.zt){
const tmpArr=[{
id:data.zyjh.id,
hxfkry:data.zyjh.hxry
}]
this.$refs.hxpgd.paigong0(tmpArr)
}else{
this.$message.error(`工单号错误:${data.gdh}`)
}
})
}, },
initPgd(pgd={}){ initPgd(pgd={}){
const group=this.drawGd(pgd) const group=this.drawGd(pgd)
this.pgdGroup.add(group) this.pgdGroup.add(group)
}, },
initBaiFang(index,item){ initDwInfo(index,dw){
if (this.slGroup){ if (this.slGroup){
this.slGroup.destroyChildren() this.slGroup.destroyChildren()
} }
this.canSl=true this.canSl=true
this.currentDw=item this.currentDw=dw
this.currentDwIndex=index this.currentDwIndex=index
const {slGroup,handler}= baifang({width:this.width,height:this.height,dw:item.list}) !!dw&&this.drawBaiFang(dw.list)
},
initBaiFang(){
const {slGroup,handler,bgGroup:slBgGroup}= baifang({width:this.width,height:this.height})
this.slGroup=slGroup this.slGroup=slGroup
this.layer.add(slBgGroup)
this.drawBaiFang=handler this.drawBaiFang=handler
this.layer.add(slGroup)
}, },
initDw(){ initDw(){
const that=this const that=this
getYcldw({type:'llj'}).then(res=>{ getYcldw({type:'llj'}).then(res=>{
const {container,dw}=drawDw(this.width,this.height,that.initBaiFang) 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)
@ -143,6 +157,8 @@ export default {
const csdGroup = drawSb(this.width, this.height) const csdGroup = drawSb(this.width, this.height)
this.layer.add(csdGroup) this.layer.add(csdGroup)
this.initBaiFang()
}, },
} }
} }

@ -30,7 +30,7 @@ export default {
}, },
methods:{ methods:{
initData() { initData() {
getPgd({zt: '52'}).then(res => { getPgd({zt: '42'}).then(res => {
this.gridOptions.data = res.data this.gridOptions.data = res.data
}) })
}, },

@ -75,8 +75,6 @@ export default function (width,height){
shape.zIndex(0) shape.zIndex(0)
} }
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{ const formatName=()=>{
for (const it of qgkw) { for (const it of qgkw) {
if (it.bm===item.tzbh){ if (it.bm===item.tzbh){
@ -101,6 +99,22 @@ export default function (width,height){
return group return group
} }
const qgkw=[
{"bmsm": "2跨超长超宽曲板", "bmlb": "QGKW", "bm": "10"},
{"bmsm": "2跨T型材腹板", "bmlb": "QGKW", "bm": "11"},
{"bmsm": "2跨激光切割板", "bmlb": "QGKW", "bm": "12"},
{"bmsm": "3跨曲板", "bmlb": "QGKW", "bm": "13"},
{"bmsm": "3跨厚板", "bmlb": "QGKW", "bm": "14"},
{"bmsm": "4跨普通板", "bmlb": "QGKW", "bm": "15"},
{"bmsm": "7跨型板", "bmlb": "QGKW", "bm": "16"},
{"bmsm": "光电", "bmlb": "QGKW", "bm": "17"},
{"bmsm": "2跨T型材面板", "bmlb": "QGKW", "bm": "5"},
{"bmsm": "3跨平铁", "bmlb": "QGKW", "bm": "6"},
{"bmsm": "1跨平直大板", "bmlb": "QGKW", "bm": "7"},
{"bmsm": "1跨进线板", "bmlb": "QGKW", "bm": "8"},
{"bmsm": "2跨超长超宽板", "bmlb": "QGKW", "bm": "9"}
]
return { return {
container,dw container,dw
} }

@ -31,9 +31,33 @@ export default {
} }
}, },
mounted() { mounted() {
this.$socket.open()
this.wsSubscribe()
this.initKonvaStage(); this.initKonvaStage();
}, },
created(){
window.addEventListener('resize', this.initKonvaStage)
},
sockets:{},
methods:{ methods:{
wsSubscribe(){
this.sockets.subscribe('zyjhzx', data => {
const currentWorker=this.getCurrentWorker()
if (!currentWorker){
this.$message.error(`未选择指派人员`)
return;
}
if (this.zt===data.zt){
const tmpArr=[{
id:data.zyjh.id,
pwry:currentWorker.userCode
}]
this.$refs.pwpgd.paigong0(tmpArr)
}else{
this.$message.error(`工单号错误:${data.gdh}`)
}
})
},
initPgd(pgd={}){ initPgd(pgd={}){
const group=this.drawGd(pgd) const group=this.drawGd(pgd)
this.pgdGroup.add(group) this.pgdGroup.add(group)

@ -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.364,_height=height*0.712 const _width=width*0.364,_height=height*0.712
const container=function (){
const x=width*0.30+30,y=260 const x=width*0.30+30,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,32 @@ const baifang=function (option={}) {
height:_height, height:_height,
image: this, image: this,
}); });
group.add(shape) bgGroup.add(shape)
shape.zIndex(0) shape.zIndex(0)
} }
return group
}
const selectObj = new Image(); const container=function (){
selectObj.src = require('@/assets/pwan/gbSelectBg.png'); return new Konva.Group({
selectObj.onload = function () {
const shape = new Konva.Image({
x:0, x:0,
y:0, y:0,
width:_width, width:_width,
height:_height, height:_height
image: this, })
visible:false
});
group.add(shape)
shape.zIndex(0)
}
return group
} }
const bgGroup=bg();
const slGroup=container() const slGroup=container()
bgGroup.add(slGroup)
slGroup.zIndex(1)
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)
@ -70,82 +65,10 @@ const baifang=function (option={}) {
}) })
let _index=0 let _index=0
let touchingFlag=false; let touchingFlag=false;
group.on('mousedown touchstart',function (evt){
const layer=evt.currentTarget.parent.parent
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()
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)
}
}
}
})
this.visible(false)
}
}
},500)
})
group.on('mouseup touchend',function (){ group.on('mouseup touchend',function (){
touchingFlag=false touchingFlag=false
this.stopDrag()
}) })
group.on('dragstart',function (){ group.on('dragstart',function (){
@ -262,7 +185,6 @@ const baifang=function (option={}) {
} }
function handler(slList){ function handler(slList){
console.log(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)
@ -270,10 +192,8 @@ const baifang=function (option={}) {
} }
} }
handler(slList)
return { return {
container,slGroup,handler container,slGroup,handler,bgGroup
} }
} }

@ -65,6 +65,7 @@ export default function (width,height,callback){
selectedShape.hide() selectedShape.hide()
if (selectedShape===selectShape){ if (selectedShape===selectShape){
selectedShape=null selectedShape=null
callback(null,null)
return return
} }
} }
@ -108,7 +109,6 @@ export default function (width,height,callback){
setSelectShape(shape) setSelectShape(shape)
} }
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{ const formatName=()=>{
for (const it of qgkw) { for (const it of qgkw) {
if (it.bm===item.tzbh){ if (it.bm===item.tzbh){
@ -133,6 +133,22 @@ export default function (width,height,callback){
return group return group
} }
const qgkw=[
{"bmsm": "2跨超长超宽曲板", "bmlb": "QGKW", "bm": "10"},
{"bmsm": "2跨T型材腹板", "bmlb": "QGKW", "bm": "11"},
{"bmsm": "2跨激光切割板", "bmlb": "QGKW", "bm": "12"},
{"bmsm": "3跨曲板", "bmlb": "QGKW", "bm": "13"},
{"bmsm": "3跨厚板", "bmlb": "QGKW", "bm": "14"},
{"bmsm": "4跨普通板", "bmlb": "QGKW", "bm": "15"},
{"bmsm": "7跨型板", "bmlb": "QGKW", "bm": "16"},
{"bmsm": "光电", "bmlb": "QGKW", "bm": "17"},
{"bmsm": "2跨T型材面板", "bmlb": "QGKW", "bm": "5"},
{"bmsm": "3跨平铁", "bmlb": "QGKW", "bm": "6"},
{"bmsm": "1跨平直大板", "bmlb": "QGKW", "bm": "7"},
{"bmsm": "1跨进线板", "bmlb": "QGKW", "bm": "8"},
{"bmsm": "2跨超长超宽板", "bmlb": "QGKW", "bm": "9"}
]
return { return {
container,dw container,dw
} }

@ -61,22 +61,60 @@ export default {
} }
this.initDw() this.initDw()
}) })
this.sockets.subscribe('zyjhzx', data => {
if (this.zt===data.zt){
const item=data.zyjh
let dwId=0
let dwCeng=0
for (const dw of this.dw) {
if(dw.tzbh===data.zyjh.kw){
dwId=dw.dwId
dwCeng=dw.list.length
}
}
const tmp={
ydjh:item,
dwId:dwId,
ceng:dwCeng+1,
czbh:item.dcCh,
pl:item.dcPl,
fd:item.dcFd,
kw:item.kw,
zl:item.zl,
tlth:item.tzbh,
wph:item.wpxh,
wpgg:item.wpgg,
sljhrq:item.sljhrq,
qgjhrq:item.qgjhrq,
bfr:data.zyjh.llry,
type:'LLJ'
}
shangLiao(tmp).then(res=>{})
}else{
this.$message.error(`工单号错误:${data.gdh}`)
}
})
}, },
initPgd(pgd={}){ initPgd(pgd={}){
const group=this.drawGd(pgd) const group=this.drawGd(pgd)
this.pgdGroup.add(group) this.pgdGroup.add(group)
}, },
initBaiFang(index,item){ initDwInfo(index,dw){
if (this.slGroup){ if (this.slGroup){
this.slGroup.destroyChildren() this.slGroup.destroyChildren()
} }
this.canSl=true this.canSl=true
this.currentDw=item this.currentDw=dw
this.currentDwIndex=index this.currentDwIndex=index
const {slGroup,handler}= baifang({width:this.width,height:this.height,dw:item.list}) !!dw&&this.drawBaiFang(dw.list)
},
initBaiFang(){
const {slGroup,handler,bgGroup:slBgGroup}= baifang({width:this.width,height:this.height})
this.slGroup=slGroup this.slGroup=slGroup
this.layer.add(slBgGroup)
this.drawBaiFang=handler this.drawBaiFang=handler
this.layer.add(slGroup)
}, },
drawSljhItem(list){ drawSljhItem(list){
if (this.sljhGroup){ if (this.sljhGroup){
@ -173,7 +211,7 @@ export default {
if(this.dwGroup){ if(this.dwGroup){
this.dwGroup.destroyChildren() this.dwGroup.destroyChildren()
} }
const {container,dw}=drawDw(this.width,this.height,that.initBaiFang) const {container,dw}=drawDw(this.width,this.height,that.initDwInfo)
const {bgGroup,group}=container() const {bgGroup,group}=container()
this.dwGroup=group this.dwGroup=group
this.dw=res.data this.dw=res.data
@ -235,6 +273,7 @@ export default {
this.sljhGroup=sljhGroup this.sljhGroup=sljhGroup
this.stage.add(sljhLayer) this.stage.add(sljhLayer)
this.initBaiFang()
}, },
} }
} }

@ -75,8 +75,6 @@ export default function (width,height){
shape.zIndex(0) shape.zIndex(0)
} }
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{ const formatName=()=>{
for (const it of qgkw) { for (const it of qgkw) {
if (it.bm===item.tzbh){ if (it.bm===item.tzbh){
@ -101,6 +99,22 @@ export default function (width,height){
return group return group
} }
const qgkw=[
{"bmsm": "2跨超长超宽曲板", "bmlb": "QGKW", "bm": "10"},
{"bmsm": "2跨T型材腹板", "bmlb": "QGKW", "bm": "11"},
{"bmsm": "2跨激光切割板", "bmlb": "QGKW", "bm": "12"},
{"bmsm": "3跨曲板", "bmlb": "QGKW", "bm": "13"},
{"bmsm": "3跨厚板", "bmlb": "QGKW", "bm": "14"},
{"bmsm": "4跨普通板", "bmlb": "QGKW", "bm": "15"},
{"bmsm": "7跨型板", "bmlb": "QGKW", "bm": "16"},
{"bmsm": "光电", "bmlb": "QGKW", "bm": "17"},
{"bmsm": "2跨T型材面板", "bmlb": "QGKW", "bm": "5"},
{"bmsm": "3跨平铁", "bmlb": "QGKW", "bm": "6"},
{"bmsm": "1跨平直大板", "bmlb": "QGKW", "bm": "7"},
{"bmsm": "1跨进线板", "bmlb": "QGKW", "bm": "8"},
{"bmsm": "2跨超长超宽板", "bmlb": "QGKW", "bm": "9"}
]
return { return {
container,dw container,dw
} }

@ -33,9 +33,33 @@ export default {
} }
}, },
mounted() { mounted() {
this.$socket.open()
this.wsSubscribe()
this.initKonvaStage(); this.initKonvaStage();
}, },
created(){
window.addEventListener('resize', this.initKonvaStage)
},
sockets:{},
methods:{ methods:{
wsSubscribe(){
this.sockets.subscribe('zyjhzx', data => {
const currentWorker=this.getCurrentWorker()
if (!currentWorker){
this.$message.error(`未选择指派人员`)
return;
}
if (this.zt===data.zt){
const tmpArr=[{
id:data.zyjh.id,
pwry:currentWorker.userCode
}]
this.$refs.pwpgd.paigong0(tmpArr)
}else{
this.$message.error(`工单号错误:${data.gdh}`)
}
})
},
initPgd(pgd={}){ initPgd(pgd={}){
const group=this.drawGd(pgd) const group=this.drawGd(pgd)
this.pgdGroup.add(group) this.pgdGroup.add(group)

@ -3,11 +3,11 @@ import {zx} from "@/api/zyjh";
import { VXETable } from 'vxe-table' 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,image=require('@/assets/gb.png')
const _width=width*0.25,_height=height*0.67 const _width=width*0.25,_height=height*0.67
const container=function (){
const x=width*0.30+30,y=300 const x=width*0.30+30,y=300
const bg=function (){
const group=new Konva.Group({ const group=new Konva.Group({
x:x, x:x,
y:y, y:y,
@ -25,32 +25,28 @@ const baifang=function (option={}) {
height:_height, height:_height,
image: this, image: this,
}); });
group.add(shape) bgGroup.add(shape)
shape.zIndex(0) shape.zIndex(0)
} }
return group
}
const selectObj = new Image(); const container=function (){
selectObj.src = require('@/assets/pwan/gbSelectBg.png'); return new Konva.Group({
selectObj.onload = function () {
const shape = new Konva.Image({
x:0, x:0,
y:0, y:0,
width:_width, width:_width,
height:_height, height:_height
image: this, })
visible:false
});
group.add(shape)
shape.zIndex(0)
}
return group
} }
const bgGroup=bg();
const slGroup=container() const slGroup=container()
bgGroup.add(slGroup)
slGroup.zIndex(1)
const thatHeight=height const thatHeight=height
const gangban=function (index,item){ 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,
@ -71,7 +67,9 @@ 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=evt.currentTarget.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(()=>{
@ -264,15 +262,13 @@ const baifang=function (option={}) {
function handler(slList){ function handler(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,slList)
slGroup.add(_group) slGroup.add(_group)
} }
} }
handler(slList)
return { return {
container,slGroup,handler container,slGroup,handler,bgGroup
} }
} }

@ -47,6 +47,7 @@ export default function (width,height,callback){
selectedShape.hide() selectedShape.hide()
if (selectedShape===selectShape){ if (selectedShape===selectShape){
selectedShape=null selectedShape=null
callback(null,null)
return return
} }
} }

@ -44,10 +44,10 @@ export default {
this.wsSubscribe() this.wsSubscribe()
this.initKonvaStage(); this.initKonvaStage();
}, },
sockets:{},
created(){ created(){
window.addEventListener('resize', this.initKonvaStage) window.addEventListener('resize', this.initKonvaStage)
}, },
sockets:{},
methods:{ methods:{
wsSubscribe(){ wsSubscribe(){
this.sockets.subscribe('pwComplete', data => { this.sockets.subscribe('pwComplete', data => {
@ -65,27 +65,41 @@ export default {
this.drawBaiFang(this.dw[this.currentDwIndex].list) this.drawBaiFang(this.dw[this.currentDwIndex].list)
} }
}) })
this.sockets.subscribe('zyjhzx', data => {
if (this.zt===data.zt){
const tmpArr=[{
id:data.zyjh.id,
pwfkry:data.zyjh.pwry
}]
this.$refs.pwpgd.paigong0(tmpArr)
}else{
this.$message.error(`工单号错误:${data.gdh}`)
}
})
}, },
initPgd(pgd={}){ initPgd(pgd={}){
const group=this.drawGd(pgd) const group=this.drawGd(pgd)
this.pgdGroup.add(group) this.pgdGroup.add(group)
}, },
initBaiFang(index,dw){ initDwInfo(index,dw){
if (this.slGroup){ if (this.slGroup){
this.slGroup.destroyChildren() this.slGroup.destroyChildren()
} }
this.canSl=true this.canSl=true
this.currentDw=dw this.currentDw=dw
this.currentDwIndex=index this.currentDwIndex=index
const {slGroup,handler}= baifang({width:this.width,height:this.height,dw:dw.list}) !!dw&&this.drawBaiFang(dw.list)
},
initBaiFang(){
const {slGroup,handler,bgGroup:slBgGroup}= baifang({width:this.width,height:this.height})
this.slGroup=slGroup this.slGroup=slGroup
this.layer.add(slBgGroup)
this.drawBaiFang=handler this.drawBaiFang=handler
this.layer.add(slGroup)
}, },
initDw(){ initDw(){
const that=this const that=this
getYcldw().then(res=>{ getYcldw({type:'ycl'}).then(res=>{
const {container,dw}=drawDw(this.width,this.height,that.initBaiFang) const {container,dw}=drawDw(this.width,this.height,that.initDwInfo)
const group=container() const group=container()
this.layer.add(group) this.layer.add(group)
@ -141,6 +155,8 @@ export default {
this.layer.add(csdGroup) this.layer.add(csdGroup)
this.initWorkers() this.initWorkers()
this.initBaiFang()
}, },
} }
} }

@ -30,7 +30,7 @@ export default {
}, },
methods:{ methods:{
initData(){ initData(){
getPgd({jhrqField:'sljhrq',zt:'21'}).then(res=>{ getPgd({zt:'21'}).then(res=>{
this.gridOptions.data=res.data this.gridOptions.data=res.data
}) })
}, },
@ -71,7 +71,20 @@ export default {
list:tmpArr list:tmpArr
} }
VXETable.modal.confirm('您确定派工吗?').then(res=>{ VXETable.modal.confirm('您确定派工吗?').then(res=>{
res==='confirm'&&zx(data) res==='confirm'&&zx(data).then(resp=>{
this.initData()
})
})
},
paigong0(arr){
const data={
type:this.type,
field:'pwpgrq',
zxZtName:'PWPG',
list:arr
}
zx(data).then(resp=>{
this.initData()
}) })
}, },
cellClick({row}){ cellClick({row}){

@ -1,17 +1,35 @@
import Konva from "konva"; import Konva from "konva";
export default function (width,height){ export default function (width,height){
const x=0,y=0,_width=width*0.16,_height=height*0.945 const x=0,y=0,_width=width*0.16,_height=height*0.955
const container=function (){ const container=function (){
const x=width*0.5+30,y=40 const x=width*0.5+30,y=40
const group=new Konva.Group({ const group=new Konva.Group({
x:0,
y:0,
width:_width,
height:_height,
draggable:true,
dragBoundFunc:function (pos){
return {
x:x,
y:pos.y
}
},
})
const bgGroup=new Konva.Group({
x:x, x:x,
y:y, y:y,
width:_width, width:_width,
height:_height height:_height
}) })
bgGroup.add(group)
bgGroup.clipFunc(function(ctx) {
ctx.rect(0, 4, _width, _height*0.989);
});
const imageObj = new Image(); const imageObj = new Image();
imageObj.src = require('@/assets/sliao/personbg.png'); imageObj.src = require('@/assets/sliao/personbg.png');
@ -23,11 +41,11 @@ export default function (width,height){
height:_height, height:_height,
image: this, image: this,
}); });
group.add(shape) bgGroup.add(shape)
shape.zIndex(0) shape.zIndex(0)
} }
return group return {bgGroup,group}
} }
const dw=function (index,item={}){ const dw=function (index,item={}){
@ -66,7 +84,7 @@ export default function (width,height){
text:`${item.name}\n${item.list.length}`, text:`${item.name}\n${item.list.length}`,
align:'center', align:'center',
verticalAlign:'middle', verticalAlign:'middle',
fontSize:18 fontSize:14
}) })
group.add(text) group.add(text)

@ -2,7 +2,7 @@ import Konva from "konva";
import QRCode from 'qrcode' import QRCode from 'qrcode'
export default function (width,height){ export default function (width,height){
const x=width*0.66+40,y=40,_width=width*0.30,_height=height*0.945 const x=width*0.66+40,y=40,_width=width*0.30,_height=height*0.95
const container=function (){ const container=function (){
const group=new Konva.Group({ const group=new Konva.Group({

@ -13,7 +13,7 @@ import workers from "./comps/person";
import drawDw from './comps/dw' import drawDw from './comps/dw'
import drawPgd from './comps/pgd' import drawPgd from './comps/pgd'
import {getBzryList} from "@/api/sjzx/bzzGL"; import {getBzryList} from "@/api/sjzx/bzzGL";
import {getYcldw} from "@/api/zyjh"; import {dict, getYcldw, shangLiao} from "@/api/zyjh";
export default { export default {
name:'PWanPGong', name:'PWanPGong',
@ -29,24 +29,47 @@ export default {
drawGd:null, drawGd:null,
getCurrentWorker:null, getCurrentWorker:null,
setWorkers:null, setWorkers:null,
tlt:null,
zt:'21'
} }
}, },
mounted() { mounted() {
this.$socket.open()
this.wsSubscribe()
this.initKonvaStage(); this.initKonvaStage();
}, },
created(){ created(){
window.addEventListener('resize', this.initKonvaStage) window.addEventListener('resize', this.initKonvaStage)
}, },
sockets:{},
methods:{ methods:{
wsSubscribe(){
this.sockets.subscribe('zyjhzx', data => {
const currentWorker=this.getCurrentWorker()
if (!currentWorker){
this.$message.error(`未选择指派人员`)
return;
}
if (this.zt===data.zt){
const tmpArr=[{
id:data.zyjh.id,
pwry:currentWorker.userCode
}]
this.$refs.pwpgd.paigong0(tmpArr)
}else{
this.$message.error(`工单号错误:${data.gdh}`)
}
})
},
initPgd(pgd={}){ initPgd(pgd={}){
const group=this.drawGd(pgd) const group=this.drawGd(pgd)
this.pgdGroup.add(group) this.pgdGroup.add(group)
}, },
initDw(){ initDw(){
getYcldw().then(res=>{ getYcldw({type:'ycl'}).then(res=>{
const {container,dw}=drawDw(this.width,this.height) const {container,dw}=drawDw(this.width,this.height)
const group=container() const {bgGroup,group}=container()
this.layer.add(group) this.layer.add(bgGroup)
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]

@ -65,6 +65,7 @@ export default function (width,height,callback){
selectedShape.hide() selectedShape.hide()
if (selectedShape===selectShape){ if (selectedShape===selectShape){
selectedShape=null selectedShape=null
callback(null,null)
return return
} }
} }
@ -108,8 +109,6 @@ export default function (width,height,callback){
setSelectShape(shape) setSelectShape(shape)
} }
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{ const formatName=()=>{
for (const it of qgkw) { for (const it of qgkw) {
if (it.bm===item.tzbh){ if (it.bm===item.tzbh){
@ -134,6 +133,22 @@ export default function (width,height,callback){
return group return group
} }
const qgkw=[
{"bmsm": "2跨超长超宽曲板", "bmlb": "QGKW", "bm": "10"},
{"bmsm": "2跨T型材腹板", "bmlb": "QGKW", "bm": "11"},
{"bmsm": "2跨激光切割板", "bmlb": "QGKW", "bm": "12"},
{"bmsm": "3跨曲板", "bmlb": "QGKW", "bm": "13"},
{"bmsm": "3跨厚板", "bmlb": "QGKW", "bm": "14"},
{"bmsm": "4跨普通板", "bmlb": "QGKW", "bm": "15"},
{"bmsm": "7跨型板", "bmlb": "QGKW", "bm": "16"},
{"bmsm": "光电", "bmlb": "QGKW", "bm": "17"},
{"bmsm": "2跨T型材面板", "bmlb": "QGKW", "bm": "5"},
{"bmsm": "3跨平铁", "bmlb": "QGKW", "bm": "6"},
{"bmsm": "1跨平直大板", "bmlb": "QGKW", "bm": "7"},
{"bmsm": "1跨进线板", "bmlb": "QGKW", "bm": "8"},
{"bmsm": "2跨超长超宽板", "bmlb": "QGKW", "bm": "9"}
]
return { return {
container,dw container,dw
} }

@ -69,26 +69,41 @@ export default {
this.initDw() this.initDw()
} }
}) })
this.sockets.subscribe('zyjhzx', data => {
if (this.zt===data.zt){
const tmpArr=[{
id:data.zyjh.id,
qgfkry:data.zyjh.qgry
}]
this.$refs.pwpgd.paigong0(tmpArr)
}else{
this.$message.error(`工单号错误:${data.gdh}`)
}
})
}, },
initPgd(pgd = {}) { initPgd(pgd = {}) {
const group = this.drawGd(pgd) const group = this.drawGd(pgd)
this.pgdGroup.add(group) this.pgdGroup.add(group)
}, },
initBaiFang(index, item) { initDwInfo(index,dw){
if (this.slGroup){ if (this.slGroup){
this.slGroup.destroyChildren() this.slGroup.destroyChildren()
} }
this.canSl=true this.canSl=true
this.currentDw=dw
this.currentDwIndex=index this.currentDwIndex=index
const {slGroup, handler} = baifang({width: this.width, height: this.height, dw: item.list}) !!dw&&this.drawBaiFang(dw.list)
},
initBaiFang(){
const {slGroup,handler,bgGroup:slBgGroup}= baifang({width:this.width,height:this.height})
this.slGroup=slGroup this.slGroup=slGroup
this.layer.add(slBgGroup)
this.drawBaiFang=handler this.drawBaiFang=handler
this.layer.add(slGroup)
}, },
initDw() { initDw() {
const that = this const that = this
getYcldw({type:'llj'}).then(res => { getYcldw({type:'llj'}).then(res => {
const {container, dw} = drawDw(this.width, this.height, that.initBaiFang) 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)
@ -147,6 +162,8 @@ export default {
const csdGroup = drawSb(this.width, this.height) const csdGroup = drawSb(this.width, this.height)
this.layer.add(csdGroup) this.layer.add(csdGroup)
this.initBaiFang()
}, },
} }
} }

@ -30,7 +30,7 @@ export default {
}, },
methods:{ methods:{
initData() { initData() {
getPgd({zt: '52'}).then(res => { getPgd({zt: '42',ztHx:'52'}).then(res => {
this.gridOptions.data = res.data this.gridOptions.data = res.data
}) })
}, },

@ -75,8 +75,6 @@ export default function (width,height){
shape.zIndex(0) shape.zIndex(0)
} }
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{ const formatName=()=>{
for (const it of qgkw) { for (const it of qgkw) {
if (it.bm===item.tzbh){ if (it.bm===item.tzbh){
@ -101,6 +99,22 @@ export default function (width,height){
return group return group
} }
const qgkw=[
{"bmsm": "2跨超长超宽曲板", "bmlb": "QGKW", "bm": "10"},
{"bmsm": "2跨T型材腹板", "bmlb": "QGKW", "bm": "11"},
{"bmsm": "2跨激光切割板", "bmlb": "QGKW", "bm": "12"},
{"bmsm": "3跨曲板", "bmlb": "QGKW", "bm": "13"},
{"bmsm": "3跨厚板", "bmlb": "QGKW", "bm": "14"},
{"bmsm": "4跨普通板", "bmlb": "QGKW", "bm": "15"},
{"bmsm": "7跨型板", "bmlb": "QGKW", "bm": "16"},
{"bmsm": "光电", "bmlb": "QGKW", "bm": "17"},
{"bmsm": "2跨T型材面板", "bmlb": "QGKW", "bm": "5"},
{"bmsm": "3跨平铁", "bmlb": "QGKW", "bm": "6"},
{"bmsm": "1跨平直大板", "bmlb": "QGKW", "bm": "7"},
{"bmsm": "1跨进线板", "bmlb": "QGKW", "bm": "8"},
{"bmsm": "2跨超长超宽板", "bmlb": "QGKW", "bm": "9"}
]
return { return {
container,dw container,dw
} }

@ -31,9 +31,33 @@ export default {
} }
}, },
mounted() { mounted() {
this.$socket.open()
this.wsSubscribe()
this.initKonvaStage(); this.initKonvaStage();
}, },
created(){
window.addEventListener('resize', this.initKonvaStage)
},
sockets:{},
methods:{ methods:{
wsSubscribe(){
this.sockets.subscribe('zyjhzx', data => {
const currentWorker=this.getCurrentWorker()
if (!currentWorker){
this.$message.error(`未选择指派人员`)
return;
}
if (this.zt===data.zt){
const tmpArr=[{
id:data.zyjh.id,
pwry:currentWorker.userCode
}]
this.$refs.pwpgd.paigong0(tmpArr)
}else{
this.$message.error(`工单号错误:${data.gdh}`)
}
})
},
initPgd(pgd={}){ initPgd(pgd={}){
const group=this.drawGd(pgd) const group=this.drawGd(pgd)
this.pgdGroup.add(group) this.pgdGroup.add(group)

@ -16,6 +16,7 @@ export default {
data(){ data(){
return{ return{
queryParam:{ queryParam:{
zt:'11',
dcCh:'', dcCh:'',
dcPl:'', dcPl:'',
dcFd:'', dcFd:'',

@ -1,11 +1,11 @@
import Konva from "konva"; import Konva from "konva";
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,image=require('@/assets/gb.png')
const _width=width*0.4-50,_height=height*0.737 const _width=width*0.4-50,_height=height*0.737
const container=function (){
const x=width*0.6+40,y=262 const x=width*0.6+40,y=262
const bg=function (){
const group=new Konva.Group({ const group=new Konva.Group({
x:x, x:x,
y:y, y:y,
@ -23,33 +23,32 @@ const baifang=function (option={}) {
height:_height, height:_height,
image: this, image: this,
}); });
group.add(shape) bgGroup.add(shape)
shape.zIndex(0) shape.zIndex(0)
} }
return group return group
} }
const createRect=function (){ const container=function (){
const rect=new Konva.Rect({ return new Konva.Group({
x:0, x:0,
y:0, y:0,
width:_width, width:_width,
height:_height, height:_height
stroke:'black',
strokeWidth:1,
}) })
return rect
} }
let slGroup=container() const bgGroup=bg();
const slGroup=container()
bgGroup.add(slGroup)
slGroup.zIndex(1)
const thatHeight=height const thatHeight=height
const gangban=function (index,item){ const gangban=function (index,item,slList){
const group=new Konva.Group({ const group=new Konva.Group({
x:0, x:0,
y:thatHeight-280-index*40, y:thatHeight-280-index*40,
draggable:true // draggable:true
}) })
group.setAttr('item',item) group.setAttr('item',item)
@ -207,23 +206,18 @@ const baifang=function (option={}) {
verticalAlign:'middle', verticalAlign:'middle',
}) })
group.add(concent) group.add(concent)
} }
function handler(slList){ function handler(slList){
slGroup.destroyChildren() slGroup.destroyChildren()
const rect=createRect()
slGroup.add(rect)
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]
gangban(i,item) gangban(i,item)
} }
} }
handler(slList)
return { return {
container,slGroup,handler container,slGroup,handler,bgGroup
} }
} }

@ -69,6 +69,7 @@ const liliao=function (width,height,dw,callback) {
selectedShape.hide() selectedShape.hide()
if (selectedShape===selectShape){ if (selectedShape===selectShape){
selectedShape=null selectedShape=null
callback(null,null)
return return
} }
} }

@ -15,7 +15,7 @@ import workers from "@/views/zyjhzx/sliao/comps/person";
import SliaoSearch from "@/views/zyjhzx/sliao/comps/SliaoSearch.vue"; import SliaoSearch from "@/views/zyjhzx/sliao/comps/SliaoSearch.vue";
import liliao from "@/views/zyjhzx/sliao/comps/liliao"; import liliao from "@/views/zyjhzx/sliao/comps/liliao";
import baifang from "@/views/zyjhzx/sliao/comps/baifang"; import baifang from "@/views/zyjhzx/sliao/comps/baifang";
import {getSljhPgd, getYcldw, shangLiao} from "@/api/zyjh"; import {dict, getSljhPgd, getYcldw, shangLiao} from "@/api/zyjh";
import {getBzryList} from "@/api/sjzx/bzzGL"; import {getBzryList} from "@/api/sjzx/bzzGL";
export default { export default {
@ -39,17 +39,30 @@ export default {
sljhItemList:[], sljhItemList:[],
tlt:[], tlt:[],
dw:[], dw:[],
workers:[] workers:[],
zt:'11'
} }
}, },
mounted() { mounted() {
Array.prototype.r = function(str){
const [start,end]=str.split(':').map(Number);
return this.slice(start, end);
}
this.$socket.open() this.$socket.open()
this.wsSubscribe() this.wsSubscribe()
this.initKonvaStage(); this.initKonvaStage();
this.tlt=JSON.parse(window.localStorage.getItem('QGKW')); this.initTlt()
},
created(){
window.addEventListener('resize', this.initKonvaStage)
}, },
sockets:{}, sockets:{},
methods:{ methods:{
initTlt(){
dict({bmlb:'QGKW'}).then(res=>{
this.tlt=res.data
})
},
wsSubscribe(){ wsSubscribe(){
this.sockets.subscribe('slComplete', data => { this.sockets.subscribe('slComplete', data => {
if (this.currentDw&&this.currentDw.id===data.dwId) { if (this.currentDw&&this.currentDw.id===data.dwId) {
@ -67,20 +80,23 @@ export default {
search(queryParam){ search(queryParam){
getSljhPgd(queryParam).then(res=>{ getSljhPgd(queryParam).then(res=>{
this.sljhItemList=res.data this.sljhItemList=res.data
this.drawSljhItem(this.sljhItemList) this.drawSljhItem(this.sljhItemList.r('0:20'))
}) })
}, },
initBaiFang(index,dw){ initDwInfo(index,dw){
if (this.slGroup){ if (this.slGroup){
this.slGroup.destroyChildren() this.slGroup.destroyChildren()
} }
this.canSl=true this.canSl=true
this.currentDw=dw this.currentDw=dw
this.currentDwIndex=index this.currentDwIndex=index
const {slGroup,handler}= baifang({width:this.width,height:this.height,dw:dw.list}) !!dw&&this.drawBaiFang(dw.list)
},
initBaiFang(){
const {slGroup,handler,bgGroup:slBgGroup}= baifang({width:this.width,height:this.height})
this.slGroup=slGroup this.slGroup=slGroup
this.layer.add(slBgGroup)
this.drawBaiFang=handler this.drawBaiFang=handler
this.layer.add(slGroup)
}, },
drawSljhItem(list){ drawSljhItem(list){
if (this.sljhGroup){ if (this.sljhGroup){
@ -332,7 +348,7 @@ export default {
that.sljhItemList.splice(this.getAttr('index'),1) that.sljhItemList.splice(this.getAttr('index'),1)
that.sljhGroup.destroyChildren() that.sljhGroup.destroyChildren()
that.drawSljhItem(that.sljhItemList) that.drawSljhItem(that.sljhItemList.r('0:20'))
}else{ }else{
this.remove() this.remove()
_that.visible(true) _that.visible(true)
@ -358,7 +374,7 @@ export default {
this.ycldwGroup.destroyChildren() this.ycldwGroup.destroyChildren()
} }
this.dw=res.data this.dw=res.data
const {container,getCurrentDw}= liliao(this.width,this.height,this.dw,this.initBaiFang) const {container,getCurrentDw}= liliao(this.width,this.height,this.dw,this.initDwInfo)
const group=container() const group=container()
this.ycldwGroup=group this.ycldwGroup=group
this.layer.add(group) this.layer.add(group)
@ -398,6 +414,7 @@ export default {
this.initYcldw() this.initYcldw()
this.initBaiFang()
}, },
} }
} }

Loading…
Cancel
Save