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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!--分配入库-->
<template>
<div class="sendRecord">
<a-form layout="inline" class="search_form">
<a-form-item label="收货状态">
<a-select v-model="searchForm.status" placeholder="请选择" style="width: 250px">
<a-select-option value="">全部</a-select-option>
<a-select-option v-for="item in statusList" :key="item.enumValue" :value="item.enumValue">
{{item.enumName}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="发货日期">
<dateRangePicker :date.sync="searchForm.date"></dateRangePicker>
</a-form-item>
<a-button type="primary" class="search_btn" icon="search" @click="searchList">搜索</a-button>
<a-button class="search_btn ant-table-btn" style="margin-left: 10px" icon="sync" @click="restSearchForm">清空</a-button>
<!-- <a-button type="primary" class="search_btn" icon="download" style="float: right" @click="downloadExcel">-->
<!-- 导出Excel-->
<!-- </a-button>-->
<div style="clear: both"></div>
</a-form>
<div style="clear: both"></div>
<a-table :dataSource="tableData"
:columns="columns"
rowKey="id"
:loading="loading"
:pagination="false"
bordered
>
<template slot="statusName" slot-scope="record">
<a-button type="link" size="small">{{record.statusName}}</a-button>
</template>
<a-table
slot="expandedRowRender"
slot-scope="record"
:columns="innerColumns"
:data-source="record.detailedList"
:pagination="false"
>
<template slot="statusName" slot-scope="record">
<a-button type="link" size="small">{{record.statusName}}</a-button>
</template>
</a-table>
</a-table>
<myPagination v-model="pagination" :pagination="pagination" @getList="getSendRecord"></myPagination>
</div>
</template>
<script>
import myPagination from '../../components/myPagination'
import dateRangePicker from '../../components/dateRangePicker'
import {getEnumByFlag, isEmptyParams} from "../../utils/common";
import moment from 'moment';
const columns = [
{
title: '收货单位',
dataIndex: 'receiveNodeName',
width:"240px",
ellipsis: true
},
{
title: '发货人',
width:"160px",
dataIndex: 'sendContact',
ellipsis: true
},
{
title: '发货人电话',
width:"240px",
dataIndex: 'sendPhone',
ellipsis: true
},
{
title: '发货日期',
width:"160px",
dataIndex: 'sendDate',
ellipsis: true
},
{
title: '收货人',
width:"160px",
dataIndex: 'receiver',
ellipsis: true
},
{
title: '收货人电话',
dataIndex: 'receivePhone',
width:"160px",
ellipsis: true
},
// {
// title: '收货时间',
// dataIndex: 'receiveDate',
// ellipsis: true
// },
{
title: '收货状态',
scopedSlots: {customRender: 'statusName'},
ellipsis: true
},
// {
// title: '备注',
// dataIndex: 'remarks',
// ellipsis: true
// },
];
const innerColumns = [
{
title: '供应商名称',
dataIndex: 'supplierName',
width:"240px",
ellipsis: true
},
{
title: '品牌',
width:"160px",
dataIndex: 'brandName',
ellipsis: true
},
{
title: '批次号',
width:"240px",
dataIndex: 'batchNumber',
ellipsis: true
},
{
title: '生产日期',
width:"160px",
dataIndex: 'produceDate',
ellipsis: true
},
{
title: '有效期至',
width:"160px",
dataIndex: 'expireDate',
},
{
title: '分配数量',
width:"160px",
dataIndex: 'sendNum',
ellipsis: true
},
{
title: '收货状态',
width:"160px",
scopedSlots: {customRender: 'statusName'},
ellipsis: true
},
{
title: '收货日期',
width:"160px",
dataIndex: 'receiveDate',
ellipsis: true
},
{
title: '备注',
dataIndex: 'remarks',
ellipsis: true
},
];
export default {
name: "sendRecord",
components: {myPagination, dateRangePicker},
data() {
return {
// 搜索框对象
searchForm: {
breedId: undefined,
medicalName: '',
factoryId: '',
date:[],
produceDate: undefined
},
statusList: [],
pagination: {
pageIndex: 1,
pageSize: 10,
total: 0,
pageSizeOptions: ['10', '20', '30', '40', '50'],
},
columns,
innerColumns,
tableData: [],
loading: false,
allSupplyInfo: [],
routerParams:{}
}
},
created() {
this.routerParams = this.$route.query
if (this.routerParams.menuId) {
window.sessionStorage.setItem('menuId', this.routerParams.menuId)
}
this.getEnumListInfo()
},
mounted() {
// let allEnum = JSON.parse(sessionStorage.getItem("allEnum"));
// this.statusList = allEnum["folacin_stock_record_status"];
this.getSendRecord()
},
methods: {
getEnumListInfo() {
if (window.sessionStorage.getItem('allEnum')) {
this.statusList = getEnumByFlag("folacin_stock_record_status");
} else {
let par = {}
this.$api.fyManage.fetchFYLoginUser(par).then(({data}) => {
window.sessionStorage.setItem('allEnum', JSON.stringify(data.enumValueList))
window.sessionStorage.setItem('userInfo', JSON.stringify(data.userInfo));
this.statusList = getEnumByFlag("folacin_stock_record_status");
})
}
},
searchList() {
this.pagination.pageIndex = 1
this.getSendRecord()
},
getSendRecord() {
this.loading = true
let pars = isEmptyParams(this.searchForm)
let par = {
...pars,
startDate: this.searchForm.date[0],
endDate: this.searchForm.date[1],
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize
}
this.$api.stockManage.fetchSendRecordList(par).then(({data = {}}) => {
const {dataList = [], total = 0} = data
this.tableData = dataList
this.pagination.total = total
this.loading = false
}).catch(() => {
this.loading = false
})
},
restSearchForm() {
this.searchForm = {
breedId: undefined,
medicalName: '',
factoryId: '',
produceDate: undefined,
date:[]
}
this.searchList()
},
downloadExcel() {
},
},
}
</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;
}
</style>