1.调整抛丸派工逻辑,根据垛位点击后勾选派工,派工完成导出excel供抛丸使用

2.修改生产环境语音ws服务地址
master
董哲奇 7 months ago
parent eae2d8e3be
commit 72e7885f43

@ -1,5 +1,12 @@
import request from '@/utils/request'
export const pwpg=function(data){
return request({
url: '/zyjh/pwpg',
method: 'post',
data: data
})
}
export function pdfList(params) {
return request({

@ -0,0 +1,2 @@
import Vue from 'vue'
export const EventBus = new Vue()

@ -40,6 +40,7 @@ export default {
const tmpList=this.list.filter(item=>item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber)
if (tmpList.length>1){
this.list=tmpList
this.gridOptions.data=tmpList
this.$message.warning('短号有重复,请使用全工单号重新派工!!!')
return
}

@ -50,6 +50,7 @@ export default {
const tmpList=this.list.filter(item=>item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber)
if (tmpList.length>1){
this.list=tmpList
this.gridOptions.data=tmpList
this.$message.warning('短号有重复,请使用全工单号重新派工!!!')
return
}

@ -1,11 +1,12 @@
<template>
<VxeGrid ref="vxeGrid" v-bind="gridOptions" @cell-click="cellClick" @checkbox-change="checkboxChange" @checkbox-all="checkboxAll" />
<VxeGrid ref="vxeGrid" v-bind="gridOptions" @checkbox-change="checkboxChange" @checkbox-all="checkboxAll" />
</template>
<script>
import {EventBus} from '@/event-bus.js'
import { VXETable } from 'vxe-table'
import paoWanPgdConfig from './pgdTable'
import {bgControl, getDw, getForeman, getPgd, getPgd2, getYdjhByZt, pdfList, pgWithForeman, zx} from "@/api/zyjh";
import {getDw, pgWithForeman} from "@/api/zyjh";
export default {
name:'PwanPgd',
@ -33,6 +34,22 @@ export default {
deviceId:null,
}
},
mounted() {
EventBus.$on('pwtg', item => {
if (this.list[0]?.dwId!==item.dwId){
this.$message.warning('垛位不符,请选择正确垛位再取消')
return;
}
this.list.forEach(data=>{
if (data.id===item.id){
data.zt=item.zt
}
})
console.log(this.list)
// this.gridOptions.data = this.list
this.showData(this.list)
})
},
created(){
this.zyq=this.$route.query.zyq
this.deviceId=this.$route.query.deviceId||''
@ -67,33 +84,37 @@ export default {
}
},
methods:{
initData(){
bgControl({}).then(res=>{
const gx=res.data||'1'
const data={
zt:'21',
wgzt:'32',
wclzt:'31'
}
if (gx==='1'){
getYdjhByZt(data).then(res=>{
this.list=res.data
this.gridOptions.data = res.data
})
}
if (gx==='0'){
data.zt='2'
getYdjhByZt(data).then(res=>{
this.list=res.data
this.gridOptions.data = res.data
})
}
})
showData(list){
this.list=list.filter(item=>item.zt==='BF')
this.gridOptions.data = this.list
},
// initData(){
// bgControl({}).then(res=>{
// const gx=res.data||'1'
// const data={
// zt:'21',
// wgzt:'32',
// wclzt:'31'
// }
// if (gx==='1'){
// getYdjhByZt(data).then(res=>{
// this.list=res.data
// this.gridOptions.data = res.data
// })
// }
// if (gx==='0'){
// data.zt='2'
// getYdjhByZt(data).then(res=>{
// this.list=res.data
// this.gridOptions.data = res.data
// })
// }
// })
//
// },
setWorkers(workers){
this.setExt('workers',workers)
this.initData()
// this.initData()
},
checkboxAll({checked}){
if (!this.privateCheck(checked)){
@ -102,17 +123,24 @@ export default {
}
if (checked){
const worker=this.$props.worker()
this.paigong(worker)
// this.paigong(worker)
}
},
checkboxChange({checked}){
checkboxChange({checked,row}){
console.log(row)
if (!this.privateCheck(checked)){
this.$refs.vxeGrid.setAllCheckboxRow(!checked);
return
}
if (checked){
const worker=this.$props.worker()
this.paigong(worker)
row.zt='PG'
EventBus.$emit('pwpg', {
...row
})
this.$refs.vxeGrid.removeCheckboxRow()
//const worker=this.$props.worker()
// this.paigong(worker)
}
},
privateCheck(){
@ -161,19 +189,19 @@ export default {
},
cellClick({row}){
// this.$emit('initPgd',row)
pdfList({
dcCh: row.dcCh,
dcPl: row.dcPl,
}).then((res) => {
this.pdfDataList = res.data;
for (const item of this.pdfDataList) {
if (item.indexOf('套料图')>-1){
const url=`${process.env.VUE_APP_BASE_API}/upload/${row.dcCh}/${row.dcPl}/PDF/${item}.pdf`;
this.$emit('loadPdf',url)
return;
}
}
});
// pdfList({
// dcCh: row.dcCh,
// dcPl: row.dcPl,
// }).then((res) => {
// this.pdfDataList = res.data;
// for (const item of this.pdfDataList) {
// if (item.indexOf('')>-1){
// const url=`${process.env.VUE_APP_BASE_API}/upload/${row.dcCh}/${row.dcPl}/PDF/${item}.pdf`;
// this.$emit('loadPdf',url)
// return;
// }
// }
// });
}
}
}

@ -0,0 +1,141 @@
<template>
<div>
<div class="btn">
<button @click="reset"></button>
<button @click="btnClick"></button>
</div>
<VxeGrid ref="vxeGrid" v-bind="gridOptions" @checkbox-change="checkboxChange" />
</div>
</template>
<script>
import { EventBus } from '@/event-bus.js'
import paoWanPgdConfig from "@/views/zyjhzx/pwanpgong/comps/pgdTable";
import {getDw, pwpg} from "@/api/zyjh";
import * as XLSX from 'xlsx'
export default {
name:'PwanSgd',
props:{
worker:{
type:Function,
default:function (){}
},
},
data(){
return{
type:'pwpg',
gridOptions:{},
list:[],
}
},
mounted() {
EventBus.$on('pwpg', item => {
this.gridOptions.data.push(item)
})
},
created(){
const {options,columns,setExt}=paoWanPgdConfig(window.innerHeight*0.95)
this.setExt=setExt
this.gridOptions=options
this.gridOptions.columns=columns
getDw({type:'ycl'}).then(res=>{
this.gridOptions.ycldw=res.data
})
},
methods:{
btnClick(){
const data={
worker:this.$props.worker().userCode,
list:this.gridOptions.data,
}
pwpg(data).then(res=>{
if (res.success){
this.export()
this.reset(false)
}
})
},
reset(resetDw=true){
const _dw=[]
for (const item of this.gridOptions.data) {
if (!_dw.includes(item.dwId)){
_dw.push(item.dwId)
}
}
if (resetDw&&_dw.length>1){
this.$message.warning('不允许多个垛位同时重置')
return;
}
if (resetDw){
this.gridOptions.data.forEach((item,index)=>{
item.zt='BF'
EventBus.$emit('pwtg', {
...item
})
})
}
this.gridOptions.data = []
},
export(){
let data = this.gridOptions.data;
if (data.length>0){
const column=this.gridOptions.columns
const fields={}
for (const item of column) {
const name=item.field;
const value=item.title
fields[name]=value
}
const printData=[]
data.forEach((item,index)=>{
const _item={}
for (const i in fields) {
_item[fields[i]]=item[i]
}
_item.序号=index+1
_item.分段=item.fd
_item.套料图号=item.tlth
for (const dw of this.gridOptions.ycldw) {
if (item.dwId===dw.id){
_item.垛位=dw.name
break;
}
}
printData.push(_item)
})
const workBook = XLSX.utils.book_new();
const sheet = XLSX.utils.json_to_sheet(printData)
XLSX.utils.book_append_sheet(workBook, sheet, "sheetName");
XLSX.writeFile(workBook, '抛丸计划.xlsx')
}
},
checkboxChange({row}){
row.zt='BF'
EventBus.$emit('pwtg', {
...row
})
const data=[]
this.gridOptions.data.forEach((item,index)=>{
if (item.id===row.id){
return
}
data.push(item)
})
this.gridOptions.data=data
console.log(this.gridOptions.data)
},
}
}
</script>
<style scoped>
.btn{
text-align: right;
button{
width: 15%;
margin-right: 5px;
background-color: blue;
}
}
</style>

@ -1,10 +1,13 @@
export default function () {
export default function (_height=0) {
let height=window.innerHeight
if (height > 1024) {
height = window.innerHeight*0.88
}else{
height = window.innerHeight*0.78
}
if (_height>0){
height=_height
}
const options={
height:height,
align:'center',
@ -48,25 +51,14 @@ export default function () {
const columns = [
{ type: 'checkbox', width: 40 },
{ type: 'seq',title:'序号', width: 60 },
// { field: 'djh',title:'派工单号', width: 120},
// {field: 'slycldw', title: '垛位', width: 60,formatter: dwFormat},
// {field: 'slyclcs', title: '层数', width: 60},
{field: 'plxh', title: '工单号', },
{field: 'dcCh', title: '船号'},
{field: 'dcPl', title: '批量', },
{field: 'total', title: '总数量', },
{field: 'wpg', title: '待处理数量', },
{field: 'comp', title: '已报工', },
{field: 'wwg', title: '未报工', },
{field: 'compOnLastGx', title: '上道序报工数量', },
// {field: 'wpgg', title: '材质', width: 80},
// {field: 'wpxh', title: '规格', width: 70},
// {field: 'slwlh', title: '炉批号', width: 100},
// {field: 'tzbh', title: '套料图号', width: 100},
// {field: 'pwry', title: '接收人', width: 80,formatter:nameFormat},
// {field: 'pwjssj', title: '接收时间', width: 100},
// {field: 'pgr', title: '派工人', width: 80},
// {field: 'pgsj', title: '派工时间', width: 100},
{field: 'dwId', title: '垛位', width: 100,formatter: dwFormat},
{field: 'ceng', title: '层数', width: 60},
{field: 'czbh', title: '船号'},
{field: 'pl', title: '批量'},
{field: 'fd', title: '分段',visible:false},
{field: 'tlth', title: '套料图号',visible:false},
{field: 'wpgg', title: '物品规格', },
{field: '', title: '抛丸',visible:false },
]
return {

@ -1,7 +1,8 @@
<template>
<div class="container">
<div id="pwpg" class="pwpg" ref="pwpg"></div>
<PWanPgd id="pwpgd" ref="pwpgd" @loadPdf="loadPdf" @initPgd="initPgd" :height="height" :worker="getWorker" :workers="workers"/>
<PWanPgd id="pwpgd" ref="pwpgd" @initPgd="initPgd" :height="height" :worker="getWorker" :workers="workers"/>
<PwanSgd id="pwsgd" ref="pwsgd" :worker="getWorker" />
<ZyjhSelectComp id="selectComp" ref="selRef" @initWorkers="initWorkers"/>
<div id="pdf" class="pdf" :style="{height:height,overflowY:'auto'}" v-if="pdfShow">
<pdf v-for="i in numPages" :key="i" :page="i" :src="pdfUrl" />
@ -24,10 +25,11 @@ import ZyjhSelectComp from "@/views/zyjhzx/components/SelectComp.vue";
import TipsComp from "@/views/zyjhzx/components/TipsComp.vue";
import Drawer from "@/views/zyjhzx/components/Drawer.vue";
import pdf from "vue-pdf";
import PwanSgd from "@/views/zyjhzx/pwanpgong/comps/PwanSgd.vue";
export default {
name:'PWanPGong',
components: {Drawer, TipsComp, ZyjhSelectComp, PWanPgd,pdf},
components: {PwanSgd, Drawer, TipsComp, ZyjhSelectComp, PWanPgd,pdf},
data(){
return {
title:'抛 丸 作 业 派 工',
@ -68,16 +70,16 @@ export default {
}
},
methods:{
loadPdf(url){
this.pdfShow=false
this.pdfUrl=null
this.numPages=null
this.pdfUrl=pdf.createLoadingTask(url)
this.pdfUrl.promise.then((pdf) => {
this.numPages = pdf.numPages;
this.pdfShow=true
});
},
// loadPdf(url){
// this.pdfShow=false
// this.pdfUrl=null
// this.numPages=null
// this.pdfUrl=pdf.createLoadingTask(url)
// this.pdfUrl.promise.then((pdf) => {
// this.numPages = pdf.numPages;
// this.pdfShow=true
// });
// },
// loadPdf(url) {
// const loadingTask = pdfjsLib.getDocument(url);
// loadingTask.promise.then(pdf => {
@ -127,14 +129,20 @@ export default {
this.dwGroup.destroyChildren()
}
getYcldw({type:'ycl'}).then(res=>{
console.log(res)
const {container,dw}=drawDw(this.width,this.height)
const {bgGroup,group}=container()
this.dwGroup=group;
this.layer.add(bgGroup)
const that=this
for (let i=0;i<res.data.length;i++){
const item=res.data[i]
const dwGroup=dw(i,item)
dwGroup.on('click tap',function (){
that.$refs.pwpgd.showData(item.list)
})
group.add(dwGroup)
}
})
@ -192,11 +200,11 @@ export default {
this.initDw()
const {container:pgdContainer,drawGd,setWorkers}=drawPgd(this.width,this.height)
this.setWorkers=setWorkers
this.drawGd=drawGd
this.pgdGroup=pgdContainer()
this.layer.add(this.pgdGroup)
// const {container:pgdContainer,drawGd,setWorkers}=drawPgd(this.width,this.height)
// this.setWorkers=setWorkers
// this.drawGd=drawGd
// this.pgdGroup=pgdContainer()
// this.layer.add(this.pgdGroup)
this.initWorkers(this.$refs.selRef.getData().bzType)
},
@ -226,6 +234,7 @@ export default {
border: none;
margin: 0;
}
#pwpgd {
width:50%;
height: auto;
@ -236,6 +245,16 @@ export default {
margin: 0;
}
#pwsgd {
width:31.5%;
height: 93.5vh;
position: absolute;
top:20px;
right:10px;
border: none;
margin: 0;
}
#pwpg {
overflow: hidden;
width: 100%;

@ -42,6 +42,7 @@ export default {
const tmpList=this.list.filter(item=>item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber)
if (tmpList.length>1){
this.list=tmpList
this.gridOptions.data=tmpList
this.$message.warning('短号有重复,请使用全工单号重新派工!!!')
return
}

Loading…
Cancel
Save