Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -11,6 +11,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="section basic-info-section">
|
||||||
|
<div class="section-header">
|
||||||
|
<span class="section-icon">💰</span>
|
||||||
|
<span class="section-title">成本信息</span>
|
||||||
|
</div>
|
||||||
|
<div class="section-body">
|
||||||
|
<el-descriptions :column="3" border size="small">
|
||||||
|
<el-descriptions-item label="囤积成本">
|
||||||
|
<span class="cost-value">{{ hoardingCost }}</span>
|
||||||
|
<span class="cost-unit">t·天</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="囤积天数">
|
||||||
|
<span>{{ hoardingDays }} 天</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="钢卷净重">
|
||||||
|
<span>{{ coilInfo.netWeight || 0 }} t</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="section trace-section">
|
<div class="section trace-section">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<span class="section-icon">🔄</span>
|
<span class="section-icon">🔄</span>
|
||||||
@@ -1218,12 +1239,24 @@ export default {
|
|||||||
salesInfo() {
|
salesInfo() {
|
||||||
return this.coilInfo.orderList?.[0] || {};
|
return this.coilInfo.orderList?.[0] || {};
|
||||||
},
|
},
|
||||||
// 判断是否为冷硬卷
|
|
||||||
isColdHardCoil() {
|
isColdHardCoil() {
|
||||||
return this.coilInfo.itemName && this.coilInfo.itemName.includes('冷硬卷');
|
return this.coilInfo.itemName && this.coilInfo.itemName.includes('冷硬卷');
|
||||||
},
|
},
|
||||||
hasPerfData() {
|
hasPerfData() {
|
||||||
return this.perfSeries && this.perfSegCount > 0;
|
return this.perfSeries && this.perfSegCount > 0;
|
||||||
|
},
|
||||||
|
hoardingDays() {
|
||||||
|
const inboundTime = this.getInboundTime();
|
||||||
|
if (!inboundTime) return 0;
|
||||||
|
const inboundDate = new Date(inboundTime);
|
||||||
|
const today = new Date();
|
||||||
|
const diffTime = today.getTime() - inboundDate.getTime();
|
||||||
|
const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
||||||
|
return Math.max(0, diffDays);
|
||||||
|
},
|
||||||
|
hoardingCost() {
|
||||||
|
const netWeight = parseFloat(this.coilInfo.netWeight) || 0;
|
||||||
|
return (this.hoardingDays * netWeight).toFixed(2);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
@@ -1367,6 +1400,18 @@ export default {
|
|||||||
this.$set(this.inspectionItemLoadingMap, taskId, false);
|
this.$set(this.inspectionItemLoadingMap, taskId, false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getInboundTime() {
|
||||||
|
if (!this.traceResult || !this.traceResult.steps) {
|
||||||
|
return this.coilInfo.createTime || null;
|
||||||
|
}
|
||||||
|
const createStep = this.traceResult.steps.find(step =>
|
||||||
|
step.action === '新增' || step.action === '创建'
|
||||||
|
);
|
||||||
|
if (createStep) {
|
||||||
|
return createStep.create_time || createStep.update_time || createStep.time;
|
||||||
|
}
|
||||||
|
return this.coilInfo.createTime || null;
|
||||||
|
},
|
||||||
formatTime(timeStamp) {
|
formatTime(timeStamp) {
|
||||||
if (!timeStamp) return '-';
|
if (!timeStamp) return '-';
|
||||||
const date = new Date(timeStamp);
|
const date = new Date(timeStamp);
|
||||||
@@ -3332,4 +3377,17 @@ export default {
|
|||||||
color: #c0c4cc;
|
color: #c0c4cc;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cost-value {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #d97706;
|
||||||
|
text-shadow: 0 0 8px rgba(217, 119, 6, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cost-unit {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #64748b;
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user