viewItemReleaseRes.vue
1.54 KB
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
<template>
<el-dialog
:title="$t('itemReleaseManage.viewItems.title')"
:visible.sync="visible"
width="50%"
>
<el-table
:data="items"
border
style="width: 100%"
v-loading="loading"
>
<el-table-column
prop="resName"
:label="$t('itemReleaseManage.viewItems.itemName')"
align="center"
/>
<el-table-column
prop="amount"
:label="$t('itemReleaseManage.viewItems.amount')"
align="center"
/>
</el-table>
</el-dialog>
</template>
<script>
import { getCommunityId } from '@/api/community/communityApi'
import { listItemReleaseRes } from '@/api/work/itemReleaseManageApi'
export default {
name: 'ViewItemReleaseRes',
data() {
return {
visible: false,
loading: false,
communityId: '',
items: [],
currentItem: {}
}
},
created() {
this.communityId = getCommunityId()
},
methods: {
open(item) {
this.currentItem = {
...item,
communityId: this.communityId
}
this.visible = true
this.loadItems()
},
async loadItems() {
try {
this.loading = true
const params = {
page: 1,
row: 500,
communityId: this.communityId,
irId: this.currentItem.irId
}
const { data } = await listItemReleaseRes(params)
this.items = data
} catch (error) {
console.error('获取放行物品失败:', error)
} finally {
this.loading = false
}
}
}
}
</script>