index.vue
7.04 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
<!-- -->
<template>
<div style="background-color:#f7f7f7;padding:10px 10px;" >
<div v-if="detailVisible==false">
<div class="refundPage">
<div style="height:58px;line-height:58px;">
<div style="color:#0006"> <span>订单管理</span> <span style="padding:0 5px;">></span> <span style="color:#000000e6">售后处理</span></div>
</div>
<div class="acTab">
<el-tabs v-model="formInline.state" @tab-click="handleClick">
<el-tab-pane label="待处理" name="0" />
<el-tab-pane label="已处理" name="1" />
</el-tabs>
</div>
<!-- 搜索 -->
<div class="formSearch">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="店铺名称/编号">
<el-input v-model="formInline.shopName" placeholder="请输入" />
</el-form-item>
<el-form-item label="订单id">
<el-input v-model="formInline.orderFormid" placeholder="请输入" />
</el-form-item>
<el-form-item label="申请时间">
<el-date-picker
v-model="formInline.dates"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</el-form-item>
<el-form-item>
<el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
<el-button style="background-color: #3F9B6A;color: #fff" @click="afterOrderDataExport">导出订单</el-button>
</el-form-item>
</el-form>
</div>
<!-- 表格 -->
<div class="tableBox">
<el-table
ref="multipleTable"
v-loading="tableLoading"
:data="tableData"
:header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
tooltip-effect="dark"
>
<el-table-column label="订单id" width="220">
<template slot-scope="scope">{{ scope.row.orderFormid }}</template>
</el-table-column>
<el-table-column prop="shopName" label="店铺名称" width="220" show-overflow-tooltip />
<el-table-column prop="shopCode" label="店铺编码" width="220" />
<el-table-column prop="number" label="退款商品数量" width="220" />
<el-table-column prop="refundMoney" label="退款金额(元)" width="220" />
<el-table-column label="操作" show-overflow-tooltip fixed="right">
<template slot-scope="scope">
<div class="btnList">
<div
v-if="formInline.state ==='0'"
class="tableBtn greens"
@click="seeMore(scope.row,1)"
>处理</div>
<div class="tableBtn greens" @click="seeMore(scope.row,2)">查看</div>
</div>
</template>
</el-table-column>
</el-table>
<div class="fenye">
<el-pagination
:current-page="formInline.page"
:page-sizes="[10, 20, 50, 100]"
:page-size="10"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</div>
<!-- <el-dialog
title="订单详情"
:visible.sync="detailVisible"
width="75%"
center
top="10vh"
:close-on-click-modal="false"
:modal-append-to-body="false"
>
</el-dialog> -->
</div>
</div>
<div class="refundPage" v-if="detailVisible">
<div style="height:58px;line-height:58px;" >
<div style="color:#0006"> <span>订单管理</span> <span style="padding:0 5px;">></span> <span style="color:#000000e6">订单详情</span></div>
<div>
<OrderDetail class="detailDialog" :detail-row="form" @cancel="cancel" />
</div>
</div>
</div>
</div>
</template>
<script>
import OrderDetail from '@/views/order/after/details/index.vue'
import { afterGetAll, afterOrderExport } from '@/api/after'
export default {
components: { OrderDetail },
data () {
return {
formInline: {
state: '0', // 处理状态 0-待处理 1-已处理
shopName: '', // 店铺名称或编号
orderFormid: '', // 订单编号
dates: [], // 申请时间数组
page: 1,
pageSize: 10
},
total: 1,
tableData: [],
tableLoading: false,
detailVisible: false,
form: {}
}
},
mounted () {
this.getAll(this.formInline)
},
// 方法集合
methods: {
handleSizeChange (val) {
this.formInline.pageSize = val
this.getAll(this.formInline)
},
handleCurrentChange (val) {
this.formInline.page = val
this.getAll(this.formInline)
},
handleClick (tab, event) {
this.formInline.state = tab.name
this.getAll(this.formInline)
},
// 查询
search () {
this.total = 1
this.formInline.page = 1
this.getAll(this.formInline)
},
// 查看
seeMore (row, index) {
row.type = index
this.detailVisible = true
this.form = row
},
cancel () {
this.detailVisible = false
},
// 编辑
edit () {},
// 删除
del () {},
// 初始化查询所有数据
async getAll (formInline) {
this.tableLoading = true
const res = await afterGetAll(formInline)
this.tableData = res.data.list
this.total = res.data.total
this.tableLoading = false
},
// 导出订单
async afterOrderDataExport() {
this.$message({
message: '数据导出中,请勿重复操作!',
type: 'success'
})
const res = await afterOrderExport(this.formInline)
if(!res){
return
}
const blob = new Blob([res],{ type: 'application/vnd.ms-excel' })
const fileName = '售后订单数据明细表.xls'
if ('download' in document.createElement('a')) {
// 非IE下载
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
} else {
// IE10+下载
navigator.msSaveBlob(blob, fileName)
}
},
}
}
</script>
<style lang='scss' scoped>
.refundPage {
padding: 0 20px 20px 20px;
min-height: calc(100vh - 50px - 20px);
background-color: #Fff;
.fenye {
margin-top: 20px;
}
.detailDialog{
height: 800px;
overflow: auto;
}
}
.greens {
color: #3F9B6A ;
}
::v-deep .buttonHover:hover{
color:#3f9b6a !important;
border-color: #c5e1d2 !important;
background-color: #ecf5f0 !important;
outline: none;
}
::v-deep .el-pagination__total {
position: absolute;
left: 10px;
}
</style>