Merge pull request '子用户首页+子用户首页接口' (#24) from luxm into main

Reviewed-on: http://120.46.37.243:3000/scrm/alikeSCRM/pulls/24
This commit is contained in:
root 2024-03-25 01:32:30 +00:00
commit a7125aadfb
18 changed files with 1001 additions and 574 deletions

View File

@ -67,7 +67,7 @@ public class CrmCustomerController extends BaseController
/**
* 查询我的客户列表
*/
@PreAuthorize("@ss.hasPermi('crm:customer:person:list')")
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/person-customers")
public AjaxResult personCustomers(CrmCustomer crmCustomer)
{
@ -141,7 +141,7 @@ public class CrmCustomerController extends BaseController
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
String formattedDate = currentDate.format(formatter);
//根据当前时间生成客户编号
crmCustomer.setCode("zy_"+formattedDate+crmCustomer.getId()+ UUID.randomUUID().toString().replace("-","").substring(0,6));
crmCustomer.setCode("zy_"+formattedDate+ UUID.randomUUID().toString().replace("-","").substring(0,6));
return toAjax(crmCustomerService.insertCrmCustomer(crmCustomer));
}
@ -207,4 +207,46 @@ public class CrmCustomerController extends BaseController
public AjaxResult toPool(@RequestParam("ids") Long[] ids, @RequestParam("poolType") String poolType){
return toAjax(crmCustomerService.customerToPoolByIds(ids, poolType));
}
/**
* 查询当前用户最近七天新增的客户列表
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/week-customers")
public AjaxResult weekCustomer()
{
List<CrmCustomer> list = crmCustomerService.selectWeekCustomer(getUsername());
return AjaxResult.success(list);
}
/**
* 查询当前用户最近七天新增的线索列表
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/week-clues")
public AjaxResult weekClues()
{
List<CrmCustomer> list = crmCustomerService.selectWeekClues(getUsername());
return AjaxResult.success(list);
}
/**
* 查询最近七天新增的线索列表的总条数
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/week-totalClues")
public String weekTotalClues()
{
return crmCustomerService.selectWeekTotalClues(getUsername());
}
/**
* 查询最近七天新增的客户列表的总条数
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/week-totalCustomer")
public String weekTotalCustomer()
{
return crmCustomerService.selectWeekTotalCustomer(getUsername());
}
}

View File

@ -118,17 +118,17 @@ public class CrmOrderController extends BaseController
//获取订单的总额度
@GetMapping(value ="/totalAmount")
public AjaxResult getTotalAmount()
public BigDecimal getTotalAmount()
{
BigDecimal totalAmount = crmOrderService.getTotalAmount();
System.out.println(totalAmount);
return AjaxResult.success(totalAmount);
return totalAmount;
}
//获取各自的订单金额
@GetMapping(value ="/someAmount")
public AjaxResult getSomeAmount()
public List<CrmOrder> getSomeAmount()
{
return AjaxResult.success(crmOrderService.getSomeAmount());
return crmOrderService.getSomeAmount();
}
/**

View File

@ -1,8 +1,7 @@
package com.ruoyi.crm.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.data.annotation.Transient;

View File

@ -105,4 +105,12 @@ public interface CrmCustomerMapper
List<TodayUpdatesVO> todayMsg(@Param("owner") String owner,@Param("createTime") String createTime);
String selectCrmCustomerByCode(String code);
List<CrmCustomer> selectWeekCustomer(@Param("owner") String username);
List<CrmCustomer> selectWeekClues(@Param("owner") String username);
String selectWeekTotalClues(@Param("owner") String username);
String selectWeekTotalCustomer(@Param("owner") String username);
}

View File

@ -100,4 +100,11 @@ import java.util.List;
String selectCrmCustomerByCode(String code);
List<CrmCustomer> selectWeekCustomer(String username);
List<CrmCustomer> selectWeekClues(String username);
String selectWeekTotalClues(String username);
String selectWeekTotalCustomer(String username);
}

View File

@ -152,4 +152,24 @@ public class CrmCustomerServiceImpl implements ICrmCustomerService
public String selectCrmCustomerByCode(String code) {
return crmCustomerMapper.selectCrmCustomerByCode(code);
}
@Override
public List<CrmCustomer> selectWeekCustomer(String username) {
return crmCustomerMapper.selectWeekCustomer(username);
}
@Override
public List<CrmCustomer> selectWeekClues(String username) {
return crmCustomerMapper.selectWeekClues(username);
}
@Override
public String selectWeekTotalClues(String username) {
return crmCustomerMapper.selectWeekTotalClues(username);
}
@Override
public String selectWeekTotalCustomer(String username) {
return crmCustomerMapper.selectWeekTotalCustomer(username);
}
}

View File

@ -153,4 +153,24 @@ public class BusinessController extends BaseController
ExcelUtil<Business> util = new ExcelUtil(Business.class);
util.importTemplateExcel(response, "商机数据");
}
/**
* 查询当前用户负责的商机
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/business-now")
public AjaxResult nowBus()
{
return AjaxResult.success(businessService.selectBusnessNow(getUsername()));
}
/**
* 查询当前用户负责的商机的数量
*/
// @PreAuthorize("@ss.hasPermi('crm:customer:person:customers')")
@GetMapping("/business-nowTotal")
public String nowBusTotal()
{
return businessService.selectBusnessNowTotal(getUsername());
}
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.crm.system.mapper;
import com.ruoyi.crm.domain.CrmCustomer;
import com.ruoyi.crm.system.domain.Business;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -66,4 +68,8 @@ public interface BusinessMapper
* @return
*/
public Business selectByBusinessNumber(String businessNumber);
List<Business> selectBusinessNow(@Param("personInCharge") String username);
String selectBusinessNowTotal(@Param("personInCharge") String username);
}

View File

@ -2,6 +2,7 @@ package com.ruoyi.crm.system.service;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.crm.domain.CrmCustomer;
import com.ruoyi.crm.system.domain.Business;
import java.util.List;
@ -71,4 +72,8 @@ public interface IBusinessService
* @return 结果
*/
public String importBusines(List<Business> userList, Boolean isUpdateSupport, String operName);
List<Business> selectBusnessNow(String username);
String selectBusnessNowTotal(String username);
}

View File

@ -1,15 +1,12 @@
package com.ruoyi.crm.system.service.impl;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanValidators;
import com.ruoyi.crm.system.domain.Business;
import com.ruoyi.crm.system.mapper.BusinessMapper;
import com.ruoyi.crm.system.service.IBusinessService;
import com.ruoyi.system.service.impl.SysUserServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -173,4 +170,14 @@ public class BusinessServiceImpl implements IBusinessService
}
return successMsg.toString();
}
@Override
public List<Business> selectBusnessNow(String username) {
return businessMapper.selectBusinessNow(username);
}
@Override
public String selectBusnessNowTotal(String username) {
return businessMapper.selectBusinessNowTotal(username);
}
}

View File

@ -71,6 +71,30 @@
</where>
</select>
<select id="selectWeekCustomer" parameterType="String" resultMap="CrmCustomerResult">
SELECT *
FROM crm_customer
WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) and status='1' and owner = #{owner}
</select>
<select id="selectWeekClues" parameterType="String" resultMap="CrmCustomerResult">
SELECT *
FROM crm_customer
WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) and status='0' and owner = #{owner}
</select>
<select id="selectWeekTotalClues" parameterType="String" resultType="String">
SELECT COUNT(*)
FROM crm_customer
WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) and status='0' and owner = #{owner}
</select>
<select id="selectWeekTotalCustomer" parameterType="String" resultType="String">
SELECT COUNT(*)
FROM crm_customer
WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) and status='1' and owner = #{owner}
</select>
<select id="selectCrmCustomerById" parameterType="Long" resultMap="CrmCustomerResult">
<include refid="selectCrmCustomerVo"/>
where id = #{id} ORDER BY id DESC

View File

@ -59,12 +59,13 @@
</select>
<select id="getTotalAmount" resultType="BigDecimal">
select sum(amount) as total_amount from crm_order;
select sum(amount) as total_amount from crm_order WHERE status = '1';
</select>
<select id="getSomeAmount" resultMap="CrmOrderResult">
SELECT create_by,SUM(amount) as total_amount
FROM crm_order
WHERE status = '1'
GROUP BY create_by;
</select>

View File

@ -68,6 +68,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY id DESC
</select>
<select id="selectBusinessNow" parameterType="String" resultMap="BusinessResult">
SELECT *
FROM business
WHERE person_in_charge = #{personInCharge}
</select>
<select id="selectBusinessNowTotal" parameterType="String" resultType="String">
SELECT count(*)
FROM business
WHERE person_in_charge = #{personInCharge}
</select>
<select id="selectBusinessById" parameterType="Long" resultMap="BusinessResult">
<include refid="selectBusinessVo"/>
where id = #{id} ORDER BY id DESC

View File

@ -1,5 +1,20 @@
import request from '@/utils/request'
// 查询当前用户负责的商机的数量
export function nowBusTotal() {
return request({
url: '/system/business/business-nowTotal',
method: 'get',
})
}
// 查询当前用户负责的商机
export function nowBus() {
return request({
url: '/system/business/business-now',
method: 'get',
})
}
// 查询商机列表
export function listBusiness(query) {
return request({

View File

@ -1,5 +1,37 @@
import request from '@/utils/request'
//查询最近七天新增的客户数量
export function newTotalCustomer() {
return request({
url: '/crm/customer/week-totalCustomer',
method: 'get',
})
}
//查询最近七天新增的线索数量
export function newTotalClues() {
return request({
url: '/crm/customer/week-totalClues',
method: 'get',
})
}
//查询最近七天新增的客户
export function newCustomerAdd() {
return request({
url: '/crm/customer/week-customers',
method: 'get',
})
}
//查询最近七天新增的线索
export function newCluesAdd() {
return request({
url: '/crm/customer/week-clues',
method: 'get',
})
}
// 查询客户列表
export function listPersonCustomer(query) {
return request({

View File

@ -20,7 +20,7 @@ router.beforeEach((to, from, next) => {
} else {
if (store.getters.roles.length === 0) {
// 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(() => {
store.dispatch('GetInfo').then((res) => {
store.dispatch('GenerateRoutes').then(accessRoutes => {
// 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes) // 动态添加可访问路由表

View File

@ -17,80 +17,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="客户编号" prop="customerCode">
<el-input
v-model="queryParams.customerCode"
placeholder="请输入客户编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="应收计划编号" prop="receiveCode">
<el-input
v-model="queryParams.receiveCode"
placeholder="请输入应收计划编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="合同订单编号" prop="contractCode">
<el-input
v-model="queryParams.contractCode"
placeholder="请输入合同订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="合同标题 " prop="contractTitle">
<el-input
v-model="queryParams.contractTitle"
placeholder="请输入合同标题 "
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="合同金额" prop="contractAmount">
<el-input
v-model="queryParams.contractAmount"
placeholder="请输入合同金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item label="负责人" prop="owner">
<el-input
v-model="queryParams.owner"
placeholder="请输入负责人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="归属部门" prop="department">
<el-input
v-model="queryParams.department"
placeholder="请输入归属部门"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item label="本次回款金额" prop="nowAmount">
<el-input
v-model="queryParams.nowAmount"
placeholder="请输入本次回款金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="回款方式" prop="receiptType">
<el-select v-model="queryParams.receiptType" placeholder="请选择回款方式" clearable>
<el-option
v-for="dict in dict.type.pay_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="回款日期" prop="receiptDate">
<el-date-picker clearable
v-model="queryParams.receiptDate"
@ -99,14 +26,7 @@
placeholder="请选择回款日期">
</el-date-picker>
</el-form-item>
<el-form-item label="回款单编号" prop="receiptCode">
<el-input
v-model="queryParams.receiptCode"
placeholder="请输入回款单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="回款状态" prop="receiptState">
<el-select v-model="queryParams.receiptState" placeholder="请选择回款状态" clearable>
<el-option
@ -117,54 +37,8 @@
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="开票状态" prop="invoState">
<el-input
v-model="queryParams.invoState"
placeholder="请输入开票状态"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item label="提交人" prop="submitPerson">
<el-input
v-model="queryParams.submitPerson"
placeholder="请输入提交人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="流程状态" prop="processSate">
<el-input
v-model="queryParams.processSate"
placeholder="请输入流程状态"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="当前节点" prop="nowNode">
<el-input
v-model="queryParams.nowNode"
placeholder="请输入当前节点"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="当前负责人" prop="nowOwner">
<el-input
v-model="queryParams.nowOwner"
placeholder="请输入当前负责人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item label="提交时间" prop="submitTime">
<el-date-picker clearable
v-model="queryParams.submitTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择提交时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>

View File

@ -1,5 +1,6 @@
<template>
<div class="dashboard-editor-container">
<div v-if="$store.getters.roles[0]=='admin'" class="dashboard-editor-container">
<div class="cards-container">
<div style="width: 68%">
@ -84,8 +85,8 @@
<td>{{followupData.no_followup}}</td>
</tr>
<tr>
<th>跟进率</th>
<td>{{followupData.followup_rate}} %</td>
<th>待回款金额</th>
<td>{{followupData.followup_rate}}</td>
</tr>
</tbody>
</table>
@ -211,7 +212,7 @@
<div slot="header" class="clearfix">
<span>业绩销售额</span>
</div>
<div ref="chart" style="width:auto;height:390px;"></div>
<div ref="chartt" style="width:auto;height:390px;"></div>
</el-card>
</el-col>
@ -275,8 +276,342 @@
<!-- 添加或修改跟进记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-dialog :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="标题" prop="title">
<el-input v-model="form.title" placeholder="请输入标题" />
</el-form-item>
<el-form-item label="跟进记录" prop="followUpRecord">
<el-input v-model="form.followUpRecord" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="客户姓名" prop="customerNum">
<el-select v-model="form.customerId" placeholder="请选择客户" @change="doChangeCustomerNumber" >
<el-option
v-for="item in customerList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="客户编号" prop="customerNumber">
<el-input v-model="form.customerNumber" placeholder="请输入客户编号" :disabled="true" />
</el-form-item>
<el-form-item label="跟进方式" prop="followUpType">
<el-select v-model="form.followUpType" placeholder="请选择跟进方式">
<el-option
v-for="dict in dict.type.follow_up_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="跟进内容">
<editor v-model="form.content" :min-height="192"/>
</el-form-item>
<el-form-item label="下次跟进" prop="followUpTime">
<el-date-picker clearable
v-model="form.followUpTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择跟进时间">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</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>-->
<!-- </div>-->
<!-- <table class="followup-table">-->
<!-- <tbody>-->
<!-- <tr>-->
<!-- <th>今日已跟进</th>-->
<!-- <td>{{followupData.today_followup}}</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <th>未跟进个数</th>-->
<!-- <td>{{followupData.no_followup}}</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <th>待回款金额</th>-->
<!-- <td>{{followupData.followup_rate}}</td>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<!-- </el-card>-->
<el-col :xs="24" :sm="24" :lg="8" class="scrollable2">
<el-card class="box-card">
<el-collapse v-model="activeName" accordion>
<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;margin-bottom: 10px">
<div slot="header" class="clearfix">
<span>销售漏斗</span>
</div>
<div class='headerBox'>
<!-- <div class='title'>交易漏斗模型</div>-->
<div class='flexstart' style="position:relative;width:1200px; height: 400px">
<!-- <div ref="myechart" style="position:relative;width: 1200px; height: 400px;z-index:2"></div>-->
<div ref="myechart" style="position:relative;z-index:2;width:1200px; height: 400px;"></div>
<div class='conversionBoxAsk flexstart coversionBox'>
<div class='lineBox'>
<i style='color:#c0c0c0;' class='el-icon-arrow-left icons'></i>
<div class='lines'></div>
<div class='line'></div>
</div>
<div>
<div class='titles'>转化率</div>
<div class='nums'>80.00%</div>
</div>
</div>
<div class='conversionBoxAdd flexstart coversionBox'>
<div class='lineBox'>
<i style='color:#c0c0c0;' class='el-icon-arrow-left icons'></i>
<div class='lines'></div>
<div class='line'></div>
</div>
<div>
<div class='titles'>转化率</div>
<div class='nums'>75.00%</div>
</div>
</div>
<div class='conversionBoxBuy flexstart coversionBox'>
<div class='lineBox'>
<i style='color:#c0c0c0;' class='el-icon-arrow-left icons'></i>
<div class='lines'></div>
<div class='line'></div>
</div>
<div>
<div class='titles'>转化率</div>
<div class='nums'>83.33%</div>
</div>
</div>
<div class='conversionBoxOut flexstart coversionBox'>
<div class='lineBox'>
<i style='color:#c0c0c0;' class='el-icon-arrow-left icons'></i>
<div class='lines'></div>
<div class='line'></div>
</div>
<div>
<div class='titles'>转化率</div>
<div class='nums'>50.00%</div>
</div>
</div>
</div>
</div>
</el-card>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :xs="24" :sm="24" :lg="8" >
<el-card body-style="display: flex;
flex-direction: column;
width: 100%;height:100%;
"
class="box-card fullwidth" style="height: 500px; margin-bottom: 10px;justify-content: space-between;">
<el-card shadow="hover" style="margin-bottom: 5px;flex: 1;" body-style="height: 100%;display: flex;flex-direction:column;
justify-content:space-between;align-items:center;">
<div class="clearfix2">
<span>合同签订数</span>
</div>
<div class="text-item" >
{{7 }}
</div>
</el-card>
<el-card shadow="hover" style="margin-bottom: 5px;flex: 1;" body-style="height: 100%;display: flex;flex-direction:column;
justify-content:space-between;align-items:center;">
<div class="clearfix2">
<span>合同总金额</span>
</div>
<div class="text-item">
{{555344.54 }}
</div>
</el-card>
<el-card shadow="hover" style="margin-bottom: 5px;flex: 1;" body-style="height: 100%;display: flex;flex-direction:column;
justify-content:space-between;align-items:center;">
<div class="clearfix2" >
<span>已回款金额</span>
</div>
<div class="text-item">
{{233500 }}
</div>
</el-card>
</el-card>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<!-- <el-card class="box-card" style="margin-bottom: 10px">-->
<!-- <div slot="header" class="clearfix">-->
<!-- <span>今日跟进提醒</span>-->
<!-- </div>-->
<!-- <div class="today-followup" v-for="followup in todayFollowupList" :key="followup">-->
<!-- <span style="color:red;">跟进</span> <a class="followup-customer" href="#">{{followup.name}}</a><br>-->
<!-- <span class="time">下次跟进时间{{parseTime(followup.nextFollowupTime)}}</span>-->
<!-- </div>-->
<!-- </el-card>-->
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>跟进计划日程</span>
</div>
<el-calendar :cellSize="30" STYLE="max-width:480px;max-height: 420px" >
<template
slot="dateCell"
slot-scope="{date, data}">
<div @click="handleClick(data.day)">{{data.day.split('-').slice(1)[1]}}</div>
</template>
</el-calendar>
</el-card>
</el-col>
<el-col :xs="24" :sm="24" :lg="8" class="scrollable">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>动态</span>
</div>
<div class="today-updates" v-for="updates in todayUpdates" :key="updates">
{{updates.owner}} <span style="color:red;">跟进</span> <a class="updates-customer" href="#">{{updates.customerName}}</a><br>
<span class="content">跟进记录</span>{{updates.content}}<br>
<span class="time">跟进时间{{parseTime(updates.createTime)}}</span>
</div>
<el-button type="primary" plain style="margin-top: 5px" @click="handleAdd">提交日程</el-button>
</el-card>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :xs="24" :sm="24" :lg="24">
<!-- <el-card class="box-card" style="margin-bottom: 10px">-->
<!-- <div slot="header" class="clearfix">-->
<!-- <span>今日待办</span>-->
<!-- </div>-->
<!-- <table class="followup-table">-->
<!-- <tbody>-->
<!-- <tr>-->
<!-- <th>今日已跟进</th>-->
<!-- <td>{{followupData.today_followup}}</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <th>未跟进个数</th>-->
<!-- <td>{{followupData.no_followup}}</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <th>跟进率</th>-->
<!-- <td>{{followupData.followup_rate}} %</td>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<!-- </el-card>-->
<el-card class="box-card" style="margin-bottom: 10px;height: 450px">
<div slot="header" class="clearfix">
<span>业绩销售额</span>
</div>
<div ref="chartt" style="width:auto;height:390px;"></div>
</el-card>
</el-col>
<!-- <el-card class="box-card" style="margin-bottom: 10px">-->
<!-- <div slot="header" class="clearfix">-->
<!-- <span>今日跟进提醒</span>-->
<!-- </div>-->
<!-- <div class="today-followup" v-for="followup in todayFollowupList" :key="followup">-->
<!-- <span style="color:red;">跟进</span> <a class="followup-customer" href="#">{{followup.name}}</a><br>-->
<!-- <span class="time">下次跟进时间{{parseTime(followup.nextFollowupTime)}}</span>-->
<!-- </div>-->
<!-- </el-card>-->
</el-row>
</div>
<!-- 添加或修改跟进记录对话框 -->
<el-dialog :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="标题" prop="title">
<el-input v-model="form.title" placeholder="请输入标题" />
</el-form-item>
@ -327,8 +662,8 @@
</div>
</template>
</template>
<script>
import PanelGroup from './dashboard/PanelGroup'
import ECharts from 'echarts'
@ -341,9 +676,18 @@ import 'echarts/lib/chart/map';
import "echarts/map/js/china.js";
import {indexData, infoDate, infoTop, infoTotalTop} from "../api/crm";
import {customerList} from "@/api/crm/order";
import {getCustomer, listPersonCustomers} from "../api/crm/customer";
import {
getCustomer,
listPersonCustomers,
newCluesAdd,
newCustomerAdd,
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";
export default {
dicts: ['follow_up_type'],
@ -355,6 +699,13 @@ export default {
},
data() {
return {
nowBusinesstotal:'',
nowBusiness:[],
newCustomerTotal: '',
newCluesTotal:'',
newClues: [],
newCustomer: [],
activeName: '1',
customerList:[],
//
form: {},
@ -373,18 +724,81 @@ export default {
},
mounted() {
this.echartsInit();
this.drawChart();
// if(this.$store.getters.roles[0]=='admin'){
// this.drawChart();
// }else{
this.drawChart2();
// }
// this.initMap();
},
created() {
this.initData();
this.getPersonCustomerList();
if (this.$store.getters.roles[0]=='admin') {
this.initTop();
this.totalTop();
this.getPersonCustomerList();
}else {
this.nowBusTot()
this.newAddCluesTotal()
this.newAddCustomerTotal()
this.newAddCustomer();
this.newAddClues()
this.nowBus()
// this.initMap();
}
},
methods: {
toBusPage(){
this.$router.push('/crm/customer/business');
},
toCustomerPage(){
this.$router.push('/crm/customer/person');
},
toCluePage(){
// console.log(222)
this.$router.push('/crm/clues/person');
},
//
nowBusTot(){
nowBusTotal().then(response => {
// console.log(response,33333)
this.nowBusinesstotal = response
});
},
//
nowBus(){
nowBus().then(response => {
// console.log(response,33333)
this.nowBusiness = response.data
});
},
//
newAddCustomerTotal(){
newTotalCustomer().then(response => {
// console.log(response,33333)
this.newCustomerTotal = response
});
},
//线
newAddCluesTotal(){
newTotalClues().then(response => {
// console.log(response,33333)
this.newCluesTotal = response
});
},
//
newAddClues(){
newCluesAdd().then(response => {
this.newClues = response.data
});
},
//
newAddCustomer(){
newCustomerAdd().then(response => {
this.newCustomer = response.data
});
},
//
doChangeCustomerNumber(){
getCustomer(this.form.customerId).then(response => {
@ -421,13 +835,15 @@ export default {
//
initTop() {
infoTop().then((response) => {
this.topPeople = response.data;
console.log(response)
this.topPeople = response;
})
},
//
totalTop() {
infoTotalTop().then((response) => {
this.totalAmount = response.data;
// console.log(response,1111)
this.totalAmount = response;
})
},
//
@ -457,130 +873,6 @@ export default {
}
});
},
// initMap() {
// let myChart = ECharts.init(this.$refs.echarts1);
// let option = {
// tooltip: {
// //
// formatter(params) {
// let htmlStr = `
// <div style='font-size:18px;'> ${params.name}</div>
// `;
// return htmlStr;
// }
// },
// // geo https://echarts.baidu.com/option.html#geo
// geo: {
// map: 'china',
// show: true,
// roam: true,
// top: 0,
// label: {
// emphasis: {
// show: false
// }
// },
// //
// itemStyle: {
// normal: {
// areaColor: '#091632',
// borderColor: '#9adcfa',
// shadowColor: '#09184F',
// shadowBlur: 20
// }
// }
// },
// series: [
// //
// {
// type: 'map',
// map: 'china',
// geoIndex: 1,
// aspectScale: 0.75, //
// showLegendSymbol: true, // legend
// top: 0,
// label: {
// normal: {
// show: false
// },
// emphasis: {
// show: false,
// textStyle: {
// color: '#fff'
// }
// }
// },
// //
// roam: false,
// //
// itemStyle: {
// normal: {
// areaColor: '#031525',
// borderColor: '#3B5077',
// borderWidth: 1
// },
// emphasis: {
// areaColor: '#0f2c70'
// }
// },
// data: [
// {
// name: '',
// //
// itemStyle: {
// normal: {
// areaColor: '#F50508',
// borderColor: '#1773c3', //
// shadowColor: '#1773c3', //
// shadowBlur: 20
// }
// }
// }
// ],
// zlevel: 0
// },
// //
// {
// type: 'effectScatter',
// coordinateSystem: 'geo',
// //
// data: [{name: '', value: [126.63, 45.75]}],
// showEffectOn: 'render',
// rippleEffect: {
// scale: 4, //
// brushType: 'stroke'
// },
// hoverAnimation: true,
// label: {
// normal: {
// show: true,
// formatter: '{b}',
// position: 'right',
// fontWeight: 500,
// fontSize: 14
// }
// },
// itemStyle: {
// normal: {
// color: '#32cd32',
// shadowBlur: 10,
// shadowColor: '#333'
// }
// },
// emphasis: {
// itemStyle: {
// color: '#f4e925' //
// }
// },
// zlevel: 1
// }
// ]
// };
// myChart.setOption(option);
// // window.addEventListener('resize', function () {
// // myChart.resize();
// // });
// },
echartsInit() {
// let that = this
let myChart = ECharts.init(this.$refs.myechart);
@ -808,17 +1100,32 @@ export default {
z: 100
}]
}
const that=this
myChart.on('click', function (params) {
//
console.log(params.name);
if (params.name=='客户数'){
that.$router.push({path:'/crm/customer/person'});
}
if (params.name=='产出商机客户数') {
that.$router.push({path:'/crm/customer/business'});
}
if (params.name=='合同签订客户数') {
that.$router.push({path:'/crm/order/crm/customer'});
}
if (params.name=='已回款客户数') {
that.$router.push({path:'/crm/finance/crm/finance/receipt'});
}
});
myChart.setOption(option);
this.series = option.series[0]
},
drawChart() {
// domecharts
let myChart = ECharts.init(this.$refs.chart)
//
// drawChart() {
// // domecharts
// let myChart = ECharts.init(this.$refs.chart)
// let option = {
// grid: {
// right: '5%',
@ -826,41 +1133,51 @@ export default {
// top: '10%', //
// bottom: '10%',
// },
// // title: {
// // text: ''
// // },
// // tooltip: {},
// legend: {
// data: ['','']
// data: ['']
// },
// xAxis: {
// data: ["20231", "20232", "20233","20234", "20235", "20236", "20237","20238",
// // data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
// data: [ "20236", "20237","20238",
// "20239","202310", "202311", "202312","20241", "20242","20243", "20244"]
// },
// yAxis: {
// // data: [50000, 100000, 150000, 200000, 250000, 300000]
// },
// yAxis: {},
// series: [
// {
// name: '',
// type: 'bar',
// // data: [23, 24, 18, 25, 27, 28, 25],
// data: [50000, 100000, 150000, 50000, 50000, 100000, 50000, 100000, 150000,50000, 100000],
// itemStyle: {
// barBorderRadius: 5,
// borderWidth: 1,
// borderType: 'solid',
// color: 'rgba(59,130,246,0.5)',
// // borderColor: '#73c0de',
// // shadowColor: '#55a3e3',
// shadowBlur: 3
// }
// },
// {
// name: '',
// type: 'line',
// smooth: true,
// data: [50000, 100000, 150000, 200000, 250000, 300000,50000, 100000, 150000, 200000, 250000, 300000,50000, 100000,150000]
// },
// {
// name: '',
// type: 'line',
// smooth: true,
// areaStyle: {
// color: '#e3e3d5',
// opacity: 0.5
// },
// data: [250000, 300000,50000, 100000, 150000,50000, 100000, 150000, 300000,50000, 100000, 150000]
// color: 'rgba(253,175,21)',
// data: [ 300000, 200000, 250000, 150000, 300000, 200000, 250000, 300000, 200000, 200000, 250000, 300000, 150000, 200000, 250000, 300000]
// },
//
//
// ]
// };
// // 使
// myChart.setOption(option);
// },
drawChart2() {
// domecharts
let myChart = ECharts.init(this.$refs.chartt)
let option = {
tooltip: {
trigger: 'item',
},
grid: {
right: '5%',
left: '5%', //
@ -868,7 +1185,7 @@ export default {
bottom: '10%',
},
legend: {
data: ['业绩金额']
data: ['业绩金额','销售金额']
},
xAxis: {
// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
@ -878,23 +1195,30 @@ export default {
yAxis: {},
series: [
{
name: '销售金额',
type: 'bar',
// data: [23, 24, 18, 25, 27, 28, 25],
data: [50000, 100000, 150000, 50000, 50000, 100000, 50000, 100000, 150000,50000, 100000],
barWidth: '60%', // 40%
itemStyle: {
barBorderRadius: 5,
borderWidth: 1,
borderType: 'solid',
color: 'rgba(59,130,246,0.5)',
// borderWidth: 1,
// borderType: 'solid',
color: '#f1c075',
// borderColor: '#73c0de',
// shadowColor: '#55a3e3',
shadowBlur: 3
// shadowBlur: 3
}
},
{
name: '业绩金额',
type: 'line',
color: 'rgba(253,175,21)',
smooth: true,
areaStyle: {
color: 'rgba(59,130,246,0.5)',
opacity: 0.5
},
color: 'rgba(59,130,246,0.5)',
data: [ 300000, 200000, 250000, 150000, 300000, 200000, 250000, 300000, 200000, 200000, 250000, 300000, 150000, 200000, 250000, 300000]
},
@ -926,7 +1250,34 @@ export default {
}
</script>
<style lang="scss" scoped>
.vertical-line-left {
border-left: 1px solid #a19d9d; /* 设置竖线颜色和粗细 */
margin: 5px;
}
.ellipsis {
margin-left: 24px;
white-space: nowrap; /* 防止文本换行 */
overflow: hidden; /* 隐藏超出容器宽度的内容 */
text-overflow: ellipsis; /* 使用省略号表示被隐藏的内容 */
}
.header-icon {
font-size: 24px; /* 设置图标的字体大小 */
color: #00a6ff;
}
::v-deep .el-collapse-item__header {
font-size: 19px; /* 设置标题的字体大小 */
font-weight: 200;
height: 55px;
}
::v-deep .el-collapse-item__content{
padding-bottom: 25px;
font-size: 14px;
color: #303133;
line-height: 1.7692307692;
}
.flexstart{
display: flex;
justify-content: flex-start;
@ -1047,7 +1398,11 @@ export default {
transform: skew(-20deg);
border-left: 0;
}
::v-deep.fullwidth .el-card__body {
display: flex;
flex-direction: column;
width: 100%;
}
.icons{
position: absolute;
bottom: -7px;
@ -1129,11 +1484,6 @@ export default {
}
}
}
.clearfix2 {
font-weight: bold;
color: black;
@ -1230,6 +1580,10 @@ td {
overflow-y: auto;
max-height: 500px; /* 根据需要调整最大高度 */
}
.scrollable2 {
overflow-y: auto;
max-height: 450px; /* 根据需要调整最大高度 */
}
@media (max-width: 1024px) {
.chart-wrapper {
padding: 8px;