From 4d8a1e1e90919b8c9b7ca594d57a6aa5c0b29018 Mon Sep 17 00:00:00 2001
From: pengda <10266652509@qq.com>
Date: Thu, 15 May 2025 16:49:36 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B4=9F=E6=AF=9B=E5=88=A9=E7=BB=9F=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Pagination.vue | 130 +++++++++++++++++++++++++++++++
src/components/super/RankingLeftMenu.vue | 8 +-
src/router/index.js | 42 +++++-----
src/views/super/Ranking/RankDetail.vue | 89 ++++++++++-----------
src/views/super/Ranking/RankList.vue | 33 ++++++++
5 files changed, 234 insertions(+), 68 deletions(-)
create mode 100644 src/components/Pagination.vue
diff --git a/src/components/Pagination.vue b/src/components/Pagination.vue
new file mode 100644
index 0000000..b6b031d
--- /dev/null
+++ b/src/components/Pagination.vue
@@ -0,0 +1,130 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/super/RankingLeftMenu.vue b/src/components/super/RankingLeftMenu.vue
index 250a2fd..1c59105 100644
--- a/src/components/super/RankingLeftMenu.vue
+++ b/src/components/super/RankingLeftMenu.vue
@@ -53,6 +53,10 @@ export default {
name: '退单数排行',
path: '/super/ranking/checkRefund',
},
+ {
+ name: '负毛利排行',
+ path: '/super/ranking/loss',
+ },
]
},
{
@@ -78,10 +82,6 @@ export default {
imgActive: require('@/assets/super/ranking-menu.svg'),
list: [
{
- name: '负毛利',
- path: '/super/ranking/loss',
- },
- {
name: '采购价',
path: '/super/ranking/purchase',
},
diff --git a/src/router/index.js b/src/router/index.js
index 3c0ef1c..942ec7e 100755
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -161,6 +161,12 @@ const routes = [{
props: {pageTitle:'产品 - 退单数排行', rank_type: 3, type: 'check_type'}
},
{
+ path: 'loss',
+ name: '产品负毛利排行',
+ component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankList.vue'),
+ props: {pageTitle:'产品 - 负毛利排行', rank_type: 5, type: 'loss'}
+ },
+ {
path: 'agentProfit',
name: '代理商毛利润排行',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankBatchList.vue'),
@@ -179,12 +185,6 @@ const routes = [{
props: {pageTitle:'代理商 - 新加盟', type: 'agentnew', showDateSelect: false}
},
{
- path: 'loss',
- name: '负毛利',
- component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankDetail.vue'),
- props: {pageTitle:'负毛利 - 排行', type: 'loss'}
- },
- {
path: 'purchase',
name: '采购价',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/Purchase.vue'),
@@ -196,20 +196,26 @@ const routes = [{
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/Purchase.vue'),
props: {pageTitle:'设置 - 阶段采购', type: 'stagePurchase'}
},
+ {
+ path: 'detail',
+ name: '详情',
+ component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankDetail.vue'),
+ props: {pageTitle:'详情', type: 'day', showDateSelect: false, lookMore:false}
+ },
+ {
+ path: 'list',
+ name: '列表',
+ component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankList.vue'),
+ props: {pageTitle:'详情', showDateSelect: false, lookMore:false}
+ },
+ {
+ path: 'order',
+ name: '订单统计',
+ component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankDetail.vue'),
+ props: {pageTitle:'订单统计', type: 'order', showDateSelect: false}
+ },
]
},
- {
- path: '/super/ranking/detail',
- name: '详情',
- component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankDetail.vue'),
- props: {pageTitle:'详情', type: 'day', showDateSelect: false, lookMore:false}
- },
- {
- path: '/super/ranking/list',
- name: '列表',
- component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankList.vue'),
- props: {pageTitle:'详情', showDateSelect: false, lookMore:false}
- },
]
const router = new VueRouter({
diff --git a/src/views/super/Ranking/RankDetail.vue b/src/views/super/Ranking/RankDetail.vue
index 14adb14..70331eb 100644
--- a/src/views/super/Ranking/RankDetail.vue
+++ b/src/views/super/Ranking/RankDetail.vue
@@ -199,33 +199,22 @@
-
-
-
- 总负毛利:{{ total_value }}
-
-
+
-
-
-
-
-
+
+
+
+
+
+
- {{ scope.row.value_1 }}
-
-
-
-
-
- {{ scope.row.value_2 }}
+ {{ scope.row.is_refund == 1 ? '是' : '否' }}
+
+
@@ -233,6 +222,7 @@
import DateSelect from '@/components/super/DateSelect.vue';
import CustomDropdown from '@/components/CustomDropdown.vue';
import HoverImage from "@/components/super/HoverImage.vue";
+import Pagination from "@/components/Pagination.vue";
export default {
name: 'rank_detail',
@@ -259,6 +249,7 @@ export default {
},
},
components: {
+ Pagination,
HoverImage,
DateSelect,
CustomDropdown
@@ -292,6 +283,10 @@ export default {
top_list: [],
growth_list: [],
show_detail_index: 0,
+ has_next: false,
+ cur_page: 1,
+ page_size: 20,
+ page_point: 0,
}
},
mounted() {
@@ -408,9 +403,8 @@ export default {
return true;
}
- if (this.dataType == 'loss') {
- this.onlyYear = false;
- this.getLossDetail(obj)
+ if (this.dataType == 'order') {
+ this.getOrderList()
return true;
}
@@ -441,28 +435,6 @@ export default {
console.error(error, 'error')
})
},
- getLossDetail(obj) {
- const that = this
- that.tableData = []
- that.total_value = 0
- this.$http('POST', '/supernew/ajax_get_loss_detail', {
- aid: that.aid,
- ver_type: that.ver_type,
- check_type: that.check_type,
- date: that.text,
- ...obj
- }).then(response => {
- this.$nextTick(() => {
- that.tableData = response.data.list
- that.total_value = response.data.total_value
- that.total = response.data.total
-
- if (that.showfilterTitle) that.filterTitle = response.data.title
- })
- }).catch(error => {
- console.error(error, 'error')
- })
- },
getRankingList(obj) {
const that = this
that.tableData1 = []
@@ -492,6 +464,31 @@ export default {
console.error(error, 'error')
})
},
+ getOrderList(obj) {
+ const that = this
+ that.tableData = []
+ this.$http('POST', '/supernew/ajax_get_order_check_list', {
+ aid: that.aid,
+ ver_type: that.ver_type,
+ check_type: that.check_type,
+ page_point: that.page_point,
+ lose: 1,
+ ...obj
+ }).then(response => {
+ this.$nextTick(() => {
+ that.tableData = response.data.list
+ that.has_next = response.data.hasNext
+ if(!that.has_next) that.cur_page = response.data.cur_page
+ that.page_point = response.data.page_point
+ })
+ }).catch(error => {
+ console.error(error, 'error')
+ })
+ },
+ handleChange(payload) {
+ this.cur_page = payload.cur_page
+ this.getOrderList(payload)
+ }
}
}
diff --git a/src/views/super/Ranking/RankList.vue b/src/views/super/Ranking/RankList.vue
index 82542cb..ddfa265 100644
--- a/src/views/super/Ranking/RankList.vue
+++ b/src/views/super/Ranking/RankList.vue
@@ -219,11 +219,13 @@ export default {
1: '毛利润',
2: '订单数',
3: '退单数',
+ 5: '负毛利',
},
type_desc: {
'agent': '代理商昵称',
'ver_type': '品牌名称',
'check_type': '服务名称',
+ 'loss': '服务名称',
},
type_select: {
'ver_type': '按品牌名称',
@@ -278,6 +280,10 @@ export default {
if (this.$route.query.rank_type) this.dataRank = this.$route.query.rank_type
if (Object.keys(this.$route.query).length > 0) this.showfilterTitle = true
+ if (this.dataType == 'loss') {
+ this.sort_order = 1;
+ }
+
this.getRankingData(); // 每次路由变化都重新获取数据
},
handleUpdateView(newView) {
@@ -439,6 +445,9 @@ export default {
if (this.dataType == 'check_type') {
this.getTypeRanking()
}
+ if (this.dataType == 'loss') {
+ this.getLossList()
+ }
},
getAgentRanking() {
const that = this
@@ -550,6 +559,30 @@ export default {
console.error(error, 'error')
})
},
+ getLossList() {
+ const that = this
+ that.tableData = []
+ this.$http('POST', '/supernew/ajax_get_loss_list', {
+ aid: that.aid,
+ ver_type: that.ver_type,
+ check_type: that.check_type,
+ date: that.text,
+ sort_by: that.sort_by,
+ sort_order: that.sort_order,
+ cur_page: that.currentPage,
+ page_size: that.pageSize,
+ }).then(response => {
+ this.$nextTick(() => {
+ that.tableData = response.data.list
+ that.total_value = response.data.total_value
+ that.total = response.data.total
+
+ if (that.showfilterTitle) that.filterTitle = response.data.title
+ })
+ }).catch(error => {
+ console.error(error, 'error')
+ })
+ },
handleSizeChange(val) {
this.pageSize = val
this.getRankingData()