优化设备状态生产计算功能,添加每天重量和箱数计算,改进维修记录对话框分析结果清理逻辑

master
huangjinysf 2 months ago
parent 0b60ba7275
commit c8a83aab3b

@ -247,6 +247,8 @@ function handleSummary() {
//
const showRepairRecords = (equipmentCode) => {
selectedEquipmentCode.value = equipmentCode
//
analysisResult.value = ''
repairRecordsDialogVisible.value = true
fetchRepairRecords(equipmentCode)
}
@ -317,6 +319,8 @@ const filterRecordsByBreakdownName = (value) => {
//
const handleRepairRecordsClose = () => {
repairRecordsDialogVisible.value = false
//
analysisResult.value = ''
}
// 30

@ -139,9 +139,20 @@
<span class="detail-value">{{ calculateAxlesPerHour() }} </span>
</div>
<div class="detail-row">
<span class="detail-label">每天重量:</span>
<span class="detail-value">{{ calculateDailyWeight() }} kg</span>
</div>
<div class="detail-row daily-production-row">
<div class="daily-production-item">
<span class="detail-label">每天轴数:</span>
<span class="detail-value">{{ calculateAxlesPerDay() }} </span>
</div>
<div class="daily-production-item">
<span class="detail-label">每天箱数:</span>
<span class="detail-value">{{ calculateBoxesPerDay() }} </span>
</div>
</div>
</div>
</div>
@ -707,6 +718,38 @@ const calculateAxlesPerDay = () => {
return (axlesPerHour * 24).toFixed(2);
};
// = * 24 *
const calculateDailyWeight = () => {
if (!productionScheduleData.value || !productionScheduleData.value.axle_final_average_speed || !editableTotalQuantity.value) {
return 0;
}
const speed = productionScheduleData.value.axle_final_average_speed;
const totalQuantity = editableTotalQuantity.value;
// * 24 *
const result = speed * 24 * totalQuantity;
return result.toFixed(2);
};
// wire_disc
const calculateBoxesPerDay = () => {
const axlesPerDay = calculateAxlesPerDay();
// 线0
if (!selectedAxle.value || !selectedAxle.value.raw_wire_disc) {
return 0;
}
// wire_disc
if (selectedAxle.value.wire_disc === 'PT-25') {
// 'PT-25'/4
return (axlesPerDay / 4).toFixed(2);
} else {
// /1
return axlesPerDay.toFixed(2);
}
};
//
const onTotalQuantityChange = (newValue) => {
//
@ -1305,6 +1348,21 @@ const updateCharts = () => {
margin-top: 10px;
}
/* 每天生产数据在同一行显示的特殊样式 */
.daily-production-row {
flex-wrap: wrap;
}
.daily-production-item {
min-width: 45%;
margin-right: 10px;
display: flex;
}
.daily-production-item .detail-label {
margin-right: 5px;
}
/* 可编辑输入框样式 */
.editable-input {
width: 100px;

Loading…
Cancel
Save