diff --git a/src/api/ie.js b/src/api/ie.js new file mode 100644 index 0000000..a6a97aa --- /dev/null +++ b/src/api/ie.js @@ -0,0 +1,7 @@ +import { getRequest, postRequest } from '@/libs/axios'; + +const PREFIX = '/app/ie/admin'; + +export const ieReportPage = (params) => getRequest(`${PREFIX}/reports/page`, params); +export const ieReportHandle = (params) => postRequest(`${PREFIX}/reports/handle`, params); +export const ieReportDelete = (reportId) => postRequest(`${PREFIX}/reports/delete`, { reportId }); diff --git a/src/views/app/data-statistics/data-statistics.vue b/src/views/app/data-statistics/data-statistics.vue index a4bbe81..52a3cc6 100644 --- a/src/views/app/data-statistics/data-statistics.vue +++ b/src/views/app/data-statistics/data-statistics.vue @@ -8,8 +8,9 @@ + - +
@@ -30,8 +31,22 @@
+ +
+ + + + + + +
+
- +
订单数据
@@ -329,6 +344,35 @@
+ +
+ i/e投诉举报 +
+
+ + + + +
+ + + + + + + + + + + + +
+
+
@@ -339,10 +383,59 @@ import { getLogiticsCompanyData, } from "@/api/app"; + import { + ieReportPage, + ieReportHandle, + ieReportDelete + } from "@/api/ie"; export default { name: "order-manage", data() { return { + tabName: "0", + ieReportLoading: false, + ieReportList: [], + ieReportTotal: 0, + ieReportModalVisible: false, + ieReportHandleForm: { + reportId: "", + status: 1, + blockIe: false, + handleResult: "" + }, + ieReportSearch: { + pageNumber: 1, + pageSize: 10, + status: "", + regionId: "" + }, + ieReportColumns: [ + { title: "ID", key: "id", width: 80 }, + { title: "举报人", key: "reporterId", minWidth: 100 }, + { title: "被举报人", key: "reportedUserId", minWidth: 100 }, + { title: "校区", key: "regionName", minWidth: 120 }, + { title: "原因", key: "reasonType", minWidth: 110, render: (h, params) => h("span", this.reasonText(params.row.reasonType)) }, + { title: "说明", key: "reasonText", minWidth: 180 }, + { title: "状态", key: "status", width: 100, render: (h, params) => h("Tag", { props: { color: this.statusColor(params.row.status) } }, this.statusText(params.row.status)) }, + { title: "处理结果", key: "handleResult", minWidth: 180 }, + { title: "创建时间", key: "createTime", minWidth: 160 }, + { + title: "操作", + width: 180, + fixed: "right", + render: (h, params) => h("div", [ + h("Button", { + props: { type: "primary", size: "small" }, + style: { marginRight: "8px" }, + on: { click: () => this.openIeReportHandle(params.row) } + }, "处理"), + h("Button", { + props: { type: "error", size: "small" }, + on: { click: () => this.deleteIeReport(params.row) } + }, "删除") + ]) + } + ], searchForm: { startDate: "", endDate: "" @@ -356,6 +449,90 @@ this.searchForm.endDate = dayTime }, methods: { + resolveRegionId() { + try { + const user = this.getStore("user") + return user ? (JSON.parse(user).departmentId || "") : "" + } catch (e) { + return "" + } + }, + changeOrderTab(name) { + this.tabName = name + if (name === "3") { + this.ieReportSearch.regionId = this.resolveRegionId() + this.handleIeReportSearch() + } + }, + handleIeReportSearch() { + this.ieReportSearch.pageNumber = 1 + this.getIeReports() + }, + getIeReports() { + this.ieReportLoading = true + this.ieReportSearch.regionId = this.resolveRegionId() + const params = Object.assign({}, this.ieReportSearch) + if (params.status === "" || params.status === null || params.status === undefined) { + delete params.status + } + ieReportPage(params).then(res => { + const data = res.result || res + this.ieReportList = data.records || [] + this.ieReportTotal = data.total || 0 + }).finally(() => { + this.ieReportLoading = false + }) + }, + changeIeReportPage(page) { + this.ieReportSearch.pageNumber = page + this.getIeReports() + }, + changeIeReportPageSize(size) { + this.ieReportSearch.pageSize = size + this.ieReportSearch.pageNumber = 1 + this.getIeReports() + }, + openIeReportHandle(row) { + this.ieReportHandleForm = { + reportId: row.id, + status: row.status === 2 ? 2 : 1, + blockIe: row.blockedIe === 1, + handleResult: row.handleResult || "" + } + this.ieReportModalVisible = true + }, + submitIeReportHandle() { + ieReportHandle(this.ieReportHandleForm).then(() => { + this.$Message.success("处理成功") + this.getIeReports() + }) + }, + deleteIeReport(row) { + this.$Modal.confirm({ + title: "删除举报记录", + content: `确认删除举报记录 #${row.id}?`, + onOk: () => { + ieReportDelete(row.id).then(() => { + this.$Message.success("删除成功") + this.getIeReports() + }) + } + }) + }, + reasonText(type) { + const map = { harassment: "骚扰不适", abuse: "攻击辱骂", fraud: "疑似欺诈", other: "其他问题" } + return map[type] || "安全反馈" + }, + statusText(status) { + if (status === 1) return "已处理" + if (status === 2) return "已驳回" + return "待处理" + }, + statusColor(status) { + if (status === 1) return "green" + if (status === 2) return "default" + return "orange" + }, getMonth() { let date = new Date() let year = date.getFullYear().toString() //'年'