|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+<template>
|
|
|
2
|
+ <div class="app-container">
|
|
|
3
|
+ <!-- 检索区 -->
|
|
|
4
|
+ <el-card shadow="never" class="search-card">
|
|
|
5
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
|
|
6
|
+ <el-form-item label="订单编号" prop="orderNo">
|
|
|
7
|
+ <el-input v-model="queryParams.orderNo" placeholder="订单编号" clearable style="width: 150px" @keyup.enter.native="handleQuery" />
|
|
|
8
|
+ </el-form-item>
|
|
|
9
|
+ <el-form-item label="售后编号" prop="aftersaleNo">
|
|
|
10
|
+ <el-input v-model="queryParams.aftersaleNo" placeholder="售后编号" clearable style="width: 150px" @keyup.enter.native="handleQuery" />
|
|
|
11
|
+ </el-form-item>
|
|
|
12
|
+ <el-form-item label="申请类型" prop="applyType">
|
|
|
13
|
+ <el-select v-model="queryParams.applyType" placeholder="全部" clearable style="width: 150px">
|
|
|
14
|
+ <el-option v-for="item in applyTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
15
|
+ </el-select>
|
|
|
16
|
+ </el-form-item>
|
|
|
17
|
+ <el-form-item>
|
|
|
18
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
19
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
20
|
+ </el-form-item>
|
|
|
21
|
+ </el-form>
|
|
|
22
|
+ </el-card>
|
|
|
23
|
+
|
|
|
24
|
+ <br/>
|
|
|
25
|
+
|
|
|
26
|
+ <!-- 列表区 -->
|
|
|
27
|
+ <el-card shadow="never" class="table-card">
|
|
|
28
|
+ <el-tabs v-model="statusTab" @tab-click="handleTabClick">
|
|
|
29
|
+ <el-tab-pane label="全部" name="all" />
|
|
|
30
|
+ <el-tab-pane label="进行中" name="1" />
|
|
|
31
|
+ <el-tab-pane label="已完结" name="2" />
|
|
|
32
|
+ </el-tabs>
|
|
|
33
|
+
|
|
|
34
|
+ <el-row :gutter="10" class="mb8">
|
|
|
35
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
36
|
+ </el-row>
|
|
|
37
|
+
|
|
|
38
|
+ <el-table border v-loading="loading" :data="aftersaleList" :empty-text="emptyTableText">
|
|
|
39
|
+ <el-table-column label="售后编号" align="center" prop="aftersaleNo" min-width="160" :show-overflow-tooltip="true" />
|
|
|
40
|
+ <el-table-column label="申请类型" align="center" width="130">
|
|
|
41
|
+ <template slot-scope="scope">
|
|
|
42
|
+ <span>{{ scope.row.applyTypeText || applyTypeLabel(scope.row.applyType) }}</span>
|
|
|
43
|
+ </template>
|
|
|
44
|
+ </el-table-column>
|
|
|
45
|
+ <el-table-column label="售后订单信息" align="left" min-width="300">
|
|
|
46
|
+ <template slot-scope="scope">
|
|
|
47
|
+ <div class="order-info">
|
|
|
48
|
+ <div class="order-no">订单号:{{ scope.row.orderNo || '—' }}</div>
|
|
|
49
|
+ <div class="goods-info">
|
|
|
50
|
+ <image-preview v-if="scope.row.goodsImage" :src="scope.row.goodsImage" :width="44" :height="44" />
|
|
|
51
|
+ <div class="goods-text">
|
|
|
52
|
+ <div>{{ scope.row.goodsName || '—' }}</div>
|
|
|
53
|
+ <div class="sub-text">
|
|
|
54
|
+ {{ scope.row.goodsSpec || '默认' }}
|
|
|
55
|
+ × {{ scope.row.quantity != null ? scope.row.quantity : '—' }}
|
|
|
56
|
+ · ¥{{ scope.row.payAmount != null ? scope.row.payAmount : '—' }}
|
|
|
57
|
+ </div>
|
|
|
58
|
+ <div class="sub-text">
|
|
|
59
|
+ {{ scope.row.memberNickName || '—' }}
|
|
|
60
|
+ · {{ scope.row.consigneeName || '—' }}
|
|
|
61
|
+ · {{ scope.row.consigneeMobile || '—' }}
|
|
|
62
|
+ </div>
|
|
|
63
|
+ <div class="sub-text addr-text">{{ scope.row.consigneeAddress || '—' }}</div>
|
|
|
64
|
+ </div>
|
|
|
65
|
+ </div>
|
|
|
66
|
+ </div>
|
|
|
67
|
+ </template>
|
|
|
68
|
+ </el-table-column>
|
|
|
69
|
+ <el-table-column label="售后原因" align="center" prop="applyReason" width="120" :show-overflow-tooltip="true">
|
|
|
70
|
+ <template slot-scope="scope">
|
|
|
71
|
+ <span>{{ scope.row.applyReason || '—' }}</span>
|
|
|
72
|
+ </template>
|
|
|
73
|
+ </el-table-column>
|
|
|
74
|
+ <el-table-column label="退货数量" align="center" width="90">
|
|
|
75
|
+ <template slot-scope="scope">
|
|
|
76
|
+ <span>{{ returnQuantityText(scope.row) }}</span>
|
|
|
77
|
+ </template>
|
|
|
78
|
+ </el-table-column>
|
|
|
79
|
+ <el-table-column label="申请金额" align="center" width="100">
|
|
|
80
|
+ <template slot-scope="scope">
|
|
|
81
|
+ <span>¥{{ scope.row.applyAmount != null ? scope.row.applyAmount : '—' }}</span>
|
|
|
82
|
+ </template>
|
|
|
83
|
+ </el-table-column>
|
|
|
84
|
+ <el-table-column label="申请时间" align="center" width="160">
|
|
|
85
|
+ <template slot-scope="scope">
|
|
|
86
|
+ <span>{{ parseTime(scope.row.createTime) || '—' }}</span>
|
|
|
87
|
+ </template>
|
|
|
88
|
+ </el-table-column>
|
|
|
89
|
+ <el-table-column label="售后状态" align="center" width="90">
|
|
|
90
|
+ <template slot-scope="scope">
|
|
|
91
|
+ <el-tag size="small" :type="aftersaleStatusTag(scope.row.aftersaleStatus)">
|
|
|
92
|
+ {{ scope.row.aftersaleStatusText || aftersaleStatusLabel(scope.row.aftersaleStatus) }}
|
|
|
93
|
+ </el-tag>
|
|
|
94
|
+ </template>
|
|
|
95
|
+ </el-table-column>
|
|
|
96
|
+ <el-table-column label="完结时间" align="center" width="160">
|
|
|
97
|
+ <template slot-scope="scope">
|
|
|
98
|
+ <span>{{ parseTime(scope.row.finishTime) || '—' }}</span>
|
|
|
99
|
+ </template>
|
|
|
100
|
+ </el-table-column>
|
|
|
101
|
+ <el-table-column label="操作" align="center" width="180" fixed="right">
|
|
|
102
|
+ <template slot-scope="scope">
|
|
|
103
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)" v-hasPermi="['agri:seller:aftersale:query']">查看详情</el-button>
|
|
|
104
|
+ <el-button
|
|
|
105
|
+ v-if="scope.row.aftersaleStatus === '1'"
|
|
|
106
|
+ size="mini"
|
|
|
107
|
+ type="text"
|
|
|
108
|
+ icon="el-icon-edit-outline"
|
|
|
109
|
+ @click="handleFinish(scope.row)"
|
|
|
110
|
+ v-hasPermi="['agri:seller:aftersale:finish']"
|
|
|
111
|
+ >处理售后</el-button>
|
|
|
112
|
+ </template>
|
|
|
113
|
+ </el-table-column>
|
|
|
114
|
+ </el-table>
|
|
|
115
|
+
|
|
|
116
|
+ <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
|
|
117
|
+ </el-card>
|
|
|
118
|
+
|
|
|
119
|
+ <!-- 详情抽屉 -->
|
|
|
120
|
+ <seller-aftersale-detail
|
|
|
121
|
+ ref="aftersaleDetail"
|
|
|
122
|
+ :visible.sync="detailOpen"
|
|
|
123
|
+ :aftersale-id="currentAftersaleId"
|
|
|
124
|
+ @finish="openFinishDialog"
|
|
|
125
|
+ @view-order="handleViewOrder"
|
|
|
126
|
+ />
|
|
|
127
|
+
|
|
|
128
|
+ <!-- 关联订单详情抽屉(只读) -->
|
|
|
129
|
+ <seller-order-detail
|
|
|
130
|
+ :visible.sync="orderDetailOpen"
|
|
|
131
|
+ :order-id="currentOrderId"
|
|
|
132
|
+ :show-actions="false"
|
|
|
133
|
+ />
|
|
|
134
|
+
|
|
|
135
|
+ <!-- 处理售后弹窗 -->
|
|
|
136
|
+ <el-dialog title="处理售后" :visible.sync="finishOpen" width="560px" append-to-body @close="cancelFinish">
|
|
|
137
|
+ <el-alert
|
|
|
138
|
+ title="完结后不可回退,处理结果将同步展示给买家;本操作不自动退款或变更订单状态。"
|
|
|
139
|
+ type="warning"
|
|
|
140
|
+ :closable="false"
|
|
|
141
|
+ show-icon
|
|
|
142
|
+ class="finish-alert"
|
|
|
143
|
+ />
|
|
|
144
|
+ <el-form ref="finishFormRef" :model="finishForm" :rules="finishRules" label-width="90px" class="finish-form">
|
|
|
145
|
+ <el-form-item label="处理结果" prop="processResult">
|
|
|
146
|
+ <el-input
|
|
|
147
|
+ v-model="finishForm.processResult"
|
|
|
148
|
+ type="textarea"
|
|
|
149
|
+ :rows="5"
|
|
|
150
|
+ placeholder="请输入处理结果,买家可在退款/售后详情查看"
|
|
|
151
|
+ maxlength="500"
|
|
|
152
|
+ show-word-limit
|
|
|
153
|
+ />
|
|
|
154
|
+ </el-form-item>
|
|
|
155
|
+ </el-form>
|
|
|
156
|
+ <div slot="footer" class="dialog-footer">
|
|
|
157
|
+ <el-button type="primary" @click="submitFinish">确认完结</el-button>
|
|
|
158
|
+ <el-button @click="cancelFinish">取 消</el-button>
|
|
|
159
|
+ </div>
|
|
|
160
|
+ </el-dialog>
|
|
|
161
|
+ </div>
|
|
|
162
|
+</template>
|
|
|
163
|
+
|
|
|
164
|
+<script>
|
|
|
165
|
+import {
|
|
|
166
|
+ listSellerAftersale,
|
|
|
167
|
+ finishSellerAftersale
|
|
|
168
|
+} from "@/api/agri/seller/aftersale"
|
|
|
169
|
+import { getSellerContext } from "@/api/agri/seller/context"
|
|
|
170
|
+import { setSellerShopContext } from "@/utils/sellerShop"
|
|
|
171
|
+import SellerAftersaleDetail from "./detail"
|
|
|
172
|
+import SellerOrderDetail from "../order/detail"
|
|
|
173
|
+
|
|
|
174
|
+const APPLY_TYPE_MAP = {
|
|
|
175
|
+ "1": "仅退款-未发货",
|
|
|
176
|
+ "2": "仅退款-已发货",
|
|
|
177
|
+ "3": "退货退款"
|
|
|
178
|
+}
|
|
|
179
|
+
|
|
|
180
|
+const AFTERSALE_STATUS_MAP = {
|
|
|
181
|
+ "1": "进行中",
|
|
|
182
|
+ "2": "已完结"
|
|
|
183
|
+}
|
|
|
184
|
+
|
|
|
185
|
+export default {
|
|
|
186
|
+ name: "AgriSellerAftersale",
|
|
|
187
|
+ components: { SellerAftersaleDetail, SellerOrderDetail },
|
|
|
188
|
+ data() {
|
|
|
189
|
+ return {
|
|
|
190
|
+ loading: false,
|
|
|
191
|
+ showSearch: true,
|
|
|
192
|
+ total: 0,
|
|
|
193
|
+ aftersaleList: [],
|
|
|
194
|
+ statusTab: "all",
|
|
|
195
|
+ detailOpen: false,
|
|
|
196
|
+ currentAftersaleId: null,
|
|
|
197
|
+ orderDetailOpen: false,
|
|
|
198
|
+ currentOrderId: null,
|
|
|
199
|
+ finishOpen: false,
|
|
|
200
|
+ finishSubmitting: false,
|
|
|
201
|
+ currentFinishAftersaleId: null,
|
|
|
202
|
+ queryParams: {
|
|
|
203
|
+ pageNum: 1,
|
|
|
204
|
+ pageSize: 10,
|
|
|
205
|
+ aftersaleNo: undefined,
|
|
|
206
|
+ orderNo: undefined,
|
|
|
207
|
+ applyType: undefined,
|
|
|
208
|
+ aftersaleStatus: undefined
|
|
|
209
|
+ },
|
|
|
210
|
+ applyTypeOptions: [
|
|
|
211
|
+ { value: "1", label: "仅退款-未发货" },
|
|
|
212
|
+ { value: "2", label: "仅退款-已发货" },
|
|
|
213
|
+ { value: "3", label: "退货退款" }
|
|
|
214
|
+ ],
|
|
|
215
|
+ finishForm: {
|
|
|
216
|
+ processResult: ""
|
|
|
217
|
+ },
|
|
|
218
|
+ finishRules: {
|
|
|
219
|
+ processResult: [{ required: true, message: "请填写处理结果", trigger: "blur" }]
|
|
|
220
|
+ }
|
|
|
221
|
+ }
|
|
|
222
|
+ },
|
|
|
223
|
+ computed: {
|
|
|
224
|
+ hasSearchFilter() {
|
|
|
225
|
+ const q = this.queryParams
|
|
|
226
|
+ return !!(q.aftersaleNo || q.orderNo || q.applyType || q.aftersaleStatus)
|
|
|
227
|
+ },
|
|
|
228
|
+ emptyTableText() {
|
|
|
229
|
+ return this.hasSearchFilter ? "未找到符合条件的售后申请" : "暂无售后申请"
|
|
|
230
|
+ }
|
|
|
231
|
+ },
|
|
|
232
|
+ created() {
|
|
|
233
|
+ this.initPage()
|
|
|
234
|
+ },
|
|
|
235
|
+ methods: {
|
|
|
236
|
+ applyTypeLabel(type) {
|
|
|
237
|
+ return APPLY_TYPE_MAP[type] || "—"
|
|
|
238
|
+ },
|
|
|
239
|
+ aftersaleStatusLabel(status) {
|
|
|
240
|
+ return AFTERSALE_STATUS_MAP[status] || "—"
|
|
|
241
|
+ },
|
|
|
242
|
+ aftersaleStatusTag(status) {
|
|
|
243
|
+ const map = { "1": "warning", "2": "success" }
|
|
|
244
|
+ return map[status] || "info"
|
|
|
245
|
+ },
|
|
|
246
|
+ returnQuantityText(row) {
|
|
|
247
|
+ if (row.applyType === "1") {
|
|
|
248
|
+ return "—"
|
|
|
249
|
+ }
|
|
|
250
|
+ return row.returnQuantity != null ? row.returnQuantity : "—"
|
|
|
251
|
+ },
|
|
|
252
|
+ initPage() {
|
|
|
253
|
+ this.loadShopContext().then(() => {
|
|
|
254
|
+ this.getList()
|
|
|
255
|
+ }).catch(() => {
|
|
|
256
|
+ this.getList()
|
|
|
257
|
+ })
|
|
|
258
|
+ },
|
|
|
259
|
+ loadShopContext() {
|
|
|
260
|
+ return getSellerContext().then(response => {
|
|
|
261
|
+ const data = response.data || {}
|
|
|
262
|
+ if (data.shopId != null) {
|
|
|
263
|
+ setSellerShopContext(data.shopId, data.shopName)
|
|
|
264
|
+ }
|
|
|
265
|
+ })
|
|
|
266
|
+ },
|
|
|
267
|
+ getList() {
|
|
|
268
|
+ this.loading = true
|
|
|
269
|
+ listSellerAftersale(this.queryParams).then(response => {
|
|
|
270
|
+ this.aftersaleList = response.rows || []
|
|
|
271
|
+ this.total = response.total || 0
|
|
|
272
|
+ this.loading = false
|
|
|
273
|
+ }).catch(() => {
|
|
|
274
|
+ this.loading = false
|
|
|
275
|
+ })
|
|
|
276
|
+ },
|
|
|
277
|
+ handleTabClick() {
|
|
|
278
|
+ this.queryParams.aftersaleStatus = this.statusTab === "all" ? undefined : this.statusTab
|
|
|
279
|
+ this.queryParams.pageNum = 1
|
|
|
280
|
+ this.getList()
|
|
|
281
|
+ },
|
|
|
282
|
+ handleQuery() {
|
|
|
283
|
+ this.queryParams.pageNum = 1
|
|
|
284
|
+ this.getList()
|
|
|
285
|
+ },
|
|
|
286
|
+ resetQuery() {
|
|
|
287
|
+ this.resetForm("queryForm")
|
|
|
288
|
+ this.statusTab = "all"
|
|
|
289
|
+ this.queryParams.aftersaleStatus = undefined
|
|
|
290
|
+ this.queryParams.pageNum = 1
|
|
|
291
|
+ this.getList()
|
|
|
292
|
+ },
|
|
|
293
|
+ handleDetail(row) {
|
|
|
294
|
+ this.currentAftersaleId = row.aftersaleId
|
|
|
295
|
+ this.detailOpen = true
|
|
|
296
|
+ },
|
|
|
297
|
+ handleViewOrder(detail) {
|
|
|
298
|
+ if (!detail.orderId) {
|
|
|
299
|
+ return
|
|
|
300
|
+ }
|
|
|
301
|
+ this.currentOrderId = detail.orderId
|
|
|
302
|
+ this.orderDetailOpen = true
|
|
|
303
|
+ },
|
|
|
304
|
+ openFinishDialog(detail) {
|
|
|
305
|
+ this.handleFinish(detail)
|
|
|
306
|
+ },
|
|
|
307
|
+ handleFinish(row) {
|
|
|
308
|
+ if (row.aftersaleStatus !== "1") {
|
|
|
309
|
+ return
|
|
|
310
|
+ }
|
|
|
311
|
+ this.currentFinishAftersaleId = row.aftersaleId
|
|
|
312
|
+ this.finishForm.processResult = ""
|
|
|
313
|
+ this.finishOpen = true
|
|
|
314
|
+ this.$nextTick(() => {
|
|
|
315
|
+ if (this.$refs.finishFormRef) {
|
|
|
316
|
+ this.$refs.finishFormRef.clearValidate()
|
|
|
317
|
+ }
|
|
|
318
|
+ })
|
|
|
319
|
+ },
|
|
|
320
|
+ cancelFinish() {
|
|
|
321
|
+ this.finishOpen = false
|
|
|
322
|
+ this.currentFinishAftersaleId = null
|
|
|
323
|
+ this.finishForm.processResult = ""
|
|
|
324
|
+ if (this.$refs.finishFormRef) {
|
|
|
325
|
+ this.$refs.finishFormRef.resetFields()
|
|
|
326
|
+ }
|
|
|
327
|
+ },
|
|
|
328
|
+ submitFinish() {
|
|
|
329
|
+ this.$refs.finishFormRef.validate(valid => {
|
|
|
330
|
+ if (!valid) {
|
|
|
331
|
+ return
|
|
|
332
|
+ }
|
|
|
333
|
+ this.$modal.confirm("确认完结该售后单?完结后不可回退,处理结果将同步至买家端。").then(() => {
|
|
|
334
|
+ finishSellerAftersale(this.currentFinishAftersaleId, {
|
|
|
335
|
+ processResult: this.finishForm.processResult.trim()
|
|
|
336
|
+ }).then(() => {
|
|
|
337
|
+ this.$modal.msgSuccess("售后已完结")
|
|
|
338
|
+ this.finishOpen = false
|
|
|
339
|
+ this.getList()
|
|
|
340
|
+ if (this.detailOpen && this.$refs.aftersaleDetail) {
|
|
|
341
|
+ this.$refs.aftersaleDetail.reload()
|
|
|
342
|
+ }
|
|
|
343
|
+ })
|
|
|
344
|
+ }).catch(() => {})
|
|
|
345
|
+ })
|
|
|
346
|
+ }
|
|
|
347
|
+ }
|
|
|
348
|
+}
|
|
|
349
|
+</script>
|
|
|
350
|
+
|
|
|
351
|
+<style scoped lang="scss">
|
|
|
352
|
+.mb8 {
|
|
|
353
|
+ margin-bottom: 8px;
|
|
|
354
|
+}
|
|
|
355
|
+.order-info {
|
|
|
356
|
+ .order-no {
|
|
|
357
|
+ font-weight: 600;
|
|
|
358
|
+ margin-bottom: 6px;
|
|
|
359
|
+ }
|
|
|
360
|
+}
|
|
|
361
|
+.goods-info {
|
|
|
362
|
+ display: flex;
|
|
|
363
|
+ align-items: flex-start;
|
|
|
364
|
+ gap: 8px;
|
|
|
365
|
+}
|
|
|
366
|
+.goods-text {
|
|
|
367
|
+ flex: 1;
|
|
|
368
|
+ min-width: 0;
|
|
|
369
|
+}
|
|
|
370
|
+.sub-text {
|
|
|
371
|
+ color: #909399;
|
|
|
372
|
+ font-size: 12px;
|
|
|
373
|
+ line-height: 1.4;
|
|
|
374
|
+}
|
|
|
375
|
+.addr-text {
|
|
|
376
|
+ display: -webkit-box;
|
|
|
377
|
+ -webkit-line-clamp: 2;
|
|
|
378
|
+ -webkit-box-orient: vertical;
|
|
|
379
|
+ overflow: hidden;
|
|
|
380
|
+}
|
|
|
381
|
+.finish-alert {
|
|
|
382
|
+ margin-bottom: 16px;
|
|
|
383
|
+}
|
|
|
384
|
+.finish-form {
|
|
|
385
|
+ margin-top: 4px;
|
|
|
386
|
+}
|
|
|
387
|
+</style>
|