|
|
@@ -43,11 +43,11 @@
|
|
|
<div class="filter-bar">
|
|
|
<span class="filter-label">状态</span>
|
|
|
<el-select v-model="queryParams.status" placeholder="请选择" style="width: 100px" clearable>
|
|
|
- <el-option label="申请中" value="applying" />
|
|
|
- <el-option label="已退货" value="returned" />
|
|
|
- <el-option label="已拒绝" value="rejected" />
|
|
|
- <el-option label="已完成" value="completed" />
|
|
|
- <el-option label="已取消" value="cancelled" />
|
|
|
+ <el-option label="申请中" value="0" />
|
|
|
+ <el-option label="已退货" value="1" />
|
|
|
+ <el-option label="已拒绝" value="2" />
|
|
|
+ <el-option label="已完成" value="3" />
|
|
|
+ <el-option label="已取消" value="4" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
|
|
|
@@ -81,7 +81,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-time">{{ item.applyTime }}</div>
|
|
|
- <div class="col-type">{{ item.serviceType }}</div>
|
|
|
+ <div class="col-type">{{ getDictLabel(service_type, item.serviceType) }}</div>
|
|
|
<div class="col-status">
|
|
|
<span :class="['status-text', getStatusClass(item.status)]">{{ item.statusText }}</span>
|
|
|
</div>
|
|
|
@@ -90,6 +90,9 @@
|
|
|
</div>
|
|
|
<el-empty v-if="afterSaleList.length === 0" description="暂无售后记录" />
|
|
|
</div>
|
|
|
+ <div class="pagination-wrapper">
|
|
|
+ <TablePagination v-model:page="pagination.page" v-model:pageSize="pagination.pageSize" :total="pagination.total" />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<template v-else>
|
|
|
@@ -155,6 +158,9 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<el-empty v-if="complaintList.length === 0" description="暂无投诉与建议" />
|
|
|
+ <div class="pagination-wrapper">
|
|
|
+ <TablePagination v-model:page="pagination.page" v-model:pageSize="pagination.pageSize" :total="pagination.total" />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<el-dialog v-model="complaintDialogVisible" :title="complaintDialogTitle" width="500px">
|
|
|
@@ -181,7 +187,8 @@ import { ref, reactive, computed, onMounted } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { Search, RefreshRight, Tools, ChatLineSquare, Picture } from '@element-plus/icons-vue';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
-import { getOrderReturnList, getOrderReturnInfo, addOrderReturn, updateOrderReturn, deleteOrderReturn } from '@/api/pc/enterprise/orderReturn';
|
|
|
+import { PageTitle, SearchBar, TablePagination } from '@/components';
|
|
|
+import { getOrderReturnList, getOrderReturnInfo, addOrderReturn, updateOrderReturn } from '@/api/pc/enterprise/orderReturn';
|
|
|
import type { OrderReturn } from '@/api/pc/enterprise/orderReturnTypes';
|
|
|
import {
|
|
|
getComplaintsSuggestionsList,
|
|
|
@@ -189,9 +196,10 @@ import {
|
|
|
updateComplaintsSuggestions,
|
|
|
deleteComplaintsSuggestions
|
|
|
} from '@/api/pc/valueAdded';
|
|
|
-import { lo } from 'element-plus/es/locale/index.mjs';
|
|
|
+import { status } from 'nprogress';
|
|
|
+import { stat } from 'fs';
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { complaints_suggestion_type } = toRefs<any>(proxy?.useDict('complaints_suggestion_type'));
|
|
|
+const { service_type, complaints_suggestion_type } = toRefs<any>(proxy?.useDict('service_type', 'complaints_suggestion_type'));
|
|
|
|
|
|
const router = useRouter();
|
|
|
const activeMainTab = ref('return');
|
|
|
@@ -201,7 +209,7 @@ const complaintDialogTitle = ref('新增投诉与建议');
|
|
|
const complaintFormRef = ref();
|
|
|
const currentComplaint = ref<any>(null);
|
|
|
const loading = ref(false);
|
|
|
-
|
|
|
+const pagination = reactive({ page: 1, pageSize: 5, total: 0 });
|
|
|
const mainTabs = [
|
|
|
{ key: 'return', label: '退换货', icon: RefreshRight },
|
|
|
{ key: 'repair', label: '返修/维修', icon: Tools },
|
|
|
@@ -210,20 +218,20 @@ const mainTabs = [
|
|
|
|
|
|
const statusTabs = [
|
|
|
{ key: 'all', label: '全部订单' },
|
|
|
- { key: 'applying', label: '申请中' },
|
|
|
- { key: 'returned', label: '已退货' },
|
|
|
- { key: 'rejected', label: '已拒绝' },
|
|
|
- { key: 'completed', label: '已完成' },
|
|
|
- { key: 'cancelled', label: '已取消' }
|
|
|
+ { key: '0', label: '申请中' },
|
|
|
+ { key: '1', label: '已退货' },
|
|
|
+ { key: '2', label: '已拒绝' },
|
|
|
+ { key: '3', label: '已完成' },
|
|
|
+ { key: '4', label: '已取消' }
|
|
|
];
|
|
|
|
|
|
const complaintStatusTabs = [
|
|
|
{ key: 'all', label: '全部订单' },
|
|
|
- { key: 'applying', label: '申请中' },
|
|
|
- { key: 'returned', label: '已退货' },
|
|
|
- { key: 'rejected', label: '已拒绝' },
|
|
|
- { key: 'completed', label: '已完成' },
|
|
|
- { key: 'cancelled', label: '已取消' }
|
|
|
+ { key: '0', label: '申请中' },
|
|
|
+ { key: '1', label: '已退货' },
|
|
|
+ { key: '2', label: '已拒绝' },
|
|
|
+ { key: '3', label: '已完成' },
|
|
|
+ { key: '4', label: '已取消' }
|
|
|
];
|
|
|
|
|
|
const queryParams = reactive({ keyword: '', dateRange: null, status: '', handleResult: '', feedbackType: '' });
|
|
|
@@ -241,8 +249,10 @@ const loadAfterSaleData = async () => {
|
|
|
try {
|
|
|
loading.value = true;
|
|
|
const res = await getOrderReturnList({
|
|
|
+ pageNum: pagination.page,
|
|
|
+ pageSize: pagination.pageSize,
|
|
|
returnStatus: activeStatusTab.value === 'all' ? '' : activeStatusTab.value,
|
|
|
- serviceType: '0'
|
|
|
+ serviceType: activeMainTab.value === 'return' ? '1' : activeMainTab.value === 'repair' ? '3' : ''
|
|
|
});
|
|
|
|
|
|
if (res.code === 200 && res.rows) {
|
|
|
@@ -258,8 +268,9 @@ const loadAfterSaleData = async () => {
|
|
|
serviceType: item.serviceType,
|
|
|
status: item.returnStatus,
|
|
|
statusText: getStatusText(item.returnStatus),
|
|
|
- type: item.serviceType === '0' ? 'return' : 'repair'
|
|
|
+ type: item.serviceType === '1' ? 'return' : 'repair'
|
|
|
}));
|
|
|
+ pagination.total = res.total | 0;
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('加载售后数据失败:', error);
|
|
|
@@ -278,11 +289,11 @@ const getDictLabel = (dictOptions: any[], value: string) => {
|
|
|
// 获取状态文本
|
|
|
const getStatusText = (status?: string) => {
|
|
|
const statusMap: Record<string, string> = {
|
|
|
- 'applying': '申请中',
|
|
|
- 'returned': '已退货',
|
|
|
- 'rejected': '已拒绝',
|
|
|
- 'completed': '已完成',
|
|
|
- 'cancelled': '已取消'
|
|
|
+ '0': '申请中',
|
|
|
+ '1': '已退货',
|
|
|
+ '2': '已拒绝',
|
|
|
+ '3': '已完成',
|
|
|
+ '4': '已取消'
|
|
|
};
|
|
|
return statusMap[status || ''] || status || '未知';
|
|
|
};
|
|
|
@@ -300,7 +311,7 @@ const complaintList = ref([]);
|
|
|
const handleMainTabChange = (key: string) => {
|
|
|
activeMainTab.value = key;
|
|
|
activeStatusTab.value = 'all';
|
|
|
- if (key !== 'complaint') {
|
|
|
+ if (key != 'complaint') {
|
|
|
loadAfterSaleData();
|
|
|
} else {
|
|
|
loadComplaintData();
|
|
|
@@ -318,7 +329,7 @@ onMounted(() => {
|
|
|
loadAfterSaleData();
|
|
|
});
|
|
|
const getStatusClass = (status: string) => {
|
|
|
- const map: Record<string, string> = { applying: 'warning', returned: 'success', rejected: 'danger', completed: 'success', cancelled: 'info' };
|
|
|
+ const map: Record<string, string> = { 0: 'warning', 1: 'success', 2: 'danger', 3: 'success', 4: 'info' };
|
|
|
return map[status] || 'info';
|
|
|
};
|
|
|
const handleViewDetail = (item: any) => {
|
|
|
@@ -366,10 +377,11 @@ const handleSubmitComplaint = async () => {
|
|
|
};
|
|
|
|
|
|
const loadComplaintData = async () => {
|
|
|
- const params: any = {};
|
|
|
+ const params: any = { pageNum: pagination.page, pageSize: pagination.pageSize };
|
|
|
const res = await getComplaintsSuggestionsList(params);
|
|
|
if (res.code === 200 && res.rows) {
|
|
|
complaintList.value = res.rows;
|
|
|
+ pagination.total = res.total || 0;
|
|
|
}
|
|
|
};
|
|
|
</script>
|