From 62386ca0771a4b146c0310fe318b700c07e94530 Mon Sep 17 00:00:00 2001 From: zx <604444282@qq.com> Date: Mon, 21 Feb 2022 14:35:02 +0800 Subject: [PATCH] zx --- src/api/SaleRank/index.js | 39 +++++ src/router/index.js | 10 +- src/views/SaleRank/AllLevel/wxCar/index.vue | 21 ++- src/views/SaleRank/BrandInfo/index.vue | 159 +++++++++++++++++ src/views/SaleRank/BrandInfoDetail/index.vue | 169 +++++++++++++++++++ src/views/SaleRank/BrandSale/index.vue | 70 ++++++-- src/views/SaleRank/SeriesInfo/index.vue | 71 +++++++- src/views/SaleRank/SeriesSale/index.vue | 3 +- 8 files changed, 520 insertions(+), 22 deletions(-) create mode 100644 src/views/SaleRank/BrandInfo/index.vue create mode 100644 src/views/SaleRank/BrandInfoDetail/index.vue diff --git a/src/api/SaleRank/index.js b/src/api/SaleRank/index.js index 82eab08..7c78597 100644 --- a/src/api/SaleRank/index.js +++ b/src/api/SaleRank/index.js @@ -169,6 +169,45 @@ export function getCheZhuCarBrandRanking(params) { }) } +// 汽车品牌销量-汽车品牌销量排行榜列表-点击销量 +export function getCheZhuCarBrandTimeRanking(params) { + let obj = Object.assign({action: 'getCheZhuCarBrandTimeRanking', sType: 'Marketing'}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} + +// 汽车品牌销量-汽车品牌销量排行榜列表-点击销量-点击详情销量 +export function getCheZhuCarBrandSeriesRanking(params) { + let obj = Object.assign({action: 'getCheZhuCarBrandSeriesRanking', sType: 'Marketing'}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} + +// 汽车品牌销量-汽车品牌销量排行榜列表-点击销量-点击详情销量-点击销量 +// export function getCheZhuCarSeriesList(params) { +// let obj = Object.assign({action: 'getCheZhuCarSeriesList', sType: 'Marketing'}, params) +// return httpService({ +// url: `/api/v6.ashx`, +// method: 'post', +// data: obj, +// headers: { +// 'content-type': 'application/x-www-form-urlencoded' +// } +// }) +// } + // 车型销量-车型销量排行榜列表 export function getCheZhuCarSeriesRanking(params) { let obj = Object.assign({action: 'getCheZhuCarSeriesRanking', sType: 'Marketing'}, params) diff --git a/src/router/index.js b/src/router/index.js index b47ffe5..057a4b4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -227,7 +227,15 @@ const router = [ }, //// { - path: 'seriesInfo', //微型车 + path: 'brandInfo', //汽车品牌销量-销量 + component: resolve => require(['@/views/SaleRank/BrandInfo/index.vue'], resolve), + }, + { + path: 'brandInfoDetail', //汽车品牌销量-销量-详细销量 + component: resolve => require(['@/views/SaleRank/BrandInfoDetail/index.vue'], resolve), + }, + { + path: 'seriesInfo', //车型销量-销量 component: resolve => require(['@/views/SaleRank/SeriesInfo/index.vue'], resolve), }, ] diff --git a/src/views/SaleRank/AllLevel/wxCar/index.vue b/src/views/SaleRank/AllLevel/wxCar/index.vue index 14de8e3..17fa4d0 100644 --- a/src/views/SaleRank/AllLevel/wxCar/index.vue +++ b/src/views/SaleRank/AllLevel/wxCar/index.vue @@ -34,6 +34,7 @@ + + \ No newline at end of file diff --git a/src/views/SaleRank/BrandInfoDetail/index.vue b/src/views/SaleRank/BrandInfoDetail/index.vue new file mode 100644 index 0000000..03b94b1 --- /dev/null +++ b/src/views/SaleRank/BrandInfoDetail/index.vue @@ -0,0 +1,169 @@ + + + + 查看图表 + 返回 + + + + + + 销量 + + + + + + + + + \ No newline at end of file diff --git a/src/views/SaleRank/BrandSale/index.vue b/src/views/SaleRank/BrandSale/index.vue index 4a2b915..3b9ac27 100644 --- a/src/views/SaleRank/BrandSale/index.vue +++ b/src/views/SaleRank/BrandSale/index.vue @@ -1,6 +1,6 @@ - + 查看图表 返回 @@ -11,9 +11,9 @@ 查询 - - - 销量 + + + 销量 @@ -39,6 +39,7 @@ export default { selTime: [], time: '汽车品牌销量排行榜', //表格 + tableLoad: false, columns: [ { title: "排名", @@ -47,7 +48,12 @@ export default { width: 120 }, { - title: "品牌", + title: "品牌logo", + dataIndex: "img", + key: "img", + }, + { + title: "品牌名称", dataIndex: "brand", key: "brand", }, @@ -57,12 +63,12 @@ export default { key: "salescount", }, { - title: "占品牌份额", + title: "占品牌份额(%)", dataIndex: "percentage", key: "percentage" }, { - title: "品牌相关", + title: "车型相关", dataIndex: "about", key: "about", scopedSlots: { customRender: "about" }, @@ -70,7 +76,9 @@ export default { ], tbData: [], pagination: { + current: 1, pageSize: 20, + total: 0 }, } }, @@ -80,22 +88,25 @@ export default { }, methods: { getData() { + this.tableLoad = true; let o = {token: this.getToken}; getCheZhuCountTime(o).then(res => { let data = res.data; - this.form.sStartTime = data.Data[0].Time; - this.form.sEndTime = data.Data[data.Data.length-1].Time; + this.form.sStartTime = data.Data[0].Time + '-01'; + this.form.sEndTime = data.Data[data.Data.length-1].Time + '-01'; let obj = { token: this.getToken, sTimeType: 4, - sStartTime: this.form.sStartTime + '-01', - sEndTime: this.form.sEndTime + '-01', + sStartTime: this.form.sStartTime, + sEndTime: this.form.sEndTime, iPageIndex: 1, iPageSize: 20, } getCheZhuCarBrandRanking(obj).then(res => { let data = res.data; - console.log(data) + this.pagination.total = res.totalNum + this.tbData = data; + this.tableLoad = false }) }); }, @@ -108,9 +119,42 @@ export default { }, //查询 onSearch() { + this.tableLoad = true; this.form.sStartTime = this.selTime[0]; this.form.sEndTime = this.selTime[1]; - this.getData(); + getCheZhuCarBrandRanking(this.form).then(res => { + let data = res.data; + this.pagination.total = res.totalNum + this.tbData = data; + this.tableLoad = false + }) + }, + //点击销量 + onSale(record) { + let sBrand = record.brand; + this.$router.push( + { + path: '/saleRank/brandInfo', + query: { + sBrand: sBrand, + sStartTime: this.form.sStartTime, + sEndTime: this.form.sEndTime + } + } + ); + }, + //改变页面数据 + handlerPagnation(page) { + this.tableLoad = true; + let cur = page.current; + this.pagination.current = cur; + this.form.iPageIndex = cur; + getCheZhuCarBrandRanking(this.form).then(res => { + let data = res.data; + this.pagination.total = res.totalNum + this.tbData = data; + this.tableLoad = false + }) }, } } diff --git a/src/views/SaleRank/SeriesInfo/index.vue b/src/views/SaleRank/SeriesInfo/index.vue index 5bd0ef2..21128dc 100644 --- a/src/views/SaleRank/SeriesInfo/index.vue +++ b/src/views/SaleRank/SeriesInfo/index.vue @@ -4,6 +4,10 @@ 查看图表 返回 + + + + @@ -20,20 +24,59 @@ export default { sBrand: '', sSeriesName: '', }, - time: '销量' + time: '销量', + //表格 + tableLoad: false, + columns: [ + { + title: "日期", + dataIndex: "sourcetime", + key: "sourcetime", + width: 240 + }, + { + title: "销量(辆)", + dataIndex: "salescount", + key: "salescount", + }, + { + title: "所属级别", + dataIndex: "specname", + key: "specname" + }, + { + title: "级别排名", + dataIndex: "specpm", + key: "specpm" + }, + { + title: "厂商排名", + dataIndex: "salespm", + key: "salespm" + }, + ], + tbData: [], + pagination: { + current: 1, + pageSize: 20, + total: 0 + }, } }, created() { this.form.token = this.getToken; - // this.form.sBrand = this.$route.query.sBrand || ""; - // this.form.sSeriesName = this.$route.query.sSeriesName || ""; + this.time = this.$route.query.sSeriesName + '销量' + this.form.sBrand = this.$route.query.sBrand || ""; + this.form.sSeriesName = this.$route.query.sSeriesName || ""; this.getData(); }, methods: { getData() { let obj = Object.assign(this.form, {}); getCheZhuCarSeriesList(obj).then(res => { - console.log(res) + let data = res.data; + this.pagination.total = res.totalNum; + this.tbData = data; }) }, //查看图表 @@ -42,6 +85,23 @@ export default { goBack() { this.$router.go(-1); }, + //改变页面数据 + handlerPagnation(page) { + this.tableLoad = true; + let cur = page.current; + this.pagination.current = cur; + this.form.iPageIndex = cur; + getCheZhuCarSeriesList(this.form).then(res => { + let data = res.data; + this.pagination.total = res.totalNum + this.tbData = data; + this.tableLoad = false + }) + }, + //查看图表 + onTable() { + + } } } @@ -51,5 +111,8 @@ export default { width: 1552px; // height: 460px; border: 2px solid #0f2a4d; + .d3 { + padding: 16px; + } } \ No newline at end of file diff --git a/src/views/SaleRank/SeriesSale/index.vue b/src/views/SaleRank/SeriesSale/index.vue index b136d32..b96234c 100644 --- a/src/views/SaleRank/SeriesSale/index.vue +++ b/src/views/SaleRank/SeriesSale/index.vue @@ -1,6 +1,6 @@ - + 查看图表 返回 @@ -141,7 +141,6 @@ export default { }, //点击销量 onSale(record) { - console.log(record) let sBrand = record.brand; let sSeriesName = record.seriesname; this.$router.push(