|
|
|
@ -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()
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|