Merge remote-tracking branch 'origin/master'

master
xhj 8 months ago
commit 487e6fee2e

@ -2,4 +2,4 @@
ENV = 'development'
# 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'
export const dict=function(data){
return request({
url: '/api/sy/getZhbmList',
method: 'post',
data: data
})
}
export const daoduo=function(data){
return request({
url: '/zyjh/daoduo',

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

@ -1,7 +1,7 @@
<template>
<el-container>
<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-col :span="4">
<el-form-item label="船号:">
@ -149,7 +149,7 @@ export default {
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', },
},
{ field: 'dcPl', title: '批量', minWidth: "70",
{ field: 'dcPl', title: '批量', minWidth: "70",
filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
filterRender: { name: 'FilterCombination', },
},

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

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

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

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

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

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

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

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

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

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

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

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

@ -18,7 +18,7 @@
<!-- >添加</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-row>
<el-row>

@ -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)
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)
}
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)
@ -100,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()
@ -185,12 +181,12 @@ 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({
@ -257,6 +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)
@ -264,10 +261,8 @@ const baifang=function (option={}) {
}
}
handler(slList)
return {
container,slGroup,handler
container,slGroup,handler,bgGroup
}
}

@ -65,6 +65,7 @@ export default function (width,height,callback){
selectedShape.hide()
if (selectedShape===selectShape){
selectedShape=null
callback(null,null)
return
}
}
@ -108,8 +109,6 @@ export default function (width,height,callback){
setSelectShape(shape)
}
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{
for (const it of qgkw) {
if (it.bm===item.tzbh){
@ -134,6 +133,22 @@ export default function (width,height,callback){
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 {
container,dw
}

@ -68,27 +68,41 @@ export default {
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={}){
const group=this.drawGd(pgd)
this.pgdGroup.add(group)
},
initBaiFang(index,item){
initDwInfo(index,dw){
if (this.slGroup){
this.slGroup.destroyChildren()
}
this.canSl=true
this.currentDw=item
this.currentDw=dw
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.layer.add(slBgGroup)
this.drawBaiFang=handler
this.layer.add(slGroup)
},
initDw(){
const that=this
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()
this.layer.add(bgGroup)
@ -143,6 +157,8 @@ export default {
const csdGroup = drawSb(this.width, this.height)
this.layer.add(csdGroup)
this.initBaiFang()
},
}
}

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

@ -75,8 +75,6 @@ export default function (width,height){
shape.zIndex(0)
}
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{
for (const it of qgkw) {
if (it.bm===item.tzbh){
@ -101,6 +99,22 @@ export default function (width,height){
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 {
container,dw
}

@ -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
}

@ -31,9 +31,33 @@ export default {
}
},
mounted() {
this.$socket.open()
this.wsSubscribe()
this.initKonvaStage();
},
created(){
window.addEventListener('resize', this.initKonvaStage)
},
sockets:{},
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={}){
const group=this.drawGd(pgd)
this.pgdGroup.add(group)

@ -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.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({
x:x,
y:y,
@ -25,36 +24,32 @@ const baifang=function (option={}) {
height:_height,
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)
}
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)
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)
@ -70,82 +65,10 @@ const baifang=function (option={}) {
})
let _index=0
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 (){
touchingFlag=false
this.stopDrag()
})
group.on('dragstart',function (){
@ -262,7 +185,6 @@ const baifang=function (option={}) {
}
function handler(slList){
console.log(slList)
for (let i = 1; i <= slList.length; i++) {
const item=slList[i-1]
const _group=gangban(i,item,item.length)
@ -270,10 +192,8 @@ const baifang=function (option={}) {
}
}
handler(slList)
return {
container,slGroup,handler
container,slGroup,handler,bgGroup
}
}

@ -65,6 +65,7 @@ export default function (width,height,callback){
selectedShape.hide()
if (selectedShape===selectShape){
selectedShape=null
callback(null,null)
return
}
}
@ -108,7 +109,6 @@ export default function (width,height,callback){
setSelectShape(shape)
}
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{
for (const it of qgkw) {
if (it.bm===item.tzbh){
@ -133,6 +133,22 @@ export default function (width,height,callback){
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 {
container,dw
}

@ -61,22 +61,60 @@ export default {
}
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={}){
const group=this.drawGd(pgd)
this.pgdGroup.add(group)
},
initBaiFang(index,item){
initDwInfo(index,dw){
if (this.slGroup){
this.slGroup.destroyChildren()
}
this.canSl=true
this.currentDw=item
this.currentDw=dw
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.layer.add(slBgGroup)
this.drawBaiFang=handler
this.layer.add(slGroup)
},
drawSljhItem(list){
if (this.sljhGroup){
@ -126,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,
@ -173,7 +212,7 @@ export default {
if(this.dwGroup){
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()
this.dwGroup=group
this.dw=res.data
@ -235,6 +274,7 @@ export default {
this.sljhGroup=sljhGroup
this.stage.add(sljhLayer)
this.initBaiFang()
},
}
}

@ -75,8 +75,6 @@ export default function (width,height){
shape.zIndex(0)
}
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{
for (const it of qgkw) {
if (it.bm===item.tzbh){
@ -101,6 +99,22 @@ export default function (width,height){
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 {
container,dw
}

@ -33,9 +33,33 @@ export default {
}
},
mounted() {
this.$socket.open()
this.wsSubscribe()
this.initKonvaStage();
},
created(){
window.addEventListener('resize', this.initKonvaStage)
},
sockets:{},
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={}){
const group=this.drawGd(pgd)
this.pgdGroup.add(group)

@ -3,11 +3,11 @@ 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')
const width=option.width,height=option.height,image=require('@/assets/gb.png')
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({
x:x,
y:y,
@ -25,36 +25,34 @@ const baifang=function (option={}) {
height:_height,
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)
}
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)
const thatHeight=height
const gangban=function (index,item){
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)
@ -71,7 +69,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(()=>{
@ -190,24 +188,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 = currSllist.splice(index-1, 1)[0];
currSllist.splice(_index-1, 0, element);
this.setAttr('index',_index)
_index=0
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({
x:0,
y:0,
@ -262,17 +250,16 @@ 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)
const _group=gangban(i,item,item.length,slList)
slGroup.add(_group)
}
}
handler(slList)
return {
container,slGroup,handler
container,slGroup,handler,bgGroup
}
}

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

@ -44,10 +44,10 @@ export default {
this.wsSubscribe()
this.initKonvaStage();
},
sockets:{},
created(){
window.addEventListener('resize', this.initKonvaStage)
},
sockets:{},
methods:{
wsSubscribe(){
this.sockets.subscribe('pwComplete', data => {
@ -63,6 +63,18 @@ export default {
}
}
this.drawBaiFang(this.dw[this.currentDwIndex].list)
this.$refs.pwpgd.initData(this.currentWorker.userCode,'31')
}
})
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}`)
}
})
},
@ -70,22 +82,25 @@ export default {
const group=this.drawGd(pgd)
this.pgdGroup.add(group)
},
initBaiFang(index,dw){
initDwInfo(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:dw.list})
!!dw&&this.drawBaiFang(dw.list)
},
initBaiFang(){
const {slGroup,handler,bgGroup:slBgGroup}= baifang({width:this.width,height:this.height})
this.slGroup=slGroup
this.layer.add(slBgGroup)
this.drawBaiFang=handler
this.layer.add(slGroup)
},
initDw(){
const that=this
getYcldw().then(res=>{
const {container,dw}=drawDw(this.width,this.height,that.initBaiFang)
getYcldw({type:'ycl'}).then(res=>{
const {container,dw}=drawDw(this.width,this.height,that.initDwInfo)
const group=container()
this.layer.add(group)
@ -141,6 +156,8 @@ export default {
this.layer.add(csdGroup)
this.initWorkers()
this.initBaiFang()
},
}
}

@ -30,7 +30,7 @@ export default {
},
methods:{
initData(){
getPgd({jhrqField:'sljhrq',zt:'21'}).then(res=>{
getPgd({zt:'21'}).then(res=>{
this.gridOptions.data=res.data
})
},
@ -71,7 +71,20 @@ export default {
list:tmpArr
}
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}){

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

@ -2,7 +2,7 @@ import Konva from "konva";
import QRCode from 'qrcode'
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 group=new Konva.Group({

@ -13,7 +13,7 @@ import workers from "./comps/person";
import drawDw from './comps/dw'
import drawPgd from './comps/pgd'
import {getBzryList} from "@/api/sjzx/bzzGL";
import {getYcldw} from "@/api/zyjh";
import {dict, getYcldw, shangLiao} from "@/api/zyjh";
export default {
name:'PWanPGong',
@ -29,24 +29,47 @@ export default {
drawGd:null,
getCurrentWorker:null,
setWorkers:null,
tlt:null,
zt:'21'
}
},
mounted() {
this.$socket.open()
this.wsSubscribe()
this.initKonvaStage();
},
created(){
window.addEventListener('resize', this.initKonvaStage)
},
sockets:{},
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={}){
const group=this.drawGd(pgd)
this.pgdGroup.add(group)
},
initDw(){
getYcldw().then(res=>{
getYcldw({type:'ycl'}).then(res=>{
const {container,dw}=drawDw(this.width,this.height)
const group=container()
this.layer.add(group)
const {bgGroup,group}=container()
this.layer.add(bgGroup)
for (let i=0;i<res.data.length;i++){
const item=res.data[i]

@ -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
}
}

@ -65,6 +65,7 @@ export default function (width,height,callback){
selectedShape.hide()
if (selectedShape===selectShape){
selectedShape=null
callback(null,null)
return
}
}
@ -108,8 +109,6 @@ export default function (width,height,callback){
setSelectShape(shape)
}
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{
for (const it of qgkw) {
if (it.bm===item.tzbh){
@ -134,6 +133,22 @@ export default function (width,height,callback){
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 {
container,dw
}

@ -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,

@ -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,
@ -69,29 +68,44 @@ export default {
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 = {}) {
const group = this.drawGd(pgd)
this.pgdGroup.add(group)
},
initBaiFang(index, item) {
if (this.slGroup) {
initDwInfo(index,dw){
if (this.slGroup){
this.slGroup.destroyChildren()
}
this.canSl = true
this.currentDwIndex = index
const {slGroup, handler} = baifang({width: this.width, height: this.height, dw: item.list})
this.slGroup = slGroup
this.drawBaiFang = handler
this.layer.add(slGroup)
this.canSl=true
this.currentDw=dw
this.currentDwIndex=index
!!dw&&this.drawBaiFang(dw.list)
},
initBaiFang(){
const {slGroup,handler,bgGroup:slBgGroup}= baifang({width:this.width,height:this.height})
this.slGroup=slGroup
this.layer.add(slBgGroup)
this.drawBaiFang=handler
},
initDw() {
const that = this
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()
this.layer.add(bgGroup)
this.dw=res.data
for (let i = 0; i < res.data.length; i++) {
const item = res.data[i]
@ -147,6 +161,8 @@ export default {
const csdGroup = drawSb(this.width, this.height)
this.layer.add(csdGroup)
this.initBaiFang()
},
}
}

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

@ -75,8 +75,6 @@ export default function (width,height){
shape.zIndex(0)
}
const qgkw=JSON.parse(window.localStorage.getItem('QGKW'))
const formatName=()=>{
for (const it of qgkw) {
if (it.bm===item.tzbh){
@ -101,6 +99,22 @@ export default function (width,height){
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 {
container,dw
}

@ -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
}

@ -31,9 +31,33 @@ export default {
}
},
mounted() {
this.$socket.open()
this.wsSubscribe()
this.initKonvaStage();
},
created(){
window.addEventListener('resize', this.initKonvaStage)
},
sockets:{},
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={}){
const group=this.drawGd(pgd)
this.pgdGroup.add(group)

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

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

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

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

Loading…
Cancel
Save