diff --git a/src/api/zyjh.js b/src/api/zyjh.js index 5b4b4fc..cf12e15 100644 --- a/src/api/zyjh.js +++ b/src/api/zyjh.js @@ -71,3 +71,11 @@ export const getYcldw=function(data={}){ params:data }) } + +export const bgControl=function(data){ + return request({ + url: '/zyjh/bgControl', + method: 'post', + params: data + }) +} diff --git a/src/views/jhzx/ydjhzxGL.vue b/src/views/jhzx/ydjhzxGL.vue index e8bcde1..ccc46ce 100644 --- a/src/views/jhzx/ydjhzxGL.vue +++ b/src/views/jhzx/ydjhzxGL.vue @@ -9,7 +9,19 @@ <el-date-picker v-model="queryParam.yf" value-format="yyyy/MM/dd" type="month" /> </el-form-item> </el-col> - <el-col :span="20"> + <el-col :span="4"> + <el-form-item> + <el-switch + v-model="bgControl" + active-text="报工完成查看下道序" + inactive-text="随时查看" + active-value="1" + inactive-value="0" + @change="bgControlChange" + /> + </el-form-item> + </el-col> + <el-col :span="16"> <el-form-item style="float: right" > <el-button type="success" @click="initList">查询</el-button> <el-button type="success" @click="tjydjh">提交月度计划</el-button> @@ -77,6 +89,7 @@ import { mapGetters } from 'vuex' import XEUtils from 'xe-utils' import { getToken } from '@/utils/auth' import ScrollPane from "@/layout/components/TagsView/ScrollPane.vue"; +import {bgControl} from "@/api/zyjh"; export default { name:'YdjhzxGL', @@ -95,6 +108,7 @@ export default { hxjhrq:null, qgjhrq:null, }, + bgControl:'1', queryParam: { dcch:'', yf:'', @@ -720,6 +734,9 @@ export default { this.initBase() }, methods: { + bgControlChange(val){ + bgControl({gx:val}) + }, plsr(){ const data=this.$refs.xGrid.getCheckboxRecords() if (data.length===0){ @@ -814,6 +831,9 @@ export default { }, //转码信息 initBase(){ + bgControl({gx:null}).then(res=>{ + this.bgControl=res.data||'1' + }) getCzxx({}).then(res=>{ this.dictData = res.data }) diff --git a/src/views/zyjhzx/hxianpgong/comps/HxianPgd.vue b/src/views/zyjhzx/hxianpgong/comps/HxianPgd.vue index 4cab718..febcef6 100644 --- a/src/views/zyjhzx/hxianpgong/comps/HxianPgd.vue +++ b/src/views/zyjhzx/hxianpgong/comps/HxianPgd.vue @@ -5,7 +5,7 @@ <script> import { VXETable } from 'vxe-table' import paoWanPgdConfig from './pgdTable' -import {getDw, getPgd,getPgd2, zx} from "@/api/zyjh"; +import {bgControl, getDw, getPgd, getPgd2, zx} from "@/api/zyjh"; export default { name:'HxianPgd', @@ -70,10 +70,25 @@ export default { }, methods:{ initData() { - getPgd2({field:'hxry'}).then(res => { - this.list=res.data - this.gridOptions.data = res.data + bgControl({}).then(res=>{ + const gx=res.data||'1' + if (gx==='1'){ + const data={ + zt:'42', + } + getPgd(data).then(res => { + this.list=res.data + this.gridOptions.data = res.data + }) + } + if (gx==='0'){ + getPgd2({field:'hxry'}).then(res => { + this.list=res.data + this.gridOptions.data = res.data + }) + } }) + }, setWorkers(workers){ this.setExt('workers',workers) diff --git a/src/views/zyjhzx/pwanpgong/comps/PwanPgd.vue b/src/views/zyjhzx/pwanpgong/comps/PwanPgd.vue index 7362c56..cfa3e0e 100644 --- a/src/views/zyjhzx/pwanpgong/comps/PwanPgd.vue +++ b/src/views/zyjhzx/pwanpgong/comps/PwanPgd.vue @@ -5,7 +5,7 @@ <script> import { VXETable } from 'vxe-table' import paoWanPgdConfig from './pgdTable' -import {getDw, getPgd, getPgd2, zx} from "@/api/zyjh"; +import {bgControl, getDw, getPgd, getPgd2, zx} from "@/api/zyjh"; export default { name:'PwanPgd', @@ -74,10 +74,25 @@ export default { }, methods:{ initData(){ - getPgd2({field:'pwry'}).then(res=>{ - this.list=res.data - this.gridOptions.data=res.data + bgControl({}).then(res=>{ + const gx=res.data||'1' + if (gx==='1'){ + const data={ + zt:'21', + } + getPgd(data).then(res => { + this.list=res.data + this.gridOptions.data = res.data + }) + } + if (gx==='0'){ + getPgd2({field:'pwry'}).then(res=>{ + this.list=res.data + this.gridOptions.data=res.data + }) + } }) + }, setWorkers(workers){ this.setExt('workers',workers) diff --git a/src/views/zyjhzx/qgepgong/comps/QgePgd.vue b/src/views/zyjhzx/qgepgong/comps/QgePgd.vue index 6b8468d..d08eb35 100644 --- a/src/views/zyjhzx/qgepgong/comps/QgePgd.vue +++ b/src/views/zyjhzx/qgepgong/comps/QgePgd.vue @@ -5,7 +5,7 @@ <script> import { VXETable } from 'vxe-table' import paoWanPgdConfig from './pgdTable' -import {getDw, getPgd,getPgd2, zx} from "@/api/zyjh"; +import {bgControl, getDw, getPgd, getPgd2, zx} from "@/api/zyjh"; export default { name:'QgePgd', @@ -27,32 +27,6 @@ export default { setExt:null, } }, - sockets:{ - zyjhzx(data){ - if (this.deviceId!==data.msg.deviceId&&data.msg.actionType==='开始派工'){ - return - } - //工单号尾号长度 - const djhWhLengh=3 - 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.$message.warning('短号有重复,请使用全工单号重新派工!!!') - return - } - for (const item of this.list) { - if (item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber){ - const worker=this.$props.worker() - const tmpArr=[{ - id:item.id, - pwry:worker.userCode - }] - this.paigong0(tmpArr) - break - } - } - } - }, sockets:{ zyjhzx(data){ if (this.deviceId!==data.msg.deviceId&&data.msg.actionType!=='开始派工'){ @@ -95,9 +69,25 @@ export default { }, methods:{ initData() { - getPgd2({field: 'qgry'}).then(res => { - this.list=res.data - this.gridOptions.data = res.data + bgControl({}).then(res=>{ + const gx=res.data||'1' + if (gx==='1'){ + const data={ + zt:'42', + ztHx:'52' + } + getPgd(data).then(res => { + this.list=res.data + this.gridOptions.data = res.data + }) + } + if (gx==='0'){ + const data={field: 'qgry'} + getPgd2(data).then(res => { + this.list=res.data + this.gridOptions.data = res.data + }) + } }) }, setWorkers(workers){