From 8ad014643f26188c16d5571ec520fa266d53de56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Mon, 12 Aug 2024 14:44:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8A=9B=E4=B8=B8=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 2 +- src/router/index.js | 12 +- src/views/sliao/index.vue | 295 ---------- src/views/zyjhzx/pwanfkui/comps/PwanPgd.vue | 26 + .../pwanfkui}/comps/baifang.js | 12 +- .../pwanfkui}/comps/container.js | 0 src/views/zyjhzx/pwanfkui/comps/csd.js | 38 ++ src/views/zyjhzx/pwanfkui/comps/dw.js | 78 +++ src/views/zyjhzx/pwanfkui/comps/person.js | 69 +++ src/views/zyjhzx/pwanfkui/comps/pgd.js | 513 ++++++++++++++++++ src/views/zyjhzx/pwanfkui/comps/pgdTable.js | 46 ++ .../{sliao => zyjhzx/pwanfkui}/comps/title.js | 0 src/views/zyjhzx/pwanfkui/index.vue | 146 +++++ 13 files changed, 934 insertions(+), 303 deletions(-) delete mode 100644 src/views/sliao/index.vue create mode 100644 src/views/zyjhzx/pwanfkui/comps/PwanPgd.vue rename src/views/{sliao => zyjhzx/pwanfkui}/comps/baifang.js (95%) rename src/views/{sliao => zyjhzx/pwanfkui}/comps/container.js (100%) create mode 100644 src/views/zyjhzx/pwanfkui/comps/csd.js create mode 100644 src/views/zyjhzx/pwanfkui/comps/dw.js create mode 100644 src/views/zyjhzx/pwanfkui/comps/person.js create mode 100644 src/views/zyjhzx/pwanfkui/comps/pgd.js create mode 100644 src/views/zyjhzx/pwanfkui/comps/pgdTable.js rename src/views/{sliao => zyjhzx/pwanfkui}/comps/title.js (100%) create mode 100644 src/views/zyjhzx/pwanfkui/index.vue diff --git a/src/permission.js b/src/permission.js index 0f51278..1fd58dc 100644 --- a/src/permission.js +++ b/src/permission.js @@ -8,7 +8,7 @@ import getPageTitle from '@/utils/get-page-title' NProgress.configure({ showSpinner: false }) // NProgress Configuration -const whiteList = ['/menu','/login', '/auth-redirect','/kban','/hbao','/sliao',] // no redirect whitelist +const whiteList = ['/menu','/login', '/auth-redirect','/kban','/hbao','/sliao','/pwpg','/pwamfkui'] // no redirect whitelist export function flatRoutes(routes) { let ret = []; routes.forEach(it => { diff --git a/src/router/index.js b/src/router/index.js index 7aedaef..7f89619 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -60,7 +60,17 @@ export const constantRoutes = [ }, { path: '/sliao', - component: () => import('@/views/sliao/index'), + component: () => import('@/views/zyjhzx/sliao/index'), + hidden: true + }, + { + path: '/pwpg', + component: () => import('@/views/zyjhzx/pwanpgong/index'), + hidden: true + }, + { + path: '/pwfk', + component: () => import('@/views/zyjhzx/pwanfkui/index'), hidden: true }, { diff --git a/src/views/sliao/index.vue b/src/views/sliao/index.vue deleted file mode 100644 index d6dcf73..0000000 --- a/src/views/sliao/index.vue +++ /dev/null @@ -1,295 +0,0 @@ - - - - - diff --git a/src/views/zyjhzx/pwanfkui/comps/PwanPgd.vue b/src/views/zyjhzx/pwanfkui/comps/PwanPgd.vue new file mode 100644 index 0000000..06eb16c --- /dev/null +++ b/src/views/zyjhzx/pwanfkui/comps/PwanPgd.vue @@ -0,0 +1,26 @@ + + + diff --git a/src/views/sliao/comps/baifang.js b/src/views/zyjhzx/pwanfkui/comps/baifang.js similarity index 95% rename from src/views/sliao/comps/baifang.js rename to src/views/zyjhzx/pwanfkui/comps/baifang.js index 6baa563..cd20411 100644 --- a/src/views/sliao/comps/baifang.js +++ b/src/views/zyjhzx/pwanfkui/comps/baifang.js @@ -2,9 +2,9 @@ import Konva from "konva"; const baifang=function (option={}) { const width=option.width,height=option.height,slList=option.dw,image=require('@/assets/gb.png') - const _width=width*0.4-50,_height=height*0.81 + const _width=width*0.25,_height=height*0.67 const container=function (){ - const x=width*0.6+40,y=190 + const x=width*0.30+30,y=300 const group=new Konva.Group({ x:x, @@ -33,7 +33,7 @@ const baifang=function (option={}) { const gangban=function (index,str){ const group=new Konva.Group({ x:0, - y:thatHeight-260-index*40, + y:thatHeight-310-index*40, draggable:true }) @@ -127,7 +127,7 @@ const baifang=function (option={}) { imageObj.src = image; imageObj.onload = function () { const shape = new Konva.Image({ - x: 60, + x: 40, y: 0, width: imgSize, height:40, @@ -135,7 +135,7 @@ const baifang=function (option={}) { }); group.add(shape) const gbText=new Konva.Text({ - x: 60, + x: 40, y: 0, width: imgSize, height:40, @@ -150,7 +150,7 @@ const baifang=function (option={}) { const concent=new Konva.Text({ x: imgSize+60, y: 0, - width: imgSize+40, + width: imgSize-20, height:40, fill:'black', text:'G175K-4,001,2302\n上料:2024/07/01,切割:2024/07/04', diff --git a/src/views/sliao/comps/container.js b/src/views/zyjhzx/pwanfkui/comps/container.js similarity index 100% rename from src/views/sliao/comps/container.js rename to src/views/zyjhzx/pwanfkui/comps/container.js diff --git a/src/views/zyjhzx/pwanfkui/comps/csd.js b/src/views/zyjhzx/pwanfkui/comps/csd.js new file mode 100644 index 0000000..858185b --- /dev/null +++ b/src/views/zyjhzx/pwanfkui/comps/csd.js @@ -0,0 +1,38 @@ +import Konva from "konva"; + +//传送带 +export default function (width,height){ + const x=width*0.55+40,y=45,_width=width*0.1,_height=height*0.945 + const container=new Konva.Group({ + x:x, + y:y, + width:_width, + height:_height + }) + + const rect=new Konva.Rect({ + x:0, + y:0, + width:_width, + height:_height, + stroke:'black', + strokeWidth:1, + }) + + container.add(rect) + + 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 +} diff --git a/src/views/zyjhzx/pwanfkui/comps/dw.js b/src/views/zyjhzx/pwanfkui/comps/dw.js new file mode 100644 index 0000000..4516c4d --- /dev/null +++ b/src/views/zyjhzx/pwanfkui/comps/dw.js @@ -0,0 +1,78 @@ +import Konva from "konva"; + +export default function (width,height,callback){ + console.log(callback) + const x=0,y=0,_width=width*0.16,_height=height*0.67 + + const container=function (){ + const x=width*0.134+30,y=300 + + const group=new Konva.Group({ + x:x, + y:y, + width:_width, + height:_height + }) + + const rect=new Konva.Rect({ + x:0, + y:0, + width:_width, + height:_height, + stroke:'black', + strokeWidth:1, + }) + + group.add(rect) + + return group + } + + const dw=function (index,item=[]){ + + const alignSize=2 + const width=((_width-20)/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 (){ + console.log(item) + callback(index,item.list) + }) + + const rect=new Konva.Rect({ + x:0, + y:0, + width:width, + height:height, + stroke:'black', + strokeWidth:1, + }) + + group.add(rect) + + const text=new Konva.Text({ + x:0, + y:0, + width: width, + height: height, + fill:'black', + text:item.name, + align:'center', + verticalAlign:'middle', + fontSize:20 + }) + group.add(text) + + return group + } + + return { + container,dw + } + +} diff --git a/src/views/zyjhzx/pwanfkui/comps/person.js b/src/views/zyjhzx/pwanfkui/comps/person.js new file mode 100644 index 0000000..99851c2 --- /dev/null +++ b/src/views/zyjhzx/pwanfkui/comps/person.js @@ -0,0 +1,69 @@ +import Konva from "konva"; + +export default function (width,height){ + const _width=width*0.134,_height=height*0.67 + + const container=function (){ + const x=20,y=300 + + const group=new Konva.Group({ + x:x, + y:y, + width:_width, + height:_height + }) + + const rect=new Konva.Rect({ + x:0, + y:0, + width:_width, + height:_height, + stroke:'black', + strokeWidth:1, + }) + + group.add(rect) + + return group + } + + const person=function (index,persons={}){ + const alignSize=2 + const width=(_width-20)/alignSize,height=110 + 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 + }) + + const rect=new Konva.Rect({ + x:0, + y:0, + width:width, + height:height, + stroke:'black', + strokeWidth:1, + }) + group.add(rect) + + const text=new Konva.Text({ + x:0, + y:0, + width:width, + height:height, + text: persons.name, + align: 'center', + verticalAlign:'middle', + fontSize:12 + }) + group.add(text) + + return group + } + + return{ + container,person + } +} diff --git a/src/views/zyjhzx/pwanfkui/comps/pgd.js b/src/views/zyjhzx/pwanfkui/comps/pgd.js new file mode 100644 index 0000000..efd3864 --- /dev/null +++ b/src/views/zyjhzx/pwanfkui/comps/pgd.js @@ -0,0 +1,513 @@ +import Konva from "konva"; +import QRCode from 'qrcode' + +export default function (width,height){ + const x=width*0.66+40,y=45,_width=width*0.30,_height=height*0.945 + + const container=function (){ + const group=new Konva.Group({ + x:x, + y:y, + width:_width, + height:_height + }) + + const rect=new Konva.Rect({ + x:0, + y:0, + width:_width, + height:_height, + stroke:'black', + strokeWidth:1, + }) + + group.add(rect) + return group + } + + const drawGd=function (data){ + // this.layer.destroyChildren(); + + const group=new Konva.Group({ + x:0, + y:0, + width:_width, + height:_height + }) + + const rect=new Konva.Rect({ + x:0, + y:0, + width:_width, + height:_height, + fill:'white' + }) + group.add(rect) + + const title=new Konva.Text({ + x:0, + y:10, + width:_width, + height:35, + lineHeight:1, + stroke:'black', + strokeWidth:1.2, + text:'大连重工大连钢材加工配送有限公司', + align:'center', + fontSize:22, + }) + group.add(title) + + const sgdTitle=new Konva.Text({ + x:0, + y:40, + width:_width, + height:25, + lineHeight:1, + stroke:'black', + strokeWidth:1, + text:'抛丸施工单', + align:'center', + fontSize:20, + }) + group.add(sgdTitle) + + const dhTitle=new Konva.Text({ + x:0, + y:50, + width:_width-48, + height:15, + lineHeight:1, + text:'单号:PW_'+data.gdh, + align:'right', + fontSize:12, + }) + group.add(dhTitle) + + const group0=new Konva.Group({ + x:15, + y:65, + width:_width-60, + height:_width-100, + }) + group.add(group0) + + const group1=drawCzbh(data) + group0.add(group1) + const group2=drawPlAndFd(data) + group0.add(group2) + const group3=drawTzbh(data) + group0.add(group3) + const group4=drawTlt(data) + group0.add(group4) + const group5=drawJs(data) + group0.add(group5) + const group6=drawHb(data) + group0.add(group6) + const group7=drawBz(data) + group0.add(group7) + const group8=drawQz(data) + group0.add(group8) + console.log(data) + generateQRCode(data.gdh,group0) + return group + } + + const drawQz=function (data){ + const group=new Konva.Group({ + x:0, + y:620, + width:(_width-60), + height:30, + }) + + const jsText=new Konva.Text({ + x:5, + y:1, + width:(_width-60), + height:30, + lineHeight:1, + stroke:'black', + strokeWidth:0.8, + text:'负责人:', + fontSize:18, + verticalAlign:'middle' + }) + group.add(jsText) + return group + } + const drawBz=function (data){ + const group=new Konva.Group({ + x:0, + y:440, + width:(_width-60), + height:180, + }) + + const rect=new Konva.Rect({ + x:0, + y:0, + width:(_width-60), + height:180, + stroke:'black', + strokeWidth:1, + }) + group.add(rect) + return group + } + const drawHb=function (data){ + const group=new Konva.Group({ + x:0, + y:410, + width:(_width-60), + height:30, + }) + + const jsRect=new Konva.Rect({ + x:0, + y:0, + width:(_width-60), + height:30, + stroke:'black', + strokeWidth:1, + }) + group.add(jsRect) + + const jsText=new Konva.Text({ + x:0, + y:0, + width:(_width-60), + height:30, + lineHeight:1, + stroke:'black', + strokeWidth:0.8, + text:'回报', + fontSize:18, + align:'center', + verticalAlign:'middle' + }) + group.add(jsText) + + const plRect=new Konva.Rect({ + x:0, + y:30, + width:(_width-60), + height:30, + stroke:'black', + strokeWidth:1, + }) + group.add(plRect) + + const plText=new Konva.Text({ + x:0, + y:30, + width:(_width-60)/2, + height:30, + lineHeight:1, + stroke:'black', + strokeWidth:0.8, + text:data.jsr, + fontSize:18, + align:'center', + verticalAlign:'middle' + }) + + const fdRect=new Konva.Rect({ + x:(_width-60)/2, + y:30, + width:(_width-60)/2, + height:30, + stroke:'black', + strokeWidth:1, + }) + group.add(fdRect) + + const fdText=new Konva.Text({ + x:(_width-60)/2, + y:30, + width:(_width-60)/2, + height:30, + lineHeight:1, + stroke:'black', + strokeWidth:0.8, + text:data.jssj, + fontSize:18, + align:'center', + verticalAlign:'middle' + }) + group.add(fdText) + + group.add(plText) + + return group + } + const drawJs=function (data){ + const group=new Konva.Group({ + x:0, + y:350, + width:(_width-60), + height:30, + }) + + const jsRect=new Konva.Rect({ + x:0, + y:0, + width:(_width-60), + height:30, + stroke:'black', + strokeWidth:1, + }) + group.add(jsRect) + + const jsText=new Konva.Text({ + x:0, + y:0, + width:(_width-60), + height:30, + lineHeight:1, + stroke:'black', + strokeWidth:0.8, + text:'接收', + fontSize:18, + align:'center', + verticalAlign:'middle' + }) + group.add(jsText) + + const plRect=new Konva.Rect({ + x:0, + y:30, + width:(_width-60), + height:30, + stroke:'black', + strokeWidth:1, + }) + group.add(plRect) + + const plText=new Konva.Text({ + x:0, + y:30, + width:(_width-60)/2, + height:30, + lineHeight:1, + stroke:'black', + strokeWidth:0.8, + text:data.jsr, + fontSize:18, + align:'center', + verticalAlign:'middle' + }) + + const fdRect=new Konva.Rect({ + x:(_width-60)/2, + y:30, + width:(_width-60)/2, + height:30, + stroke:'black', + strokeWidth:1, + }) + group.add(fdRect) + + const fdText=new Konva.Text({ + x:(_width-60)/2, + y:30, + width:(_width-60)/2, + height:30, + lineHeight:1, + stroke:'black', + strokeWidth:0.8, + text:data.jssj, + fontSize:18, + align:'center', + verticalAlign:'middle' + }) + group.add(fdText) + + group.add(plText) + + return group + } + const drawTlt=function (data){ + const group=new Konva.Group({ + x:0, + y:150, + width:(_width-60), + height:200, + }) + + const rect=new Konva.Rect({ + x:0, + y:0, + width:(_width-60), + height:200, + stroke:'black', + strokeWidth:1, + }) + group.add(rect) + return group + } + const drawTzbh=function (data){ + const group=new Konva.Group({ + x:0, + y:120, + width:(_width-60), + height:30, + }) + + const rect=new Konva.Rect({ + x:0, + y:0, + width:(_width-60), + height:30, + stroke:'black', + strokeWidth:1, + }) + group.add(rect) + + const text=new Konva.Text({ + x:0, + y:0, + width:(_width-60), + height:30, + lineHeight:1, + stroke:'black', + strokeWidth:0.8, + text:data.tzbh, + fontSize:18, + align:'center', + verticalAlign:'middle' + }) + group.add(text) + return group + } + const drawPlAndFd=function (data){ + const group=new Konva.Group({ + x:0, + y:60, + width:(_width-188), + height:60, + }) + + const plRect=new Konva.Rect({ + x:0, + y:0, + width:(_width-188)/2, + height:60, + stroke:'black', + strokeWidth:1, + }) + group.add(plRect) + + const plText=new Konva.Text({ + x:0, + y:0, + width:(_width-188)/2, + height:60, + lineHeight:1, + stroke:'black', + strokeWidth:0.8, + text:'批量:'+data.dcPl, + fontSize:18, + align:'center', + verticalAlign:'middle' + }) + group.add(plText) + + const fdRect=new Konva.Rect({ + x:(_width-188)/2, + y:0, + width:(_width-188)/2, + height:60, + stroke:'black', + strokeWidth:1, + }) + group.add(fdRect) + + const fdText=new Konva.Text({ + x:(_width-188)/2, + y:0, + width:(-width-188)/2, + height:60, + lineHeight:1, + stroke:'black', + strokeWidth:0.8, + text:'分段:'+data.dcFd, + fontSize:18, + align:'center', + verticalAlign:'middle' + }) + group.add(fdText) + + + return group + } + const drawCzbh=function (data){ + const czbhGroup=new Konva.Group({ + x:0, + y:0, + width:(_width-188), + height:60, + }) + + const czbhRect=new Konva.Rect({ + x:0, + y:0, + width:(_width-188), + height:60, + stroke:'black', + strokeWidth:1, + }) + czbhGroup.add(czbhRect) + + const czbhText=new Konva.Text({ + x:0, + y:0, + width:(_width-188), + height:60, + lineHeight:1, + stroke:'black', + strokeWidth:0.8, + text:'船号:'+data.dcCh, + fontSize:18, + align:'center', + verticalAlign:'middle' + }) + czbhGroup.add(czbhText) + return czbhGroup + } + const generateQRCode=function (text,group) { + const imgSize=118 + const rect=new Konva.Rect({ + x:385, + y:0, + width:128.7, + height:120, + stroke:'black', + strokeWidth:1, + }) + group.add(rect) + QRCode.toDataURL(text,{width:600,height:600,margin:1}) + .then(url => { + const imageObj = new Image(); + imageObj.src = url; + imageObj.onload = function () { + + const shape = new Konva.Image({ + x: 390, + y: 1, + width: imgSize, + height: imgSize, + image: imageObj, + }); + group.add(shape) + } + + }).catch(err => { + console.error(err); + }); + } + + return { + container,drawGd + } +} diff --git a/src/views/zyjhzx/pwanfkui/comps/pgdTable.js b/src/views/zyjhzx/pwanfkui/comps/pgdTable.js new file mode 100644 index 0000000..4d162c0 --- /dev/null +++ b/src/views/zyjhzx/pwanfkui/comps/pgdTable.js @@ -0,0 +1,46 @@ + +export default function () { + const options={ + height:250, + align:'center', + border: true, + resizable: true, + keepSource:true, + size:'mini', + showOverflow: true, + scrollY:{enable:true}, + data:[ + {dcCh:'G175K-6',gdh:'20240812101',dcPl:'002',dcFd:'2302','tzbh':'1231232'} + ] + } + const gdhFormat=function ({cellValue}){ + if (cellValue){ + return 'PW'+cellValue + } + return '' + } + const columns = [ + { type: 'checkbox', width: 40 }, + { type: 'seq',title:'序号', width: 60 }, + { field: 'gdh',title:'派工单号', width: 120,formatter: gdhFormat}, + {field: '', title: '抛丸位置', width: 80}, + {field: '', title: '垛位', width: 60}, + {field: '', title: '层数', width: 60}, + {field: 'dcCh', title: '船号', width: 80}, + {field: 'dcPl', title: '批量', width: 80}, + {field: '', title: '材质', width: 80}, + {field: '', title: '规格', width: 100}, + {field: '', title: '炉批号', width: 100}, + {field: 'tzbh', title: '套料图号', width: 100}, + {field: '', title: '接收人', width: 80}, + {field: '', title: '接收时间', width: 100}, + {field: '', title: '反馈人', width: 80}, + {field: '', title: '反馈时间', width: 100}, + {field: '', title: '状态', width: 60}, + ] + + return { + options, + columns, + } +} diff --git a/src/views/sliao/comps/title.js b/src/views/zyjhzx/pwanfkui/comps/title.js similarity index 100% rename from src/views/sliao/comps/title.js rename to src/views/zyjhzx/pwanfkui/comps/title.js diff --git a/src/views/zyjhzx/pwanfkui/index.vue b/src/views/zyjhzx/pwanfkui/index.vue new file mode 100644 index 0000000..909ef29 --- /dev/null +++ b/src/views/zyjhzx/pwanfkui/index.vue @@ -0,0 +1,146 @@ + + + + +