feat(wms/coil/info): 新增钢卷成本信息展示模块
新增囤积成本、囤积天数、钢卷净重的展示卡片,计算并展示钢卷的囤积成本,通过入库时间计算实际囤积天数,优化页面数据展示维度
This commit is contained in:
@@ -11,6 +11,27 @@
|
||||
</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-header">
|
||||
<span class="section-icon">🔄</span>
|
||||
@@ -1218,12 +1239,24 @@ export default {
|
||||
salesInfo() {
|
||||
return this.coilInfo.orderList?.[0] || {};
|
||||
},
|
||||
// 判断是否为冷硬卷
|
||||
isColdHardCoil() {
|
||||
return this.coilInfo.itemName && this.coilInfo.itemName.includes('冷硬卷');
|
||||
},
|
||||
hasPerfData() {
|
||||
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() {
|
||||
@@ -1367,6 +1400,18 @@ export default {
|
||||
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) {
|
||||
if (!timeStamp) return '-';
|
||||
const date = new Date(timeStamp);
|
||||
@@ -3332,4 +3377,17 @@ export default {
|
||||
color: #c0c4cc;
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user