|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
- <div class="Marketingamount-box">
|
|
|
+ <div class="Marketingamount-box" v-loading.fullscreen.lock="fullscreenLoading">
|
|
|
<!-- 详情弹出框 -->
|
|
|
<el-dialog title="详情" :visible.sync="particulars">
|
|
|
- <el-table :data="gridData">
|
|
|
+ <el-table >
|
|
|
<el-table-column property="date" label="日期" width="150"></el-table-column>
|
|
|
<el-table-column property="name" label="姓名" width="200"></el-table-column>
|
|
|
<el-table-column property="address" label="地址"></el-table-column>
|
|
@@ -12,33 +12,63 @@
|
|
|
<el-dialog title="拜访记录" :visible.sync="visitlog">
|
|
|
|
|
|
</el-dialog>
|
|
|
- <el-form ref="form" label-width="75px">
|
|
|
- <el-form-item label="人员名称:">
|
|
|
- <el-select v-model="DiId" placeholder="请选择团队名称">
|
|
|
- <el-option v-for="(item,index) in cTablelist" :key="index" :label="item.teamName" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <div class="search-head">
|
|
|
+ <el-form ref="form" label-width="75px">
|
|
|
+ <el-form-item label="公司名称:">
|
|
|
+ <el-select :disabled='verifytf' @change="CompanySwitching" filterable v-model="companyname" placeholder="请选择公司名称">
|
|
|
+ <el-option v-for="(item,index) in companynamearr" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-form ref="form" label-width="75px">
|
|
|
+ <el-form-item label="人员名称:">
|
|
|
+ <el-select :disabled='verifytf' @change="EmployeeSwitching" filterable v-model="personnelname" placeholder="请选择人员名称">
|
|
|
+ <el-option v-for="(item,index) in personnelnamearr" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-form ref="form" label-width="75px">
|
|
|
+ <el-form-item label="年:">
|
|
|
+ <el-select @change="PostMarketingSalesGroupList($event,1)" filterable v-model="years" placeholder="请选择年">
|
|
|
+ <el-option v-for="(item,index) in yearsarr" :key="index" :label="item.year" :value="item.year"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-form ref="form" label-width="75px">
|
|
|
+ <el-form-item label="季度:">
|
|
|
+ <el-select @change="QuarterlySwitching" filterable v-model="quarter" placeholder="请选择季度">
|
|
|
+ <el-option v-for="(item,index) in quarterarr" :key="index" :label="item.name" :value="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-form ref="form" label-width="75px">
|
|
|
+ <el-form-item label="月:">
|
|
|
+ <el-select @change="MonthlySwitch" filterable v-model="month" placeholder="请选择月">
|
|
|
+ <el-option v-for="(item,index) in montharr" :key="index" :label="item.name" :value="item.name"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
<div class="Marketingamount-head-ul">
|
|
|
- <div style="background-color: #ff4f4f;" class="Marketingamount-head-li">
|
|
|
- <div class="head-li-title">全年销售总金额</div>
|
|
|
+ <div :style="yratio>0?'background-color: #ff4f4f':'background-color: #069305'" class="Marketingamount-head-li">
|
|
|
+ <div class="head-li-title">{{ytitle}} ({{years}}年)</div>
|
|
|
<div class="head-li-info">
|
|
|
- <div class="li-info-amount">¥99,999</div>
|
|
|
- <div class="li-info-ratio">年同比:5% ▲</div>
|
|
|
+ <div class="li-info-amount">¥ {{yamount}}</div>
|
|
|
+ <div class="li-info-ratio">年同比: {{yratio}}% {{yratio>0?'▲':'▼'}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="background-color: #069305;" class="Marketingamount-head-li">
|
|
|
- <div class="head-li-title">全年销售总金额</div>
|
|
|
+ <div :style="qratio>0?'background-color: #ff4f4f':'background-color: #069305'" class="Marketingamount-head-li">
|
|
|
+ <div class="head-li-title">{{qtitle}} ({{quarter}})</div>
|
|
|
<div class="head-li-info">
|
|
|
- <div class="li-info-amount">¥99,999</div>
|
|
|
- <div class="li-info-ratio">年同比:5% ▼</div>
|
|
|
+ <div class="li-info-amount">¥ {{qamount}}</div>
|
|
|
+ <div class="li-info-ratio">季同比: {{qratio}}% {{qratio>0?'▲':'▼'}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="background-color: #ff4f4f;" class="Marketingamount-head-li">
|
|
|
- <div class="head-li-title">全年销售总金额</div>
|
|
|
+ <div :style="mratio>0?'background-color: #ff4f4f':'background-color: #069305'" class="Marketingamount-head-li">
|
|
|
+ <div class="head-li-title">{{mtitle}} ({{month}})</div>
|
|
|
<div class="head-li-info">
|
|
|
- <div class="li-info-amount">¥99,999</div>
|
|
|
- <div class="li-info-ratio">年同比:5% ▲</div>
|
|
|
+ <div class="li-info-amount">¥ {{mamount}}</div>
|
|
|
+ <div class="li-info-ratio">月同比: {{mratio}}% {{mratio>0?'▲':'▼'}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -50,25 +80,29 @@
|
|
|
border
|
|
|
style="width: 100%">
|
|
|
<el-table-column
|
|
|
- prop=""
|
|
|
+ prop="rowNumber"
|
|
|
label="排名"
|
|
|
width="50">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="date"
|
|
|
+ prop="userName"
|
|
|
label="名称"
|
|
|
width="100">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="date"
|
|
|
+ prop="count"
|
|
|
label="成单量">
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<div style="text-align: center;margin: 5px 0">
|
|
|
<el-pagination
|
|
|
small
|
|
|
+ @size-change="handleSizeChanges"
|
|
|
+ @current-change="handleCurrentChanges"
|
|
|
+ :current-page="currentPages"
|
|
|
+ :page-size="pagesizes"
|
|
|
layout="prev, pager, next"
|
|
|
- :total="50">
|
|
|
+ :total="pmlist">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
<div id="statisticallyone" style="height:300px;"></div>
|
|
@@ -81,30 +115,31 @@
|
|
|
border
|
|
|
style="width: 100%">
|
|
|
<el-table-column
|
|
|
- prop=""
|
|
|
+ prop="rowNumber"
|
|
|
label="序号"
|
|
|
width="50">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="date"
|
|
|
+ prop="teamName"
|
|
|
label="团组名"
|
|
|
- width="100">
|
|
|
+ width="150">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="date"
|
|
|
+ prop="clientUnit"
|
|
|
label="客户单位">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="date"
|
|
|
+ prop="clientName"
|
|
|
label="客户名称">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="date"
|
|
|
+ prop="visitDate"
|
|
|
label="出访日期"
|
|
|
width="100">
|
|
|
+ <template slot-scope="scope">{{ scope.row.visitDate | getvisitDate}}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop=""
|
|
|
+ prop="visitPNumber"
|
|
|
label="人数"
|
|
|
width="50">
|
|
|
</el-table-column>
|
|
@@ -123,8 +158,9 @@
|
|
|
@current-change="handleCurrentChange"
|
|
|
:current-page="currentPage"
|
|
|
:page-size="pagesize"
|
|
|
+ :page-sizes="[10, 15, 20, 50]"
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="400">
|
|
|
+ :total="tabletotal">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -140,85 +176,65 @@ export default {
|
|
|
cTablelist:[],
|
|
|
currentPage:1,
|
|
|
pagesize:10,
|
|
|
- tableDatas:[
|
|
|
- {
|
|
|
- date: '2016-05-02',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-04',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1517 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-01',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1519 弄'
|
|
|
- }
|
|
|
- ],
|
|
|
- tableData: [{
|
|
|
- date: '2016-05-02',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-04',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1517 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-01',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1519 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }
|
|
|
- ],
|
|
|
+ currentPages:1,
|
|
|
+ pagesizes:3,
|
|
|
+ tabletotal:0,
|
|
|
+ pmlist:0,
|
|
|
+ tableDatas:[],
|
|
|
+ customertype:[],
|
|
|
+ customerlevel:[],
|
|
|
+ tableData: [],
|
|
|
particulars:false,
|
|
|
visitlog:false,
|
|
|
+ userId:'',
|
|
|
+ token:'',
|
|
|
+ companyname:'',
|
|
|
+ companynamearr:[],
|
|
|
+ personnelname:'',
|
|
|
+ personnelnamearr:[],
|
|
|
+ personnelnamearrs:[],
|
|
|
+ years:'',
|
|
|
+ yearsarr:'',
|
|
|
+ quarter:'',
|
|
|
+ quarterarr:'',
|
|
|
+ month:'',
|
|
|
+ montharr:'',
|
|
|
+ YbeginDt:'',
|
|
|
+ YendDt:'',
|
|
|
+ QbeginDt:'',
|
|
|
+ QendDt:'',
|
|
|
+ MbeginDt:'',
|
|
|
+ MendDt:'',
|
|
|
+ //图
|
|
|
+ ytitle:'全年销售总金额',
|
|
|
+ yamount:0,
|
|
|
+ yratio:0,
|
|
|
+ qtitle:'季度销售金额',
|
|
|
+ qamount:0,
|
|
|
+ qratio:0,
|
|
|
+ mtitle:'月度销售金额',
|
|
|
+ mamount:0,
|
|
|
+ mratio:0,
|
|
|
+ fullscreenLoading:false,
|
|
|
+ verifytf:false,
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
handleSizeChange(val) {
|
|
|
- console.log(`每页 ${val} 条`);
|
|
|
+ this.pagesize=val;
|
|
|
+ this.PostMarketingSalesGroupList(this.years,1);
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
- console.log(`当前页: ${val}`);
|
|
|
+ this.currentPage=val;
|
|
|
+ this.PostMarketingSalesGroupList(this.years,1);
|
|
|
+ },
|
|
|
+ handleSizeChanges(val) {
|
|
|
+ this.pagesizes=val;
|
|
|
+ this.PostMarketingSalesOrderRanking(this.YbeginDt,this.YendDt);
|
|
|
+ },
|
|
|
+ handleCurrentChanges(val) {
|
|
|
+ this.currentPages=val;
|
|
|
+ this.PostMarketingSalesOrderRanking(this.YbeginDt,this.YendDt);
|
|
|
},
|
|
|
statisone(){
|
|
|
var myChart = echarts.init(document.getElementById('statisticallyone'));
|
|
@@ -230,29 +246,14 @@ export default {
|
|
|
tooltip: {
|
|
|
trigger: 'item'
|
|
|
},
|
|
|
- // legend: {
|
|
|
- // orient: 'vertical',
|
|
|
- // left: 'left'
|
|
|
- // },
|
|
|
series: [
|
|
|
{
|
|
|
type: 'pie',
|
|
|
radius: '50%',
|
|
|
- data: [
|
|
|
- { value: 1048, name: '政府' },
|
|
|
- { value: 735, name: '企业' },
|
|
|
- { value: 580, name: '散客' },
|
|
|
- { value: 484, name: '高校' },
|
|
|
- { value: 484, name: '非团组' },
|
|
|
- { value: 484, name: '成都会务活动' },
|
|
|
- { value: 484, name: '四川会务活动' },
|
|
|
- { value: 484, name: '成都赛事' },
|
|
|
- { value: 484, name: '四川赛事' },
|
|
|
- { value: 300, name: '未知' }
|
|
|
- ],
|
|
|
+ data: this.customertype,
|
|
|
emphasis: {
|
|
|
itemStyle: {
|
|
|
- shadowBlur: 10,
|
|
|
+ shadowBlur: this.customertype.length,
|
|
|
shadowOffsetX: 0,
|
|
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
}
|
|
@@ -273,14 +274,10 @@ export default {
|
|
|
{
|
|
|
type: 'pie',
|
|
|
radius: '50%',
|
|
|
- data: [
|
|
|
- { value: 1048, name: 'VIP' },
|
|
|
- { value: 735, name: 'VVIP' },
|
|
|
- { value: 580, name: '暂未定级' },
|
|
|
- ],
|
|
|
+ data: this.customerlevel,
|
|
|
emphasis: {
|
|
|
itemStyle: {
|
|
|
- shadowBlur: 10,
|
|
|
+ shadowBlur: this.customerlevel.length,
|
|
|
shadowOffsetX: 0,
|
|
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
}
|
|
@@ -288,9 +285,467 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
});
|
|
|
+ },
|
|
|
+ //获取PostMarketingSalesInitData
|
|
|
+ PostMarketingSalesInitData() {
|
|
|
+ var url = "/api/Statistics/PostMarketingSalesInitData"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ portType:1,
|
|
|
+ userId: 208,
|
|
|
+ pageId:180,
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.yearsarr=res.data.data.dtData;
|
|
|
+ that.years=res.data.data.dtData[0].year;
|
|
|
+ that.companynamearr=res.data.data.companyData;
|
|
|
+ that.personnelnamearrs=res.data.data.userData;
|
|
|
+
|
|
|
+ that.companyname=that.companynamearr[0].id;
|
|
|
+ that.personnelname=that.personnelnamearrs[0].id;
|
|
|
+
|
|
|
+ // that.verifyID();
|
|
|
+
|
|
|
+ that.CompanySwitching(that.companyname);
|
|
|
+ }else{
|
|
|
+ that.$message({
|
|
|
+ message:res.data.msg,
|
|
|
+ duration:1000,
|
|
|
+ type:"error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(function (error) {
|
|
|
+ that.$message.error('接口报错请联系信息部!');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //年市场部销售额api
|
|
|
+ YPostMarketingSalesStatistic() {
|
|
|
+ var url = "/api/Statistics/PostMarketingSalesStatistics"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ portType:1,
|
|
|
+ userId: that.userId,
|
|
|
+ pageId:180,
|
|
|
+ companyId:that.companyname,
|
|
|
+ groupPickupUserId:that.personnelname,
|
|
|
+ beginDt:that.YbeginDt,
|
|
|
+ endDt:that.YendDt,
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.yamount=res.data.data.thisYearSales;
|
|
|
+ that.yratio=res.data.data.yoy;
|
|
|
+ that.QuarterlySwitching('第一季度')
|
|
|
+ }else{
|
|
|
+ that.$message({
|
|
|
+ message:res.data.msg,
|
|
|
+ duration:1000,
|
|
|
+ type:"error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(function (error) {
|
|
|
+ that.$message.error('接口报错请联系信息部!');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //季市场部销售额api
|
|
|
+ QPostMarketingSalesStatistic() {
|
|
|
+ var url = "/api/Statistics/PostMarketingSalesStatistics"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ portType:1,
|
|
|
+ userId: that.userId,
|
|
|
+ pageId:180,
|
|
|
+ companyId:that.companyname,
|
|
|
+ groupPickupUserId:that.personnelname,
|
|
|
+ beginDt:that.QbeginDt,
|
|
|
+ endDt:that.QendDt,
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.qamount=res.data.data.thisYearSales;
|
|
|
+ that.qratio=res.data.data.yoy;
|
|
|
+ that.MonthlySwitch(that.month)
|
|
|
+ }else{
|
|
|
+ that.$message({
|
|
|
+ message:res.data.msg,
|
|
|
+ duration:1000,
|
|
|
+ type:"error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(function (error) {
|
|
|
+ that.$message.error('接口报错请联系信息部!');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //月市场部销售额api
|
|
|
+ MPostMarketingSalesStatistic() {
|
|
|
+ var url = "/api/Statistics/PostMarketingSalesStatistics"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ portType:1,
|
|
|
+ userId: that.userId,
|
|
|
+ pageId:180,
|
|
|
+ companyId:that.companyname,
|
|
|
+ groupPickupUserId:that.personnelname,
|
|
|
+ beginDt:that.MbeginDt,
|
|
|
+ endDt:that.MendDt,
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.mamount=res.data.data.thisYearSales;
|
|
|
+ that.mratio=res.data.data.yoy;
|
|
|
+ }else{
|
|
|
+ that.$message({
|
|
|
+ message:res.data.msg,
|
|
|
+ duration:1000,
|
|
|
+ type:"error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(function (error) {
|
|
|
+ that.$message.error('接口报错请联系信息部!');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //公司切换
|
|
|
+ CompanySwitching(val){
|
|
|
+ this.personnelnamearr=[];
|
|
|
+ this.personnelname='';
|
|
|
+ if(val==-1){
|
|
|
+ this.personnelnamearr=this.personnelnamearrs;
|
|
|
+ this.personnelname=this.personnelnamearr[0].id;
|
|
|
+ // this.PostMarketingSalesGroupList(this.years,1)
|
|
|
+ }else{
|
|
|
+ for(let i=0;i<this.personnelnamearrs.length;i++){
|
|
|
+ if(val==this.personnelnamearrs[i].companyId){
|
|
|
+ this.personnelnamearr.push(this.personnelnamearrs[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.userId!=233){
|
|
|
+ this.verifytf=true;
|
|
|
+ var idarr=[];
|
|
|
+ for (let x = 0; x < this.personnelnamearr.length; x++) {
|
|
|
+ idarr.push(this.personnelnamearr[x].id)
|
|
|
+ if (idarr.includes(this.userId)) {
|
|
|
+ if(this.userId==this.personnelnamearr[x].id){
|
|
|
+ this.personnelname=this.personnelnamearr[x].id;
|
|
|
+ this.companyname=this.personnelnamearr[x].companyId;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!idarr.includes(this.userId)) {
|
|
|
+ this.personnelname="";
|
|
|
+ this.companyname="";
|
|
|
+ this.$message({
|
|
|
+ message: '无权限!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.PostMarketingSalesGroupList(this.years,1)
|
|
|
+ },
|
|
|
+ //员工切换
|
|
|
+ EmployeeSwitching(val){
|
|
|
+ this.PostMarketingSalesGroupList(this.years,1)
|
|
|
+ },
|
|
|
+ //季度切换
|
|
|
+ QuarterlySwitching(val){
|
|
|
+ //初始化
|
|
|
+ this.QbeginDt='';
|
|
|
+ this.QendDt='';
|
|
|
+ this.montharr=[]
|
|
|
+ for (let w = 0; w < this.quarterarr.length; w++) {
|
|
|
+ if (val==this.quarterarr[w].name) {
|
|
|
+ if(val=='全部'){
|
|
|
+ this.QbeginDt=this.quarterarr[w].beginDt;
|
|
|
+ this.QendDt=this.quarterarr[w].endDt;
|
|
|
+ this.montharr.push(this.quarterarr[1].monthData[0]);
|
|
|
+ this.month=this.quarterarr[1].monthData[0].name;
|
|
|
+ }else{
|
|
|
+ this.QbeginDt=this.quarterarr[w].monthData[0].beginDt;
|
|
|
+ this.QendDt=this.quarterarr[w].monthData[0].endDt;
|
|
|
+ this.montharr=this.quarterarr[w].monthData;
|
|
|
+ this.month=this.quarterarr[w].monthData[1].name;
|
|
|
+ }
|
|
|
+ console.log(this.montharr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.QPostMarketingSalesStatistic()
|
|
|
+ },
|
|
|
+ //月切换
|
|
|
+ MonthlySwitch(val){
|
|
|
+ console.log(val);
|
|
|
+
|
|
|
+ for (let m = 0; m < this.montharr.length; m++) {
|
|
|
+ if(val==this.montharr[m].name){
|
|
|
+ console.log(this.montharr[m]);
|
|
|
+ this.MbeginDt=this.montharr[m].beginDt;
|
|
|
+ this.MendDt=this.montharr[m].endDt;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.MPostMarketingSalesStatistic()
|
|
|
+ },
|
|
|
+ //市场部销售额团组列表
|
|
|
+ PostMarketingSalesGroupList(val,index) {
|
|
|
+ this.fullscreenLoading=true;
|
|
|
+ var beginDt='';
|
|
|
+ var endDt='';
|
|
|
+ if(index==1){
|
|
|
+ for(let j=0;j<this.yearsarr.length;j++){
|
|
|
+ if(this.yearsarr[j].year==val){
|
|
|
+ this.quarterarr=this.yearsarr[j].quarterData;
|
|
|
+ this.quarter=this.quarterarr[1].name;
|
|
|
+ // this.montharr=this.yearsarr[j].quarterData[1].monthData;
|
|
|
+ // this.month=this.montharr[0].name;
|
|
|
+ this.YbeginDt=this.yearsarr[j].quarterData[0].beginDt;
|
|
|
+ this.YendDt=this.yearsarr[j].quarterData[0].endDt;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ beginDt=this.YbeginDt;
|
|
|
+ endDt=this.YendDt;
|
|
|
+ }
|
|
|
+ var url = "/api/Statistics/PostMarketingSalesGroupList"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ portType:1,
|
|
|
+ userId: that.userId,
|
|
|
+ pageId:180,
|
|
|
+ companyId:that.companyname,
|
|
|
+ groupPickupUserId:that.personnelname,
|
|
|
+ beginDt:beginDt,
|
|
|
+ endDt:endDt,
|
|
|
+ pageIndex:that.currentPage,
|
|
|
+ pageSize:that.pagesize,
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.tableData=res.data.data;
|
|
|
+ that.tabletotal=res.data.count;
|
|
|
+ that.YPostMarketingSalesStatistic();
|
|
|
+ setTimeout(function(){
|
|
|
+ that.PostMarketingSalesGroupStatistics(beginDt,endDt);
|
|
|
+ },500);
|
|
|
+ setTimeout(function(){
|
|
|
+ that.PostMarketingSalesOrderRanking(beginDt,endDt)
|
|
|
+ },600);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ that.fullscreenLoading=false;
|
|
|
+ that.$message({
|
|
|
+ message:res.data.msg,
|
|
|
+ duration:1000,
|
|
|
+ type:"error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(function (error) {
|
|
|
+ that.fullscreenLoading=false;
|
|
|
+ that.$message.error('接口报错请联系信息部!');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //验证id
|
|
|
+ verifyID(){
|
|
|
+
|
|
|
+ },
|
|
|
+ //统计api
|
|
|
+ PostMarketingSalesGroupStatistics(beginDt,endDt) {
|
|
|
+ var url = "/api/Statistics/PostMarketingSalesGroupStatistics"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ portType:1,
|
|
|
+ userId: that.userId,
|
|
|
+ pageId:180,
|
|
|
+ companyId:that.companyname,
|
|
|
+ groupPickupUserId:that.personnelname,
|
|
|
+ beginDt:beginDt,
|
|
|
+ endDt:endDt,
|
|
|
+ statisticsType:1
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ var newArr = res.data.data.customerTypeData.map(item => ({
|
|
|
+ name: item.name,
|
|
|
+ value: item.count
|
|
|
+ }))
|
|
|
+ that.customertype=newArr;
|
|
|
+ var newArrs = res.data.data.clientGradeData.map(item => ({
|
|
|
+ name: item.name,
|
|
|
+ value: item.count
|
|
|
+ }))
|
|
|
+ that.customerlevel=newArrs;
|
|
|
+ that.fullscreenLoading=false;
|
|
|
+ }else{
|
|
|
+ that.fullscreenLoading=false;
|
|
|
+ that.$message({
|
|
|
+ message:res.data.msg,
|
|
|
+ duration:1000,
|
|
|
+ type:"error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(function (error) {
|
|
|
+ that.fullscreenLoading=false;
|
|
|
+ that.$message.error('统计api报错请联系信息部!');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //排名api
|
|
|
+ PostMarketingSalesOrderRanking(beginDt,endDt) {
|
|
|
+ var url = "/api/Statistics/PostMarketingSalesOrderRanking"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ portType:1,
|
|
|
+ userId: that.userId,
|
|
|
+ pageId:180,
|
|
|
+ companyId:that.companyname,
|
|
|
+ groupPickupUserId:that.personnelname,
|
|
|
+ beginDt:beginDt,
|
|
|
+ endDt:endDt,
|
|
|
+ pageIndex:that.currentPages,
|
|
|
+ pageSize:that.pagesizes,
|
|
|
+
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.pmlist=res.data.count;
|
|
|
+ that.tableDatas=res.data.data;
|
|
|
+ }else{
|
|
|
+ that.fullscreenLoading=false;
|
|
|
+ that.$message({
|
|
|
+ message:res.data.msg,
|
|
|
+ duration:1000,
|
|
|
+ type:"error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(function (error) {
|
|
|
+ that.fullscreenLoading=false;
|
|
|
+ that.$message.error('接口报错请联系信息部!');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ getvisitDate(val) {
|
|
|
+ return val.split(' ')[0];
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ customertype: {
|
|
|
+ handler(val, oldVal) {
|
|
|
+ this.statisone();
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ },
|
|
|
+ customerlevel: {
|
|
|
+ handler(val, oldVal) {
|
|
|
+ this.statisone();
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ },
|
|
|
+ // companyname:function(val){
|
|
|
+ // this.personnelnamearr=[];
|
|
|
+ // this.personnelname='';
|
|
|
+ // if(val==-1){
|
|
|
+ // this.personnelnamearr=this.personnelnamearrs;
|
|
|
+ // this.personnelname=this.personnelnamearr[0].id;
|
|
|
+ // }else{
|
|
|
+ // for(let i=0;i<this.personnelnamearrs.length;i++){
|
|
|
+ // if(val==this.personnelnamearrs[i].companyId){
|
|
|
+ // this.personnelnamearr.push(this.personnelnamearrs[i]);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // years:function(val){
|
|
|
+ // for(let j=0;j<this.yearsarr.length;j++){
|
|
|
+ // if(this.yearsarr[j].year==val){
|
|
|
+ // this.quarterarr=this.yearsarr[j].quarterData;
|
|
|
+ // this.quarter=this.quarterarr[0].name;
|
|
|
+ // this.montharr=this.yearsarr[j].quarterData[1].monthData;
|
|
|
+ // this.month=this.montharr[0].name;
|
|
|
+ // this.YbeginDt=this.yearsarr[j].quarterData[0].beginDt;
|
|
|
+ // this.YendDt=this.yearsarr[j].quarterData[0].endDt;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.YPostMarketingSalesStatistic()
|
|
|
+ // },
|
|
|
+ // quarter:function(val){
|
|
|
+ // this.montharr=[]
|
|
|
+ // for (let g = 0; g < this.quarterarr.length; g++) {
|
|
|
+ // if(val==this.quarterarr[g].name){
|
|
|
+ // if (val=="全部") {
|
|
|
+ // this.month="全部";
|
|
|
+ // this.QbeginDt=this.quarterarr[g].beginDt;
|
|
|
+ // this.QendDt=this.quarterarr[g].endDt;
|
|
|
+ // this.QPostMarketingSalesStatistic()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // this.QbeginDt=this.quarterarr[g].monthData[0].beginDt;
|
|
|
+ // this.QendDt=this.quarterarr[g].monthData[0].endDt;
|
|
|
+ // this.montharr=this.quarterarr[g].monthData;
|
|
|
+ // this.month=this.montharr[0].name;
|
|
|
+ // this.QPostMarketingSalesStatistic()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // month:function(val){
|
|
|
+ // console.log(this.montharr);
|
|
|
+ // if (this.montharr!=undefined) {
|
|
|
+ // for (let h = 0; h < this.montharr.length; h++) {
|
|
|
+ // if(val==this.montharr[h].name){
|
|
|
+ // this.MbeginDt=this.montharr[h].beginDt;
|
|
|
+ // this.MendDt=this.montharr[h].endDt;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // console.log(this.MbeginDt,this.MendDt);
|
|
|
+ // // this.MPostMarketingSalesStatistic()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ created(){
|
|
|
+ this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
|
|
|
+ this.token = JSON.parse(localStorage.getItem('userinif')).token;
|
|
|
+ },
|
|
|
mounted(){
|
|
|
+ this.PostMarketingSalesInitData()
|
|
|
this.statisone()
|
|
|
}
|
|
|
}
|
|
@@ -341,4 +796,13 @@ export default {
|
|
|
.content-table .block{
|
|
|
text-align: center;
|
|
|
}
|
|
|
+.search-head{
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+.search-head .el-form{
|
|
|
+ width: 300px;
|
|
|
+}
|
|
|
+.search-head .el-select{
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
</style>
|