|
|
@@ -1,26 +1,22 @@
|
|
|
<template>
|
|
|
<div class="table-box">
|
|
|
<ProTable ref="proTable" :columns="columns" :request-api="getTableList" :data-callback="dataCallback">
|
|
|
- <template #endFundsButton="scope">
|
|
|
- <el-tag v-if="scope.row.endFundsButton == 1" type="success"> 审核中 </el-tag>
|
|
|
- <el-tag v-if="scope.row.endFundsButton == 2" type="success"> 已通过 </el-tag>
|
|
|
- <el-tag v-if="scope.row.endFundsButton == 3" type="primary"> 已驳回 </el-tag>
|
|
|
- </template>
|
|
|
- <template #promoteType="scope">
|
|
|
- <el-tag v-for="(item, index) in getPromoteTypes(scope.row.promoteType)" :key="index">
|
|
|
- {{ item }}
|
|
|
+ <template #processingStatus="scope">
|
|
|
+ <el-tag v-if="getStatusMeta(scope.row.processingStatus)" :type="getStatusMeta(scope.row.processingStatus)?.tagType">
|
|
|
+ {{ getStatusMeta(scope.row.processingStatus)?.label }}
|
|
|
</el-tag>
|
|
|
+ <span v-else> -- </span>
|
|
|
</template>
|
|
|
|
|
|
<template #operation="scope">
|
|
|
<el-button type="primary" :icon="Search" link @click="handleDetail(scope.row)"> 查看详情 </el-button>
|
|
|
- <el-button type="primary" :icon="Setting" v-if="scope.row.endFundsButton == 1" link @click="handleReview(scope.row)">
|
|
|
+ <el-button type="primary" :icon="Setting" v-if="scope.row.processingStatus == 0" link @click="handleReview(scope.row)">
|
|
|
审核
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</ProTable>
|
|
|
|
|
|
- <ReviewDialog ref="reviewDialog" @approve="handleApprove" @reject="handleReject" />
|
|
|
+ <ReviewDialog ref="reviewDialog" @submit="handleReviewSubmit" />
|
|
|
<DetailDialog ref="detailDialog" />
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -29,18 +25,41 @@
|
|
|
import ReviewDialog from "./reviewDialog.vue";
|
|
|
import DetailDialog from "./detailDialog.vue";
|
|
|
import { ref, reactive, onActivated } from "vue";
|
|
|
-import type { Course } from "@/api/interface";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
import ProTable from "@/components/ProTable/index.vue";
|
|
|
import type { ProTableInstance, ColumnProps } from "@/components/ProTable/interface";
|
|
|
import { Search, Setting } from "@element-plus/icons-vue";
|
|
|
+import { getViolationPage, violationApprove } from "@/api/modules/lawyer";
|
|
|
|
|
|
const proTable = ref<ProTableInstance>();
|
|
|
|
|
|
const reviewDialog = ref<any>(null);
|
|
|
const detailDialog = ref<any>(null);
|
|
|
+const currentRow = ref<any>();
|
|
|
+
|
|
|
+const statusMeta = [
|
|
|
+ { value: 0, label: "未处理", tagType: "info" },
|
|
|
+ { value: 1, label: "违规", tagType: "danger" },
|
|
|
+ { value: 2, label: "未违规", tagType: "success" }
|
|
|
+] as const;
|
|
|
+
|
|
|
+const violationTypeMeta = [
|
|
|
+ { value: 1, label: "服务态度差" },
|
|
|
+ { value: 2, label: "专业能力差" },
|
|
|
+ { value: 3, label: "响应时间超过24小时" },
|
|
|
+ { value: 4, label: "其他原因" }
|
|
|
+] as const;
|
|
|
+
|
|
|
+const getStatusMeta = (status?: number) => statusMeta.find(item => item.value == status);
|
|
|
+const getViolationMeta = (type?: number | string) => violationTypeMeta.find(item => item.value == type);
|
|
|
+
|
|
|
+const getViolationDisplay = (row: any) => {
|
|
|
+ if (!row) return "--";
|
|
|
+ if (row.violationReason == 4) return row.otherReasonContent || "其他原因";
|
|
|
+ return getViolationMeta(row.violationReason)?.label || "--";
|
|
|
+};
|
|
|
|
|
|
-const columns = reactive<ColumnProps<Course.ReqCourseParams>[]>([
|
|
|
+const columns = reactive<ColumnProps<any>[]>([
|
|
|
{
|
|
|
label: "序号",
|
|
|
type: "index",
|
|
|
@@ -49,79 +68,64 @@ const columns = reactive<ColumnProps<Course.ReqCourseParams>[]>([
|
|
|
fixed: "left" // 固定在左侧
|
|
|
},
|
|
|
{
|
|
|
- label: "订单编号",
|
|
|
- prop: "orderNo",
|
|
|
- width: 240,
|
|
|
- search: { el: "input", tooltip: "请输入订单编号" },
|
|
|
+ label: "律师姓名",
|
|
|
+ prop: "reportedUserName",
|
|
|
+ width: 200,
|
|
|
+ search: { el: "input", tooltip: "请输入律师姓名" },
|
|
|
fixed: "left", // 固定在左侧
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
{
|
|
|
- label: "姓名",
|
|
|
- prop: "realName",
|
|
|
- width: 160,
|
|
|
- search: { el: "input", tooltip: "请输入姓名" },
|
|
|
+ label: "订单编号",
|
|
|
+ prop: "orderNumber",
|
|
|
+ width: 220,
|
|
|
+ fixed: "left", // 固定在左侧
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
{
|
|
|
- label: "订单金额(元)",
|
|
|
- prop: "orderMoney",
|
|
|
- width: 200,
|
|
|
- align: "right"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "状态",
|
|
|
- prop: "endFundsButton",
|
|
|
- width: 100,
|
|
|
+ label: "举报类型",
|
|
|
+ prop: "violationReason",
|
|
|
+ showOverflowTooltip: true,
|
|
|
search: {
|
|
|
el: "select",
|
|
|
- tooltip: "请选择状态",
|
|
|
props: { clearable: true }
|
|
|
},
|
|
|
- enum: [
|
|
|
- { value: 1, label: "审核中" },
|
|
|
- { value: 2, label: "已通过" },
|
|
|
- { value: 3, label: "已驳回" }
|
|
|
- ],
|
|
|
- fieldNames: { label: "label", value: "value" }
|
|
|
+ enum: violationTypeMeta as any,
|
|
|
+ render: scope => getViolationDisplay(scope.row)
|
|
|
},
|
|
|
{
|
|
|
- label: "下单时间",
|
|
|
- prop: "orderTime"
|
|
|
+ label: "处理说明",
|
|
|
+ prop: "reportResult",
|
|
|
+ width: 200,
|
|
|
+ align: "center"
|
|
|
},
|
|
|
{
|
|
|
- label: "申请时间",
|
|
|
- prop: "endFundsTime"
|
|
|
+ label: "举报人姓名",
|
|
|
+ prop: "nickname",
|
|
|
+ width: 200,
|
|
|
+ align: "center"
|
|
|
},
|
|
|
{
|
|
|
- label: "下单时间",
|
|
|
- prop: "time1",
|
|
|
- isShow: false, // 关键:不在表格中显示
|
|
|
- search: {
|
|
|
- el: "date-picker",
|
|
|
- props: {
|
|
|
- type: "datetimerange",
|
|
|
- valueFormat: "YYYY-MM-DD HH:mm:ss",
|
|
|
- rangeSeparator: "至",
|
|
|
- startPlaceholder: "开始时间",
|
|
|
- endPlaceholder: "结束时间"
|
|
|
- }
|
|
|
- }
|
|
|
+ label: "举报时间",
|
|
|
+ prop: "createdTime",
|
|
|
+ width: 200,
|
|
|
+ align: "center"
|
|
|
},
|
|
|
{
|
|
|
- label: "申请时间",
|
|
|
- prop: "time4",
|
|
|
- isShow: false, // 关键:不在表格中显示
|
|
|
+ label: "当前状态",
|
|
|
+ prop: "processingStatus",
|
|
|
+ width: 100,
|
|
|
search: {
|
|
|
- el: "date-picker",
|
|
|
- props: {
|
|
|
- type: "datetimerange",
|
|
|
- valueFormat: "YYYY-MM-DD HH:mm:ss",
|
|
|
- rangeSeparator: "至",
|
|
|
- startPlaceholder: "开始时间",
|
|
|
- endPlaceholder: "结束时间"
|
|
|
- }
|
|
|
- }
|
|
|
+ el: "select",
|
|
|
+ tooltip: "请选择状态",
|
|
|
+ props: { clearable: true }
|
|
|
+ },
|
|
|
+ enum: [
|
|
|
+ { value: 0, label: "未处理" },
|
|
|
+ { value: 1, label: "违规" },
|
|
|
+ { value: 2, label: "未违规" }
|
|
|
+ ],
|
|
|
+ fieldNames: { label: "label", value: "value" }
|
|
|
},
|
|
|
{
|
|
|
label: "操作",
|
|
|
@@ -132,35 +136,14 @@ const columns = reactive<ColumnProps<Course.ReqCourseParams>[]>([
|
|
|
]);
|
|
|
|
|
|
const getTableList = async (params: any) => {
|
|
|
- let tempParams = JSON.parse(JSON.stringify(params));
|
|
|
- delete tempParams.time1;
|
|
|
- delete tempParams.time2;
|
|
|
- delete tempParams.time3;
|
|
|
- delete tempParams.time4;
|
|
|
- // 深拷贝原始参数
|
|
|
- let newParams = JSON.parse(JSON.stringify(tempParams));
|
|
|
- newParams.page = newParams.pageNum;
|
|
|
- newParams.size = newParams.pageSize;
|
|
|
+ const newParams = {
|
|
|
+ ...params,
|
|
|
+ page: params.pageNum,
|
|
|
+ size: params.pageSize
|
|
|
+ };
|
|
|
delete newParams.pageNum;
|
|
|
delete newParams.pageSize;
|
|
|
- if (params.time1) {
|
|
|
- newParams.orderCreatedTime = params.time1[0];
|
|
|
- newParams.orderEndTime = params.time1[1];
|
|
|
- }
|
|
|
- // todo 后端 现在下单时间和支付时间是一个字段,后续调整 在改动
|
|
|
- if (params.time2) {
|
|
|
- newParams.payCreatedTime = params.time2[0];
|
|
|
- newParams.payEndTime = params.time2[1];
|
|
|
- }
|
|
|
- if (params.time3) {
|
|
|
- newParams.firstCompleteTime = params.time3[0];
|
|
|
- newParams.endCompleteTime = params.time3[1];
|
|
|
- }
|
|
|
- if (params.time4) {
|
|
|
- newParams.createdEndPaymentTime = params.time4[0];
|
|
|
- newParams.endEndPaymentTime = params.time4[1];
|
|
|
- }
|
|
|
- const res = await getFinalPaymentList(newParams);
|
|
|
+ const res = await getViolationPage(newParams);
|
|
|
return res;
|
|
|
};
|
|
|
|
|
|
@@ -171,12 +154,6 @@ const dataCallback = (data: any) => {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
-// 处理推广板块字符串
|
|
|
-const getPromoteTypes = (promoteType: string) => {
|
|
|
- if (!promoteType) return [];
|
|
|
- return promoteType.split(",");
|
|
|
-};
|
|
|
-
|
|
|
//详情
|
|
|
const handleDetail = row => {
|
|
|
detailDialog.value?.open(row);
|
|
|
@@ -184,64 +161,24 @@ const handleDetail = row => {
|
|
|
|
|
|
// 审核
|
|
|
const handleReview = (row: any) => {
|
|
|
+ currentRow.value = row;
|
|
|
reviewDialog.value?.open(row);
|
|
|
};
|
|
|
|
|
|
-// 处理同意操作 endFundsButton: 2
|
|
|
-const handleApprove = async (payload: {
|
|
|
- id: number;
|
|
|
- name: string;
|
|
|
- orderMoney: number;
|
|
|
- orderNo: string;
|
|
|
- storeTel: string;
|
|
|
- userPhone: string;
|
|
|
- endPaymentRefusal: string;
|
|
|
- endPayment: number | string;
|
|
|
-}) => {
|
|
|
+const handleReviewSubmit = async (payload: { processingStatus: number; reportResult: string }) => {
|
|
|
+ if (!currentRow.value) return;
|
|
|
try {
|
|
|
- const res: any = await getFinalPaymentReview({
|
|
|
- ...payload,
|
|
|
- endFundsButton: 2
|
|
|
+ await violationApprove({
|
|
|
+ id: currentRow.value.id,
|
|
|
+ processingStatus: payload.processingStatus,
|
|
|
+ reportResult: payload.reportResult
|
|
|
});
|
|
|
- if (res.data.status == 0) {
|
|
|
- ElMessage.success(res.msg);
|
|
|
- }
|
|
|
- if (res.data.status == 1) {
|
|
|
- ElMessage.error(res.data.codeMsg);
|
|
|
- }
|
|
|
- proTable.value?.getTableList();
|
|
|
- } catch (error) {
|
|
|
- console.error("审核通过失败:", error);
|
|
|
- ElMessage.error("审核通过失败");
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
-// 处理驳回操作 endFundsButton: 3
|
|
|
-const handleReject = async (payload: {
|
|
|
- id: number;
|
|
|
- name: string;
|
|
|
- orderMoney: number;
|
|
|
- orderNo: string;
|
|
|
- storeTel: string;
|
|
|
- userPhone: string;
|
|
|
- endPaymentRefusal: string;
|
|
|
- endPayment: number | string;
|
|
|
-}) => {
|
|
|
- try {
|
|
|
- const res: any = await getFinalPaymentReview({
|
|
|
- ...payload,
|
|
|
- endFundsButton: 3
|
|
|
- });
|
|
|
- if (res.data.status == 0) {
|
|
|
- ElMessage.success(res.msg);
|
|
|
- }
|
|
|
- if (res.data.status == 1) {
|
|
|
- ElMessage.error(res.data.codeMsg);
|
|
|
- }
|
|
|
+ ElMessage.success("审核结果已提交");
|
|
|
+ reviewDialog.value?.close?.();
|
|
|
proTable.value?.getTableList();
|
|
|
} catch (error) {
|
|
|
- console.error("审核驳回失败:", error);
|
|
|
- ElMessage.error("审核驳回失败");
|
|
|
+ console.error("审核失败:", error);
|
|
|
+ ElMessage.error("审核失败,请稍后重试");
|
|
|
}
|
|
|
};
|
|
|
|