产线看板优化

Signed-off-by: Yangwl <1726150332@qq.com>
master
Yangwl 1 month ago
parent 2592b06982
commit c297f06052

@ -461,10 +461,10 @@ export default {
// this.getdatalist(this.selectxt) // this.getdatalist(this.selectxt)
this.selectfactoryCodelist(); this.selectfactoryCodelist();
this.gettime(); this.gettime();
this.startRotation()
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.getProductionNumberPLC(); this.getProductionNumberPLC();
}, 10000); }, 10000);
this.startRotation()
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.rotationTimer) clearInterval(this.rotationTimer)
@ -503,17 +503,17 @@ export default {
} }
}); });
}, },
getDeviceRefreshTime() { // getDeviceRefreshTime() {
const _this = this; // const _this = this;
getDeviceRefreshTime().then((response) => { // getDeviceRefreshTime().then((response) => {
if (response) { // if (response) {
this.RefreshTime = response.data; // this.RefreshTime = response.data;
this.time1 = setInterval(() => { // this.time1 = setInterval(() => {
_this.getdatalist(_this.selectxt); // _this.getdatalist(_this.selectxt);
},1000 * 60 * this.RefreshTime); // },1000 * 60 * this.RefreshTime);
} // }
}); // });
}, // },
getDictData() { getDictData() {
const _this = this; const _this = this;
getDictData({ getDictData({
@ -525,7 +525,7 @@ export default {
this.dictDatatype = response; this.dictDatatype = response;
_this.selectxtclasses = _this.dictDatatype[0].equCode; _this.selectxtclasses = _this.dictDatatype[0].equCode;
_this.getdatalist(); _this.getdatalist();
_this.getDeviceRefreshTime(); // _this.getDeviceRefreshTime();
} }
}); });
}, },
@ -557,10 +557,9 @@ export default {
if (_this.orderdetail.length == 0) { if (_this.orderdetail.length == 0) {
_this.orderdetail = this.ceshitable; _this.orderdetail = this.ceshitable;
} }
_this.getProductionNumberPLC();
} }
}); });
}, },
@ -596,7 +595,7 @@ export default {
} else { } else {
//_this.initChart3(); //_this.initChart3();
} }
_this.getProductionNumberPLC(); //_this.getProductionNumberPLC();
} }
}); });
}, },
@ -608,19 +607,7 @@ export default {
factoryCode: "ds_" + _this.selectxt, factoryCode: "ds_" + _this.selectxt,
workorderCode: _this.workOrder.workorderCode workorderCode: _this.workOrder.workorderCode
}).then((response) => { }).then((response) => {
if (response) { if (response.data) {
// let strQty = response.data.qty_total.toString();
// if (strQty.length < 6) {
// strQty = String(
// strQty
// ).padStart(6, "0");
// }
// this.actProduction = strQty.split("");
// //
// const totalProduction = _this.orderdetail.reduce((sum, item) => {
// return sum + (item.quantityProduced || 0);
// }, Number(this.actProduction.join("")));
// console.log(':', totalProduction);
// 6 // 6
const baseQty = Number(response.data.qty_build); const baseQty = Number(response.data.qty_build);
let strQty = baseQty.toString(); let strQty = baseQty.toString();
@ -639,7 +626,19 @@ export default {
// actProduction // actProduction
this.actProduction = totalStr.split(""); this.actProduction = totalStr.split("");
console.log('总产量:', total); console.log('总产量1:', this.actProduction);
}else {
// orderdetail
const detailTotal = _this.orderdetail.reduce((sum, item) => {
return sum + (item.quantityProduced || 0);
}, 0);
// 6
const total = detailTotal;
const totalStr = total.toString().padStart(6, "0");
// actProduction
this.actProduction = totalStr.split("");
console.log('总产量2:', this.actProduction);
} }
}) })
}, },

Loading…
Cancel
Save