index.vue
11.7 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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
<template>
<div class="equity-wrap">
<div class="equity-wrap contain">
<GLCombiForm ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="out_wrap">
<div class="choseRow flex_sc">
<div class="choseItem" :class="{ active: currentIndex == index }" v-for="(item, index) in choseList" :key="index" @click="tabClick(index)">
{{ item }}
</div>
</div>
</div>
<div class="table_border">
<GLTable v-if="flag" :noDataImg="url" ref="table" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="tableParams.getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="desc" slot-scope="scope">
<el-popover placement="bottom" width="240" trigger="click">
<img :src="scope.scope.img" style="width: 200px; height: 200px" />
<img :src="scope.scope.img" style="width: 36px; height: 36px" slot="reference" />
</el-popover>
<!-- <div class="flex_sc refund-box">
<div class="refund-img-box">
<img :src="scope.scope.img" alt="" />
</div>
</div> -->
</span>
<span slot="goodMsg" slot-scope="scope">
<div v-if="scope.scope.brandName || scope.scope.productName" class="refund-box">
<div class="mb4">{{ scope.scope.brandName }}</div>
<div class="min-text">{{ scope.scope.productName }}</div>
</div>
<div v-else>--</div>
</span>
<span slot="userInfo" slot-scope="scope">
<div class="mb4">{{ scope.scope.accountName }}</div>
<div class="min-text">{{ scope.scope.mobile }}</div>
</span>
<div class="flex_sc" slot="colorStatus" slot-scope="scope">
<div class="table_point" :style="{ background: colors[scope.scope.refundStatus] }"></div>
<span>{{ refundStatusList[scope.scope.refundStatus] }}</span>
</div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLButton fn="查看售后详情" type="text" @click="jump(scope.scope, 'sale')">查看详情</GLButton>
</span>
</GLTable>
</div>
</div>
</div>
</template>
<script>
// type='text/ecmascript-6'
// import { orderMixin, searchMixin } from '@/mixins'
import url from '@/assets/empty.png'
export default {
name: '',
// mixins: [orderMixin, searchMixin],
data() {
return {
url: url,
choseList: ['全部', '售后中', '售后完成'],
currentIndex: 0,
size: 'small',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
flag: true,
tabIndex: '',
// searchForm: {},
searchForm: {
orderCode: '',
refundCode: '',
productName: '',
merchantName: '',
userInfo: '',
daterange: ''
},
searchFormData: [
{
label: '售后编号',
name: 'refundCode',
type: 'input',
isClear: true
},
{
label: '订单编号',
name: 'orderCode',
type: 'input',
isClear: true
},
{
label: '商品名称',
name: 'productName',
type: 'input',
isClear: true
},
{
label: '门店名称',
name: 'merchantName',
type: 'input',
isClear: true
},
{
label: '用户信息',
name: 'userInfo',
type: 'input',
isClear: true
},
{
label: '下单时间',
name: 'daterange',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true,
customPickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
}
],
searchFormTable: {},
tableParams: {
listName: 'list',
getListApi: this.$apis.orderApi.getRefundList,
tableColumns: [
{
label: '售后图片',
width: 100,
addHtml: 'desc'
},
{
label: '售后描述',
width: 300,
line: 1,
prop: 'reason'
},
{
label: '售后编号',
prop: 'refundCode',
width: 300
},
{
label: '商品信息',
minWidth: 200,
addHtml: 'goodMsg'
},
{
label: '订单编号',
width: 250,
prop: 'orderCode'
},
{
label: '价格/元',
width: 110,
align: 'right',
prop: 'orderPrices'
},
{
label: '数量/张',
width: 110,
align: 'right',
prop: 'goodsQuality'
},
{
label: '订单渠道',
width: 250,
line: 1,
prop: 'merchantName'
},
{
label: '实收金额/元',
width: 120,
align: 'right',
formatter: cell => {
return `${cell.orderPrices}`
}
},
{
label: '售后状态',
width: 120,
addHtml: 'colorStatus'
// formatter: cell => {
// const refundStatusList = {
// 1: '售后中',
// 2: '已拒绝',
// 3: '退款成功'
// }
// return `${refundStatusList[cell.refundStatus]}`
// }
},
{
label: '售后时间',
width: 180,
formatter: cell => {
return cell.createDate ? new Date(cell.createDate).format('yyyy-MM-dd hh:mm:ss') : '- -'
}
},
{
label: '用户信息',
minWidth: '200',
addHtml: 'userInfo'
},
{
label: '操作',
width: 100,
fixed: 'right',
addHtml: 'auth-button'
}
]
},
refundStatusList: {
1: '售后中',
2: '已拒绝',
3: '退款成功'
},
colors: {
1: '#5850FF',
2: '#999999',
3: '#2CCA74'
}
}
},
mounted() {},
methods: {
getHttpsImgUrl(url) {
if (!url) {
return ''
}
var flag = url.startsWith('http:')
// console.log(flag,'快快快')
if (flag) {
var newurl = url.replace('http:', 'https:')
//去掉http自动带的端口 :7060,https不能有
var startPos = newurl.lastIndexOf(':')
var endPos = newurl.indexOf('/', startPos)
var preStr = newurl.substring(0, startPos)
var afterStr = newurl.substring(endPos)
// console.log(preStr,'前部分')
// console.log(afterStr,'后部分')
var finalStr = preStr + afterStr
// console.log(finalStr,'6777777')
return finalStr
}
return url
},
tabClick(index) {
this.currentIndex = index
this.searchForm.redundStatus = ''
switch (index) {
case 0:
delete this.searchForm['redundStatus[0]']
delete this.searchForm['redundStatus[1]']
delete this.searchForm['redundStatus']
// delete this.searchForm['orderStatus[2]']
// this.searchForm.orderStatus = ''
break
case 1:
//售后中
delete this.searchForm['redundStatus[0]']
delete this.searchForm['redundStatus[1]']
this.searchForm['redundStatus[0]'] = 1
delete this.searchForm['redundStatus']
break
case 2:
delete this.searchForm['redundStatus[0]']
delete this.searchForm['redundStatus[1]']
this.searchForm['redundStatus[0]'] = 2
this.searchForm['redundStatus[1]'] = 3
delete this.searchForm['redundStatus']
break
}
this.handleSearch()
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchFormTable.daterange) {
this.searchFormTable.orderDateStart = this.searchForm.daterange[0] + ' 00:00:00'
this.searchFormTable.orderDateEnd = this.searchForm.daterange[1] + ' 23:59:59'
} else {
if (this.searchFormTable.orderDateStart) delete this.searchFormTable.orderDateStart && delete this.searchFormTable.orderDateEnd
}
delete this.searchFormTable.daterange
resolve()
})
},
setTableFinishFun() {
// 接收到的数据为空
if (!this.$refs.table.data.length) {
this.$refs.table.setTableHeightFun()
}
},
handleReset() {
this.flag = false
this.currentIndex = 0
this.searchForm = {}
this.$nextTick(() => {
this.flag = true
})
},
handleSearch() {
this.$refs.table.refreshTable()
},
jump(query, name) {
let parent = name == 'order' ? '/order/detail' : '/sale/detail'
// window.location.href = `./detail.html?orderCode=${orderCode}`
// let target = ['嘀加权益卡管理平台', '运营平台', '权益', parent, '*详情']
// if (window.$config.axios.environment) {
// let arr = name == 'order' ? ['订单管理', '*权益订单详情'] : ['售后管理', '售后详情']
// target = ['权益卡管理平台', '运营平台', 'SCRM权益平台', ...arr]
// }
// console.log(target, { orderCode: query.orderCode })
// this.$root.to(target, { orderCode: query.orderCode })
this.$router.push({ path: parent, query })
}
}
}
// <style src="@a/css/tao.css"></style>
// <style >
// .el-tabs__nav-wrap:after {
// display: none;
// }
// .refund-img-box {
// width: 100px;
// height: 100px;
// margin-bottom: 10px;
// }
// .refund-title {
// margin-bottom: 10px;
// }
// </style>
</script>
<style lang="scss" scoped>
.equity-wrap .contain {
padding: 20px;
.out_wrap {
position: relative;
z-index: 100;
margin-bottom: -1px;
}
.choseRow {
.choseItem {
display: inline-block;
box-sizing: border-box;
padding: 0 20px;
height: 40px;
line-height: 40px;
cursor: pointer;
border: 1px solid #e5e5e5;
margin-right: 1px;
border-radius: 4px 4px 0 0;
background: #fafafa;
}
.active {
color: #5850ff;
background-color: white;
font-weight: 600;
border-bottom: none;
}
}
.refund-img-box {
width: 36px;
height: 36px;
margin-right: 8px;
> img {
width: 100%;
height: 100%;
}
}
.refund-title {
margin-bottom: 10px;
}
.table_border {
border: 1px solid #e5e5e5;
box-sizing: border-box;
padding: 16px 20px;
border-radius: 0 4px 4px 4px;
}
.hide-text {
width: 156px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
cursor: pointer;
}
.mb4 {
margin-bottom: 4px;
}
.min-text {
font-size: 10px;
color: #999;
font-weight: 400;
}
}
.el-form-item {
margin-bottom: 15px;
}
.el-range-editor.is-active,
.el-range-editor.is-active:hover {
border-color: #5850ff;
width: 215px;
}
.el-range-editor--small.el-input__inner {
width: 215px;
}
// /deep/ .contain .el-input--small .el-input__inner {
// width: 215px;
// }
</style>