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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
| <template>
| <el-bus-crud ref="crud" v-bind="tableConfig">
| <template #table="{ list }">
| <template v-if="list && list.length > 0">
| <after-sale-table :list="list" @detail="onDetail" @handle="onHandle" />
| </template>
| <el-bus-empty v-else />
| </template>
| </el-bus-crud>
| </template>
|
| <script>
| import AfterSaleTable from '@/components/order/after-sale-table'
| const feeKeys = [
| 'feeSupplier',
| 'feePlatform',
| 'feePartner',
| 'feePlatformPack',
| 'feePlatformCheck',
| 'feePlatformTransport',
| 'feePackingTransport',
| ]
| export default {
| components: {
| AfterSaleTable,
| },
| data() {
| return {
| tableConfig: {
| url: 'flower/api/sales/list',
| hasNew: false,
| hasEdit: false,
| hasDelete: false,
| hasExport: true,
| exportUrl: 'flower/api/sales/list/export',
| exportText: '售后导出',
| searchFormAttrs: {
| labelWidth: 'auto',
| },
| beforeRequest: (params) => {
| const searchForm = this.$refs.crud?.$refs?.searchForm
| if (searchForm) {
| const statusComp = searchForm.getComponentById('status')
| if (statusComp) {
| // 组件内部不会修改这个prop直接修改可忽略警告
| statusComp.extraQuery = { ...params, status: '' }
| statusComp.getOtherOptions()
| }
| }
| },
| searchForm: [
| {
| type: 'row',
| id: 'row',
| items: [
| {
| label: '售后状态:',
| id: 'status',
| type: 'bus-radio',
| el: {
| hasAll: true,
| otherInterfaceUri: 'flower/api/sales/status/count',
| childType: 'el-radio-button',
| filterOptions: (list) => {
| return list.map((item) => {
| return {
| ...item,
| label: `${item.label}(${item.orderCount})`,
| }
| })
| },
| // code: 'ORDER_SALES_STATUS',
| },
| default: this.$route.query.status || '',
| span: 24,
| searchImmediately: true,
| on: {
| optionsChange: (e, updateForm, { currentComp }) => {
| if (Array.isArray(e[0]) && e[0].length > 0) {
| const totalCount = e[0].reduce((total, current) => {
| return (total += current.orderCount)
| }, 0)
| // 组件内部不会修改这个prop直接修改可忽略警告
| currentComp.props = {
| allLabel: `不限(${totalCount})`,
| }
| }
| },
| },
| },
| { label: '商品名称:', id: 'flowerName', type: 'input' },
| { label: '订单号:', id: 'orderNo', type: 'input' },
| { label: '售后单号:', id: 'salesNo', type: 'input' },
| { label: '收货人姓名:', id: 'customer', type: 'input' },
| { label: '收货人电话:', id: 'customerTel', type: 'input' },
| { label: '供应商:', id: 'supplierName', type: 'input' },
| {
| label: '下单时间:',
| id: 'orderStartDateStr',
| component: 'el-bus-date-range',
| commonFormat: true,
| commonFormatProps: ['orderStartDateStr', 'orderEndDateStr'],
| customClass: 'in-bus-form',
| },
| {
| label: '售后时间:',
| id: 'salesStartDateStr',
| component: 'el-bus-date-range',
| commonFormat: true,
| commonFormatProps: ['salesStartDateStr', 'salesEndDateStr'],
| customClass: 'in-bus-form',
| },
| {
| label: '售后类别',
| id: 'salesType',
| type: 'bus-select-dict',
| el: {
| code: 'after_sale_type',
| clearable: true,
| style: 'width:100%',
| },
| },
| ],
| },
| ],
| form: [
| {
| type: 'row',
| items: [
| { label: '商品名称:', id: 'flowerName', type: 'input' },
| { label: '合伙人加价(元):', id: 'markupPartner', type: 'input' },
| { label: '原价(元):', id: 'price', type: 'input' },
| { label: '券后单价(元):', id: 'realPrice', type: 'input' },
| { label: '券后总金额(元):', id: 'realTotal', type: 'input' },
| { label: '供应商价格(元):', id: 'supplierPrice', type: 'input' },
| { label: '商品数量:', id: 'flowerNum', type: 'input' },
| { label: '申请售后数量:', id: 'num', type: 'input' },
| ],
| },
| {
| type: 'row',
| items: [
| {
| label: '质检总扣款(元):',
| id: 'checkTotalAmount',
| type: 'input',
| span: 24,
| customClass: 'to-red to-bold',
| },
| {
| label: '降级数量:',
| id: 'reduceNum',
| type: 'input',
| },
| {
| label: '降级总金额(元):',
| id: 'reduceAmount',
| type: 'input',
| },
| {
| label: '缺货数量:',
| id: 'lackNum',
| type: 'input',
| span: 24,
| },
| {
| label: '已退总金额(元):',
| id: 'refundTotalAmount',
| type: 'input',
| span: 24,
| customClass: 'to-red to-bold',
| },
| ],
| },
| ],
| extraDialogs: [
| {
| title: '售后处理',
| readonly: true,
| confirmText: '通过',
| cancelText: '不通过',
| confirmButtonAttrs: {
| type: 'success',
| },
| cancelButtonAttrs: {
| type: 'danger',
| },
| dialogAttrs: {
| width: '70%',
| },
| form: [
| {
| type: 'row',
| items: [
| {
| label: '供应商(元):',
| id: 'feeSupplier',
| type: 'input-number',
| el: { min: 0, precision: 2, controls: false },
| },
| {
| label: '平台(元):',
| id: 'feePlatform',
| type: 'input-number',
| el: { min: 0, precision: 2, controls: false },
| },
| {
| label: '合伙人(元):',
| id: 'feePartner',
| type: 'input-number',
| el: { min: 0, precision: 2, controls: false },
| },
| {
| label: '打包(元):',
| id: 'feePlatformPack',
| type: 'input-number',
| el: { min: 0, precision: 2, controls: false },
| },
| {
| label: '质检(元):',
| id: 'feePlatformCheck',
| type: 'input-number',
| el: { min: 0, precision: 2, controls: false },
| },
| {
| label: '物流(元):',
| id: 'feePlatformTransport',
| type: 'input-number',
| el: { min: 0, precision: 2, controls: false },
| },
| {
| label: '打包运费(元)(散户):',
| id: 'feePackingTransport',
| type: 'input-number',
| el: { min: 0, precision: 2, controls: false },
| },
| {
| label: '实际总扣款(元):',
| id: 'tempTotal',
| component: 'simple-text',
| readonly: true,
| forceDisabled: true,
| el: (row) => ({
| text: feeKeys
| .reduce((total, current) => {
| total += row[current] ?? 0
| return total
| }, 0)
| .toFixed(2),
| }),
| span: 24,
| customClass: 'to-bold-label',
| },
| {
| label: '申请理由:',
| id: 'reason',
| type: 'input',
| el: {
| type: 'textarea',
| },
| readonly: true,
| span: 24,
| },
| {
| label: '平台回复:',
| id: 'remarks',
| type: 'input',
| el: {
| type: 'textarea',
| rows: 6,
| },
| rules: {
| required: true,
| message: '请输入平台回复',
| trigger: 'blur',
| },
| span: 24,
| },
| ],
| },
| ],
| atConfirm: async (val) => {
| const { code } = await this.$elBusHttp.request(
| 'flower/api/sales/audit/agree',
| { method: 'post', data: val }
| )
| if (code === 0) {
| this.$message.success('操作成功')
| } else {
| return false
| }
| },
| atCancel: async (val) => {
| const { code } = await this.$elBusHttp.request(
| 'flower/api/sales/audit/reject',
| {
| method: 'post',
| data: {
| id: val.id,
| remarks: val.remarks,
| },
| }
| )
| if (code === 0) {
| this.$message.success('操作成功')
| } else {
| return false
| }
| },
| },
| ],
| },
| }
| },
| head() {
| return {
| title: '售后理赔',
| }
| },
| methods: {
| onDetail(item) {
| this.$router.push(`${this.$route.path}/view/${item.id}`)
| },
| async onHandle(item) {
| const { code, data } = await this.$elBusHttp.request(
| 'flower/api/sales/list/view',
| { params: { id: item.id } }
| )
| if (code === 0) {
| feeKeys.forEach((key) => {
| data[key] = data[key] ?? undefined
| })
| this.$refs.crud.$refs.extraDialog[0].show(data)
| }
| },
| },
| }
| </script>
|
| <style lang="scss" scoped>
| ::v-deep {
| .el-form-item {
| &.to-bold {
| .el-form-item__label,
| .simple-text,
| .el-bus-form-item__normal {
| font-weight: bold;
| }
| }
| &.to-red {
| .el-form-item__label,
| .simple-text,
| .el-bus-form-item__normal {
| color: $danger-color;
| }
| }
| &.to-bold-label {
| .el-form-item__label {
| font-weight: bold;
| }
| }
| }
| }
| </style>
|
|