Merge pull request '管理员首页' (#31) from luxm into main

Reviewed-on: http://120.46.37.243:3000/scrm/alikeSCRM/pulls/31
This commit is contained in:
root 2024-03-26 06:43:52 +00:00
commit d26a8d9d30
13 changed files with 337 additions and 27 deletions

View File

@ -249,4 +249,48 @@ public class CrmCustomerController extends BaseController
{
return crmCustomerService.selectWeekTotalCustomer(getUsername());
}
/**
* 查询当前用户最近七天新增的客户列表
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/adminWeek-customers")
public AjaxResult adminWeekCustomer()
{
List<CrmCustomer> list = crmCustomerService.selectAdminWeekCustomer();
return AjaxResult.success(list);
}
/**
* 查询当前用户最近七天新增的线索列表
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/adminWeek-clues")
public AjaxResult adminWeekClues()
{
List<CrmCustomer> list = crmCustomerService.selectAdminWeekClues();
return AjaxResult.success(list);
}
/**
* 查询最近七天新增的线索列表的总条数
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/adminWeek-totalClues")
public String adminWeekTotalClues()
{
return crmCustomerService.selectAdminWeekTotalClues();
}
/**
* 查询最近七天新增的客户列表的总条数
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/adminWeek-totalCustomer")
public String adminWeekTotalCustomer()
{
return crmCustomerService.selectAdminWeekTotalCustomer();
}
}

View File

@ -113,4 +113,12 @@ public interface CrmCustomerMapper
String selectWeekTotalClues(@Param("owner") String username);
String selectWeekTotalCustomer(@Param("owner") String username);
List<CrmCustomer> selectAdminWeekCustomer();
List<CrmCustomer> selectAdminWeekClues();
String selectAdminWeekTotalClues();
String selectAdminWeekTotalCustomer();
}

View File

@ -107,4 +107,12 @@ import java.util.List;
String selectWeekTotalClues(String username);
String selectWeekTotalCustomer(String username);
List<CrmCustomer> selectAdminWeekCustomer();
List<CrmCustomer> selectAdminWeekClues();
String selectAdminWeekTotalClues();
String selectAdminWeekTotalCustomer();
}

View File

@ -172,4 +172,24 @@ public class CrmCustomerServiceImpl implements ICrmCustomerService
public String selectWeekTotalCustomer(String username) {
return crmCustomerMapper.selectWeekTotalCustomer(username);
}
@Override
public List<CrmCustomer> selectAdminWeekCustomer() {
return crmCustomerMapper.selectAdminWeekCustomer();
}
@Override
public List<CrmCustomer> selectAdminWeekClues() {
return crmCustomerMapper.selectAdminWeekClues();
}
@Override
public String selectAdminWeekTotalClues() {
return crmCustomerMapper.selectAdminWeekTotalClues();
}
@Override
public String selectAdminWeekTotalCustomer() {
return crmCustomerMapper.selectAdminWeekTotalCustomer();
}
}

View File

@ -173,4 +173,24 @@ public class BusinessController extends BaseController
{
return businessService.selectBusnessNowTotal(getUsername());
}
/**
* 管理员页面查询的商机
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/business-adminNow")
public AjaxResult nowAdminBus()
{
return AjaxResult.success(businessService.selectAdminBusinessNow());
}
/**
* 管理员页面查询的商机数量
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/business-adminNowTotal")
public String nowAdminBusTotal()
{
return businessService.selectAdminBusinessNowTotal();
}
}

View File

@ -72,4 +72,9 @@ public interface BusinessMapper
List<Business> selectBusinessNow(@Param("personInCharge") String username);
String selectBusinessNowTotal(@Param("personInCharge") String username);
List<Business> selectAdminBusinessNow();
String selectAdminBusinessNowTotal();
}

View File

@ -76,4 +76,8 @@ public interface IBusinessService
List<Business> selectBusnessNow(String username);
String selectBusnessNowTotal(String username);
List<Business> selectAdminBusinessNow();
String selectAdminBusinessNowTotal();
}

View File

@ -180,4 +180,15 @@ public class BusinessServiceImpl implements IBusinessService
public String selectBusnessNowTotal(String username) {
return businessMapper.selectBusinessNowTotal(username);
}
@Override
public List<Business> selectAdminBusinessNow() {
return businessMapper.selectAdminBusinessNow();
}
@Override
public String selectAdminBusinessNowTotal() {
return businessMapper.selectAdminBusinessNowTotal();
}
}

View File

@ -95,6 +95,31 @@
WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) and status='1' and owner = #{owner}
</select>
<select id="selectAdminWeekCustomer" resultMap="CrmCustomerResult">
SELECT *
FROM crm_customer
WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) and status='1' and owner IS NOT NULL;
</select>
<select id="selectAdminWeekClues" resultMap="CrmCustomerResult">
SELECT *
FROM crm_customer
WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) and status='0' and owner IS NOT NULL;
</select>
<select id="selectAdminWeekTotalClues" resultType="String">
SELECT COUNT(*)
FROM crm_customer
WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) and status='0' and owner IS NOT NULL;
</select>
<select id="selectAdminWeekTotalCustomer" resultType="String">
SELECT COUNT(*)
FROM crm_customer
WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) and status='1' and owner IS NOT NULL;
</select>
<select id="selectCrmCustomerById" parameterType="Long" resultMap="CrmCustomerResult">
<include refid="selectCrmCustomerVo"/>
where id = #{id} ORDER BY id DESC

View File

@ -81,6 +81,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE person_in_charge = #{personInCharge}
</select>
<select id="selectAdminBusinessNow" resultMap="BusinessResult">
SELECT *
FROM business
WHERE person_in_charge IS NOT NULL;
</select>
<select id="selectAdminBusinessNowTotal" resultType="String">
SELECT count(*)
FROM business
WHERE person_in_charge IS NOT NULL;
</select>
<select id="selectBusinessById" parameterType="Long" resultMap="BusinessResult">
<include refid="selectBusinessVo"/>
where id = #{id} ORDER BY id DESC

View File

@ -1,5 +1,21 @@
import request from '@/utils/request'
// 管理员页面查询的商机数量
export function nowAdminBusTotal() {
return request({
url: '/system/business/business-adminNowTotal',
method: 'get',
})
}
// 管理员页面查询的商机
export function nowAdminBus() {
return request({
url: '/system/business/business-adminNow',
method: 'get',
})
}
// 查询当前用户负责的商机的数量
export function nowBusTotal() {
return request({

View File

@ -1,6 +1,37 @@
import request from '@/utils/request'
//管理员页面查询最近七天新增的客户数量
export function newTotalAdminCustomer() {
return request({
url: '/crm/customer/adminWeek-totalCustomer',
method: 'get',
})
}
//管理员页面查询最近七天新增的线索数量
export function newTotalAdminClues() {
return request({
url: '/crm/customer/adminWeek-totalClues',
method: 'get',
})
}
//管理员页面查询最近七天新增的客户
export function newAdminCustomerAdd() {
return request({
url: '/crm/customer/adminWeek-customers',
method: 'get',
})
}
//管理员页面查询最近七天新增的线索
export function newAdminCluesAdd() {
return request({
url: '/crm/customer/adminWeek-clues',
method: 'get',
})
}
//查询最近七天新增的客户数量
export function newTotalCustomer() {
return request({

View File

@ -101,28 +101,67 @@
<div >
<el-row :gutter="10">
<el-col :xs="24" :sm="24" :lg="8">
<el-card class="box-card" style="height: 450px;margin-bottom: 10px">
<div slot="header" class="clearfix">
<span>销售额-个人TOP榜</span>
</div>
<table class="no-table" >
<tbody>
<tr>
<th>共记</th>
<td style="text-align: right;" slot="header">{{totalAmount}}</td>
</tr>
<tr v-for="(item, index) in topPeople" :key="index">
<th>{{ item.createBy }}</th>
<td style="text-align: right;">{{ item.totalAmount}}</td>
</tr>
<el-col :xs="24" :sm="24" :lg="8" class="scrollable2">
<el-card class="box-card">
<el-collapse v-model="activeName" accordion>
</tbody>
</table>
<el-collapse-item >
<template slot="title" >
<i class="header-icon el-icon-s-opportunity"></i>
推进中商机
<el-badge v-if="nowBusinesstotal>0" class="mark" :value="nowBusinesstotal" />
</template>
<div v-for="(item, index) in nowBusiness" :key="index" style="display: flex">
<div class="ellipsis" style="flex: 1" @click="toBusPage()">
{{ item.title }}
</div>
<div class="vertical-line-left"></div>
<div style="flex: 1" @click="toBusPage()">
{{ item.businessName }}
</div>
</div>
</el-collapse-item>
<el-collapse-item>
<template slot="title">
<i class="header-icon el-icon-user-solid"></i> 本周新客户
<el-badge v-if="this.newCustomerTotal>0" class="mark" :value="this.newCustomerTotal" />
</template>
<div v-for="(item, index) in newCustomer" :key="index" style="display: flex">
<div class="ellipsis" style="flex: 1" @click="toCustomerPage()">
{{ item.name }}
</div>
<div class="vertical-line-left"></div>
<div style="flex: 1" @click="toCustomerPage()">
{{ item.customerRank }}
</div>
</div>
</el-collapse-item>
<el-collapse-item>
<template slot="title" >
<i class="header-icon el-icon-connection"></i> 本周新线索
<el-badge v-if="this.newCluesTotal>0" class="mark" :value="this.newCluesTotal" />
</template>
<div v-for="(item, index) in newClues" :key="index" style="display: flex">
<div class="ellipsis" style="flex: 1" @click="toCluePage()">
{{ item.cluesName }}
</div>
<div class="vertical-line-left"></div>
<div style="flex: 1" @click="toCluePage()">
{{ item.cluesStatus }}
</div>
</div>
</el-collapse-item>
</el-collapse>
</el-card>
</el-col>
<el-col :xs="24" :sm="24" :lg="16">
<el-card class="box-card" style="height: 450px">
<div slot="header" class="clearfix">
@ -208,7 +247,7 @@
<!-- </table>-->
<!-- </el-card>-->
<el-card class="box-card" style="margin-bottom: 10px;height: 450px">
<el-card class="box-card" style="margin-bottom: 10px;height: 450px;margin-top: 10px;">
<div slot="header" class="clearfix">
<span>业绩销售额</span>
</div>
@ -270,6 +309,30 @@
<el-button type="primary" plain style="margin-top: 5px" @click="handleAdd">提交日程</el-button>
</el-card>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<el-card class="box-card" style="margin-bottom: 10px;height:500px">
<div slot="header" class="clearfix">
<span>销售额-个人TOP榜</span>
</div>
<table class="no-table" >
<tbody>
<tr>
<th>共记</th>
<td style="text-align: right;" slot="header">{{totalAmount}}</td>
</tr>
<tr v-for="(item, index) in topPeople" :key="index">
<th>{{ item.createBy }}</th>
<td style="text-align: right;">{{ item.totalAmount}}</td>
</tr>
</tbody>
</table>
</el-card>
</el-col>
</el-row>
</div>
@ -328,12 +391,9 @@
</div>
<div v-else class="dashboard-editor-container">
<!-- <panel-group :customer-data="customerData" />-->
<div >
<el-row :gutter="10">
<!-- <el-card class="box-card" style="margin-bottom: 10px">-->
<!-- <div slot="header" class="clearfix">-->
<!-- <span>今日待办</span>-->
@ -678,16 +738,16 @@ import {indexData, infoDate, infoTop, infoTotalTop} from "../api/crm";
import {customerList} from "@/api/crm/order";
import {
getCustomer,
listPersonCustomers,
listPersonCustomers, newAdminCluesAdd, newAdminCustomerAdd,
newCluesAdd,
newCustomerAdd,
newCustomerAdd, newTotalAdminClues, newTotalAdminCustomer,
newTotalClues,
newTotalCustomer
} from "../api/crm/customer";
import {addPlan, updatePlan} from "../api/crm/plan";
import {addRecord, updateRecord} from "../api/crm/record";
import store from '@/store/index.js' ;
import {nowBus, nowBusTotal} from "../api/crm/business";
import {nowAdminBus, nowAdminBusTotal, nowBus, nowBusTotal} from "../api/crm/business";
export default {
dicts: ['follow_up_type'],
@ -735,6 +795,12 @@ export default {
this.initData();
this.getPersonCustomerList();
if (this.$store.getters.roles[0]=='admin') {
this.adminBusTot();
this.newAddAdminCluesTotal();
this.newAddAdminCustomerTotal();
this.adminBus();
this.newAddAdminClues();
this.newAddAdminCustomer();
this.initTop();
this.totalTop();
}else {
@ -744,11 +810,11 @@ export default {
this.newAddCustomer();
this.newAddClues()
this.nowBus()
// this.initMap();
}
},
methods: {
//
toBusPage(){
this.$router.push('/crm/customer/business');
},
@ -759,6 +825,20 @@ export default {
// console.log(222)
this.$router.push('/crm/clues/person');
},
//
adminBusTot(){
nowAdminBusTotal().then(response => {
// console.log(response,33333)
this.nowBusinesstotal = response
});
},
//
adminBus(){
nowAdminBus().then(response => {
this.nowBusiness = response.data
});
},
//
nowBusTot(){
nowBusTotal().then(response => {
@ -773,6 +853,33 @@ export default {
this.nowBusiness = response.data
});
},
//
newAddAdminCustomerTotal(){
newTotalAdminCustomer().then(response => {
// console.log(response,33333)
this.newCustomerTotal = response
});
},
//线
newAddAdminCluesTotal(){
newTotalAdminClues().then(response => {
// console.log(response,33333)
this.newCluesTotal = response
});
},
//线
newAddAdminClues(){
newAdminCluesAdd().then(response => {
this.newClues = response.data
});
},
//
newAddAdminCustomer(){
newAdminCustomerAdd().then(response => {
this.newCustomer = response.data
});
},
//
newAddCustomerTotal(){
newTotalCustomer().then(response => {
@ -787,7 +894,7 @@ export default {
this.newCluesTotal = response
});
},
//
//线
newAddClues(){
newCluesAdd().then(response => {
this.newClues = response.data