Merge remote-tracking branch 'origin/test' into test

pull/17/head
tangqian 2023-06-16 11:20:55 +08:00
commit 82f9e16fe3
3 changed files with 35 additions and 15 deletions

View File

@ -68,6 +68,16 @@ export function getPromoterPage(query) {
}) })
} }
// 导出所有推广员 Excel
export function allExport(query) {
return request({
url: '/member/promoter/all-export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 导出推广员 Excel // 导出推广员 Excel
export function exportPromoterExcel(query) { export function exportPromoterExcel(query) {
return request({ return request({

View File

@ -1,8 +1,10 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="快速查看" class="width100" prop="type"> <el-form-item label="快速查看" class="width100" prop="type">
<el-radio-group v-model="queryParams.type" type="button" class="mr20" size="small" > <el-radio-group v-model="queryParams.type" type="button" class="mr20" size="small" @change="getList">
<el-radio-button v-for="(item,i) in lookList" :label=i+1 :key="i">{{item.name}}</el-radio-button> <el-radio-button v-for="(item,i) in lookList" :label=i+1 :key="i">{{item.name}}</el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@ -15,14 +17,18 @@
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div>
<div class="statistics"> <div class="statistics">
<div v-for="(item,index) in list" :key="index" :class="[item.class,'statistics_item']"> <div v-for="(item,index) in statisticsList" :key="index" :class="[item.class,'statistics_item']">
<span>{{item.name}}</span> <span>{{item.name}}</span>
<span v-if="index<3">{{item.value}}</span> <span v-if="index<3">{{item.value}}</span>
<span v-else>{{item.value}} </span> <span v-else>{{item.value}} </span>
</div> </div>
</div> </div>
</el-card>
</div> </div>
<!-- <div class="dashboard-editor-container">--> <!-- <div class="dashboard-editor-container">-->
@ -97,15 +103,18 @@ export default {
return { return {
lineChartData: lineChartData.newVisitis, lineChartData: lineChartData.newVisitis,
queryParams: { queryParams: {
type:4
}, },
list:[], // list:[],
lookList:[{name:'今日'},{name:'上周'},{name:'上月'},{name:'全部'}], lookList:[{name:'今日'},{name:'上周'},{name:'上月'},{name:'全部'}],
statisticsList:[{name:'总销售金额',class:'totalMoney'},{name:'总订单数量(单)',class:'totalNum'},{name:'总退款金额',class:'totalWithdrawMoney'},{name:'240档订单数量',class:'threeTotalNum'},{name:'400档订单数量',class:'twoTotalNum'},{name:'640档订单数量',class:'oneTotalNum'}], statisticsList:[{name:'总销售金额',class:'totalMoney',value:0},{name:'总退款金额',class:'totalWithdrawMoney',value:0},{name:'总订单数量(单)',class:'totalNum',value:0},{name:'240档订单数量',class:'threeTotalNum',value:0},{name:'400档订单数量',class:'twoTotalNum',value:0},{name:'640档订单数量',class:'oneTotalNum',value:0}],
} }
}, },
created() { created() {
this.getList(); this.getList();
}, },
computed:{
},
methods: { methods: {
onchangeTime(value){ onchangeTime(value){
this.queryParams.startTime = value[0] this.queryParams.startTime = value[0]
@ -119,11 +128,10 @@ export default {
this.statisticsList.forEach((item,index) =>{ this.statisticsList.forEach((item,index) =>{
for (let key in response.data){ for (let key in response.data){
if(item.class === key){ if(item.class === key){
item.value = response.data[key] item.value = response.data[key] || 0
} }
} }
}) })
this.list = this.statisticsList
this.loading = false; this.loading = false;
}); });
}, },
@ -133,7 +141,9 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams ={}; this.queryParams ={
type: 4
};
this.handleQuery(); this.handleQuery();
}, },
handleSetLineChartData(type) { handleSetLineChartData(type) {
@ -150,6 +160,7 @@ export default {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
flex-wrap: wrap; flex-wrap: wrap;
border-bottom: 1px solid #e6ebf5;
.statistics_item{ .statistics_item{
border-radius: 10px; border-radius: 10px;
width: 240px; width: 240px;

View File

@ -44,10 +44,10 @@
<!-- v-hasPermi="['member:promoter:export']">导入--> <!-- v-hasPermi="['member:promoter:export']">导入-->
<!-- </el-button>--> <!-- </el-button>-->
<!-- </el-col>--> <!-- </el-col>-->
<!-- <el-col :span="1.5">--> <el-col :span="1.5">
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"--> <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
<!-- v-hasPermi="['member:promoter:export']">导出</el-button>--> >导出</el-button>
<!-- </el-col>--> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -161,7 +161,7 @@ import {
createPromoter, createPromoter,
tenantIgnoreUpdate, tenantIgnoreUpdate,
deletePromoter, deletePromoter,
getPromoter, allExport,
getallPage, getallPage,
importTemplate, importTemplate,
exportPromoterExcel, updatePassword exportPromoterExcel, updatePassword
@ -462,11 +462,10 @@ export default {
handleExport() { handleExport() {
// //
let params = {...this.queryParams}; let params = {...this.queryParams};
params.pageNo = undefined; params.pageSize = 999;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有推广员数据项?').then(() => { this.$modal.confirm('是否确认导出所有推广员数据项?').then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportPromoterExcel(params); return allExport(params);
}).then(response => { }).then(response => {
this.$download.excel(response, '推广员.xls'); this.$download.excel(response, '推广员.xls');
this.exportLoading = false; this.exportLoading = false;