cancel-task.vue
9.51 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
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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<!-- 快递作业管理 -->
<template>
<div class="dashboard-container cancel-task customer-list-box">
<div
v-loading="listLoading"
:class="{ 'loading-box': listLoading }"
element-loading-text="加载中"
style="margin-top: 20px"
>
<el-card
v-show="dataList && dataList.length > 0"
class="table-card-box"
shadow="never"
>
<el-table
:key="tableKey"
ref="multipleTable"
:data="dataList"
fit
style="width: 100%"
stripe
:header-cell-style="{ background: 'rgba(250,252,255,1)' }"
@selection-change="handleSelectionChange"
>
<!-- <el-table-column align="left" type="selection" width="40" /> -->
<el-table-column
align="left"
type="index"
label="序号"
width="80"
>
<template slot-scope="scope">
<span>{{
scope.$index +
(operationalSearchFormData.page - 1) *
operationalSearchFormData.pageSize +
1
}}</span>
</template>
</el-table-column>
<el-table-column
align="left"
label="作业编号"
width="150"
>
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column
align="left"
label="运单编号"
width="150"
>
<template slot-scope="scope">
<span>{{
scope.row.transportOrder === null
? ''
: scope.row.transportOrder.id
}}</span>
</template>
</el-table-column>
<el-table-column
align="left"
label="快递员分配状态"
width="140"
>
<template slot-scope="scope">
<span v-if="scope.row.assignedStatus == 1">未分配</span>
<span v-else-if="scope.row.assignedStatus == 2">已分配</span>
<span v-else>待人工分配</span>
</template>
</el-table-column>
<el-table-column
align="left"
label="下单时间"
width="160"
>
<template slot-scope="scope">
<span>{{
scope.row.order === null ? '' : scope.row.order.createTime
}}</span>
</template>
</el-table-column>
<el-table-column
align="left"
label="作业状态"
width="100"
>
<template slot-scope="scope">
<span v-if="scope.row.status == 1">待提货</span>
<span v-else-if="scope.row.status == 2">在途</span>
<span
v-else-if="scope.row.status == 3 || scope.row.status == 4"
>已交付</span>
<span v-else>已作废</span>
</template>
</el-table-column>
<el-table-column
align="left"
label="快递员姓名"
width="120"
>
<template slot-scope="scope">
<span>{{
scope.row.courier === null ? '' : scope.row.courier.name
}}</span>
</template>
</el-table-column>
<el-table-column
align="left"
label="取消时间"
width="160"
>
<template slot-scope="scope">
<span>{{ scope.row.cancelTime }}</span>
</template>
</el-table-column>
<el-table-column
align="left"
label="发件人姓名"
width="120"
>
<template slot-scope="scope">
<span>{{
scope.row.order === null ? '' : scope.row.order.senderName
}}</span>
</template>
</el-table-column>
<el-table-column
align="left"
label="发件人电话"
width="120"
>
<template slot-scope="scope">
<span>{{
scope.row.order === null ? '' : scope.row.order.senderPhone
}}</span>
</template>
</el-table-column>
<el-table-column
align="left"
label="发件人地址"
min-width="120"
>
<template slot-scope="scope">
<span>{{
scope.row.order === null
? ''
: scope.row.order.senderProvince.name
}}</span>
<span>{{
scope.row.order === null ? '' : scope.row.order.senderCity.name
}}</span>
<span>{{
scope.row.order === null
? ''
: scope.row.order.senderCounty.name
}}</span>
<span>{{
scope.row.order === null ? '' : scope.row.order.senderAddress
}}</span>
</template>
</el-table-column>
<!-- <el-table-column align="left" label="发件人电话" width="100">
<template slot-scope="scope">
<span>{{ scope.row.mark }}</span>
</template>
</el-table-column> -->
<!-- 操作按钮 -->
<!-- <el-table-column
align="left"
label="操作"
fixed="right"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-link
v-if="scope.row.transportOrderId"
type="primary"
:underline="false"
@click="handleWayllDetail(scope.row.transportOrderId)"
>查看运单详情</el-link>
<el-link
v-else
disabled
:underline="false"
@click="handleWayllDetail(scope.row.transportOrderId)"
>查看运单详情</el-link>
</template>
</el-table-column> -->
</el-table>
<!-- end -->
<!-- 分页 -->
<div class="pagination">
<div class="pages">
<el-pagination
:current-page="Number(operationalSearchFormData.page)"
:total="Number(total)"
:page-size="Number(operationalSearchFormData.pageSize)"
:page-sizes="[10, 20, 30, 50]"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</div>
</el-card>
<el-card
v-show="(!dataList || dataList.length <= 0) && !listLoading"
class="table-empty-box"
shadow="never"
>
<empty></empty>
</el-card>
</div>
</div>
</template>
<script>
import { pickupTaskList } from '@/api/branch'
export default {
data() {
return {
multipleSelection: [],
tableKey: 0,
dataList: [],
total: null,
listLoading: true,
alertText: '',
operationalSearchFormData: {
page: 1,
pageSize: 10,
status: 5
},
titleInfo: {
pageTitle: '',
text: ''
},
formData: {
isFamous: '',
shortName: '',
company: '',
tags: '',
remarks: ''
}
}
},
computed: {
status() {
return status
}
},
// 挂载结束
mounted: function () {},
// 创建完毕状态
created() {
this.companyId = this.$route.query.companyId
this.initialDate()
// 键盘enter操作
document.onkeydown = function (e) {
var key = window.event.keyCode
if (key === 13) {
this.handleFilter(this.operationalSearchFormData)
}
}
},
// 组件更新
updated: function () {},
methods: {
// 初始数据
initialDate() {
// 读取数据
this.getList()
},
handleSelectionChange(val) {
this.multipleSelection = val
},
// 获取列表数据
async getList() {
this.listLoading = true
// eslint-disable-next-line no-undef
const { data: res } = await pickupTaskList(this.operationalSearchFormData)
this.listLoading = false
// 获取数据给dataList
this.dataList = res.items
// 获取总条数
this.total = res.counts
},
// 重置
resetForm() {
this.$refs['operationalSearchFormData'].resetFields()
},
// 搜索信息
handleFilter() {
this.operationalSearchFormData.page = 1
this.getList(this.operationalSearchFormData)
},
// 每页显示信息条数
handleSizeChange(val) {
this.operationalSearchFormData.pageSize = val
if (this.operationalSearchFormData.page === 1) {
this.getList(this.operationalSearchFormData)
}
},
// 进入某一页
handleCurrentChange(val) {
this.operationalSearchFormData.page = val
this.getList()
},
// 查看运单详情
handleWayllDetail(id) {
// eslint-disable-next-line object-curly-spacing
this.$router.push({ path: '/business/waybill-detail', query: { id: id } })
}
}
}
</script>
<style lang="scss" scoped>
.pagination {
margin-top: 40px;
}
.dashboard-container {
width: 100%;
}
.demo-table-expand {
font-size: 0;
}
.demo-table-expand label {
width: 120px;
color: #99a9bf;
}
.demo-table-expand .el-form-item {
margin-right: 0;
margin-bottom: 0;
width: 50%;
}
</style>
<style lang="scss" scoped>
.cancel-task {
}
</style>