diff --git a/src/api/app.js b/src/api/app.js index da87561..e4e6a26 100644 --- a/src/api/app.js +++ b/src/api/app.js @@ -199,6 +199,9 @@ export const getBillDateSummaryList = (params) => { export const getBillDetailList = (params) => { return postBodyRequest('/mall/admin/settlement/detailList', params) } +export const getDataStatisticsSummary = (params) => { + return postBodyRequest('/mall/admin/dataStatistics/summary', params) +} export const settlementConfirm = (params) => { return postBodyRequest('/mall/admin/settlement/confirmByShop', params) } diff --git a/src/api/fishMarket.js b/src/api/fishMarket.js index 71eaa04..b6550b6 100644 --- a/src/api/fishMarket.js +++ b/src/api/fishMarket.js @@ -15,6 +15,7 @@ export const fishCategoryStatus = (params) => postBodyRequest(`${PREFIX}/categor export const fishComplaintPage = (params) => postBodyRequest(`${PREFIX}/complaints/page`, params); export const fishComplaintHandle = (params) => postBodyRequest(`${PREFIX}/complaints/handle`, params); +export const fishComplaintUnblock = (params) => postBodyRequest(`${PREFIX}/complaints/unblock`, params); export const fishCommentDelete = (id) => postBodyRequest(`${PREFIX}/comments/${id}/delete`, {}); export const fishUserLimitPage = (params) => postBodyRequest(`${PREFIX}/users/limits/page`, params); diff --git a/src/views/app/bill/current/current.vue b/src/views/app/bill/current/current.vue index e8889f4..3ac219b 100644 --- a/src/views/app/bill/current/current.vue +++ b/src/views/app/bill/current/current.vue @@ -34,6 +34,11 @@
+ + +
@@ -196,6 +201,15 @@ data: [], detailData: [], total: 0, + detailTotal: 0, + detailSearchForm: { + regionId: "", + settlementDate: "", + shopId: "", + status: 0, + pageNumber: 1, + pageSize: 10 + }, Visiable: false, detailVisible: false, orderDetailVisible: false, @@ -299,21 +313,37 @@ }, stationBinding(row) { this.detailVisible = true - this.detailLoading = true - getBillDetailList({ + this.detailSearchForm = { regionId: this.searchForm.regionId, settlementDate: this.searchForm.settlementDate, shopId: row.shopId, - status: 0 - }).then((res) => { + status: 0, + pageNumber: 1, + pageSize: this.detailSearchForm.pageSize + } + this.getDetailList() + }, + getDetailList() { + this.detailLoading = true + getBillDetailList(this.detailSearchForm).then((res) => { this.detailLoading = false if (res.success) { - this.detailData = res.result || [] + this.detailData = (res.result && res.result.records) || res.result || [] + this.detailTotal = (res.result && res.result.total) || this.detailData.length } }).catch(() => { this.detailLoading = false }) }, + changeDetailPage(v) { + this.detailSearchForm.pageNumber = v + this.getDetailList() + }, + changeDetailPageSize(v) { + this.detailSearchForm.pageNumber = 1 + this.detailSearchForm.pageSize = v + this.getDetailList() + }, closeOrderDetail(){ this.orderDetailVisible = false; }, diff --git a/src/views/app/bill/historical/historical.vue b/src/views/app/bill/historical/historical.vue index fede621..6796caa 100644 --- a/src/views/app/bill/historical/historical.vue +++ b/src/views/app/bill/historical/historical.vue @@ -46,6 +46,11 @@
+ + +
@@ -157,7 +162,16 @@ shopData: [], detailData: [], total: 0, - shopTotal: 0 + shopTotal: 0, + detailTotal: 0, + detailSearchForm: { + regionId: "", + settlementDate: "", + shopId: "", + status: 0, + pageNumber: 1, + pageSize: 10 + } }; }, methods: { @@ -232,17 +246,35 @@ }, openDetail(row) { this.detailVisible = true; - this.detailLoading = true; - getBillDetailList({ + this.detailSearchForm = { regionId: this.searchForm.regionId, settlementDate: this.currentDate, shopId: row.shopId, - status: 0 - }).then(res => { + status: 0, + pageNumber: 1, + pageSize: this.detailSearchForm.pageSize + }; + this.getDetailList(); + }, + getDetailList() { + this.detailLoading = true; + getBillDetailList(this.detailSearchForm).then(res => { this.detailLoading = false; - if (res.success) this.detailData = res.result || []; + if (res.success) { + this.detailData = (res.result && res.result.records) || res.result || []; + this.detailTotal = (res.result && res.result.total) || this.detailData.length; + } }).catch(() => this.detailLoading = false); }, + changeDetailPage(v) { + this.detailSearchForm.pageNumber = v; + this.getDetailList(); + }, + changeDetailPageSize(v) { + this.detailSearchForm.pageNumber = 1; + this.detailSearchForm.pageSize = v; + this.getDetailList(); + }, settleSelected() { if (this.settlementLoading) return; if (this.selectList.length === 0) { diff --git a/src/views/app/bill/success/success.vue b/src/views/app/bill/success/success.vue index a193ad4..c302e7b 100644 --- a/src/views/app/bill/success/success.vue +++ b/src/views/app/bill/success/success.vue @@ -43,6 +43,11 @@
+ + +
@@ -151,7 +156,16 @@ shopData: [], detailData: [], total: 0, - shopTotal: 0 + shopTotal: 0, + detailTotal: 0, + detailSearchForm: { + regionId: "", + settlementDate: "", + shopId: "", + status: 1, + pageNumber: 1, + pageSize: 10 + } }; }, methods: { @@ -225,17 +239,35 @@ }, openDetail(row) { this.detailVisible = true; - this.detailLoading = true; - getBillDetailList({ + this.detailSearchForm = { regionId: this.searchForm.regionId, settlementDate: this.currentDate, shopId: row.shopId, - status: 1 - }).then(res => { + status: 1, + pageNumber: 1, + pageSize: this.detailSearchForm.pageSize + }; + this.getDetailList(); + }, + getDetailList() { + this.detailLoading = true; + getBillDetailList(this.detailSearchForm).then(res => { this.detailLoading = false; - if (res.success) this.detailData = res.result || []; + if (res.success) { + this.detailData = (res.result && res.result.records) || res.result || []; + this.detailTotal = (res.result && res.result.total) || this.detailData.length; + } }).catch(() => this.detailLoading = false); }, + changeDetailPage(v) { + this.detailSearchForm.pageNumber = v; + this.getDetailList(); + }, + changeDetailPageSize(v) { + this.detailSearchForm.pageNumber = 1; + this.detailSearchForm.pageSize = v; + this.getDetailList(); + }, closeOrderDetail(){ this.orderDetailVisible = false; }, diff --git a/src/views/app/business/expressCompany/expressCompany.vue b/src/views/app/business/expressCompany/expressCompany.vue index 9d348f1..5a13780 100644 --- a/src/views/app/business/expressCompany/expressCompany.vue +++ b/src/views/app/business/expressCompany/expressCompany.vue @@ -18,7 +18,7 @@ @@ -77,7 +77,7 @@ @@ -195,6 +195,39 @@
暂无商品详情
+ + +
+ + 处理意见会提示给被封禁人,请填写清晰、规范的处理说明。 + + + + + + + +
+
+ + +
+
@@ -209,6 +242,7 @@ import { fishCategoryStatus, fishComplaintPage, fishComplaintHandle, + fishComplaintUnblock, fishCommentDelete, fishUserLimitPage, fishUserLimitSave, @@ -233,8 +267,24 @@ export default { categoryModal: false, userLimitModal: false, goodsDetailModal: false, + complaintHandleModal: false, + complaintHandleLoading: false, categoryForm: {}, userLimitForm: {}, + complaintHandleRow: {}, + complaintHandleForm: { reason: "" }, + complaintHandleRules: { + reason: [ + { required: true, message: "处理意见不能为空", trigger: "blur" }, + { type: "string", min: 1, message: "处理意见不能为空", trigger: "blur", transform: value => (value || "").trim() } + ] + }, + complaintReasonPresets: [ + "举报属实,内容违反平台规范,已对相关账号进行封禁处理。", + "举报属实,商品信息存在违规内容,已封禁发布账号并限制发布。", + "举报属实,相关聊天内容违规,已对账号进行封禁及禁言处理。", + "多次违规发布不当内容,已按平台规则进行封禁处理。" + ], goodsDetail: {}, detailGoodsId: "", detailCommentList: [], @@ -257,7 +307,7 @@ export default { { title: "操作", width: 250, fixed: "right", render: (h, p) => { if (p.row.status == 3) return h("span", ""); return h("div", [ - /* h("Button", { props: { type: "success", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 1, "审核通过") } }, "通过"), */ + /* h("Button", { props: { type: "success", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 1, "审核已处理") } }, "已处理"), */ h("Button", { props: { type: "info", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.viewGoodsDetail(p.row) } }, "详情"), h("Button", { props: { type: "warning", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 2, "强制下架") } }, "下架"), h("Button", { props: { type: "primary", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 1, "恢复上架") } }, "恢复") @@ -292,11 +342,23 @@ export default { return h("a", { on: { click: () => this.viewGoodsDetail(p.row) } }, title); } }, { title: "举报人", key: "reporterName", width: 130 }, - { title: "卖家账号", key: "sellerAccount", minWidth: 150 }, + { title: "被举报账号", key: "sellerAccount", minWidth: 150 }, { title: "原因", key: "reason", minWidth: 220 }, { title: "状态", key: "status", width: 100, render: (h, p) => h("Tag", { props: { color: p.row.status == 0 ? "orange" : (p.row.status == 1 ? "green" : "default") } }, this.complaintStatusText(p.row.status)) }, { title: "时间", key: "createTime", minWidth: 150 }, - { title: "操作", width: 100, fixed: "right", render: (h, p) => h("Button", { props: { type: "primary", size: "small" }, on: { click: () => this.handleComplaint(p.row) } }, "处理") } + { title: "操作", width: 110, fixed: "right", render: (h, p) => { + if (p.row.status == 1) { + return h("Button", { + props: { type: "warning", size: "small" }, + on: { click: () => this.unblockComplaintUser(p.row) } + }, "解除封禁"); + } + if (p.row.status != 0) return h("span", "-"); + return h("Button", { + props: { type: "primary", size: "small" }, + on: { click: () => this.handleComplaint(p.row) } + }, "处理"); + } } ], auditLogColumns: [ { title: "ID", key: "id", width: 80 }, @@ -403,7 +465,7 @@ export default { return Number(data.total || data.totalElements) || 0; }, auditText(status) { - return status == 1 ? "通过" : (status == 2 ? "拒绝" : "待审"); + return status == 1 ? "已处理" : (status == 2 ? "拒绝" : "待审"); }, auditColor(status) { return status == 1 ? "green" : (status == 2 ? "red" : "orange"); @@ -419,7 +481,7 @@ export default { return "green"; }, complaintStatusText(status) { - return status == 1 ? "通过" : (status == 2 ? "驳回" : "待处理"); + return status == 1 ? "已处理" : (status == 2 ? "驳回" : "待处理"); }, complaintTypeText(type) { const map = { @@ -555,26 +617,56 @@ export default { }); }, handleComplaint(row) { - this.actionReason = ""; + this.complaintHandleRow = row; + this.complaintHandleForm = { reason: "" }; + this.complaintHandleModal = true; + this.$nextTick(() => { + if (this.$refs.complaintHandleForm) { + this.$refs.complaintHandleForm.resetFields(); + } + }); + }, + fillComplaintReason(reason) { + this.complaintHandleForm.reason = reason; + this.$nextTick(() => { + if (this.$refs.complaintHandleForm) { + this.$refs.complaintHandleForm.validateField("reason"); + } + }); + }, + submitComplaintHandle() { + this.$refs.complaintHandleForm.validate(valid => { + if (!valid) return; + const reason = (this.complaintHandleForm.reason || "").trim(); + this.complaintHandleLoading = true; + fishComplaintHandle({ + complaintId: this.complaintHandleRow.id, + status: 1, + blockUser: true, + muted: 1, + publishBanned: 1, + permanentBanned: 1, + reason, + handleResult: reason + }).then(() => { + this.$Message.success("处理成功"); + this.complaintHandleModal = false; + this.loadComplaints(); + }).finally(() => { + this.complaintHandleLoading = false; + }); + }); + }, + unblockComplaintUser(row) { this.$Modal.confirm({ - title: "处理举报", - render: (h) => h("Input", { - props: { type: "textarea", autofocus: true, rows: 4, placeholder: "请输入处理意见,确认后将封禁卖家账号" }, - on: { input: val => this.actionReason = val } - }), + title: "解除封禁", + content: `确认解除被举报账号“${row.sellerAccount || "-"}”的封禁限制吗?`, onOk: () => { - const reason = this.actionReason || "举报成立,封禁卖家账号"; - fishComplaintHandle({ + fishComplaintUnblock({ complaintId: row.id, - status: 1, - blockUser: true, - muted: 1, - publishBanned: 1, - permanentBanned: 1, - reason, - handleResult: reason + reason: "后台解除举报封禁" }).then(() => { - this.$Message.success("处理成功"); + this.$Message.success("解除封禁成功"); this.loadComplaints(); }); } diff --git a/src/views/app/data-statistics/data-statistics.vue b/src/views/app/data-statistics/data-statistics.vue index 4bd3f83..bee3157 100644 --- a/src/views/app/data-statistics/data-statistics.vue +++ b/src/views/app/data-statistics/data-statistics.vue @@ -5,20 +5,18 @@
-
100
+
{{ statistics.orderCount }}
订单数量(单)
@@ -76,7 +77,7 @@
-
100
+
{{ statistics.grossFlowAmount }}
流水总金额(元)
@@ -87,8 +88,8 @@
-
100
-
支付总金额(元)
+
{{ statistics.effectiveFlowAmount }}
+
有效流水总金额(元)
@@ -98,8 +99,8 @@
-
100
-
活动总优惠(元)
+
{{ statistics.koiDiscountAmount }}
+
锦鲤总优惠(元)
@@ -112,30 +113,19 @@
-
100
+
{{ statistics.onTimeRate }}
配送总准时率(%)
- -
-
- -
-
-
100
-
优惠券优惠总金额(元)
-
-
-
-
100
-
配送费总金额(元)
+
{{ statistics.refundAmount }}
+
退款总金额(元)
@@ -145,26 +135,24 @@
-
100
-
配送费实际支付总金额(元)
+
{{ statistics.afterSaleAmount }}
+
售后总金额(元)
- -
-
-
100
-
返佣补贴金额(元)
+
{{ statistics.couponDiscountAmount }}
+
优惠券优惠总金额(元)
+
平台数据
@@ -172,69 +160,58 @@
- +
-
100
-
平台营收(元)
+
{{ statistics.customerAverageAmount }}
+
客单价(元)
- +
-
100
-
平台补贴总金额(元)
+
{{ statistics.actualIncomeAmount }}
+
实际所得(元)
- +
-
100
-
客单价(元)
+
{{ statistics.headquartersDeductionAmount }}
+
总部扣点(元)
- +
-
100
-
平台抽成(元)
+
{{ statistics.deliveryFeeAmount }}
+
配送费总额(元)
- -
-
- -
-
-
100
-
平台优惠券补贴总金额(元)
-
-
-
-
100
-
平台配送费(元)
+
{{ statistics.smsCount }}
+
短信总数
@@ -244,108 +221,57 @@
-
100
-
平台实际配送费(元)
+
{{ statistics.contentAuditCount }}
+
内容审核数
-
-
- 商家数据 -
-
-
- -
-
-
100
-
外卖入驻商家数量(家)
-
-
- - -
-
- +
+
-
100
-
产生订单商家数量(家)
+
{{ statistics.realNameAuthCount }}
+
实名认证数
-
+
-
100
-
外卖申请商家数量(家)
-
-
- - -
-
- -
-
-
100
-
冻结商家数量(家)
+
{{ rewardTotalAmount }}
+
抽奖奖励、排位奖励、配送奖励(元)
+
+ 商家数据 +
- -
-
-
100
-
商家补贴总金额(元)
-
-
- - -
-
- -
-
-
100
-
商家配送费(元)
-
-
- - -
-
- +
-
100
-
商家实际配送费(元)
+
{{ statistics.orderShopCount }}
+
产生订单商家数量(家)
-
-
- 用户数据 -
-
-
100
+
{{ statistics.orderUserCount }}
产生订单用户数
@@ -406,7 +332,7 @@ getDictDataByType, } from "@/api/index"; import { - getLogiticsCompanyData, + getDataStatisticsSummary, } from "@/api/app"; import { ieReportPage, @@ -420,6 +346,14 @@ data() { return { tabName: "0", + selectDate: [], + statisticsLoading: false, + statistics: this.defaultStatistics(), + options: { + disabledDate(date) { + return date && date.valueOf() > Date.now() + } + }, ieReportLoading: false, ieReportList: [], ieReportTotal: 0, @@ -518,6 +452,12 @@ computed: { ieMessageModalTitle() { return this.ieMessageSearch.roomId ? `房间聊天记录 #${this.ieMessageSearch.roomId}` : "房间聊天记录" + }, + rewardTotalAmount() { + const total = this.toNumber(this.statistics.collegeRankRewardAmount) + + this.toNumber(this.statistics.drawPoolAmount) + + this.toNumber(this.statistics.deliveryRankRewardAmount) + return total.toFixed(2) } }, mounted() { @@ -525,9 +465,39 @@ this.selectDate = [dayTime, dayTime] this.searchForm.startDate = dayTime this.searchForm.endDate = dayTime + this.searchForm.regionId = this.resolveRegionId() + this.getDataList() this.getIeReportPendingCount() }, methods: { + defaultStatistics() { + return { + orderCount: 0, + grossFlowAmount: "0.00", + effectiveFlowAmount: "0.00", + koiDiscountAmount: "0.00", + onTimeRate: "0.00", + refundAmount: "0.00", + afterSaleAmount: "0.00", + couponDiscountAmount: "0.00", + customerAverageAmount: "0.00", + actualIncomeAmount: "0.00", + headquartersDeductionAmount: "0.00", + deliveryFeeAmount: "0.00", + smsCount: 0, + contentAuditCount: 0, + realNameAuthCount: 0, + collegeRankRewardAmount: "0.00", + drawPoolAmount: "0.00", + deliveryRankRewardAmount: "0.00", + orderShopCount: 0, + orderUserCount: 0 + } + }, + toNumber(value) { + const num = Number(value) + return Number.isNaN(num) ? 0 : num + }, resolveRegionId() { try { const user = this.getStore("user") @@ -756,9 +726,46 @@ let single = year + '-' + month + '-' + da //当天 return single }, + formatDate(date) { + let year = date.getFullYear().toString() + let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : (date.getMonth() + 1).toString() + let day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate().toString() + return `${year}-${month}-${day}` + }, + setQuickRange(type) { + const today = new Date() + let start = new Date(today) + let end = new Date(today) + if (type === 'yesterday') { + start.setDate(today.getDate() - 1) + end.setDate(today.getDate() - 1) + } else if (type === '7') { + start.setDate(today.getDate() - 6) + } else if (type === '30') { + start.setDate(today.getDate() - 29) + } + this.selectDate = [this.formatDate(start), this.formatDate(end)] + this.searchForm.startDate = this.selectDate[0] + this.searchForm.endDate = this.selectDate[1] + this.getDataList() + }, + selectDateRange(v) { + this.searchForm.startDate = v && v[0] ? v[0] : "" + this.searchForm.endDate = v && v[1] ? v[1] : "" + }, + getDataList() { + this.statisticsLoading = true + const params = Object.assign({}, this.searchForm, { + regionId: this.resolveRegionId() + }) + getDataStatisticsSummary(params).then(res => { + const data = res.result || res || {} + this.statistics = Object.assign(this.defaultStatistics(), data) + }).finally(() => { + this.statisticsLoading = false + }) + }, handleSearch() { - this.searchForm.pageNum = 1; - this.searchForm.pageSize = 10; this.getDataList(); } } diff --git a/src/views/app/shop/dictManage.vue b/src/views/app/shop/dictManage.vue index e80f999..450effa 100644 --- a/src/views/app/shop/dictManage.vue +++ b/src/views/app/shop/dictManage.vue @@ -51,6 +51,53 @@ background: #60F3FF; color: #fff !important; } + .goods-attribute-list { + display: flex; + flex-direction: column; + } + .goods-attribute-row { + display: flex; + align-items: flex-start; + margin-bottom: 8px; + padding: 8px; + line-height: 30px; + background: #f8f8f9; + border: 1px solid #e8eaec; + border-radius: 4px; + } + .goods-attribute-name { + flex: 0 0 auto; + margin-right: 8px; + font-weight: bold; + color: #515a6e; + } + .goods-attribute-values { + display: flex; + flex: 1; + flex-wrap: wrap; + min-width: 0; + } + .goods-attribute-value { + margin: 0 6px 6px 0; + padding: 0 8px; + line-height: 24px; + background: #fff; + border: 1px solid #dcdee2; + border-radius: 12px; + color: #515a6e; + white-space: nowrap; + } + .goods-attribute-canbuy { + display: flex; + align-items: center; + flex: 0 0 auto; + margin-right: 12px; + color: #888; + } + .goods-attribute-canbuy .ivu-input-wrapper { + width: 60px; + margin-left: 4px; + }