diff --git a/src/api/kanban/Packagingline.js b/src/api/kanban/Packagingline.js index 9041e47..cff605f 100644 --- a/src/api/kanban/Packagingline.js +++ b/src/api/kanban/Packagingline.js @@ -38,4 +38,12 @@ export function getPorOrderList(data) { method: 'post', data: data }); -} \ No newline at end of file +} + +export function getProductionNumberPLC(data){ + return request({ + url: '/mes/mesborad/getProductionNumberPLC', + method: 'post', + data: data + }); +} diff --git a/src/api/quality/qcTable.js b/src/api/quality/qcTable.js index 5e99d05..34487b1 100644 --- a/src/api/quality/qcTable.js +++ b/src/api/quality/qcTable.js @@ -297,3 +297,21 @@ export function getDefectItemLinePC(query) { params: query }); } + +//黑蚊香分类汇总头部 +export function getCpDateTitle(query) { + return request({ + url: '/quality/staticTable/getCpDateTitle', + method: 'get', + params: query + }); +} + +//黑蚊香分类汇总头部 +export function getCpDefectDate(query) { + return request({ + url: '/quality/staticTable/getCpDefectDate', + method: 'get', + params: query + }); +} diff --git a/src/views/cs/index5.vue b/src/views/cs/index5.vue index 106cbe4..34de877 100644 --- a/src/views/cs/index5.vue +++ b/src/views/cs/index5.vue @@ -86,6 +86,7 @@ export default { flex-direction: column; box-sizing: border-box; padding-left: 20px; + width:80%; } .block-top-content { diff --git a/src/views/kanban/Packagingline/index2.vue b/src/views/kanban/Packagingline/index2.vue index 5340b9c..0b28297 100644 --- a/src/views/kanban/Packagingline/index2.vue +++ b/src/views/kanban/Packagingline/index2.vue @@ -373,12 +373,14 @@ import { getProMonthNoOk, getLineDayNoOk, getMonthOfYearContrast, + } from "@/api/kanban/quality"; import { getDictData, getProduction15Days, getProductionLineInfo, getPorOrderList, + getProductionNumberPLC } from "@/api/kanban/Packagingline"; import { getDeviceRefreshTime } from "@/api/kanban/equipment"; import * as echarts from "echarts"; @@ -441,20 +443,28 @@ export default { // 当日实际产量 actProduction: [], ceshitable: [{}, {}, {}, {}, {}, {}], + pollTimer: null, + timer: null }; }, created() {}, destroyed() { clearInterval(this.time1); this.time1 = null; + if (this.timer) clearInterval(this.timer); }, mounted() { // this.datetime = moment().subtract(2, "day").format("yyyy-MM-DD"); //console.log('zhuanhuahou',this.dateRangeone) // this.getdatalist(this.selectxt) this.selectfactoryCodelist(); - this.gettime(); + this.timer = setInterval(() => { + this.getProductionNumberPLC(); + }, 10000); + }, + beforeDestroy() { + }, methods: { back() { @@ -507,57 +517,36 @@ export default { const _this = this; _this.initChart1(); _this.piedata = []; - // getProductionLineInfo({ - // equCode: _this.selectxtclasses, - // factoryCode: "ds_" + _this.selectxt, - // }).then((response) => { - // if (response) { - // _this.workOrder = response.data.workOrder; - // _this.taskNum = response.data.taskNum; - // _this.taskSampleNum = response.data.taskSampleNum; - // if (response.data.piedata.checkList) { - // response.data.piedata.checkList.forEach((item) => { - // let a = {}; - // let b = {}; - // if (item.checkResult == "合格") { - // a.name = item.checkResult; - // a.value = item.quality; - // _this.piedata[0] = a; - // } - // if (item.checkResult == "不合格") { - // b.name = item.checkResult; - // b.value = item.quality; - // _this.piedata[1] = b; - // } - // }); - // _this.initChart2(); - // } else { - // _this.initChart3(); - // } - // } - // }); getPorOrderList({ equCode: _this.selectxtclasses, factoryCode: "ds_" + _this.selectxt, }).then((response) => { if (response) { _this.orderdetail = response.data; - - if(_this.datetime == 0){ - _this.gudingworkorderCodeSap = _this.orderdetail[0].workorderCodeSap; + // _this.gudingworkorderCodeSap = _this.orderdetail[0].workorderCodeSap; + // 筛选逻辑实现 + const w2Items = response.data.filter(item => + item.status === 'w2' + ); + this.actProduction = "000000" + if (w2Items.length) { + _this.gudingworkorderCodeSap = w2Items[0].workorderCodeSap; _this.getorderdetail(_this.gudingworkorderCodeSap); } - _this.datetime+=1; - + // _this.getorderdetail(_this.gudingworkorderCodeSap); if (_this.orderdetail.length == 0) { _this.orderdetail = this.ceshitable; } } }); + + }, + + //选择订单查看详细 getorderdetail(item) { - const _this = this; + const _this = this; getProductionLineInfo({ equCode: _this.selectxtclasses, factoryCode: "ds_" + _this.selectxt, @@ -586,9 +575,29 @@ export default { } else { //_this.initChart3(); } + _this.getProductionNumberPLC(); } }); }, + //PLC产量信息 + getProductionNumberPLC(){ + const _this = this; + getProductionNumberPLC({ + equCode: _this.selectxtclasses, + factoryCode: "ds_" + _this.selectxt, + workorderCode: _this.workOrder.workorderCode + }).then((response) => { + if (response) { + let strQty = response.data.qty_total.toString(); + if (strQty.length < 6) { + strQty = String( + strQty + ).padStart(6, "0"); + } + this.actProduction = strQty.split(""); + } + }) + }, // 订单异常信息 selectline() { const _this = this; @@ -754,6 +763,9 @@ export default { ], }; myChart6.setOption(option6); + + + getProduction15Days({ equCode: _this.selectxtclasses, factoryCode: "ds_" + _this.selectxt, @@ -764,13 +776,9 @@ export default { response.data.planProduction ).padStart(6, "0"); } - if (response.data.actProduction.length < 6) { - response.data.actProduction = String( - response.data.actProduction - ).padStart(6, "0"); - } + this.planProduction = response.data.planProduction.split(""); - this.actProduction = response.data.actProduction.split(""); + let seriesdata1 = response.data.acts; let seriesdata2 = response.data.plans; diff --git a/src/views/mes/report/proEfficiencyTable/index.vue b/src/views/mes/report/proEfficiencyTable/index.vue index e943832..8189c92 100644 --- a/src/views/mes/report/proEfficiencyTable/index.vue +++ b/src/views/mes/report/proEfficiencyTable/index.vue @@ -2,7 +2,7 @@