|
@@ -72,7 +72,7 @@
|
|
|
</div>
|
|
|
<!-- 合计 -->
|
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
- <div class="ftext" slot="message">当前库存总数量(个):<strong>{{ productTotal.stockQty }}</strong>;当前库存总成本(¥):<strong>{{ productTotal.stockCost }}</strong>。</div>
|
|
|
+ <div class="ftext" slot="message">当前库存总数量(个):<strong>{{ (productTotal&&productTotal.totalQty) ? productTotal.totalQty : 0 }}</strong>;当前库存总成本(¥):<strong>{{ (productTotal&&productTotal.totalCost) ? productTotal.totalCost : 0 }}</strong>。</div>
|
|
|
</a-alert>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
@@ -99,8 +99,7 @@
|
|
|
<script>
|
|
|
import moment from 'moment'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import { stockFlowList } from '@/api/stockFlow'
|
|
|
-import { stockByProductSn } from '@/api/stock'
|
|
|
+import { stockFlowList, stockFlowCount } from '@/api/stockFlow'
|
|
|
import { warehouseAllList } from '@/api/warehouse'
|
|
|
export default {
|
|
|
components: { STable, VSelect },
|
|
@@ -161,10 +160,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
warehouseList: [], // 仓库 下拉数据
|
|
|
- productTotal: {
|
|
|
- stockQty: 0,
|
|
|
- stockCost: 0
|
|
|
- } // 合计
|
|
|
+ productTotal: null // 合计
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -174,17 +170,11 @@ export default {
|
|
|
},
|
|
|
// 合计
|
|
|
getTotal (param) {
|
|
|
- stockByProductSn(param).then(res => {
|
|
|
+ stockFlowCount(param).then(res => {
|
|
|
if (res.status == 200 && res.data) {
|
|
|
- this.productTotal = {
|
|
|
- stockQty: (Number(res.data.currentStockQty) + Number(res.data.freezeQty)) || 0,
|
|
|
- stockCost: (Number(res.data.currentStockCost) + Number(res.data.freezeCost)) || 0
|
|
|
- }
|
|
|
+ this.productTotal = res.data
|
|
|
} else {
|
|
|
- this.productTotal = {
|
|
|
- stockQty: 0,
|
|
|
- stockCost: 0
|
|
|
- }
|
|
|
+ this.productTotal = null
|
|
|
}
|
|
|
})
|
|
|
},
|