修改成品包装线看板生产数量从PLC点位里面取值

Signed-off-by: Yangwl <1726150332@qq.com>
master
Yangwl 4 months ago
parent 33ca8a5049
commit f209a08ccb

@ -39,3 +39,11 @@ export function getPorOrderList(data) {
data: data
});
}
export function getProductionNumberPLC(data){
return request({
url: '/mes/mesborad/getProductionNumberPLC',
method: 'post',
data: data
});
}

@ -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() {
@ -485,7 +495,7 @@ export default {
this.RefreshTime = response.data;
this.time1 = setInterval(() => {
_this.getdatalist(_this.selectxt);
},1000 * 60 * this.RefreshTime);
},1000 * 5 );
}
});
},
@ -507,54 +517,33 @@ 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;
@ -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;

Loading…
Cancel
Save