|
|
|
|
@ -162,6 +162,18 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 转移概率信息 -->
|
|
|
|
|
<div v-if="transitionProbabilitiesLoading" v-loading="true" class="transition-probabilities-loading"></div>
|
|
|
|
|
<div v-else-if="transitionProbabilitiesData && transitionProbabilitiesData.current_specification_transitions" class="transition-probabilities-details">
|
|
|
|
|
<div class="detail-title">当前规格的转移概率</div>
|
|
|
|
|
<div class="transition-probabilities-content">
|
|
|
|
|
<div v-for="(info, spec) in transitionProbabilitiesData.current_specification_transitions" :key="spec" class="transition-probability-item">
|
|
|
|
|
<span class="detail-label">到 {{ spec }}:</span>
|
|
|
|
|
<span class="detail-value">概率 {{ (info.probability * 100).toFixed(2) }}%, 转移次数 {{ info.count }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 右侧:历史数据图表 -->
|
|
|
|
|
@ -526,6 +538,10 @@ const selectedCompletionLevel = ref('all'); // 默认显示全部
|
|
|
|
|
const productionScheduleData = ref(null);
|
|
|
|
|
const productionScheduleLoading = ref(false);
|
|
|
|
|
|
|
|
|
|
// 转移概率相关状态
|
|
|
|
|
const transitionProbabilitiesData = ref(null);
|
|
|
|
|
const transitionProbabilitiesLoading = ref(false);
|
|
|
|
|
|
|
|
|
|
// 可编辑的总轴数
|
|
|
|
|
const editableTotalQuantity = ref(0);
|
|
|
|
|
|
|
|
|
|
@ -555,6 +571,7 @@ const showAxleDetails = (record, equipmentCode) => {
|
|
|
|
|
fetchHistoryData(record.model, record.specification, record.wire_disc);
|
|
|
|
|
fetchProductionScheduleData(record.model, record.specification, record.wire_disc, equipmentCode, record.axle_number);
|
|
|
|
|
fetchSalesData(record.model, record.specification);
|
|
|
|
|
fetchTransitionProbabilitiesData(equipmentCode, record.axle_number, record.model, record.specification, record.wire_disc);
|
|
|
|
|
} else {
|
|
|
|
|
hasHistoryData.value = false;
|
|
|
|
|
}
|
|
|
|
|
@ -568,6 +585,8 @@ const showAxleDetails = (record, equipmentCode) => {
|
|
|
|
|
// 关闭对话框
|
|
|
|
|
const handleClose = () => {
|
|
|
|
|
dialogVisible.value = false;
|
|
|
|
|
// 重置转移概率数据
|
|
|
|
|
transitionProbabilitiesData.value = null;
|
|
|
|
|
// 销毁图表实例
|
|
|
|
|
if (totalNumberChart) {
|
|
|
|
|
totalNumberChart.dispose();
|
|
|
|
|
@ -781,6 +800,48 @@ const fetchProductionScheduleData = (model, specification, wireDisc, equipmentCo
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 获取转移概率数据
|
|
|
|
|
const fetchTransitionProbabilitiesData = (equipmentCode, axleNumber, model, specification, wireDisc) => {
|
|
|
|
|
transitionProbabilitiesLoading.value = true;
|
|
|
|
|
|
|
|
|
|
// 使用URL编码处理参数,特别是中文和特殊字符
|
|
|
|
|
const params = new URLSearchParams({
|
|
|
|
|
equipment_code: equipmentCode,
|
|
|
|
|
axle_number: axleNumber,
|
|
|
|
|
model: model,
|
|
|
|
|
specification: specification,
|
|
|
|
|
wire_disc: wireDisc
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 构建API URL
|
|
|
|
|
let apiUrl = `${API_CONFIG.BASE_URL}/api/plan/transition/probabilities?${params.toString()}`;
|
|
|
|
|
|
|
|
|
|
console.log('转移概率API URL:', apiUrl);
|
|
|
|
|
|
|
|
|
|
fetch(apiUrl)
|
|
|
|
|
.then(response => {
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
|
|
|
}
|
|
|
|
|
return response.json();
|
|
|
|
|
})
|
|
|
|
|
.then(data => {
|
|
|
|
|
console.log('转移概率API响应:', data);
|
|
|
|
|
if (data.code === 200 && data.data) {
|
|
|
|
|
transitionProbabilitiesData.value = data.data;
|
|
|
|
|
} else {
|
|
|
|
|
transitionProbabilitiesData.value = null;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
console.error('转移概率API调用失败:', error);
|
|
|
|
|
transitionProbabilitiesData.value = null;
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
transitionProbabilitiesLoading.value = false;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 计算小时轴数 = 总轴数 * 产速 / 每轴均重
|
|
|
|
|
const calculateAxlesPerHour = () => {
|
|
|
|
|
if (!selectedAxle.value || !editableTotalQuantity.value ||
|
|
|
|
|
@ -1627,6 +1688,34 @@ const updateCharts = () => {
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 转移概率样式 */
|
|
|
|
|
.transition-probabilities-loading {
|
|
|
|
|
height: 80px;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.transition-probabilities-details {
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
border-top: 1px dashed #e4e7ed;
|
|
|
|
|
padding-top: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.transition-probabilities-content {
|
|
|
|
|
background-color: #f8f9fa;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
padding: 8px;
|
|
|
|
|
max-height: 150px;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.transition-probability-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.detail-label {
|
|
|
|
|
min-width: 100px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
|