产线看板优化

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