1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<template>
<div class="StInventoryAccountDetail">
<div class="sub-title sub-title-fix">库存详情</div>
<dee-up-table
v-if="show"
:pagination="pagination"
:columns="parentColumns"
:data="tableData"
:options="options"
@pagination-current-change="onPageIndexChange"
/>
</div>
</template>
<script>
import _get from 'lodash.get'
import columns from './columns'
import { post } from '@/utils/http'
export default {
name: 'StInventoryAccountDetail',
componentName: '库存台账详情',
mixins: [columns],
data() {
return {
emitMethods: [
{
methods: 'getData',
methodsName: '获取列表数据'
}
],
pagination: {
currentPage: 1,
pageSize: 20,
total: 0,
pageSizes: [20, 50, 100]
},
tableData: [],
currentRow: {},
show: false,
options: {
rowKey: 'dxStLocationId'
}
}
},
computed: {
tableQueryParams() {
return {
pageFrom: this.pagination.currentPage,
pageSize: this.pagination.pageSize
}
}
},
methods: {
getData(params) {
if (!params) {
this.pagination.total = 0
this.tableData = []
return
}
this.show = false
this.$nextTick(() => {
this.show = true
})
this.currentRow = params
this.pagination.currentPage = 1
this.getTableData()
},
getTableData() {
const url = 'DxStInventoryAccount/getInventoryDetails'
const params = Object.assign({}, this.tableQueryParams, {
dxResNumber: this.currentRow.dxResNumber,
dxStHouseId: this.currentRow.dxStHouseId
})
post(url, params).then((res) => {
this.pagination.total = _get(res, 'items.totalElements', 0)
this.tableData = _get(res, 'items.content', [])
})
},
onPageIndexChange(pageIndex) {
this.getTableData()
}
}
}
</script>
<style lang="scss">
.StInventoryAccountDetail{
margin-top: 8px;
.sub-title-fix{
margin-left: 8px;
margin-bottom: 8px;
padding-top: 0px;
padding-bottom: 0px;
font-size: 16px;
}
}
.StInventoryAccountDetail>.dee-up-table{
height: calc(100% - 32px);
.el-table__body-wrapper{
overflow: auto;
}
}
</style>