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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<template>
<div class="inStockManage">
<a-form layout="inline" class="search_form">
<a-form-item label="证件号码">
<!--v-price="{digit:4}"-->
<a-input v-model="searchForm.idCar" placeholder="请输入证件号码" style="width: 250px"></a-input>
</a-form-item>
<a-form-item>
<a-button class="search_btn" @click="restSearchForm">读卡识别</a-button>
<a-button type="primary" class="search_btn" style="margin-left: 10px" @click="searchList">搜索</a-button>
<a-button class="search_btn" style="margin-left: 10px" @click="restSearchForm">清空</a-button>
</a-form-item>
<a-button type="primary" class="search_btn" style="float: right" @click="toAdd">发放登记</a-button>
<div style="clear: both"></div>
</a-form>
<div style="margin-top: 16px;margin-bottom: 10px"></div>
<a-table :dataSource="tableData"
:columns="columns"
rowKey="id"
:loading="loading"
:pagination="false"
>
<template slot="expireDateS" slot-scope="record">
{{record.expireDate | formatDate}}
</template>
<template slot="action" slot-scope="record">
<!--<a-button type="link" size="small" @click="openChildModal(record)">人工发放</a-button>-->
<a-button type="link" size="small" @click="toDetail(record)">查看</a-button>
</template>
</a-table>
<a-pagination
v-if="pagination.total > 0"
:total="pagination.total"
show-size-changer
show-quick-jumper
v-model="pagination.pageIndex"
:page-size="pagination.pageSize"
:page-size-options="pagination.pageSizeOptions"
@showSizeChange="showSizeChange"
@change="change"
:showTotal="() => `共 ${pagination.total} 条`"
/>
</div>
</template>
<script>
import {isEmptyParams} from "../../utils/common";
import moment from 'moment'
const columns = [
{
title: '发放日期',
dataIndex: 'medicineName',
ellipsis: true
},
{
title: '姓名',
dataIndex: 'typeName',
ellipsis: true
},
{
title: '证件号码',
width: '120px',
dataIndex: 'factoryName',
ellipsis: true
},
{
title: '联系电话',
dataIndex: 'batchNumber',
ellipsis: true
},
{
title: '发放数量(瓶)',
dataIndex: 'specs',
ellipsis: true
},
{
title: '发放时期',
width: '120px',
scopedSlots: {customRender: 'expireDateS'},
},
{
title: '现住址',
dataIndex: 'isHistoryName',
ellipsis: true
},
{
title: '登记人',
dataIndex: 'specs',
ellipsis: true
},
{
title: '操作',
align: 'center',
scopedSlots: {customRender: 'action'},
},
]
export default {
components: {},
data() {
return {
// 搜索框对象
searchForm: {
idCar:undefined
},
pagination: {
pageIndex: 1,
pageSize: 10,
total: 0,
pageSizeOptions: ['10', '20', '30', '40', '50'],
},
columns,
tableData: [],
loading: false,
}
},
created() {
this.getInStockList()
},
methods: {
searchList() {
this.pagination.pageIndex = 1
this.getInStockList()
},
getInStockList() {
this.loading = true
let pars = isEmptyParams(this.searchForm)
let par = {
...pars,
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize
}
this.$api.stockManage.fetchInStockList(par).then(({data = {}}) => {
const {dataList = [], total = 0} = data
this.tableData = dataList
this.pagination.total = total
this.loading = false
}).finally(() => {
this.loading = false
})
},
// 分页
showSizeChange(pageNum, pageSize) {
this.pagination.pageIndex = 1;
this.pagination.pageSize = pageSize;
this.getInStockList()
},
change(pageNum, pageSize) {
this.pagination.pageIndex = pageNum;
this.pagination.pageSize = pageSize;
this.getInStockList()
},
restSearchForm() {
this.searchForm = {
idCar:undefined
}
this.searchList()
},
toAdd() {
this.$router.push({path:'/folviteDistribution/add'})
},
toDetail(record) {
this.$router.push({path:'/folviteDistribution/detail', query: record})
}
},
}
</script>
<style lang="less" scoped>
// 文件上传样式
.ant-upload-select-picture-card i {
font-size: 32px;
color: #999;
}
.ant-upload-select-picture-card .ant-upload-text {
margin-top: 6px;
color: #666;
}
.btn_space {
margin-right: 5px;
}
/* .search_form {
margin-top: -16px;
border: 1px solid rgba(255,77,128, .2);
border-top: 0px;
padding: 30px;
}*/
</style>