Skip to content

Commit 4b13497

Browse files
committed
trade:【交易售后】查询分页列表
1 parent 9ffc008 commit 4b13497

File tree

2 files changed

+40
-156
lines changed

2 files changed

+40
-156
lines changed

src/views/mall/trade/afterSale/bak.vue

Lines changed: 0 additions & 149 deletions
This file was deleted.

src/views/mall/trade/afterSale/index.vue

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,28 @@
4646
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
4747
</el-row>
4848

49+
<!-- Tab 选项:真正的内容在 Lab -->
50+
<el-tabs v-model="activeTab" type="card" @tab-click="tabClick" style="margin-top: -40px;">
51+
<el-tab-pane v-for="tab in statusTabs" :key="tab.value" :label="tab.label" :name="tab.value" />
52+
</el-tabs>
53+
4954
<!-- 列表 -->
5055
<el-table v-loading="loading" :data="list">
5156
<el-table-column label="退款编号" align="center" prop="no" />
52-
<el-table-column label="订单编号" align="center" prop="orderNo" />
53-
<el-table-column label="订单编号" align="center" prop="orderNo" />
54-
<el-table-column label="商品信息" align="center" prop="status" width="auto" min-width="300">
57+
<el-table-column label="订单编号" align="center" prop="orderNo" /> <!-- TODO 芋艿:未来要加个订单链接 -->
58+
<el-table-column label="商品信息" align="center" prop="spuName" width="auto" min-width="300">
5559
<!-- TODO @小红:样式不太对,辛苦改改 -->
5660
<!-- <div slot-scope="{ row }" class="goods-info">-->
5761
<!-- <img :src="row.picUrl"/>-->
5862
<!-- <span class="ellipsis-2" :title="row.name">{{row.name}}</span>-->
5963
<!-- </div>-->
6064
</el-table-column>
61-
<el-table-column label="订单金额" align="center" prop="refundPrice" />
62-
<el-table-column label="买家" align="center" prop="userId" />
65+
<el-table-column label="订单金额" align="center" prop="refundPrice">
66+
<template v-slot="scope">
67+
<span>¥{{ (scope.row.refundPrice / 100.0).toFixed(2) }}</span>
68+
</template>
69+
</el-table-column>
70+
<el-table-column label="买家" align="center" prop="user.nickname" /> <!-- TODO 芋艿:未来要加个会员链接 -->
6371
<el-table-column label="申请时间" align="center" prop="createTime" width="180">
6472
<template v-slot="scope">
6573
<span>{{ parseTime(scope.row.createTime) }}</span>
@@ -77,8 +85,9 @@
7785
</el-table-column>
7886
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
7987
<template v-slot="scope">
80-
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"-->
81-
<!-- v-hasPermi="['trade:after-sale:update']">修改</el-button>-->
88+
<el-button size="mini" type="text" icon="el-icon-thumb"
89+
>处理退款</el-button>
90+
<!-- @click="handleUpdate(scope.row)" v-hasPermi="['trade:after-sale:update']"-->
8291
</template>
8392
</el-table-column>
8493
</el-table>
@@ -91,6 +100,7 @@
91100
<script>
92101
import { getAfterSalePage } from "@/api/mall/trade/afterSale";
93102
import { datePickerOptions } from "@/utils/constants";
103+
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
94104
95105
export default {
96106
name: "AfterSale",
@@ -124,12 +134,25 @@ export default {
124134
way: null,
125135
type: null,
126136
},
137+
// Tab 筛选
138+
activeTab: 'all',
139+
statusTabs: [{
140+
label: '全部',
141+
value: 'all'
142+
}],
127143
// 静态变量
128144
datePickerOptions: datePickerOptions
129145
};
130146
},
131147
created() {
132148
this.getList();
149+
// 设置 statuses 过滤
150+
for (const dict of getDictDatas(DICT_TYPE.TRADE_AFTER_SALE_STATUS)) {
151+
this.statusTabs.push({
152+
label: dict.label,
153+
value: dict.value
154+
})
155+
}
133156
},
134157
methods: {
135158
/** 查询列表 */
@@ -145,13 +168,23 @@ export default {
145168
/** 搜索按钮操作 */
146169
handleQuery() {
147170
this.queryParams.pageNo = 1;
171+
this.activeTab = this.queryParams.status ? this.queryParams.status : 'all'; // 处理 tab
148172
this.getList();
149173
},
150174
/** 重置按钮操作 */
151175
resetQuery() {
152176
this.resetForm("queryForm");
177+
this.activeTab = 'all'; // 处理 tab
153178
this.handleQuery();
154179
},
180+
/** tab 切换 */
181+
tabClick(tab) {
182+
this.queryParams.status = tab.name === 'all' ? undefined : tab.name;
183+
this.getList();
184+
},
185+
goToDetail (row) {
186+
this.$router.push({ path: '/mall/trade/order/detail', query: { orderNo: row.orderNo }})
187+
}
155188
}
156189
};
157190
</script>

0 commit comments

Comments
 (0)