|
|
@@ -0,0 +1,302 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <dataTemPlate ref="dataTemPlateRef" :isTitle="true" title="联系人关联项目情况统计" @list="listData" id="statisticsOfProjectFull">
|
|
|
+ <template slot="operation">
|
|
|
+ <div class="mt-10 inline-16">
|
|
|
+ <label class="search__label">{{ $t("项目类型") }}:</label>
|
|
|
+ <el-select
|
|
|
+ class="inline-16"
|
|
|
+ v-model="paramTable.content.where.projecttype"
|
|
|
+ size="small"
|
|
|
+ :placeholder="$t('请选择')"
|
|
|
+ @focus="queryType"
|
|
|
+ @change="selectChange"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in typesData"
|
|
|
+ :key="item.value"
|
|
|
+ :label="$t(item.value)"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="mt-10 inline-16">
|
|
|
+ <label class="search__label">{{$t(`项目状态`)}}:</label>
|
|
|
+ <el-select class="inline-24" v-model="paramTable.content.where.status" :placeholder="$t(`请选择项目状态`)" @change="selectChange" size="small" multiple clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="item in statusTab"
|
|
|
+ :key="item.value"
|
|
|
+ :label="$t(item.label)"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <btnSelect ref="btnSelectRef" @btnClick="btnClick" class="inline-16" :btnTitle="['全部','本年']" dateType="本年"></btnSelect>
|
|
|
+<!-- <fullScreen class="inline-16" domId="statisticsOfCustomerFull" @onFull="onFull" @backFull="backFull" ></fullScreen>-->
|
|
|
+ </template>
|
|
|
+ <template slot="content">
|
|
|
+ <div style="display: flex;justify-content: space-between" :style="{height:heightDiv}">
|
|
|
+ <div ref="statisticsOfProjectChart" :style="{height: heightChart}"></div>
|
|
|
+ <div style="width: 70%" :style="{height: heightDiv}">
|
|
|
+ <tableDetail :layout="tablecols" :data="tableList" :opwidth="200" :custom="true" fixed-name="operation" :height="heightTable">
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
+ <div v-if="scope.column.columnname === 'tag'">
|
|
|
+ <div v-if="scope.column.data.tag">
|
|
|
+ <div v-if="scope.column.data.tag.length > 0">
|
|
|
+ <el-tag v-for="item in scope.column.data.tag" :key="item.index" :type="item === '支持者'?'warning':item === '反对者'?'danger':''" size="mini" style="margin:0 5px 0 0">
|
|
|
+ {{$t(item)}}
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ <div v-else>--</div>
|
|
|
+ </div>
|
|
|
+ <div v-else>--</div>
|
|
|
+ </div>
|
|
|
+ <div v-else>{{scope.column.data[scope.column.columnname]||scope.column.columnname === 'operation' ? scope.column.data[scope.column.columnname] : '--'}}</div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:opreation="scope">
|
|
|
+ <drawerTemp class="inline-16" v-if="detailPath" :data="scope.data" :detailPath="detailPath" :idName="idName" :disabled="isFull"
|
|
|
+ :listqueryid="listqueryid" :total="total" :overview="true"></drawerTemp>
|
|
|
+ </template>
|
|
|
+ </tableDetail>
|
|
|
+ <div style="margin-top:10px;text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ small
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-size="paramTable.content.pageSize"
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </dataTemPlate>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import dataTemPlate from '@/components/dataTemplate/index'
|
|
|
+import btnSelect from "./btnSelectInfo"
|
|
|
+import {Pie} from "@antv/g2plot";
|
|
|
+import fullScreen from "@/views/salesData/components/fullScreen";
|
|
|
+export default {
|
|
|
+ name: "statisticsOfProject",
|
|
|
+ components:{dataTemPlate,btnSelect,fullScreen,
|
|
|
+ drawerTemp:() => import('@/components/normal-basic-layout/drawerDetail/index')},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ detailPath:{
|
|
|
+ path:'/contactDataDetail'
|
|
|
+ },
|
|
|
+ idName:'sys_phonebookid',
|
|
|
+ isFull:false,
|
|
|
+ listqueryid:'',
|
|
|
+ paramChart:{
|
|
|
+ "id": 2025080114335902,
|
|
|
+ "content": {
|
|
|
+ "type": 1,
|
|
|
+ "dataid": 58,
|
|
|
+ "dateType": "本年",
|
|
|
+ "where": {
|
|
|
+ "begdate": "",
|
|
|
+ "enddate": "",
|
|
|
+ "isleave": "1",
|
|
|
+ "projecttype":"",
|
|
|
+ "status": []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ paramTable:{
|
|
|
+ "id": 2025080114340402,
|
|
|
+ "content": {
|
|
|
+ "type": 1,
|
|
|
+ "dataid": 58,
|
|
|
+ "pageSize": 10,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "dateType": "本年",
|
|
|
+ "where": {
|
|
|
+ "begdate": "",
|
|
|
+ "enddate": "",
|
|
|
+ "isleave": "1",
|
|
|
+ "isprojects": "",
|
|
|
+ "projecttype":"",
|
|
|
+ "status": []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ tablecols:[],
|
|
|
+ tableList:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ chartList:[],
|
|
|
+ chartMap:null,
|
|
|
+ typesData:[],
|
|
|
+ heightChart:'100%',
|
|
|
+ heightDiv:'400px',
|
|
|
+ heightTable:'360px',
|
|
|
+ statusTab:[
|
|
|
+ {
|
|
|
+ value:"跟进中",
|
|
|
+ label:"跟进中"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:"已成交",
|
|
|
+ label:"已成交"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:"已失败",
|
|
|
+ label:"已失败"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value:"已结案",
|
|
|
+ label:"已结案"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ listData(dataid,type,isleave,state,init){
|
|
|
+ this.paramChart.content.dataid = dataid
|
|
|
+ this.paramTable.content.dataid = dataid
|
|
|
+ this.paramChart.content.type = type
|
|
|
+ this.paramTable.content.type = type
|
|
|
+ this.paramChart.content.where.isleave = isleave
|
|
|
+ this.paramTable.content.where.isleave = isleave
|
|
|
+ // this.paramTable.content.where.status = this.paramTable.content.where.status?this.paramTable.content.where.status:[]
|
|
|
+ // this.paramChart.content.where.status = this.paramChart.content.where.status?this.paramChart.content.where.status:[]
|
|
|
+ this.chartData(init,state)
|
|
|
+ this.tableData()
|
|
|
+ },
|
|
|
+ async chartData(init,state){
|
|
|
+ const res = await this.$api.requested(this.paramChart)
|
|
|
+ this.chartList = res.data
|
|
|
+ if (init) {
|
|
|
+ this.chartMap = new Pie(this.$refs.statisticsOfProjectChart, {
|
|
|
+ appendPadding: 10,
|
|
|
+ data:this.chartList,
|
|
|
+ angleField: 'ratio',
|
|
|
+ colorField: 'key',
|
|
|
+ radius: 1,
|
|
|
+ innerRadius: 0.64,
|
|
|
+ label:{
|
|
|
+ formatter: (datum) => `${datum.ratio}%`
|
|
|
+ },
|
|
|
+ tooltip:{
|
|
|
+ formatter: (datum) => {
|
|
|
+ return { name: datum.key, value: datum.ratio + '%' };
|
|
|
+ },
|
|
|
+ },
|
|
|
+ statistic: {
|
|
|
+ title: {
|
|
|
+ offsetY: -4,
|
|
|
+ style: {
|
|
|
+ fontSize:'16px'
|
|
|
+ },
|
|
|
+ content:this.$t('项目总数')
|
|
|
+ },
|
|
|
+ content: {
|
|
|
+ offsetY: 4,
|
|
|
+ style: {
|
|
|
+ whiteSpace: 'pre-wrap',
|
|
|
+ overflow: 'hidden',
|
|
|
+ textOverflow: 'ellipsis',
|
|
|
+ fontSize:'16px'
|
|
|
+ },
|
|
|
+ customHtml: (container, view, datum, data) => {
|
|
|
+ const text = data[0].totalqty
|
|
|
+ return text
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ position:'bottom'
|
|
|
+ },
|
|
|
+ // 添加 中心统计文本 交互
|
|
|
+ interactions: [{ type: 'element-single-selected' },{ type: 'element-active' }],
|
|
|
+ });
|
|
|
+ this.chartMap.on('element:click',(v) => {
|
|
|
+ if (v.data.data.key != this.paramTable.content.where.isprojects) {
|
|
|
+ this.paramTable.content.pageNumber = 1
|
|
|
+ this.paramTable.content.where.isprojects = v.data.data.key
|
|
|
+ this.tableData()
|
|
|
+ } else {
|
|
|
+ this.paramTable.content.pageNumber = 1
|
|
|
+ this.paramTable.content.where.isprojects = ''
|
|
|
+ this.tableData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.chartMap.render();
|
|
|
+ } else {
|
|
|
+ this.chartMap.changeData(this.chartList)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async tableData(){
|
|
|
+ const res = await this.$api.requested(this.paramTable)
|
|
|
+ this.tableList = res.data
|
|
|
+ this.total = res.total
|
|
|
+ this.currentPage = res.pageNumber
|
|
|
+ this.listqueryid = res.listqueryid
|
|
|
+ },
|
|
|
+ btnClick(dateType,dateData){
|
|
|
+ this.paramTable.content.pageNumber = 1
|
|
|
+ if (dateType){
|
|
|
+ this.paramChart.content.dateType = dateType
|
|
|
+ this.paramTable.content.dateType = dateType
|
|
|
+ }else {
|
|
|
+ this.paramTable.content.where.begdate = dateData[0]
|
|
|
+ this.paramTable.content.where.enddate = dateData[1]
|
|
|
+ this.paramChart.content.where.begdate = dateData[0]
|
|
|
+ this.paramChart.content.where.enddate = dateData[1]
|
|
|
+ }
|
|
|
+ this.listData(this.paramChart.content.dataid,this.paramChart.content.type,this.paramChart.content.where.isleave)
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.paramTable.content.pageSize = val
|
|
|
+ this.listData(this.paramChart.content.dataid,this.paramChart.content.type,this.paramChart.content.where.isleave)
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.paramTable.content.pageNumber = val
|
|
|
+ this.listData(this.paramChart.content.dataid,this.paramChart.content.type,this.paramChart.content.where.isleave)
|
|
|
+ },
|
|
|
+ selectChange(){
|
|
|
+ this.paramChart.content.dateType = this.paramTable.content.where.type
|
|
|
+ this.listData(this.paramChart.content.dataid,this.paramChart.content.type,this.paramChart.content.where.isleave)
|
|
|
+ },
|
|
|
+ async queryType(){
|
|
|
+ if (this.typesData.length == 0){
|
|
|
+ const res = await this.$store.dispatch("optiontypeselect", "projecttype")
|
|
|
+ this.typesData = res.data
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /*全屏*/
|
|
|
+ onFull(){
|
|
|
+ this.heightChart = this.windowWidth > 1136 ? 'calc(100vh - 70px)':'calc(100vh - 123px)'
|
|
|
+ this.heightDiv = this.windowWidth > 1136 ? 'calc(100vh - 70px)':'calc(100vh - 123px)'
|
|
|
+ this.heightTable = this.windowWidth > 1136 ? 'calc(100vh - 100px)':'calc(100vh - 153px)'
|
|
|
+ this.isFull = true
|
|
|
+ },
|
|
|
+ /*退出全屏*/
|
|
|
+ backFull(val){
|
|
|
+ this.heightChart = '100%'
|
|
|
+ this.heightDiv = '400px'
|
|
|
+ this.heightTable = '360px'
|
|
|
+ this.isFull = false
|
|
|
+ this.$emit('backFull',val)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.tablecols = this.tool.tabelCol(this.$route.name).contactsTable.tablecols
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|