parent
a473fafbb2
commit
048a451e6e
@ -0,0 +1,80 @@
|
|||||||
|
<template>
|
||||||
|
<div id="searchPl" ref="searchPl">
|
||||||
|
<ProjectSelect ref="projectSelectRef" :_style="{width:'115px'}"/>
|
||||||
|
<VxeInput v-model="queryParam.dcPl" placeholder="请输入批量"/>
|
||||||
|
<VxeInput v-if="kwShow" v-model="queryParam.kw" placeholder="请输入跨位"/>
|
||||||
|
<VxeButton status="primary" content="查询" @click="search" />
|
||||||
|
<VxeSelect v-if="ljbs" v-model="gylxSelectData" ref="gylxSelectRef" :options="gylx" placeholder="选择工艺路线"/>
|
||||||
|
<VxeSelect v-if="ljbs" v-model="worker.pscry" ref="pkSelectRef" :options="sgry" placeholder="坡口施工"/>
|
||||||
|
<VxeSelect v-if="ljbs" v-model="worker.qscry" ref="qmSelectRef" :options="sgry" placeholder="曲面施工"/>
|
||||||
|
<VxeSelect v-if="ljbs" v-model="worker.dscry" ref="dmSelectRef" :options="sgry" placeholder="打磨施工"/>
|
||||||
|
<VxeButton v-if="ljbs" status="primary" content="批量" @click="plGylx" />
|
||||||
|
<VxeButton v-if="ljbs" status="success" content="派工" @click="paigong" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import ProjectSelect from "@/components/ProjectSelect/index.vue";
|
||||||
|
import {startLoading} from "@/utils";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name:'SliaoSearch',
|
||||||
|
components:{ProjectSelect},
|
||||||
|
props:{
|
||||||
|
workers:{
|
||||||
|
type:Array,
|
||||||
|
default:[]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
sgry:[],
|
||||||
|
worker:{
|
||||||
|
pscry:'',
|
||||||
|
qscry:'',
|
||||||
|
dscry:'',
|
||||||
|
},
|
||||||
|
kwShow:true,
|
||||||
|
ljbs:false,
|
||||||
|
queryParam:{
|
||||||
|
zt:'11',
|
||||||
|
dcCh:'',
|
||||||
|
dcPl:'',
|
||||||
|
dcFd:'',
|
||||||
|
},
|
||||||
|
gylxSelectData:'',
|
||||||
|
gylx:[
|
||||||
|
{label:'坡口->曲面',value:['pkbs','qbs']},
|
||||||
|
{label:'坡口->曲面->打磨',value:['pkbs','qbs','dmbs']},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created(){
|
||||||
|
const path=this.$route.path.replace('/','')
|
||||||
|
if (path==='ljian'){
|
||||||
|
this.ljbs=true
|
||||||
|
}
|
||||||
|
this.sgry=this.$props.workers.map(item=>{
|
||||||
|
return {label:item.userName,value:item.userCode}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
plGylx(){
|
||||||
|
this.$emit('plGylx',this.gylxSelectData,this.worker)
|
||||||
|
},
|
||||||
|
paigong(){
|
||||||
|
this.$emit('paigong')
|
||||||
|
},
|
||||||
|
search(){
|
||||||
|
this.queryParam.dcCh=this.$refs.projectSelectRef.getDcch()
|
||||||
|
this.$emit('search',this.queryParam)
|
||||||
|
},
|
||||||
|
getQueryParam(){
|
||||||
|
return this.queryParam
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -1,48 +0,0 @@
|
|||||||
<template>
|
|
||||||
<VxeGrid ref="hxPgd" v-bind="gridOptions" @cell-click="cellClick" @current-change="getCurrentData" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import paoWanPgdConfig from './pgdTable'
|
|
||||||
import {getDw, getPgd} from "@/api/zyjh";
|
|
||||||
export default {
|
|
||||||
name:'HxianPgd',
|
|
||||||
props:{
|
|
||||||
workers:{
|
|
||||||
type:Array,
|
|
||||||
default:[]
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data(){
|
|
||||||
return{
|
|
||||||
gridOptions:{},
|
|
||||||
list:{},
|
|
||||||
setExt:null,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created(){
|
|
||||||
const {options,columns,setExt}=paoWanPgdConfig()
|
|
||||||
this.setExt=setExt
|
|
||||||
this.gridOptions=options
|
|
||||||
this.gridOptions.columns=columns
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
initData(worker,zt){
|
|
||||||
getDw({type:'llj'}).then(res=>{
|
|
||||||
this.gridOptions.ycldw=res.data
|
|
||||||
})
|
|
||||||
getPgd({user:worker,zt:zt,field:'hxry'}).then(res=>{
|
|
||||||
this.gridOptions.data=res.data
|
|
||||||
this.setExt('workers',this.$props.workers)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCurrentData(){
|
|
||||||
const data= this.$refs.hxPgd.getCurrentRecord()
|
|
||||||
window.localStorage.setItem("hxfk",JSON.stringify(data))
|
|
||||||
},
|
|
||||||
cellClick({row}){
|
|
||||||
this.$emit('initPgd',row)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -0,0 +1,114 @@
|
|||||||
|
<template>
|
||||||
|
<VxeGrid ref="ljpgd" v-bind="gridOptions" @cell-click="cellClick" @current-change="getCurrentData" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import paoWanPgdConfig from './pgdTable'
|
||||||
|
import {ljpg} from "@/api/jhzxgl/pgd";
|
||||||
|
import {endLoading, startLoading} from "@/utils";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name:'LjianPgd',
|
||||||
|
props:{
|
||||||
|
worker:{
|
||||||
|
type:Object,
|
||||||
|
default: {}
|
||||||
|
},
|
||||||
|
workers:{
|
||||||
|
type:Array,
|
||||||
|
default:[]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
gridOptions:{},
|
||||||
|
list:{},
|
||||||
|
setExt:null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created(){
|
||||||
|
this.$store.dispatch('page/handler', true)
|
||||||
|
const {options,columns,setExt}=paoWanPgdConfig()
|
||||||
|
this.setExt=setExt
|
||||||
|
this.gridOptions=options
|
||||||
|
this.gridOptions.columns=columns
|
||||||
|
console.log(this.$props.workers)
|
||||||
|
this.setExt("workers",this.$props.workers)
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
plGylx(gylx,worker){
|
||||||
|
if (!gylx){
|
||||||
|
this.$message.warning('请选择工艺路线')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const data=this.$refs.ljpgd.getCheckboxRecords()
|
||||||
|
if (data.length===0){
|
||||||
|
this.$message.warning('工单未选择')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
data.forEach(item=>{
|
||||||
|
gylx.forEach(gy=>{
|
||||||
|
item[gy]='Y'
|
||||||
|
})
|
||||||
|
item.pscry=worker.pscry
|
||||||
|
item.qscry=worker.qscry
|
||||||
|
item.dscry=worker.dscry
|
||||||
|
})
|
||||||
|
},
|
||||||
|
paigong(worker){
|
||||||
|
const data=this.$refs.ljpgd.getCheckboxRecords()
|
||||||
|
if (data.length===0){
|
||||||
|
this.$message.warning('请选择需要派工的工单')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (const item of data) {
|
||||||
|
if (item.pkbs&&!item.pscry){
|
||||||
|
this.$message.warning('坡口施工人员未安排')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (item.qbs&&!item.qscry){
|
||||||
|
this.$message.warning('曲面施工人员未安排')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (item.dmbs&&!item.dscry){
|
||||||
|
this.$message.warning('打磨施工人员未安排')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const pgData=data//.filter(item=>this.isAllNotEmpty(item.dmry,item.pkry,item.qjgry,item.pkbs,item.qbs,item.dmbs))
|
||||||
|
.map(item=>{
|
||||||
|
const data={
|
||||||
|
id:item.id,
|
||||||
|
dscry:item.dscry,pscry:item.pscry,qscry:item.qscry,
|
||||||
|
pkbs:item.pkbs,qbs:item.qbs,dmbs:item.dmbs
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
})
|
||||||
|
startLoading()
|
||||||
|
ljpg(pgData).then(res=>{
|
||||||
|
if (res.success){
|
||||||
|
this.$message.warning('成功')
|
||||||
|
this.$emit('search')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
isAllNotEmpty(...data){
|
||||||
|
|
||||||
|
},
|
||||||
|
initData(data){
|
||||||
|
// this.gridOptions.data=data
|
||||||
|
this.$refs.ljpgd.reloadData(data)
|
||||||
|
setTimeout(()=>{
|
||||||
|
endLoading()
|
||||||
|
},2000)
|
||||||
|
},
|
||||||
|
getCurrentData(){
|
||||||
|
const data= this.$refs.ljpgd.getCheckboxRecords()
|
||||||
|
window.localStorage.setItem("ljfk",JSON.stringify(data))
|
||||||
|
},
|
||||||
|
cellClick({row}){
|
||||||
|
this.$emit('initPgd',row)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -1,276 +0,0 @@
|
|||||||
import Konva from "konva";
|
|
||||||
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=width*0.32,_height=height*0.713
|
|
||||||
const x=width*0.16+25,y=260
|
|
||||||
const bg=function (){
|
|
||||||
const group=new Konva.Group({
|
|
||||||
x:x,
|
|
||||||
y:y,
|
|
||||||
width:_width,
|
|
||||||
height:_height
|
|
||||||
})
|
|
||||||
|
|
||||||
const imageObj = new Image();
|
|
||||||
imageObj.src = require('@/assets/sliao/personbg.png');
|
|
||||||
imageObj.onload = function () {
|
|
||||||
const shape = new Konva.Image({
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
width: _width,
|
|
||||||
height:_height,
|
|
||||||
image: this,
|
|
||||||
});
|
|
||||||
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
|
|
||||||
})
|
|
||||||
|
|
||||||
group.setAttr('index',index)
|
|
||||||
group.setAttr('item',item)
|
|
||||||
|
|
||||||
slGroup.add(group)
|
|
||||||
const {x}=group.absolutePosition()
|
|
||||||
group.dragBoundFunc(function (pos){
|
|
||||||
return {
|
|
||||||
x:x,
|
|
||||||
y:pos.y
|
|
||||||
}
|
|
||||||
})
|
|
||||||
let _index=0
|
|
||||||
let touchingFlag=false;
|
|
||||||
group.on('mousedown touchstart',function (evt){
|
|
||||||
const layer=this.parent.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-50)
|
|
||||||
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==='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){
|
|
||||||
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()
|
|
||||||
that.visible(true)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (zyjh.dcCh!==info.czbh&&zyjh.dcPl!==info.pl&&zyjh.dcFd!==info.fd&&zyjh.tzbh!==info.tlth){
|
|
||||||
VXETable.modal.message({content: '板材与工单未对应', status: 'warning'})
|
|
||||||
this.remove()
|
|
||||||
that.visible(true)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
zx({
|
|
||||||
field:'hxfkrq',
|
|
||||||
zxZtName:'HXFK',
|
|
||||||
list:[{
|
|
||||||
id:zyjh.id,
|
|
||||||
hxfkry: worker.userCode
|
|
||||||
}],
|
|
||||||
ycldwInfo:info
|
|
||||||
}).then(res=>{
|
|
||||||
if (res.success){
|
|
||||||
window.localStorage.removeItem('hxfk')
|
|
||||||
this.remove()
|
|
||||||
that.remove()
|
|
||||||
}else{
|
|
||||||
this.remove()
|
|
||||||
that.visible(true)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
this.remove()
|
|
||||||
that.visible(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.visible(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},500)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
group.on('mouseup touchend',function (){
|
|
||||||
touchingFlag=false
|
|
||||||
})
|
|
||||||
|
|
||||||
group.on('dragstart',function (){
|
|
||||||
const {x,y}=this.absolutePosition()
|
|
||||||
this.startPos={
|
|
||||||
x:x,
|
|
||||||
y:y
|
|
||||||
}
|
|
||||||
})
|
|
||||||
group.on('dragmove',function (){
|
|
||||||
if(_index===0){
|
|
||||||
_index=this.getAttr('index')
|
|
||||||
}
|
|
||||||
this.zIndex(7)
|
|
||||||
const {y:thisY}=this.absolutePosition()
|
|
||||||
|
|
||||||
const dir=thisY-this.startPos.y>0?-40:40
|
|
||||||
|
|
||||||
const children=slGroup.children
|
|
||||||
|
|
||||||
for (const child of children) {
|
|
||||||
if (child===this){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const {y:thatY}=child.absolutePosition()
|
|
||||||
const moveDir=child.getAttr('moveDir')||0
|
|
||||||
if (thisY>=thatY&&thisY<=thatY+40&&moveDir!==dir){
|
|
||||||
child.setAttr('moveDir',dir);
|
|
||||||
_index+=dir>0?1:-1
|
|
||||||
child.move({
|
|
||||||
y:dir
|
|
||||||
})
|
|
||||||
this.startPos={
|
|
||||||
x:x,
|
|
||||||
y:thisY
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
group.on('dragend',function (){
|
|
||||||
const index=this.getAttr('index')
|
|
||||||
const element = currSlist.splice(index-1, 1)[0];
|
|
||||||
currSlist.splice(_index-1, 0, element);
|
|
||||||
this.setAttr('index',_index)
|
|
||||||
_index=0
|
|
||||||
slGroup.destroyChildren()
|
|
||||||
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,
|
|
||||||
width:40,
|
|
||||||
height:40,
|
|
||||||
fill:'black',
|
|
||||||
text:index,
|
|
||||||
align:'center',
|
|
||||||
verticalAlign:'middle',
|
|
||||||
})
|
|
||||||
group.add(indexText)
|
|
||||||
|
|
||||||
//层 规格,套料图 船号,上料日期,计划切割日期
|
|
||||||
const imageObj = new Image();
|
|
||||||
const imgSize=200
|
|
||||||
imageObj.src = image;
|
|
||||||
imageObj.onload = function () {
|
|
||||||
const shape = new Konva.Image({
|
|
||||||
x: 40,
|
|
||||||
y: 0,
|
|
||||||
width: imgSize,
|
|
||||||
height:40,
|
|
||||||
image: imageObj,
|
|
||||||
});
|
|
||||||
group.add(shape)
|
|
||||||
const gbText=new Konva.Text({
|
|
||||||
x: 40,
|
|
||||||
y: 0,
|
|
||||||
width: imgSize,
|
|
||||||
height:40,
|
|
||||||
fill:'black',
|
|
||||||
text:`${item.wph||''},${item.wpgg}`,
|
|
||||||
align:'center',
|
|
||||||
verticalAlign:'middle',
|
|
||||||
})
|
|
||||||
group.add(gbText)
|
|
||||||
}
|
|
||||||
|
|
||||||
const concent=new Konva.Text({
|
|
||||||
x: imgSize+60,
|
|
||||||
y: 0,
|
|
||||||
width: imgSize-20,
|
|
||||||
height:40,
|
|
||||||
fill:'black',
|
|
||||||
text:`${item.czbh},${item.pl},${item.fd}\n上料:${item.bfrq||''},切割:${item.qgjhrq||''}`,
|
|
||||||
align:'center',
|
|
||||||
verticalAlign:'middle',
|
|
||||||
})
|
|
||||||
group.add(concent)
|
|
||||||
|
|
||||||
return group
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
|
||||||
slGroup.add(_group)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
container,slGroup,handler,bgGroup
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default baifang
|
|
@ -1,156 +0,0 @@
|
|||||||
import Konva from "konva";
|
|
||||||
|
|
||||||
export default function (width,height,callback){
|
|
||||||
const _width=width*0.08,_height=height*0.73
|
|
||||||
|
|
||||||
const container=function (){
|
|
||||||
const x=width*0.08+20,y=260
|
|
||||||
|
|
||||||
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.969);
|
|
||||||
});
|
|
||||||
|
|
||||||
const imageObj = new Image();
|
|
||||||
imageObj.src = require('@/assets/sliao/personbg.png');
|
|
||||||
imageObj.onload = function () {
|
|
||||||
const shape = new Konva.Image({
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
width: _width,
|
|
||||||
height:_height*0.975,
|
|
||||||
image: this,
|
|
||||||
});
|
|
||||||
bgGroup.add(shape)
|
|
||||||
shape.zIndex(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
return {bgGroup,group}
|
|
||||||
}
|
|
||||||
|
|
||||||
let selectedShape=null;
|
|
||||||
const dw=function (index,item=[]){
|
|
||||||
|
|
||||||
const alignSize=1
|
|
||||||
const width=((_width-5)/alignSize),height=150
|
|
||||||
const x=index%alignSize*width+index%alignSize*10+5,y=height*(Math.floor(index/alignSize))+(Math.floor(index/alignSize)+1)*10
|
|
||||||
const group=new Konva.Group({
|
|
||||||
x:x,
|
|
||||||
y:y,
|
|
||||||
width:width,
|
|
||||||
height:height
|
|
||||||
})
|
|
||||||
group.on('click touchstart',function (){
|
|
||||||
if (selectedShape){
|
|
||||||
selectedShape.hide()
|
|
||||||
if (selectedShape===selectShape){
|
|
||||||
selectedShape=null
|
|
||||||
callback(null,null)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
selectedShape=selectShape
|
|
||||||
selectedShape.show()
|
|
||||||
callback(index,item)
|
|
||||||
})
|
|
||||||
|
|
||||||
const bgObj = new Image();
|
|
||||||
bgObj.src = require('@/assets/sliao/personbg1.png');
|
|
||||||
bgObj.onload = function () {
|
|
||||||
const shape = new Konva.Image({
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
offsetX:4,
|
|
||||||
width: width,
|
|
||||||
height:height,
|
|
||||||
image: this,
|
|
||||||
});
|
|
||||||
group.add(shape)
|
|
||||||
shape.zIndex(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectObj = new Image();
|
|
||||||
selectObj.src = require('@/assets/sliao/selected.png');
|
|
||||||
let selectShape=null
|
|
||||||
const setSelectShape=function (shape){
|
|
||||||
selectShape=shape
|
|
||||||
}
|
|
||||||
selectObj.onload = function () {
|
|
||||||
const shape = new Konva.Image({
|
|
||||||
x: width-width*0.31,
|
|
||||||
y: 4,
|
|
||||||
width: width*0.25,
|
|
||||||
height:width*0.25,
|
|
||||||
image: this,
|
|
||||||
visible:false
|
|
||||||
});
|
|
||||||
group.add(shape)
|
|
||||||
shape.zIndex(0)
|
|
||||||
setSelectShape(shape)
|
|
||||||
}
|
|
||||||
|
|
||||||
const formatName=()=>{
|
|
||||||
for (const it of qgkw) {
|
|
||||||
if (it.bm===item.tzbh){
|
|
||||||
return it.bmsm
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const text=new Konva.Text({
|
|
||||||
x:0,
|
|
||||||
y:0,
|
|
||||||
width: width,
|
|
||||||
height: height,
|
|
||||||
fill:'black',
|
|
||||||
text:`${formatName()}\n${item.list.length}张`,
|
|
||||||
align:'center',
|
|
||||||
verticalAlign:'middle',
|
|
||||||
fontSize:14
|
|
||||||
})
|
|
||||||
group.add(text)
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
import Konva from "konva";
|
|
||||||
|
|
||||||
export default function (width,height){
|
|
||||||
const x=width*0.495,y=260,_width=width*0.186,_height=height*0.713
|
|
||||||
const container=new Konva.Group({
|
|
||||||
id:'sb',
|
|
||||||
x:x,
|
|
||||||
y:y,
|
|
||||||
width:_width,
|
|
||||||
height:_height
|
|
||||||
})
|
|
||||||
|
|
||||||
const imageObj = new Image();
|
|
||||||
imageObj.src = require('@/assets/sliao/personbg.png');
|
|
||||||
imageObj.onload = function () {
|
|
||||||
const shape = new Konva.Image({
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
width: _width,
|
|
||||||
height:_height,
|
|
||||||
image: this,
|
|
||||||
});
|
|
||||||
container.add(shape)
|
|
||||||
shape.zIndex(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
const text=new Konva.Text({
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
width: _width,
|
|
||||||
height:_height,
|
|
||||||
fill:'black',
|
|
||||||
text:'划线设备',
|
|
||||||
align:'center',
|
|
||||||
verticalAlign:'middle',
|
|
||||||
})
|
|
||||||
|
|
||||||
container.add(text)
|
|
||||||
|
|
||||||
return container
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="searchPl" ref="searchPl">
|
|
||||||
<ProjectSelect ref="projectSelectRef" :_style="{width:'115px'}"/>
|
|
||||||
<VxeInput v-model="queryParam.dcPl" placeholder="请输入批量"/>
|
|
||||||
<VxeInput v-model="queryParam.kw" placeholder="请输入跨位"/>
|
|
||||||
<VxeButton status="primary" content="查询" @click="search" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import ProjectSelect from "@/components/ProjectSelect/index.vue";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name:'SliaoSearch',
|
|
||||||
components:{ProjectSelect},
|
|
||||||
data(){
|
|
||||||
return{
|
|
||||||
queryParam:{
|
|
||||||
zt:'11',
|
|
||||||
dcCh:'',
|
|
||||||
dcPl:'',
|
|
||||||
dcFd:'',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
search(){
|
|
||||||
this.queryParam.dcCh=this.$refs.projectSelectRef.getDcch()
|
|
||||||
this.$emit('search',this.queryParam)
|
|
||||||
},
|
|
||||||
getQueryParam(){
|
|
||||||
return this.queryParam
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
Loading…
Reference in new issue