修复成本问题
This commit is contained in:
@@ -89,13 +89,13 @@ export function batchCalculateCost(calcDate) {
|
||||
})
|
||||
}
|
||||
|
||||
// 按入场钢卷号维度计算成本
|
||||
export function calculateCostByEnterCoilNo(enterCoilNo, calcDate) {
|
||||
// 按当前钢卷号维度计算成本(单卷详情)
|
||||
export function calculateCostByCurrentCoilNo(currentCoilNo, calcDate) {
|
||||
return request({
|
||||
url: '/wms/cost/coil/calculateByEnterCoilNo',
|
||||
url: '/wms/cost/coil/calculateByCurrentCoilNo',
|
||||
method: 'post',
|
||||
params: {
|
||||
enterCoilNo,
|
||||
currentCoilNo,
|
||||
calcDate
|
||||
}
|
||||
})
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
<el-card class="block-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="card-title">成本汇总(按入场卷号)</span>
|
||||
<span class="card-title">成本汇总</span>
|
||||
</div>
|
||||
<el-table :data="mergedRows" border stripe>
|
||||
<el-table-column prop="enterCoilNo" label="入场卷号"></el-table-column>
|
||||
@@ -257,6 +257,7 @@ export default {
|
||||
}
|
||||
fetchCoilTotalMerged(params).then(res => {
|
||||
this.mergedRows = res.rows || []
|
||||
console.log(res)
|
||||
this.mergedTotal = res.total || 0
|
||||
|
||||
const rows = this.mergedRows || []
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
style="width: 100%"
|
||||
@sort-change="handleSortChange"
|
||||
>
|
||||
<el-table-column prop="enterCoilNo" label="入场钢卷号" />
|
||||
<el-table-column prop="currentCoilNo" label="当前钢卷号" />
|
||||
<el-table-column prop="coilCount" label="子钢卷数" align="right" />
|
||||
<el-table-column prop="totalGrossWeight" label="总毛重(吨)" align="right">
|
||||
<template slot-scope="scope">
|
||||
@@ -112,7 +112,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="viewCoilDetail(scope.row)">查看子钢卷成本</el-button>
|
||||
<el-button type="text" size="small" @click="viewCoilDetail(scope.row)">查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -126,56 +126,45 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 入场钢卷号下子钢卷详情对话框 -->
|
||||
<!-- 当前钢卷成本详情对话框 -->
|
||||
<el-dialog
|
||||
title="入场钢卷号下子钢卷成本详情"
|
||||
title="当前钢卷成本详情"
|
||||
:visible.sync="showDetailDialog"
|
||||
width="900px"
|
||||
>
|
||||
<div v-if="detailEnterCoilNo" style="margin-bottom: 10px;">
|
||||
入场钢卷号:<strong>{{ detailEnterCoilNo }}</strong>
|
||||
</div>
|
||||
<el-table :data="detailList" stripe style="width: 100%">
|
||||
<el-table-column prop="currentCoilNo" label="当前钢卷号" />
|
||||
<el-table-column prop="grossWeightTon" label="毛重(吨)" align="right">
|
||||
<template slot-scope="scope">
|
||||
{{ formatWeight(scope.row.grossWeightTon) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="netWeightTon" label="净重(吨)" align="right">
|
||||
<template slot-scope="scope">
|
||||
{{ formatWeight(scope.row.netWeightTon) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="storageDays" label="在库天数" align="right">
|
||||
<template slot-scope="scope">
|
||||
<span :class="getStorageDaysClass(scope.row.storageDays)">
|
||||
{{ scope.row.storageDays || '-' }}
|
||||
<div v-if="detailInfo">
|
||||
<el-form label-width="140px" size="small">
|
||||
<el-form-item label="当前钢卷号">
|
||||
<span>{{ detailCoilNo }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="毛重(吨)">
|
||||
<span>{{ formatWeight(detailInfo.grossWeightTon) }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="净重(吨)">
|
||||
<span>{{ formatWeight(detailInfo.netWeightTon) }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="在库天数">
|
||||
<span :class="getStorageDaysClass(detailInfo.storageDays)">
|
||||
{{ detailInfo.storageDays || '-' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unitCost" label="单位成本(元/吨/天)" align="right">
|
||||
<template slot-scope="scope">
|
||||
{{ formatMoney(scope.row.unitCost) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dailyCost" label="日成本(元)" align="right">
|
||||
<template slot-scope="scope">
|
||||
{{ formatMoney(scope.row.dailyCost) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalCost" label="累计成本(元)" align="right">
|
||||
<template slot-scope="scope">
|
||||
<span class="cost-total">{{ formatMoney(scope.row.totalCost) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位成本(元/吨/天)">
|
||||
<span>{{ formatMoney(detailInfo.unitCost) }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="日成本(元)">
|
||||
<span>{{ formatMoney(detailInfo.dailyCost) }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="累计成本(元)">
|
||||
<span class="cost-total">{{ formatMoney(detailInfo.totalCost) }}</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { calculateCostByEnterCoilNo, getStockpileCostList } from '@/api/wms/cost'
|
||||
import { calculateCostByCurrentCoilNo, getStockpileCostList } from '@/api/wms/cost'
|
||||
|
||||
export default {
|
||||
name: 'CostStockpile',
|
||||
@@ -197,8 +186,8 @@ export default {
|
||||
currentCoilNo: null
|
||||
},
|
||||
showDetailDialog: false,
|
||||
detailEnterCoilNo: null,
|
||||
detailList: []
|
||||
detailCoilNo: null,
|
||||
detailInfo: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -272,10 +261,10 @@ export default {
|
||||
},
|
||||
async viewCoilDetail(row) {
|
||||
try {
|
||||
const res = await calculateCostByEnterCoilNo(row.enterCoilNo, null)
|
||||
const res = await calculateCostByCurrentCoilNo(row.currentCoilNo, null)
|
||||
if (res.code === 200 && res.data && !res.data.error) {
|
||||
this.detailEnterCoilNo = row.enterCoilNo
|
||||
this.detailList = res.data.coilDetails || []
|
||||
this.detailCoilNo = row.currentCoilNo
|
||||
this.detailInfo = res.data
|
||||
this.showDetailDialog = true
|
||||
} else {
|
||||
this.$message.error(res.data?.error || '加载详情失败')
|
||||
|
||||
Reference in New Issue
Block a user