1.完善上料反馈界面逻辑

master
董哲奇 9 months ago
parent ff8d8a2a01
commit 75ec83c884

@ -0,0 +1,15 @@
import request from '@/utils/request'
export const getSljhPgd=function(){
return request({
url: '/zyjh/sljh',
method: 'post',
})
}
export const getYcldw=function(){
return request({
url: '/zyjh/ycldw',
method: 'post',
})
}

@ -29,7 +29,7 @@ export default {
},
{
name:'二剁',
list:['板材1','板材2','板材3','板材4','板材5','板材6','板材7','板材8','板材9','板材10','板材11','板材12','板材13','板材14',]
//list:['1','2','3','4','5','6','7','8','9','10','11','12','13','14',]
}
]
},
@ -121,7 +121,6 @@ export default {
methods: {
//
drawSlItem(slList){
console.log(slList.length)
for (let i = 1; i <=slList.length; i++) {
const gb=slList[i-1]
const group=new Konva.Group({
@ -318,7 +317,7 @@ export default {
group.on('click touchstart',(evt)=>{
console.log(evt.target)
this.slGroup.destroyChildren()
this.drawSlItem(dw.list)
this.drawSlItem(dw.list||[])
})
_group.add(group)
}

@ -1,8 +1,8 @@
<template>
<div id="searchPl" ref="searchPl">
<VxeInput v-model="queryParam.kw" placeholder="请输入跨位"/>
<ProjectSelect ref="projectSelectRef" :_style="{width:'115px'}"/>
<VxeInput v-model="queryParam.dcPl" placeholder="请输入批量"/>
<VxeInput v-model="queryParam.dcFd" placeholder="请输入分段"/>
<VxeInput type="date" value-format="yyyy/MM/dd" label-format="yyyy/MM/dd" v-model="queryParam.sljhrq" placeholder="请选择上料日期"/>
<VxeButton status="primary" content="查询" @click="search" />
</div>

@ -13,6 +13,13 @@ const baifang=function (option={}) {
height:_height
})
// const rect=createRect(x,y)
// group.add(rect)
return group
}
const createRect=function (){
const rect=new Konva.Rect({
x:0,
y:0,
@ -21,16 +28,13 @@ const baifang=function (option={}) {
stroke:'black',
strokeWidth:1,
})
group.add(rect)
return group
return rect
}
const slGroup=container()
let slGroup=container()
const thatHeight=height
const gangban=function (index,str){
const gangban=function (index,item){
const group=new Konva.Group({
x:0,
y:thatHeight-260-index*40,
@ -50,6 +54,7 @@ const baifang=function (option={}) {
let _index=0
group.on('dragstart',function (){
console.log(this)
const {x,y}=this.absolutePosition()
this.startPos={
x:x,
@ -95,7 +100,6 @@ const baifang=function (option={}) {
slList.splice(_index-1, 0, element);
this.setAttr('index',_index)
_index=0
slGroup.destroyChildren()
handler(slList)
})
@ -140,7 +144,7 @@ const baifang=function (option={}) {
width: imgSize,
height:40,
fill:'black',
text:str+',12*2830*13090',
text:`${item.wph||''},${item.wpgg}`,
align:'center',
verticalAlign:'middle',
})
@ -153,20 +157,21 @@ const baifang=function (option={}) {
width: imgSize+40,
height:40,
fill:'black',
text:'G175K-4,001,2302\n上料:2024/07/01,切割:2024/07/04',
text:`${item.czbh},${item.pl},${item.fd}\n上料:${item.sljhrq},切割:${item.qgjhrq||''}`,
align:'center',
verticalAlign:'middle',
})
group.add(concent)
return group
}
function handler(slList){
slGroup.destroyChildren()
const rect=createRect()
slGroup.add(rect)
for (let i = 1; i <= slList.length; i++) {
const item=slList[i-1]
const _group=gangban(i,item,item.length)
slGroup.add(_group)
gangban(i,item,item.length)
}
}

@ -26,14 +26,19 @@ const liliao=function (width,height,dw,callback) {
for (let i = 0; i < dw.length; i++) {
const item=dw[i]
const _group=duowei(i,item.name)
const _group=duowei(i,item)
group.add(_group)
}
return group
}
const duowei=function (index,str){
let currentDw=null
const getCurrentDw=function (){
return currentDw
}
const duowei=function (index,item){
const alignSize=3
const width=((_width-60)/alignSize),height=208
const x=index%alignSize*width+index%alignSize*10+20,y=height*(Math.floor(index/alignSize))+(Math.floor(index/alignSize)+1)*10
@ -44,7 +49,8 @@ const liliao=function (width,height,dw,callback) {
height:height
})
group.on('click touchstart',function (){
callback(index,dw[index].list)
currentDw=item
callback(index,dw[index])
})
const rect=new Konva.Rect({
@ -64,7 +70,7 @@ const liliao=function (width,height,dw,callback) {
width: width,
height: height,
fill:'black',
text:str,
text:item.name,
align:'center',
verticalAlign:'middle',
fontSize:20
@ -75,7 +81,7 @@ const liliao=function (width,height,dw,callback) {
}
return {
container,duowei
container,duowei,getCurrentDw
}
}

@ -26,14 +26,19 @@ const workers=function (width,height,persons) {
for (let i = 0; i < persons.length; i++) {
const item=persons[i]
const _group=person(i,item.name,persons.length)
const _group=person(i,item)
group.add(_group)
}
return group
}
const person=function (index,str,img,size){
let currentWork=null;
const getCurrentWorker=function (){
return currentWork
}
const person=function (index,item){
const alignSize=2
const width=((_width-30)/alignSize),height=108
const x=index%alignSize*width+(index%alignSize+1)*10,y=height*(Math.floor(index/alignSize))+(Math.floor(index/alignSize)+1)*10
@ -44,6 +49,10 @@ const workers=function (width,height,persons) {
height:height
})
group.on('click touchstart',function (){
currentWork=item
})
const rect=new Konva.Rect({
x:0,
y:0,
@ -61,7 +70,7 @@ const workers=function (width,height,persons) {
width: width,
height: height,
fill:'black',
text:str,
text:item.userName,
align:'center',
verticalAlign:'middle',
fontSize:20
@ -72,7 +81,7 @@ const workers=function (width,height,persons) {
}
return {
container
container,getCurrentWorker
}
}

@ -0,0 +1,5 @@
//获取跨位对应得套料图名称
export const formatTlt=function (kw,tlt){
return tlt.filter(item=>item.bm===kw)[0].bmsm
}

@ -14,6 +14,9 @@ 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, getTlt, getYcldw} from "@/api/zyjh";
import {formatTlt} from "@/views/zyjhzx/sliao/comps/utils";
import {getBzryList} from "@/api/sjzx/bzzGL";
export default {
name:'SLiao',
@ -28,63 +31,39 @@ export default {
slGroup:null,
sljhGroup:null,
drawBaiFang:null,
ycldwGroup:null,
canSl:false,
getCurrentWorker:null,
currentDw:null,
currentDwIndex:-1,
sljhItemList:[
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX006',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX007',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX096',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX007',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX006',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B706N4PX077',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX098',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX998',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX008',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX098',perQy:'一区',perDw:'一剁',perCeng:'三层'},
{czbh:'G175K-4',pl:'001',tzbh:'B006N4PX099',perQy:'一区',perDw:'一剁',perCeng:'三层'},
],
dw:[
{name:'预处理垛位\n垛位1\n摆放预览',
list:['板材1','板材2','板材3','板材4','板材5','板材6','板材7','板材8','板材9','板材10','板材11','板材12','板材13','板材14',]
},
{name:'预处理垛位\n垛位2\n摆放预览',
list:['板材1','板材2','板材3','板材4','板材5','板材6','板材7','板材8','板材9','板材10','板材11','板材12','板材13','板材14',]
},
{name:'预处理垛位\n垛位2\n摆放预览',
list:['板材1','板材2','板材3','板材4','板材5','板材6','板材7','板材8','板材9','板材10','板材11','板材12','板材13','板材14',]
},
]
sljhItemList:[],
tlt:[],
dw:[],
workers:[]
}
},
mounted() {
this.initKonvaStage();
this.tlt=JSON.parse(window.localStorage.getItem('QGKW'));
},
methods:{
search(queryParam){
console.log(queryParam)
},
initBaiFang(index,list){
initBaiFang(index,dw){
// if (this.slGroup){
// this.slGroup.destroyChildren()
// }
this.canSl=true
this.currentDw=dw
this.currentDwIndex=index
const {slGroup,handler}= baifang({width:this.width,height:this.height,dw:list})
const {slGroup,handler}= baifang({width:this.width,height:this.height,dw:dw.list})
this.slGroup=slGroup
this.drawBaiFang=handler
this.layer.add(slGroup)
},
drawSljhItem(list){
const itemWith=80;
const itemWith=85;
const itemHeight=108
for (let i = 0; i < list.length; i++) {
const item=list[i];
@ -96,13 +75,15 @@ export default {
height:itemHeight,
})
qyGroup.setAttr('index',i)
qyGroup.setAttr('item',item)
const _layer=this.layer
const _sljhGroup=this.sljhGroup;
let touchingFlag=false;
const that=this
qyGroup.on('touchstart',function ({evt}){
if (!that.canSl){
const worker=that.getCurrentWorker();
if (!that.canSl||!worker){
return
}
@ -128,11 +109,26 @@ export default {
const maxX=x+that.width*0.4-20
const maxY=y+that.height*0.8-20
if(thisX>=x&&thisY>=y&&thisX<=maxX&&thisY<=maxY){
that.dw[that.currentDwIndex].list.push('12123')
that.slGroup.destroyChildren()
that.initBaiFang(that.currentDwIndex,that.dw[that.currentDwIndex].list)
const item=this.getAttr('item')
console.log(item)
const data={
dwId:that.currentDw.id,
ceng:'',
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.slrq,
qgjhrq:item.qgrq,
bfr:''
}
that.dw[that.currentDwIndex].list.push(data)
that.drawBaiFang(that.dw[that.currentDwIndex].list)
//that.drawBaiFang(that.dw[that.currentDwIndex].list)
this.remove()
that.sljhItemList.splice(this.getAttr('index'),1)
@ -176,7 +172,7 @@ export default {
lineHeight:1,
stroke:'blue',
strokeWidth:0.1,
text:item.czbh+'\n'+item.pl+'\n'+item.tzbh+'\n建议位置\n'+item.perQy+'\n'+item.perDw+'\n'+item.perCeng,
text:item.dcCh+'\n'+item.dcPl+'\n'+item.dcFd+'\n'+item.tzbh+'\n'+formatTlt(item.kw,this.tlt),
align:'center',
verticalAlign:'middle',
})
@ -185,24 +181,21 @@ export default {
this.sljhGroup.add(qyGroup)
}
},
initLiLiao(){
new Promise(resolve => {
return resolve(this.dw)
}).then(res=>{
const {container}= liliao(this.width,this.height,res,this.initBaiFang)
initYcldw(){
getYcldw().then(res=>{
this.dw=res.data
const {container,getCurrentDw}= liliao(this.width,this.height,this.dw,this.initBaiFang)
const group=container()
this.ycldwGroup=group
this.layer.add(group)
})
},
initWorkers(){
new Promise(resolve => {
return resolve([
{name:'张三1'},{name:'张三2'},
{name:'张三1'},{name:'张三2'},
])
}).then(res=>{
const {container}=workers(this.width,this.height,res)
getBzryList({resourcesCode:'4KB002'}).then(res=>{
this.workers=res.data
const {container,getCurrentWorker}=workers(this.width,this.height,this.workers)
const group=container()
this.getCurrentWorker=getCurrentWorker
this.layer.add(group)
})
},
@ -220,17 +213,20 @@ export default {
this.layer.add(group)
getSljhPgd().then(res=>{
this.sljhItemList=res.data
this.drawSljhItem(this.sljhItemList)
})
const {layer:sljhLayer,group:sljhGroup}=sljh(this.width,this.height)
this.sljhGroup=sljhGroup
this.drawSljhItem(this.sljhItemList)
this.stage.add(sljhLayer)
this.initWorkers()
this.initLiLiao()
this.initYcldw()
},
}
}

Loading…
Cancel
Save