|
@@ -80,8 +80,8 @@
|
|
|
<!-- 合计 -->
|
|
|
<a-alert type="info" style="margin-bottom:10px">
|
|
|
<div class="ftext" slot="message">
|
|
|
- 现有库存总数量(个):<strong>{{ stockQty }}</strong>;
|
|
|
- <span v-if="$hasPermissions('B_isShowCost')">现有库存总成本(¥):<strong>{{ stockCost }}</strong>。</span>
|
|
|
+ 可用库存总数量(个):<strong>{{ (currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0)) ? currentStock.currentStockQty : '--' }}</strong>;
|
|
|
+ <span v-if="$hasPermissions('B_isShowCost')">可用库存总成本(¥):<strong>{{ (currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0)) ? currentStock.currentStockCost : '--' }}</strong>。</span>
|
|
|
</div>
|
|
|
</a-alert>
|
|
|
<!-- 列表 -->
|
|
@@ -95,14 +95,6 @@
|
|
|
:data="loadData"
|
|
|
:scroll="{ x: 1170, y: tableHeight }"
|
|
|
bordered>
|
|
|
- <!-- 现有库存数量 -->
|
|
|
- <template slot="currentStockQty" slot-scope="text, record">
|
|
|
- {{ (record.currentStockQty + record.freezeQty) || 0 }}
|
|
|
- <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
|
|
|
- </template>
|
|
|
- <template slot="currentStockCost" slot-scope="text, record">
|
|
|
- {{ ((Number(record.currentStockCost)*1000 + Number(record.freezeCost)*1000)/1000).toFixed(2) || 0 }}
|
|
|
- </template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-button
|
|
@@ -201,16 +193,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- stockQty () { // 库存总数量 合计
|
|
|
- const currentStockQty = this.currentStock && this.currentStock.currentStockQty ? Number(this.currentStock.currentStockQty) : 0
|
|
|
- const freezeQty = this.currentStock && this.currentStock.freezeQty ? Number(this.currentStock.freezeQty) : 0
|
|
|
- return currentStockQty + freezeQty
|
|
|
- },
|
|
|
- stockCost () { // 库存总成本 合计
|
|
|
- const currentStockCost = this.currentStock && this.currentStock.currentStockCost ? Number(this.currentStock.currentStockCost) : 0
|
|
|
- const freezeCost = this.currentStock && this.currentStock.freezeCost ? Number(this.currentStock.freezeCost) : 0
|
|
|
- return ((currentStockCost * 1000 + freezeCost * 1000) / 1000).toFixed(2)
|
|
|
- },
|
|
|
columns () {
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
@@ -219,11 +201,11 @@ export default {
|
|
|
{ title: '最后入库时间', dataIndex: 'lastStockTime', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品品牌', dataIndex: 'productBrandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 120, align: 'center', sorter: true },
|
|
|
+ { title: '可用库存数量', dataIndex: 'currentStockQty', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 160, align: 'center', fixed: 'right' }
|
|
|
]
|
|
|
if (this.$hasPermissions('B_isShowCost')) {
|
|
|
- arr.splice(7, 0, { title: '库存成本(¥)', dataIndex: 'currentStockCost', scopedSlots: { customRender: 'currentStockCost' }, width: 120, align: 'center', sorter: true })
|
|
|
+ arr.splice(7, 0, { title: '可用库存成本', dataIndex: 'currentStockCost', width: 120, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
}
|
|
|
return arr
|
|
|
}
|