Explorar o código

Merge branch 'crm14.8'

mayday hai 1 ano
pai
achega
4edcb551a9

+ 4 - 0
src/api/modules/statisticApi.js

@@ -253,6 +253,10 @@ const dataMainInterface = {
 	unusualRenewalCustomStatistic: params => {
 		return http.get('/statistic_report/report/unusual_renew_company',params)
 	},
+	//续约异常客户统计图表数据
+	unusualRenewalCustomStatisticChartData:params=>{
+		return http.get('/statistic_report/report/unusual_renew_company/chart',params)
+	},
 
 	/**
 	 * 新增客户列表

+ 19 - 3
src/views/custom_manage/customList/customShareList.vue

@@ -18,6 +18,7 @@
 			clearable
 			filterable
 			@change="getTableData"
+			v-if="roleType!=='ficc_seller'"
 		  />
           <el-select v-model="sales" placeholder="请选择分配销售" style="width: 214px; margin-right: 20px;" 
           clearable filterable multiple collapse-tags @change="getTableData">
@@ -324,7 +325,7 @@
 										<el-dropdown-menu slot="dropdown">
 											<el-dropdown-item :command="{type:item.type,data:scope.row}" 
 											v-for="item in getToolBtnList(scope.row).slice(3)" :key="item.type">
-												<span>{{item.type}}</span>
+												<span>{{item.type=='设置共享'&&scope.row.IsShare==1?'取消共享':item.type}}</span>
 											</el-dropdown-item>
 										</el-dropdown-menu>
 									</span>
@@ -488,6 +489,9 @@ export default {
 			}else{
 				return 'thisSeller';
 			}
+		},
+		roleType(){
+			return localStorage.getItem('Role') || ''
 		}
 	},
 	data () {
@@ -529,7 +533,8 @@ export default {
 				BtnAddAgreement: '补充协议',
 				BtnTryOut: '增开试用',
 				BtnServiceRecord:'服务记录',
-				BtnRemarkView:'备注'
+				BtnRemarkView:'备注',
+				BtnShare:'设置共享',
 			},	// 按钮命令列表
 			accumulativeFrequencyDlg:false,//路演业阅读的弹框
 			accumulativeFrequencyItem:{},
@@ -633,10 +638,21 @@ export default {
 				this.handleShowRemark(query.data)
 			}else if(["续约申请","补充协议"].includes(query.type)){
 				this.handleOpenContractChoose(query.type,query.data)
-			}else if("增开试用"){
+			}else if(query.type=="增开试用"){
 				this.addTrialHandle(query.data)
+			}else if(query.type=='设置共享' || query.type=='取消共享'){
+				this.shareSetting(query.data)
 			}
 		},
+		// 设置/取消 共享
+		shareSetting(row){
+			customInterence.setCustomShare({CompanyId:row.CompanyId,IsShare:row.IsShare==0?1:0}).then(res=>{
+				if(res.Ret==200){
+					this.$message.success(row.IsShare==0?'设置共享成功':'取消共享成功')
+					this.getTableData()
+				}
+			})
+		},
 		/* 查看权限 */
 		lookHandle(item) {
 			this.lookTitle = item.CompanyName;

+ 162 - 0
src/views/dataReport_manage/components/abnormalRenewalChart.vue

@@ -0,0 +1,162 @@
+<template>
+    <div class="abnormal-renewal-chart-wrap">
+        <div class="top-wrap">
+            <el-date-picker
+                v-model="date"
+                type="monthrange"
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+                :clearable="false"
+                value-format="yyyy-MM"
+                @change="handleDateChange"
+            />
+            <div style="color:#409EFF;cursor: pointer;" @click="handleClose">
+                <img src="~@/assets/img/icons/changeLang.png" alt="">
+                <span style="display:inline-block;position: relative;top:-3px;left:3px">数据表</span>
+            </div>
+        </div>
+        <div class="chart-main-wrap">
+            <h2 style="text-align:center;font-size:30px;margin:30px 0;">续约异常客户统计图</h2>
+            <div class="chart-box" ref="chartBox"></div>
+        </div>
+    </div>
+</template>
+
+<script>
+import { dataMainInterface } from '@/api/api.js';
+import { nextTick } from 'vue';
+export default {
+    data() {
+        return {
+            date:'',
+            myChart:null
+        }
+    },
+    created() {
+        this.date=[this.$moment().format('YYYY-01'),this.$moment().format('YYYY-MM')]
+    },
+    mounted() {
+        this.getData()
+    },
+    methods: {
+        async getData(){
+            const res=await dataMainInterface.unusualRenewalCustomStatisticChartData({
+                StartDate:this.date[0],
+                EndDate:this.date[1]
+            })
+            if(res.Ret===200){
+                this.$nextTick(()=>{
+                    this.renderChart(res.Data)
+                })
+            }
+        },
+        handleDateChange(){
+            this.getData()
+        },
+        handleClose(){
+            this.$emit('close')
+        },
+        renderChart(data){
+            const arr=data.List||[]
+
+            const options={
+				legend: {
+					name: [],
+                    icon:'circle',
+					left: 'center',
+				},
+				tooltip: {
+                    formatter:function(params){
+                        let str=`${params.name}<br>
+                        <span style='display:inline-block;width:15px;height:15px;background:#FDB863;border-radius:100%'></span>
+                        ${params.seriesName}&nbsp;&nbsp;${params.value}`
+
+                        return str
+                    }
+                },
+				title: {
+					text: '',
+				},
+				color: ['#FDB863'],
+				textStyle: {
+					fontSize: 12,
+				},
+				xAxis: {
+					type: '',
+					data: [],
+					// /* x轴文字 */
+					axisLabel: {
+						show: true,
+						rotate: '40', //字体倾斜
+						textStyle: {
+							color: '#999', //更改坐标轴文字颜色
+							fontSize: 12, //更改坐标轴文字大小
+						},
+					},
+				},
+				yAxis: {
+					type: 'value',
+					minInterval:1,
+                    position: 'left',
+                    name:'家',
+                    splitLine:{
+                        lineStyle:{
+                            type:'dotted'
+                        }
+                    }
+				},
+				series: [
+                    {
+                        data:[],
+                        name:'续约异常客户合计',
+                        type:'bar',
+                        yAxisIndex: 0,
+                    }
+                ],
+			}
+
+            arr.forEach(item => {
+                options.xAxis.data.push(item.Date)
+                options.series[0].data.push(item.CompanyNum)
+            });
+
+            console.log(options);
+
+            const chart = this.$refs.chartBox;
+            if(chart){
+                this.$nextTick(()=>{
+                    if(!this.myChart){
+                        this.myChart = echarts.init(chart);
+                        this.myChart.setOption(options);
+                    }else{
+                        this.myChart.setOption(options,true);
+                    }
+                    
+                })
+            }
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.abnormal-renewal-chart-wrap{
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: #fff;
+    padding: 30px;
+    .top-wrap{
+        display: flex;
+        justify-content: space-between;
+    }
+    .chart-box{
+        margin: 0 auto;
+        width: 80%;
+        height: 500px;
+    }
+}
+</style>

+ 17 - 3
src/views/dataReport_manage/statistic/abnormalRenewal.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="statistic-container" ref="reference">
-        <div class="frequency-cont">
+        <div class="frequency-cont" style="position: relative;">
 			<ul class="frequency-ul">
 				<li v-for="tab in staticTabs" :key="tab" :class="{act: tab=== default_tab}" @click="changeTabHandle(tab)">{{ tab }}</li>
 			</ul>
@@ -14,6 +14,11 @@
                 placeholder="请选择统计时间"
             />
             <span style="color:#A3A3A3;display:inline-block;margin-left:20px">续约异常:合同到期后两个月内未签约</span>
+
+            <div style="color:#409EFF;position: absolute;top:10px;right:10px;cursor: pointer;" @click="showChart=true">
+                <img src="~@/assets/img/icons/changeLang.png" alt="">
+                <span style="display:inline-block;position: relative;top:-3px;left:3px">统计图</span>
+            </div>
         </div>
         <div class="table-cont" v-show="dataLoading">
             <div class="table-body-wrapper">
@@ -76,16 +81,18 @@
                 </table>
             </div>
         </div>
-
+        <abnormalRenewalChart v-if="showChart" @close="showChart=false"/>
     </div>
 </template>
 
 <script>
 import { dataMainInterface } from '@/api/api.js';
 import mixin from './mixin';
+import abnormalRenewalChart from '../components/abnormalRenewalChart.vue';
 export default {
     name:'abnormalRenewal',
     mixins: [ mixin ],
+    components:{abnormalRenewalChart},
     computed:{
         tableThead:function(){
             if(['周度统计表','月度统计表'].includes(this.default_tab)){
@@ -98,7 +105,8 @@ export default {
     data() {
         return {
             sellerList:[],
-            summaryList:[]
+            summaryList:[],
+            showChart:false,
         }
     },
     created() {
@@ -108,6 +116,8 @@ export default {
 
         getTableData(){
             this.dataLoading=true
+            this.sellerList=[]
+            this.summaryList=[]
             dataMainInterface.unusualRenewalCustomStatistic({
                 DataType: this.default_tab === '周度统计表' ? 'week' : this.default_tab === '月度统计表' ? 'month' : 'time_interval',
 				StartDate: this.select_date ? this.select_date[0] : '',
@@ -155,4 +165,8 @@ export default {
 
 <style lang="scss" scoped>
 @import './index.scss';
+.statistic-container{
+    height: calc(100vh - 180px);
+    position: relative;
+}
 </style>