Browse Source

Merge pull request '统计页面优化' (#19) from wpd_stats into master

Reviewed-on: #19
pull/20/head
pengda 2 weeks ago
parent
commit
e1fb2ed600
  1. 2
      src/assets/super/growth-down.svg
  2. 2
      src/assets/super/growth-flat.svg
  3. 2
      src/assets/super/growth-up.svg
  4. 1
      src/assets/super/list-detail-hover.svg
  5. 58
      src/components/super/GrowthText.vue
  6. 36
      src/components/super/HoverImage.vue
  7. 4
      src/router/index.js
  8. 23
      src/views/Franchise.vue
  9. 2
      src/views/super/Ranking/Purchase.vue
  10. 200
      src/views/super/Ranking/RankBatchList.vue
  11. 103
      src/views/super/Ranking/RankDetail.vue
  12. 122
      src/views/super/Ranking/RankList.vue
  13. 24
      src/views/super/Ranking/Ranking.vue

2
src/assets/super/growth-down.svg

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="10.5" height="14" viewBox="0 0 10.5 14"><defs><clipPath id="master_svg0_230_73233"><rect x="0" y="0" width="10.5" height="14" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_230_73233)"><g transform="matrix(1,0,0,-1,0,26.8515625)"><g><path d="M4.62109,13.67187525Q4.89453,13.42578125,5.25,13.42578125Q5.60547,13.42578125,5.87891,13.67187525L10.2539,18.04687125Q10.5,18.32031125,10.5,18.67578125Q10.5,19.03125125,10.2539,19.30469125Q9.98047,19.55078125,9.625,19.55078125Q9.26953,19.55078125,8.99609,19.30469125L6.125,16.40625125L6.125,24.80078125Q6.125,25.18358125,5.87891,25.42968125Q5.63281,25.67578125,5.25,25.67578125Q4.86719,25.67578125,4.62109,25.42968125Q4.375,25.18358125,4.375,24.80078125L4.375,16.40625125L1.50391,19.30469125Q1.23047,19.55078125,0.875,19.55078125Q0.519531,19.55078125,0.246094,19.30469125Q0,19.03125125,0,18.67578125Q0,18.32031125,0.246094,18.04687125L4.62109,13.67187525Z" fill="#EF4444" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></g></g></svg> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="14" height="14.000000953674316" viewBox="0 0 14 14.000000953674316"><defs><clipPath id="master_svg0_391_050433"><rect x="0" y="0" width="14" height="14.000000953674316" rx="0"/></clipPath><clipPath id="master_svg1_391_050434"><rect x="2" y="0" width="10.5" height="14" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_391_050433)"><g clip-path="url(#master_svg1_391_050434)"><g transform="matrix(1,0,0,-1,0,26.8515625)"><g><path d="M6.62109,13.67187525Q6.89453,13.42578125,7.25,13.42578125Q7.60547,13.42578125,7.87891,13.67187525L12.2539,18.04687125Q12.5,18.32031125,12.5,18.67578125Q12.5,19.03125125,12.2539,19.30469125Q11.98047,19.55078125,11.625,19.55078125Q11.26953,19.55078125,10.99609,19.30469125L8.125,16.40625125L8.125,24.80078125Q8.125,25.18358125,7.87891,25.42968125Q7.63281,25.67578125,7.25,25.67578125Q6.86719,25.67578125,6.62109,25.42968125Q6.375,25.18358125,6.375,24.80078125L6.375,16.40625125L3.5039100000000003,19.30469125Q3.23047,19.55078125,2.875,19.55078125Q2.5195309999999997,19.55078125,2.246094,19.30469125Q2,19.03125125,2,18.67578125Q2,18.32031125,2.246094,18.04687125L6.62109,13.67187525Z" fill="#EF4444" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

2
src/assets/super/growth-flat.svg

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="11.5" height="2" viewBox="0 0 11.5 2"><g><path d="M1,0L10.5,0Q10.59849,0,10.69509,0.019214999999999982Q10.79169,0.038429999999999964,10.88268,0.076121Q10.97368,0.11381200000000002,11.0556,0.16852999999999996Q11.1375,0.22324900000000003,11.2071,0.29289299999999996Q11.2767,0.362537,11.3315,0.44443Q11.3862,0.526322,11.4239,0.617317Q11.4616,0.708311,11.4808,0.80491Q11.5,0.9015086,11.5,1Q11.5,1.0984914,11.4808,1.19509Q11.4616,1.2916889999999999,11.4239,1.382683Q11.3862,1.473678,11.3315,1.55557Q11.2767,1.637463,11.2071,1.7071070000000002Q11.1375,1.776751,11.0556,1.83147Q10.97368,1.886188,10.88268,1.923879Q10.79169,1.96157,10.69509,1.980785Q10.59849,2,10.5,2L1,2Q0.9015086,2,0.80491,1.980785Q0.708311,1.96157,0.617317,1.923879Q0.526322,1.886188,0.44443,1.83147Q0.362537,1.776751,0.29289299999999996,1.7071070000000002Q0.22324900000000003,1.637463,0.16852999999999996,1.55557Q0.11381200000000002,1.473678,0.076121,1.382683Q0.038429999999999964,1.2916889999999999,0.019214999999999982,1.19509Q0,1.0984914,0,1Q0,0.9015086,0.019214999999999982,0.80491Q0.038429999999999964,0.708311,0.076121,0.617317Q0.11381200000000002,0.526322,0.16852999999999996,0.44443Q0.22324900000000003,0.362537,0.29289299999999996,0.29289299999999996Q0.362537,0.22324900000000003,0.44443,0.16852999999999996Q0.526322,0.11381200000000002,0.617317,0.076121Q0.708311,0.038429999999999964,0.80491,0.019214999999999982Q0.9015086,0,1,0Z" fill-rule="evenodd" fill="#006AFF" fill-opacity="1"/></g></svg> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="14" height="14.000000953674316" viewBox="0 0 14 14.000000953674316"><defs><clipPath id="master_svg0_391_050444"><rect x="0" y="0" width="14" height="14.000000953674316" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_391_050444)"><g><path d="M2.5,6L12,6Q12.09849,6,12.19509,6.019215Q12.29169,6.03843,12.38268,6.076121Q12.47368,6.113812,12.5556,6.16853Q12.6375,6.223249,12.7071,6.292893Q12.7767,6.362537,12.8315,6.44443Q12.8862,6.526322,12.9239,6.617317Q12.9616,6.708311,12.9808,6.80491Q13,6.9015086,13,7Q13,7.0984914,12.9808,7.19509Q12.9616,7.291689,12.9239,7.382683Q12.8862,7.473678,12.8315,7.55557Q12.7767,7.637463,12.7071,7.707107Q12.6375,7.776751,12.5556,7.83147Q12.47368,7.886188,12.38268,7.923879Q12.29169,7.96157,12.19509,7.980785Q12.09849,8,12,8L2.5,8Q2.4015086,8,2.30491,7.980785Q2.208311,7.96157,2.117317,7.923879Q2.026322,7.886188,1.94443,7.83147Q1.862537,7.776751,1.7928929999999998,7.707107Q1.723249,7.637463,1.66853,7.55557Q1.613812,7.473678,1.576121,7.382683Q1.53843,7.291689,1.519215,7.19509Q1.5,7.0984914,1.5,7Q1.5,6.9015086,1.519215,6.80491Q1.53843,6.708311,1.576121,6.617317Q1.613812,6.526322,1.66853,6.44443Q1.723249,6.362537,1.7928929999999998,6.292893Q1.862537,6.223249,1.94443,6.16853Q2.026322,6.113812,2.117317,6.076121Q2.208311,6.03843,2.30491,6.019215Q2.4015086,6,2.5,6Z" fill-rule="evenodd" fill="#006AFF" fill-opacity="1"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

2
src/assets/super/growth-up.svg

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="10.5" height="14" viewBox="0 0 10.5 14"><defs><clipPath id="master_svg0_223_004796"><rect x="0" y="0" width="10.5" height="14" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_223_004796)"><g transform="matrix(1,0,0,-1,0,26.8515625)"><g><path d="M5.87891,25.42968125Q5.60547,25.67578125,5.25,25.67578125Q4.89453,25.67578125,4.62109,25.42968125L0.246094,21.05469125Q0,20.78125125,0,20.42578125Q0,20.07031125,0.246094,19.79687125Q0.519531,19.55078125,0.875,19.55078125Q1.23047,19.55078125,1.50391,19.79687125L4.375,22.69531125L4.375,14.30078125Q4.375,13.91796925,4.62109,13.67187525Q4.86719,13.42578125,5.25,13.42578125Q5.63281,13.42578125,5.87891,13.67187525Q6.125,13.91796925,6.125,14.30078125L6.125,22.69531125L8.99609,19.79687125Q9.26953,19.55078125,9.625,19.55078125Q9.98047,19.55078125,10.2539,19.79687125Q10.5,20.07031125,10.5,20.42578125Q10.5,20.78125125,10.2539,21.05469125L5.87891,25.42968125Z" fill="#22C55E" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></g></g></svg> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="14" height="14.000000953674316" viewBox="0 0 14 14.000000953674316"><defs><clipPath id="master_svg0_391_050437"><rect x="0" y="0" width="14" height="14.000000953674316" rx="0"/></clipPath><clipPath id="master_svg1_391_050441"><rect x="2" y="0" width="10.5" height="14" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_391_050437)"><g clip-path="url(#master_svg1_391_050441)"><g transform="matrix(1,0,0,-1,0,26.8515625)"><g><path d="M7.87891,25.42968125Q7.60547,25.67578125,7.25,25.67578125Q6.89453,25.67578125,6.62109,25.42968125L2.246094,21.05469125Q2,20.78125125,2,20.42578125Q2,20.07031125,2.246094,19.79687125Q2.5195309999999997,19.55078125,2.875,19.55078125Q3.23047,19.55078125,3.5039100000000003,19.79687125L6.375,22.69531125L6.375,14.30078125Q6.375,13.91796925,6.62109,13.67187525Q6.86719,13.42578125,7.25,13.42578125Q7.63281,13.42578125,7.87891,13.67187525Q8.125,13.91796925,8.125,14.30078125L8.125,22.69531125L10.99609,19.79687125Q11.26953,19.55078125,11.625,19.55078125Q11.98047,19.55078125,12.2539,19.79687125Q12.5,20.07031125,12.5,20.42578125Q12.5,20.78125125,12.2539,21.05469125L7.87891,25.42968125Z" fill="#22C55E" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></g></g></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

1
src/assets/super/list-detail-hover.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

58
src/components/super/GrowthText.vue

@ -0,0 +1,58 @@
<template>
<span v-if="value">
<span v-if="value > 0" class="growth-text flex">
<img class="edit_icon" src="@/assets/super/growth-up.svg"/>
<span class="growth-up">{{ value }}%</span>
<span>同比上年</span>
</span>
<span v-else-if="value < 0" class="growth-text flex">
<img class="edit_icon" src="@/assets/super/growth-down.svg"/>
<span class="growth-down">{{ value }}%</span>
<span>同比上年</span>
</span>
<span v-else class="growth-text">
<img class="edit_icon" src="@/assets/super/growth-flat.svg"/>
<span>同比上年持平</span>
</span>
</span>
<span v-else class="growth-text">上年无数据</span>
</template>
<script>
export default {
name: 'GrowthText',
props: {
value: {
type: [Boolean, String, Number],
required: true
}
},
data() {
return {
};
}
};
</script>
<style scoped>
.growth-up {
padding-right:5px;
color: #22C55E;
}
.growth-down {
padding-right:5px;
color: #EF4444;
}
.growth-text {
color: #9CA3AF;
padding-left: 5px;
font-size: 12px;
}
.edit_icon {
vertical-align: middle;
padding: 0 5px;
}
</style>

36
src/components/super/HoverImage.vue

@ -0,0 +1,36 @@
<template>
<img :src="isHover ? hover : normal" class="detail_icon"
@mouseover="isHover = true"
@mouseleave="isHover = false"
v-on="$listeners"
/>
</template>
<script>
export default {
name: 'HoverImage',
props: {
normal: {
type: String,
required: true
},
hover: {
type: String,
required: true
}
},
data() {
return {
isHover: false
};
}
};
</script>
<style scoped>
.detail_icon {
vertical-align: text-top;
padding-left: 5px;
cursor: pointer;
}
</style>

4
src/router/index.js

@ -196,13 +196,13 @@ const routes = [{
path: '/super/ranking/detail', path: '/super/ranking/detail',
name: '详情', name: '详情',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankDetail.vue'), component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankDetail.vue'),
props: {pageTitle:'详情',rank_type: 1, type: 'day', showDateSelect: false} props: {pageTitle:'详情', type: 'day', showDateSelect: false, lookMore:false}
}, },
{ {
path: '/super/ranking/list', path: '/super/ranking/list',
name: '列表', name: '列表',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankList.vue'), component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankList.vue'),
props: {pageTitle:'排行',} props: {pageTitle:'详情', showDateSelect: false, lookMore:false}
}, },
] ]

23
src/views/Franchise.vue

@ -226,9 +226,6 @@ export default {
sendCode() { sendCode() {
if (!this.canSend || this.countdown > 0) return if (!this.canSend || this.countdown > 0) return
//
console.log('发送验证码到:', this.form.phone)
// //
this.countdown = 60 this.countdown = 60
this.timer = setInterval(() => { this.timer = setInterval(() => {
@ -238,12 +235,26 @@ export default {
} }
}, 1000) }, 1000)
// API const that = this
// this.$api.sendSmsCode({ phone: this.formData.phone }) this.$http('POST', '/agentnew/ajax_send_verify_code', {
phone: that.form.phone,
}).then(response => {
if (!response.status) {
that.$message.warning(response.info);
}else{
that.$message.success(response.info);
}
}).catch(error => {
console.error(error, 'error')
})
}, },
goAddFranchise(){ goAddFranchise(){
console.log(this.form) if(!this.checked){
this.$message.warning('请阅读并同意协议');
return false;
}
const that = this const that = this
that.$refs.formRef.validate((valid) => { that.$refs.formRef.validate((valid) => {
if (valid) { if (valid) {

2
src/views/super/Ranking/Purchase.vue

@ -168,6 +168,8 @@ export default {
} }
}, },
mounted() { mounted() {
document.title = this.pageTitle
this.currentPage = 1 this.currentPage = 1
this.getData() this.getData()
}, },

200
src/views/super/Ranking/RankBatchList.vue

@ -25,7 +25,7 @@
v-if="(dataRank == 1 || dataRank == 2) && (dataType == 'ver_type' || dataType == 'check_type')" v-if="(dataRank == 1 || dataRank == 2) && (dataType == 'ver_type' || dataType == 'check_type')"
prop="name" prop="name"
:key="selectedType" :key="selectedType"
:label="type_select[selectedType]"> :label="type_select[selectedType]" width="200">
<template slot="header"> <template slot="header">
<el-select class="custom-select" popper-class="custom-select-dropdown" v-model="selectedType" @change="changeRankType"> <el-select class="custom-select" popper-class="custom-select-dropdown" v-model="selectedType" @change="changeRankType">
@ -46,10 +46,11 @@
<el-table-column v-for="(field, index) in valueFields" <el-table-column v-for="(field, index) in valueFields"
:key="field" :key="field"
:label="labels[index]" :label="labels[index] + (index == 3 ? current_month : '')"
:prop="String(index + 1)" :prop="String(index + 1)"
sortable="custom"> sortable="custom">
<!--产品利润排行展示查看更多-->
<template v-if="index == 3 && dataRank == 1 && type != 'agent'" v-slot="{ row, $index }"> <template v-if="index == 3 && dataRank == 1 && type != 'agent'" v-slot="{ row, $index }">
<el-popover v-model="row.id_popover" <el-popover v-model="row.id_popover"
placement="top" placement="top"
@ -68,35 +69,15 @@
</span> </span>
</div> </div>
<el-table :data="tableData1" style="width: 100%"> <el-table :data="tableData1" style="width: 100%">
<el-table-column prop="value_1" width="208" label="日期"></el-table-column> <el-table-column prop="value_1" width="200" label="日期"></el-table-column>
<el-table-column width="348" :label="rank_type_desc[dataRank]"> <el-table-column width="200" :label="rank_type_desc[dataRank]">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex"> <div class="flex">
{{ scope.row.value_2 }} {{ scope.row.value_2 }}
<template v-if="Object.keys(growth_list1).length > 0"> <template v-if="Object.keys(growth_list1).length > 0">
<span v-if="growth_list1[scope.row.id]" <GrowthText :value="growth_list1[scope.row.id] ? growth_list1[scope.row.id].value : false"
class="flex growth-text"> :prop="'growth'+index"/>
<span v-if="growth_list1[scope.row.id].value>0">
<span class="growth-up">
<img class="edit_icon"
src="@/assets/super/growth-up.svg">
{{ growth_list1[scope.row.id].value }}%
</span>同比上年
</span>
<span v-if="growth_list1[scope.row.id].value<0">
<span class="growth-down">
<img class="edit_icon"
src="@/assets/super/growth-down.svg">
{{ growth_list1[scope.row.id].value }}%
</span>同比上年
</span>
<span v-if="growth_list1[scope.row.id].value==0">
<img class="edit_icon"
src="@/assets/super/growth-flat.svg">同比上年持平
</span>
</span>
<span v-else class="flex growth-text">上年无数据</span>
</template> </template>
</div> </div>
</template> </template>
@ -106,59 +87,63 @@
<div class="flex" slot="reference"> <div class="flex" slot="reference">
{{ row[field] }} {{ row[field] }}
<template v-if="Object.keys(growth_list).length > 0"> <template v-if="view === 'month' && (index != 3 || current_month == '')">
<template v-if="growth_list[row.id] && growth_list[row.id][field]"> <GrowthText :value="growth_list[row.id] && growth_list[row.id][field] ? growth_list[row.id][field].value : false"
<span v-if="growth_list[row.id][field].value > 0" class="growth-text"> :prop="'growth'+index"/>
<span class="growth-up">
<img class="edit_icon" src="@/assets/super/growth-up.svg"/>
{{ growth_list[row.id][field].value }}%
</span>同比上年
</span>
<span v-else-if="growth_list[row.id][field].value < 0" class="growth-text">
<span class="growth-down">
<img class="edit_icon" src="@/assets/super/growth-down.svg"/>
{{ growth_list[row.id][field].value }}%
</span>同比上年
</span>
<span v-else class="growth-text">
<img class="edit_icon" src="@/assets/super/growth-flat.svg"/>同比上年持平
</span>
</template>
<span v-else class="growth-text">上年无数据</span>
</template> </template>
<img v-if="show_detail_index == row.sort" <HoverImage v-if="show_detail_index == row.sort && row[field] > 0"
@click="handleClick(row, $index, 'id')" @click="handleClick(row, $index, 'id')"
class="detail_icon" src="@/assets/super/list-detail.svg"> :normal="require('@/assets/super/list-detail.svg')"
:hover="require('@/assets/super/list-detail-hover.svg')"/>
</div> </div>
</el-popover> </el-popover>
</template> </template>
<template v-else slot-scope="scope"> <template v-else slot-scope="scope">
<div class="flex"> <div class="flex">
{{ scope.row[field] }} {{ scope.row[field] }}
<template v-if="Object.keys(growth_list).length > 0"> <template v-if="view === 'month' && (index != 3 || current_month == '')">
<template v-if="growth_list[scope.row.id] && growth_list[scope.row.id][field]"> <GrowthText :value="growth_list[scope.row.id] && growth_list[scope.row.id][field] ? growth_list[scope.row.id][field].value : false"
<span v-if="growth_list[scope.row.id][field].value > 0" class="growth-text"> :prop="'growth'+index"/>
<span class="growth-up">
<img class="edit_icon" src="@/assets/super/growth-up.svg"/>
{{ growth_list[scope.row.id][field].value }}%
</span>同比上年
</span>
<span v-else-if="growth_list[scope.row.id][field].value < 0"
class="growth-text">
<span class="growth-down">
<img class="edit_icon" src="@/assets/super/growth-down.svg"/>
{{ growth_list[scope.row.id][field].value }}%
</span>同比上年
</span>
<span v-else class="growth-text">
<img class="edit_icon" src="@/assets/super/growth-flat.svg"/>同比上年持平
</span>
</template>
<span v-else class="growth-text">上年无数据</span>
</template> </template>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<!--产品利润排行展示代理商排行-->
<el-table-column v-if="dataRank == 1 && (dataType == 'ver_type' || dataType == 'check_type')" key="top" prop="top" :label="'代理商排行'+current_month">
<template v-slot="{ row, $index }">
<el-popover v-model="row.id_popover_2"
placement="top"
trigger="manual"
:ref="`popover_2-${$index}`"
@show="popshow">
<div class="pop-wrap">
<div class="flex-between flex pop-top">
<h3>
{{ row.name }} 代理商排行
<span @click="goLookMoreRank(row.id)">查看更多</span>
</h3>
<span class="flex point" @click="closePop(row,'id')">
关闭<img src="@/assets/register/close.svg">
</span>
</div>
<el-table :data="tableData1" style="width: 100%">
<el-table-column prop="sort" width="100" label="排行"></el-table-column>
<el-table-column prop="name" width="200" label="代理商"></el-table-column>
<el-table-column prop="value_1" width="200" label="销售额"></el-table-column>
</el-table>
</div>
<span v-if="top_list[row.id]" slot="reference">
No.1 {{ top_list[row.id]['name'] }}
<HoverImage v-if="show_detail_index == row.sort"
@click="handleClick2(row, $index, 'id')"
:normal="require('@/assets/super/list-detail.svg')"
:hover="require('@/assets/super/list-detail-hover.svg')"/>
</span>
<span v-else slot="reference">暂无排行</span>
</el-popover>
</template>
</el-table-column>
</el-table> </el-table>
<el-pagination background <el-pagination background
@size-change='handleSizeChange' @size-change='handleSizeChange'
@ -174,6 +159,8 @@
</template> </template>
<script> <script>
import DateSelect from '@/components/super/DateSelect.vue'; import DateSelect from '@/components/super/DateSelect.vue';
import HoverImage from '@/components/super/HoverImage.vue';
import GrowthText from '@/components/super/GrowthText.vue';
import CustomDropdown from '@/components/CustomDropdown.vue'; import CustomDropdown from '@/components/CustomDropdown.vue';
export default { export default {
@ -193,6 +180,8 @@ export default {
} }
}, },
components: { components: {
HoverImage,
GrowthText,
DateSelect, DateSelect,
CustomDropdown CustomDropdown
}, },
@ -221,6 +210,7 @@ export default {
selectedType: 'check_type', selectedType: 'check_type',
view: 'month', view: 'month',
labels: ['', '', '', ''], labels: ['', '', '', ''],
current_month:'',
valueFields: ['value_1', 'value_2', 'value_3', 'value_4'], valueFields: ['value_1', 'value_2', 'value_3', 'value_4'],
currentPage: 1, // currentPage: 1, //
pageSize: 20, // pageSize: 20, //
@ -232,6 +222,7 @@ export default {
dataType: '', dataType: '',
dataRank: '', dataRank: '',
tableData: [], tableData: [],
top_list: [],
growth_list: [], growth_list: [],
tableData1: [], tableData1: [],
growth_list1: [], growth_list1: [],
@ -305,12 +296,33 @@ export default {
query: query query: query
}).href, '_blank') }).href, '_blank')
}, },
goLookMoreRank(id) {
let query = {}
query.date = this.text
query.rank_type = this.dataRank
query.type = 'agent'
if (this.dataType == 'agent') {
query.aid = id
}
if (this.dataType == 'ver_type') {
query.ver_type = id
}
if (this.dataType == 'check_type') {
query.check_type = id
}
window.open(this.$router.resolve({
path: '/super/ranking/list',
query: query
}).href, '_blank')
},
closePop(row, type) { closePop(row, type) {
row[type + '_popover'] = false; // row[type + '_popover'] = false;
row[type + '_popover_2'] = false;
}, },
handleClick(row, index, type) { handleClick(row, index, type) {
// //
this.tableData.forEach((item, i) => { this.tableData.forEach((item, i) => {
item[type + '_popover_2'] = false;
if (i !== index) { if (i !== index) {
item[type + '_popover'] = false; item[type + '_popover'] = false;
} }
@ -330,6 +342,29 @@ export default {
} }
this.getRankingDetail(obj); this.getRankingDetail(obj);
}, },
handleClick2(row, index, type) {
//
this.tableData.forEach((item, i) => {
item[type + '_popover'] = false;
if (i !== index) {
item[type + '_popover_2'] = false;
}
});
//
row[type + '_popover_2'] = true;
let obj = {}
if (this.dataType == 'agent') {
obj.aid = row.id
}
if (this.dataType == 'ver_type') {
obj.ver_type = row.id
}
if (this.dataType == 'check_type') {
obj.check_type = row.id
}
this.getRankingList(obj);
},
popshow() { popshow() {
var ariaEls = document.querySelectorAll('.el-popover') var ariaEls = document.querySelectorAll('.el-popover')
ariaEls.forEach((item) => { ariaEls.forEach((item) => {
@ -380,6 +415,14 @@ export default {
const year = date.getFullYear(); const year = date.getFullYear();
const month = date.getMonth() + 1; const month = date.getMonth() + 1;
const currentYear = new Date().getFullYear();
const currentMonth = new Date().getMonth() + 1;
this.current_month = '';
if(this.view === 'month' && year == currentYear && month == currentMonth){
this.current_month = '(当月)';
}
this.labels = []; this.labels = [];
if (this.view === 'year') { if (this.view === 'year') {
for (let i = 3; i >= 0; i--) { for (let i = 3; i >= 0; i--) {
@ -390,6 +433,7 @@ export default {
for (let i = 3; i >= 0; i--) { for (let i = 3; i >= 0; i--) {
let m = month - i; let m = month - i;
if (m <= 0) m += 12; if (m <= 0) m += 12;
monthLabels.push(m + '月' + this.rank_type_desc[this.dataRank]); monthLabels.push(m + '月' + this.rank_type_desc[this.dataRank]);
} }
this.labels = monthLabels; this.labels = monthLabels;
@ -484,6 +528,24 @@ export default {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
getRankingList(obj) {
const that = this
that.tableData1 = []
that.growth_list1 = []
this.$http('POST', '/supernew/ajax_get_agent_rank_list', {
date: that.text,
rank_type: that.dataRank,
cur_page: 1,
page_size: 5,
...obj
}).then(response => {
this.$nextTick(() => {
that.tableData1 = response.data.list
})
}).catch(error => {
console.error(error, 'error')
})
},
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val this.pageSize = val
this.getRankingData() this.getRankingData()

103
src/views/super/Ranking/RankDetail.vue

@ -55,17 +55,17 @@
</div> </div>
<el-table :data="tableData1" style="width: 100%"> <el-table :data="tableData1" style="width: 100%">
<el-table-column prop="sort" width="100" label="排行"></el-table-column> <el-table-column prop="sort" width="100" label="排行"></el-table-column>
<el-table-column prop="name" width="208" label="代理商"></el-table-column> <el-table-column prop="name" width="200" label="代理商"></el-table-column>
<el-table-column prop="value_1" width="348" label="销售额"></el-table-column> <el-table-column prop="value_1" width="200" label="销售额"></el-table-column>
</el-table> </el-table>
</div> </div>
<span v-if="top_list[row.id]" slot="reference"> <span v-if="top_list[row.id]" slot="reference">
No.1 {{ top_list[row.id]['name'] }} No.1 {{ top_list[row.id]['name'] }}
<img v-if="show_detail_index == row.sort" <HoverImage v-if="show_detail_index == row.sort"
@click="handleClick(row, $index, 'id')" @click="handleClick(row, $index, 'id')"
class="detail_icon" :normal="require('@/assets/super/list-detail.svg')"
src="@/assets/super/list-detail.svg"> :hover="require('@/assets/super/list-detail-hover.svg')"/>
</span> </span>
<span v-else slot="reference">暂无排行</span> <span v-else slot="reference">暂无排行</span>
</el-popover> </el-popover>
@ -94,24 +94,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex"> <div class="flex">
{{ scope.row.value_2 }} {{ scope.row.value_2 }}
<span v-if="growth_list[scope.row.id]" class="flex growth-text"> <GrowthText :value="growth_list[scope.row.id] ? growth_list[scope.row.id].value : false" prop="growth"/>
<span v-if="growth_list[scope.row.id].value>0">
<span class="growth-up">
<img class="edit_icon" src="@/assets/super/growth-up.svg">
{{ growth_list[scope.row.id].value }}%
</span>同比上年
</span>
<span v-if="growth_list[scope.row.id].value<0">
<span class="growth-down">
<img class="edit_icon" src="@/assets/super/growth-down.svg">
{{ growth_list[scope.row.id].value }}%
</span>同比上年
</span>
<span v-if="growth_list[scope.row.id].value==0">
<img class="edit_icon" src="@/assets/super/growth-flat.svg">同比上年持平
</span>
</span>
<span class="flex growth-text" v-else>上年无数据</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -135,15 +118,16 @@
</div> </div>
<el-table :data="tableData1" style="width: 100%"> <el-table :data="tableData1" style="width: 100%">
<el-table-column prop="sort" width="100" label="排行"></el-table-column> <el-table-column prop="sort" width="100" label="排行"></el-table-column>
<el-table-column prop="name" width="208" label="代理商"></el-table-column> <el-table-column prop="name" width="200" label="代理商"></el-table-column>
<el-table-column prop="value_1" width="348" label="销售额"></el-table-column> <el-table-column prop="value_1" width="200" label="销售额"></el-table-column>
</el-table> </el-table>
</div> </div>
<span v-if="top_list[row.id]" slot="reference"> <span v-if="top_list[row.id]" slot="reference">
No.1 {{ top_list[row.id]['name'] }} No.1 {{ top_list[row.id]['name'] }}
<img v-if="show_detail_index == row.sort" <HoverImage v-if="show_detail_index == row.sort"
@click="handleClick(row, $index, 'id')" @click="handleClick(row, $index, 'id')"
class="detail_icon" src="@/assets/super/list-detail.svg"> :normal="require('@/assets/super/list-detail.svg')"
:hover="require('@/assets/super/list-detail-hover.svg')"/>
</span> </span>
<span v-else slot="reference">暂无排行</span> <span v-else slot="reference">暂无排行</span>
</el-popover> </el-popover>
@ -178,24 +162,7 @@
<div class="flex"> <div class="flex">
{{ scope.row.value_2 }} {{ scope.row.value_2 }}
<template v-if="Object.keys(growth_list).length > 0"> <template v-if="Object.keys(growth_list).length > 0">
<span v-if="growth_list[scope.row.id]" class="flex growth-text"> <GrowthText :value="growth_list[scope.row.id] ? growth_list[scope.row.id].value : false" prop="growth"/>
<span v-if="growth_list[scope.row.id].value>0">
<span class="growth-up">
<img class="edit_icon" src="@/assets/super/growth-up.svg">
{{ growth_list[scope.row.id].value }}%
</span>同比上年
</span>
<span v-if="growth_list[scope.row.id].value<0">
<span class="growth-down">
<img class="edit_icon" src="@/assets/super/growth-down.svg">
{{ growth_list[scope.row.id].value }}%
</span>同比上年
</span>
<span v-if="growth_list[scope.row.id].value==0">
<img class="edit_icon" src="@/assets/super/growth-flat.svg">同比上年持平
</span>
</span>
<span v-else class="flex growth-text">上年无数据</span>
</template> </template>
</div> </div>
</template> </template>
@ -240,6 +207,8 @@
<script> <script>
import DateSelect from '@/components/super/DateSelect.vue'; import DateSelect from '@/components/super/DateSelect.vue';
import CustomDropdown from '@/components/CustomDropdown.vue'; import CustomDropdown from '@/components/CustomDropdown.vue';
import HoverImage from "@/components/super/HoverImage.vue";
import GrowthText from "@/components/super/GrowthText.vue";
export default { export default {
name: 'rank_detail', name: 'rank_detail',
@ -259,9 +228,15 @@ export default {
showDateSelect: { showDateSelect: {
type: Boolean, type: Boolean,
default: true default: true
} },
lookMore:{
type: Boolean,
default: true
},
}, },
components: { components: {
GrowthText,
HoverImage,
DateSelect, DateSelect,
CustomDropdown CustomDropdown
}, },
@ -469,4 +444,36 @@ export default {
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.pop-wrap {
display: flex;
flex-direction: column;
gap: 20px;
box-sizing: border-box;
.pop-top {
h3 {
font-family: Microsoft YaHei UI;
font-size: 16px;
font-weight: bold;
line-height: 18px;
letter-spacing: 0.08em;
color: #1D2129;
margin: 0;
span {
display: inline-block;
margin-left: 12px;
font-size: 14px;
line-height: 18px;
color: #006AFF;
}
}
img {
width: 20px;
height: 20px;
}
}
}
</style> </style>

122
src/views/super/Ranking/RankList.vue

@ -2,7 +2,7 @@
<div class="demo-wrap min-flex-right"> <div class="demo-wrap min-flex-right">
<div class="flex-between"> <div class="flex-between">
<h2>{{ filterTitle ? filterTitle : pageTitle }}</h2> <h2>{{ filterTitle ? filterTitle : pageTitle }}</h2>
<CustomDropdown ref="dropdownRef" <CustomDropdown v-if="showDateSelect" ref="dropdownRef"
:placeholder="'('+viewDesc[this.view]+')'+text" :placeholder="'('+viewDesc[this.view]+')'+text"
width="280px"> width="280px">
<DateSelect slot="normal" <DateSelect slot="normal"
@ -13,7 +13,8 @@
</CustomDropdown> </CustomDropdown>
</div> </div>
<div class=" flex-common"> <div class=" flex-common">
<div v-if="total_value>0" style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;"> <!--产品利润排行展示总数-->
<div v-if="total_value>0 && dataRank == 1" style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
<h3 style="margin: 0;"></h3> <h3 style="margin: 0;"></h3>
<span style="font-size: 14px; color: #999;">{{ rank_type_desc[dataRank] }}{{ total_value }}</span> <span style="font-size: 14px; color: #999;">{{ rank_type_desc[dataRank] }}{{ total_value }}</span>
</div> </div>
@ -80,29 +81,8 @@
<div class="flex" slot="reference"> <div class="flex" slot="reference">
{{ row.value_1 }} {{ row.value_1 }}
<template v-if="Object.keys(growth_list).length > 0"> <template v-if="Object.keys(growth_list).length > 0">
<span v-if="growth_list[row.id]" class="flex growth-text"> <GrowthText :value="growth_list[row.id] ? growth_list[row.id].value : false" prop="growth"/>
<span v-if="growth_list[row.id].value>0">
<span class="growth-up">
<img class="edit_icon" src="@/assets/super/growth-up.svg">
{{ growth_list[row.id].value }}%
</span>同比上年
</span>
<span v-if="growth_list[row.id].value<0">
<span class="growth-down">
<img class="edit_icon" src="@/assets/super/growth-down.svg">
{{ growth_list[row.id].value }}%
</span>同比上年
</span>
<span v-if="growth_list[row.id].value==0">
<img class="edit_icon" src="@/assets/super/growth-flat.svg">同比上年持平
</span>
</span>
<span v-else class="flex growth-text">上年无数据</span>
</template> </template>
<img v-if="false && row.value_1>0 && show_detail_index == row.sort"
@click="handleClick2(row, $index, 'id')"
class="detail_icon"
src="@/assets/super/list-detail.svg">
</div> </div>
</el-popover> </el-popover>
@ -136,28 +116,12 @@
<div class="flex" slot="reference"> <div class="flex" slot="reference">
{{ row.value_2 }} {{ row.value_2 }}
<template v-if="Object.keys(growth_list).length > 0"> <template v-if="Object.keys(growth_list).length > 0">
<span v-if="growth_list[row.id]" class="flex growth-text"> <GrowthText :value="growth_list[row.id] ? growth_list[row.id].value : false" prop="growth"/>
<span v-if="growth_list[row.id].value>0">
<span class="growth-up">
<img class="edit_icon" src="@/assets/super/growth-up.svg">
{{ growth_list[row.id].value }}%
</span>同比上年
</span>
<span v-if="growth_list[row.id].value<0">
<span class="growth-down">
<img class="edit_icon" src="@/assets/super/growth-down.svg">
{{ growth_list[row.id].value }}%
</span>同比上年
</span>
<span v-if="growth_list[row.id].value==0">
<img class="edit_icon" src="@/assets/super/growth-flat.svg">同比上年持平
</span>
</span>
<span class="flex growth-text" v-else>上年无数据</span>
</template> </template>
<img @click="handleClick2(row, $index, 'id')" <HoverImage v-if="row.value_1>0 && show_detail_index == row.sort && lookMore"
v-if="row.value_1>0 && show_detail_index == row.sort" class="detail_icon" @click="handleClick2(row, $index, 'id')"
src="@/assets/super/list-detail.svg"> :normal="require('@/assets/super/list-detail.svg')"
:hover="require('@/assets/super/list-detail-hover.svg')"/>
</div> </div>
</el-popover> </el-popover>
</template> </template>
@ -182,9 +146,13 @@
</div> </div>
<el-table :data="tableData1" style="width: 100%"> <el-table :data="tableData1" style="width: 100%">
<el-table-column prop="sort" width="100" label="排行"></el-table-column> <el-table-column prop="sort" width="100" label="排行"></el-table-column>
<el-table-column prop="name" width="208" label="代理商"></el-table-column> <el-table-column prop="name" width="150" label="代理商"></el-table-column>
<el-table-column prop="value_1" width="100" label="退单率"></el-table-column> <el-table-column prop="value_2" width="100" label="退单率">
<el-table-column prop="value_2" width="100" label="退单数"></el-table-column> <template slot-scope="scope">
<span :class="scope.row.value_2>20?'color-red':''">{{ scope.row.value_2 }} %</span>
</template>
</el-table-column>
<el-table-column prop="value_1" width="100" label="退单数"></el-table-column>
</el-table> </el-table>
</div> </div>
<!-- 触发弹框的按钮 --> <!-- 触发弹框的按钮 -->
@ -192,10 +160,10 @@
No.1 {{ top_list[row.id]['name'] }} No.1 {{ top_list[row.id]['name'] }}
<span class="color-red">{{ top_list[row.id]['value_1'] }}%</span> <span class="color-red">{{ top_list[row.id]['value_1'] }}%</span>
<span class="color-red">{{ top_list[row.id]['value_2'] }}</span> <span class="color-red">{{ top_list[row.id]['value_2'] }}</span>
<img v-if="show_detail_index == row.sort" <HoverImage v-if="show_detail_index == row.sort && lookMore"
@click="handleClick(row, $index, 'id')" @click="handleClick(row, $index, 'id')"
class="detail_icon" :normal="require('@/assets/super/list-detail.svg')"
src="@/assets/super/list-detail.svg"> :hover="require('@/assets/super/list-detail-hover.svg')"/>
</span> </span>
<span v-else slot="reference">暂无排行</span> <span v-else slot="reference">暂无排行</span>
</el-popover> </el-popover>
@ -219,6 +187,8 @@
import DateSelect from '@/components/super/DateSelect.vue'; import DateSelect from '@/components/super/DateSelect.vue';
import CustomDropdown from '@/components/CustomDropdown.vue'; import CustomDropdown from '@/components/CustomDropdown.vue';
import GrowthText from "@/components/super/GrowthText.vue";
import HoverImage from "@/components/super/HoverImage.vue";
export default { export default {
name: 'rank_list', name: 'rank_list',
@ -234,9 +204,19 @@ export default {
type: { type: {
type: String, type: String,
default: '' default: ''
} },
showDateSelect: {
type: Boolean,
default: true
},
lookMore:{
type: Boolean,
default: true
},
}, },
components: { components: {
HoverImage,
GrowthText,
DateSelect, DateSelect,
CustomDropdown CustomDropdown
}, },
@ -599,4 +579,40 @@ export default {
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.color-red{
color: #FF4D4F;
font-size: 12px;
}
.pop-wrap {
display: flex;
flex-direction: column;
gap: 20px;
box-sizing: border-box;
.pop-top {
h3 {
font-family: Microsoft YaHei UI;
font-size: 16px;
font-weight: bold;
line-height: 18px;
letter-spacing: 0.08em;
color: #1D2129;
margin: 0;
span {
display: inline-block;
margin-left: 12px;
font-size: 14px;
line-height: 18px;
color: #006AFF;
}
}
img {
width: 20px;
height: 20px;
}
}
}
</style> </style>

24
src/views/super/Ranking/Ranking.vue

@ -41,30 +41,6 @@ export default {
padding: 20px; padding: 20px;
} }
.growth-up {
padding: 0 5px;
color: #22C55E;
}
.growth-down {
padding: 0 5px;
color: #EF4444;
}
.growth-text {
color: #9CA3AF;
padding-left: 5px;
}
.edit_icon {
padding: 0 5px;
vertical-align: middle;
}
.detail_icon {
vertical-align: text-top;
padding-left: 5px;
}
.custom-select { .custom-select {
width: 110px; width: 110px;

Loading…
Cancel
Save