1.上料增加批量上料功能,批量选择上料计划,然后选择垛位,自动把选中的上料计划进行上料

master
董哲奇 4 months ago
parent 4556a36ebb
commit 8294d78096

@ -112,6 +112,14 @@ export const getPgd=function(data){
}) })
} }
export const shangLiaos=function(data){
return request({
url: '/zyjh/sls',
method: 'post',
data: data
})
}
export const shangLiao=function(data){ export const shangLiao=function(data){
return request({ return request({
url: '/zyjh/sl', url: '/zyjh/sl',

@ -50,7 +50,7 @@ export default {
// },10000) // },10000)
// } // }
let msg let msg
if (data.success&&data.data.deviceId===this.deviceId){ if (data?.success&&data?.data?.deviceId===this.deviceId){
msg=`处理成功` msg=`处理成功`
} }

@ -209,7 +209,6 @@ const baifang=function (option={}) {
} }
function handler(slList){ function handler(slList){
console.log(slList)
slGroup.destroyChildren() slGroup.destroyChildren()
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]

@ -55,6 +55,14 @@ const liliao=function (width,height,dw,callback) {
} }
let selectedShape=null; let selectedShape=null;
const getSelectShape=function (){
return selectedShape
}
const nonSelectShape=function (){
selectedShape.hide()
selectedShape=null
}
const duowei=function (index,item){ const duowei=function (index,item){
const alignSize=3 const alignSize=3
@ -116,6 +124,7 @@ const liliao=function (width,height,dw,callback) {
shape.zIndex(0) shape.zIndex(0)
setSelectShape(shape) setSelectShape(shape)
if (selectIndex===index){ if (selectIndex===index){
selectedShape=shape
shape.show() shape.show()
} }
} }
@ -137,7 +146,7 @@ const liliao=function (width,height,dw,callback) {
} }
return { return {
container,duowei,getCurrentDw container,duowei,getCurrentDw,getSelectShape,nonSelectShape
} }
} }

@ -17,7 +17,7 @@ import workers from "@/views/zyjhzx/sliao/comps/person";
import SliaoSearch from "@/views/zyjhzx/components/SliaoSearch.vue"; import SliaoSearch from "@/views/zyjhzx/components/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 {dict, getBzryByBz, getSljhPgd, getYcldw, shangLiao} from "@/api/zyjh"; import {dict, getBzryByBz, getSljhPgd, getYcldw, shangLiao, shangLiaos} from "@/api/zyjh";
import {getBzryList} from "@/api/sjzx/bzzGL"; import {getBzryList} from "@/api/sjzx/bzzGL";
import TipsComp from "@/views/zyjhzx/components/TipsComp.vue"; import TipsComp from "@/views/zyjhzx/components/TipsComp.vue";
import ZyjhSelectComp from "@/views/zyjhzx/components/SelectComp.vue"; import ZyjhSelectComp from "@/views/zyjhzx/components/SelectComp.vue";
@ -50,6 +50,11 @@ export default {
msg:null, msg:null,
tipsId:null, tipsId:null,
llist:[], llist:[],
selectedJh:[],
plslflag:false,
plslList:[],
getSelectShape:null,
nonSelectShape:null,
} }
}, },
mounted() { mounted() {
@ -143,6 +148,10 @@ export default {
}, },
wsSubscribe(){ wsSubscribe(){
this.sockets.subscribe('slComplete', data => { this.sockets.subscribe('slComplete', data => {
if(this.plslflag){
this.plslList.push(data)
return
}
console.log(data) console.log(data)
if (this.currentDw&&this.currentDw.id===data.dwId) { if (this.currentDw&&this.currentDw.id===data.dwId) {
if (this.slGroup){ if (this.slGroup){
@ -177,7 +186,63 @@ export default {
this.canSl=true this.canSl=true
this.currentDw=dw this.currentDw=dw
this.currentDwIndex=index this.currentDwIndex=index
if (this.selectedJh.length>0){
this.plslflag=true
const jh=[]
this.selectedJh.forEach(item=>{
const data={
ydjh:item,
ydid:item.id,
dwId:dw.id,
ceng:dw.list.length+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,
wlh:item.slwlh,
lph:item.sllph,
nbsbm:item.nbsbm,
bfr:this.getCurrentWorker()?.userCode,
type:'YCL'
}
jh.push(data)
})
shangLiaos(jh).then(res=>{
this.selectedJh=[]
this.plslflag=false
if (!res.success){
this.drawSljhItem(this.sljhItemList.r('0:200'))
return;
}
if (this.slGroup){
this.slGroup.destroyChildren()
}
for (const data of this.plslList) {
if (this.currentDw&&this.currentDw.id===data.dwId) {
this.dw[this.currentDwIndex].list.push(data)
}else {
this.dw[data.dwId].list.push(data)
}
this.sljhItemList.forEach((sljh,index)=>{
if(data.czbh===sljh.dcCh&&data.pl===sljh.dcPl&&data.tlth===sljh.tzbh){
this.$delete(this.sljhItemList, index);
}
})
this.drawSljhItem(this.sljhItemList.r('0:200'))
}
this.drawBaiFang(this.dw[this.currentDwIndex].list)
this.initYcldw();
})
}else{
!!dw&&this.drawBaiFang(dw.list) !!dw&&this.drawBaiFang(dw.list)
}
}, },
initBaiFang(){ initBaiFang(){
const {slGroup,handler,bgGroup:slBgGroup}= baifang({width:this.width,height:this.height}) const {slGroup,handler,bgGroup:slBgGroup}= baifang({width:this.width,height:this.height})
@ -206,6 +271,48 @@ export default {
}) })
qyGroup.setAttr('index',i) qyGroup.setAttr('index',i)
qyGroup.setAttr('item',item) qyGroup.setAttr('item',item)
let selectShape=null
let selectedShape=null;
const setSelectShape=function (shape){
selectShape=shape
}
const _that=this
qyGroup.on('click touchstart',function (){
if (_that.currentDw){
_that.currentDw=null
_that.currentDwIndex=null
_that.nonSelectShape()
}
if (selectedShape){
selectedShape.hide()
selectedShape=null
_that.selectedJh=_that.selectedJh.filter(it=>it.dcCh!==item.dcCh&&it.dcPl!==item.dcPl&&it.tzbh!==item.tzbh)
return;
}
selectedShape=selectShape
selectedShape.show()
_that.selectedJh.push(item)
})
const selectObj = new Image();
selectObj.src = require('@/assets/sliao/selected.png');
selectObj.onload = function () {
const shape = new Konva.Image({
x: itemWith-itemWith*0.30,
y: 4,
width: itemWith*0.25,
height:itemWith*0.25,
image: this,
visible:false
});
qyGroup.add(shape)
shape.zIndex(0)
setSelectShape(shape)
}
this.sljhGroup.add(qyGroup) this.sljhGroup.add(qyGroup)
const imageObj = new Image(); const imageObj = new Image();
@ -534,8 +641,10 @@ 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.initDwInfo) const {container,getCurrentDw,getSelectShape,nonSelectShape}= liliao(this.width,this.height,this.dw,this.initDwInfo)
const group=container() const group=container()
this.getSelectShape=getSelectShape
this.nonSelectShape=nonSelectShape
this.ycldwGroup=group this.ycldwGroup=group
this.layer.add(group) this.layer.add(group)
}) })

Loading…
Cancel
Save