管理端 推广员导入

pull/17/head
Jruome 2023-06-16 11:14:35 +08:00
parent 581e6b74ae
commit 5085f63772
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
export function exportPromoterExcel(query) {
return request({

View File

@ -1,8 +1,10 @@
<template>
<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-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-group>
</el-form-item>
@ -15,14 +17,18 @@
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</div>
<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 v-if="index<3">{{item.value}}</span>
<span v-else>{{item.value}} </span>
</div>
</div>
</el-card>
</div>
<!-- <div class="dashboard-editor-container">-->
@ -97,15 +103,18 @@ export default {
return {
lineChartData: lineChartData.newVisitis,
queryParams: {
type:4
},
list:[],
// list:[],
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() {
this.getList();
},
computed:{
},
methods: {
onchangeTime(value){
this.queryParams.startTime = value[0]
@ -119,11 +128,10 @@ export default {
this.statisticsList.forEach((item,index) =>{
for (let key in response.data){
if(item.class === key){
item.value = response.data[key]
item.value = response.data[key] || 0
}
}
})
this.list = this.statisticsList
this.loading = false;
});
},
@ -133,7 +141,9 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams ={};
this.queryParams ={
type: 4
};
this.handleQuery();
},
handleSetLineChartData(type) {
@ -150,6 +160,7 @@ export default {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
border-bottom: 1px solid #e6ebf5;
.statistics_item{
border-radius: 10px;
width: 240px;

View File

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