diff --git a/klp-ui/src/views/wms/coil/info.vue b/klp-ui/src/views/wms/coil/info.vue index d5012dfc..ace8d90d 100644 --- a/klp-ui/src/views/wms/coil/info.vue +++ b/klp-ui/src/views/wms/coil/info.vue @@ -11,6 +11,27 @@ +
+
+ 💰 + 成本信息 +
+
+ + + {{ hoardingCost }} + t·天 + + + {{ hoardingDays }} 天 + + + {{ coilInfo.netWeight || 0 }} t + + +
+
+
🔄 @@ -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; +}