1.增加上料计划查询条件

master
董哲奇 8 months ago
parent 3ce6bfd17f
commit 994d6b1bef

@ -16,10 +16,11 @@ export const shangLiao=function(data){
}) })
} }
export const getSljhPgd=function(){ export const getSljhPgd=function(data={}){
return request({ return request({
url: '/zyjh/sljh', url: '/zyjh/sljh',
method: 'post', method: 'post',
data:data
}) })
} }

@ -27,6 +27,9 @@ export default {
search(){ search(){
this.queryParam.dcCh=this.$refs.projectSelectRef.getDcch() this.queryParam.dcCh=this.$refs.projectSelectRef.getDcch()
this.$emit('search',this.queryParam) this.$emit('search',this.queryParam)
},
getQueryParam(){
return this.queryParam
} }
} }
} }

@ -87,9 +87,6 @@ const baifang=function (option={}) {
child.move({ child.move({
y:dir y:dir
}) })
const item=child.getAttr('item')
item.ceng+=dir>0?1:-1
child.setAttr('item',item)
const movedIndex=movedList.indexOf(child) const movedIndex=movedList.indexOf(child)
if (movedIndex===-1){ if (movedIndex===-1){
movedList.push(child) movedList.push(child)
@ -108,25 +105,35 @@ const baifang=function (option={}) {
group.on('dragend',function (){ group.on('dragend',function (){
const index=this.getAttr('index') const index=this.getAttr('index')
const item=this.getAttr('item') const item=this.getAttr('item')
const mList=[]
for (const it of movedList) {
mList.push(it.getAttr('item'))
}
console.log(mList)
const data={ const data={
id:item.id, id:item.id,
lastCeng:item.ceng, lastCeng:item.ceng,
lastDuo:item.dwId, lastDuo:item.dwId,
ceng:_index, ceng:_index,
duo:item.dwId, duo:item.dwId,
movedList:movedList movedList:mList
} }
daoduo(data).then(res=>{ const element = slList.splice(index-1, 1)[0];
if (res.success){ slList.splice(_index-1, 0, element);
const element = slList.splice(index-1, 1)[0]; this.setAttr('index',_index)
slList.splice(_index-1, 0, element); _index=0
this.setAttr('index',_index) handler(slList)
_index=0 // daoduo(data).then(res=>{
handler(slList) // if (res.success){
}else { // const element = slList.splice(index-1, 1)[0];
// slList.splice(_index-1, 0, element);
} // this.setAttr('index',_index)
}) // _index=0
// handler(slList)
// }else {
//
// }
// })
}) })
const indexRect=new Konva.Rect({ const indexRect=new Konva.Rect({

@ -7,9 +7,11 @@ const container=function (width=0,height=0,container){
height: height, height: height,
}); });
const layer = new Konva.Layer(); const layer = new Konva.Layer({
id:"1"
});
stage.add(layer) stage.add(layer)
layer.draw(); // layer.draw();
return { return {
stage,layer stage,layer

@ -1,20 +1,22 @@
import Konva from "konva"; import Konva from "konva";
let _width=0,_height=0
export const sljh=function (width,height){ export const sljh=function (width,height){
_width=width const layer=new Konva.Layer({
_height=height id:'2',
const layer=new Konva.Layer()
layer.draw()
const group=new Konva.Group({
x:15, x:15,
y:65, y:65,
})
layer.clipFunc(function(ctx) {
ctx.rect(0, 0, width-30, height*0.2-60);
});
//layer.draw()
const group=new Konva.Group({
x:0,
y:0,
width: width-30, width: width-30,
height: height*0.2-60, height: height*0.2-60,
stroke:'blue',
strokeWidth:1,
draggable: true, draggable: true,
dragBoundFunc:function (pos){ dragBoundFunc:function (pos){
return { return {

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div id="sliao" class="sliao" ref="sliao"></div> <div id="sliao" class="sliao" ref="sliao"></div>
<SliaoSearch @search="search" /> <SliaoSearch ref="sliaoSearch" @search="search" />
</div> </div>
</template> </template>
@ -64,7 +64,10 @@ export default {
}) })
}, },
search(queryParam){ search(queryParam){
console.log(queryParam) getSljhPgd(queryParam).then(res=>{
this.sljhItemList=res.data
this.drawSljhItem(this.sljhItemList)
})
}, },
initBaiFang(index,dw){ initBaiFang(index,dw){
if (this.slGroup){ if (this.slGroup){
@ -79,6 +82,9 @@ export default {
this.layer.add(slGroup) this.layer.add(slGroup)
}, },
drawSljhItem(list){ drawSljhItem(list){
if (this.sljhGroup){
this.sljhGroup.destroyChildren()
}
const itemWith=85; const itemWith=85;
const itemHeight=108 const itemHeight=108
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
@ -231,10 +237,7 @@ export default {
this.layer.add(group) this.layer.add(group)
getSljhPgd().then(res=>{ this.search(this.$refs.sliaoSearch.getQueryParam())
this.sljhItemList=res.data
this.drawSljhItem(this.sljhItemList)
})
const {layer:sljhLayer,group:sljhGroup}=sljh(this.width,this.height) const {layer:sljhLayer,group:sljhGroup}=sljh(this.width,this.height)
this.sljhGroup=sljhGroup this.sljhGroup=sljhGroup

Loading…
Cancel
Save