qymljy 2 سال پیش
والد
کامیت
13d7edbaf6
2فایلهای تغییر یافته به همراه118 افزوده شده و 23 حذف شده
  1. 3 2
      src/components/table/index5.vue
  2. 115 21
      src/views/mediaStatistics/modules/salesfunnel.vue

+ 3 - 2
src/components/table/index5.vue

@@ -1,7 +1,8 @@
 <template>
 <template>
   <div>
   <div>
     <!-- :header-cell-style="{background:'#EEEEEE',color:'#333'}" -->
     <!-- :header-cell-style="{background:'#EEEEEE',color:'#333'}" -->
-    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini"  :height="height ==''?data.length <= 4?'260px':data.length <= 20?'':'calc(100vh - 420px)':height"  @row-click="rowClick" style="width:100%;min-height:260px;max-height: calc(100vh - 420px)" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
+    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini"  :height="height ==''?data.length <= 4?'260px':data.length <= 20?'':'calc(100vh - 420px)':height"  @row-click="rowClick"
+              style="width:100%;min-height:260px;max-height: calc(100vh - 420px)" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
               :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange" >
               :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange" >
       <el-table-column
       <el-table-column
           type="selection"
           type="selection"
@@ -32,7 +33,7 @@ export default {
     custom:是否启用自定义结构;
     custom:是否启用自定义结构;
     opwidth:操作列宽度
     opwidth:操作列宽度
   */
   */
-  props:['layout','data','custom','height','fixedName','width','checkbox','loading'],
+  props:['layout','data','custom','height','fixedName','width','checkbox'],
   data () {
   data () {
     return {
     return {
       list:[],
       list:[],

+ 115 - 21
src/views/mediaStatistics/modules/salesfunnel.vue

@@ -1,7 +1,7 @@
 // 各模块文件存储占比
 // 各模块文件存储占比
 <template>
 <template>
   <div class="container normal-panel">
   <div class="container normal-panel">
-    <div class="inline-16" style="margin-top:20px;margin-bottom: 50px">
+    <div class="inline-16" style="margin-top:0px;margin-bottom: 20px">
       <label  class="search__label" >部门:</label>
       <label  class="search__label" >部门:</label>
       <el-cascader ref="selectdep" size="small" v-model="depment" :options="deplist" :props="{emitPath:true,expandTrigger:'hover',checkStrictly:true,label:'label',value:'departmentid',children:'children'}"  @change="selectDep"  clearable></el-cascader>
       <el-cascader ref="selectdep" size="small" v-model="depment" :options="deplist" :props="{emitPath:true,expandTrigger:'hover',checkStrictly:true,label:'label',value:'departmentid',children:'children'}"  @change="selectDep"  clearable></el-cascader>
     </div>
     </div>
@@ -18,7 +18,7 @@
     </div>
     </div>
     <div class="inline-16">
     <div class="inline-16">
       <el-button-group>
       <el-button-group>
-        <el-button size="small" :type="dataParam.content.dateType==1?'primary':''" @click="dataChange(1)">近一年</el-button>
+        <el-button size="small" :type="dataParam.content.dateType==1?'primary':''" @click="dataChange(1)" >近一年</el-button>
         <el-button size="small" :type="dataParam.content.dateType==2?'primary':''" @click="dataChange(2)">近九个月</el-button>
         <el-button size="small" :type="dataParam.content.dateType==2?'primary':''" @click="dataChange(2)">近九个月</el-button>
         <el-button size="small" :type="dataParam.content.dateType==3?'primary':''" @click="dataChange(3)">近六个月</el-button>
         <el-button size="small" :type="dataParam.content.dateType==3?'primary':''" @click="dataChange(3)">近六个月</el-button>
         <el-button size="small" :type="dataParam.content.dateType==4?'primary':''" @click="dataChange(4)">近三个月</el-button>
         <el-button size="small" :type="dataParam.content.dateType==4?'primary':''" @click="dataChange(4)">近三个月</el-button>
@@ -29,7 +29,7 @@
         <el-col :span="14">
         <el-col :span="14">
           <p class="title">销售漏斗图</p>
           <p class="title">销售漏斗图</p>
           <div class="re-panel">
           <div class="re-panel">
-            <div id="containerFunnel" style="height: calc(100vh - 500px)"></div>
+            <div id="containerFunnel" style="height: calc(60vh)"></div>
           </div>
           </div>
         </el-col>
         </el-col>
         <el-col :span="10">
         <el-col :span="10">
@@ -37,14 +37,15 @@
             <p class="title">表格数据</p>
             <p class="title">表格数据</p>
             <el-table
             <el-table
                 :data="tableData"
                 :data="tableData"
-                style="width: 100%"
-                width="900px"
+                style="width: 500px"
                 size="small"
                 size="small"
+                :header-cell-style="{height:'60px',fontWeight:'400',fontSize:'22px',color:'#333333',background:'#ddebf7'}"
+                :cell-style="{height:'40px',fontWeight:'400',fontSize:'18px'}"
                 border>
                 border>
               <el-table-column
               <el-table-column
                   prop="stagename"
                   prop="stagename"
                   label="阶段"
                   label="阶段"
-                  width="120">
+                  width="180">
               </el-table-column>
               </el-table-column>
               <el-table-column
               <el-table-column
                   prop="projectqty"
                   prop="projectqty"
@@ -58,25 +59,69 @@
             </el-table>
             </el-table>
           </div>
           </div>
         </el-col>
         </el-col>
+<!--        <el-col :span="24" style="margin-top: 20px">
+          <p class="title">{{projectTile}}</p>
+          <tableTemp :layout="tablecols" :data="projectList" :opwidth="200" :custom="true"  :height="tableHieght">
+            <template v-slot:customcol="scope">
+              <p>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'&#45;&#45;'}}</p>
+            </template>
+          </tableTemp>
+          <div class="container normal-panel" style="text-align:right">
+            <el-pagination
+                background
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :current-page="projectParam.content.pageNumber"
+                :page-sizes="[10, 10, 50, 100]"
+                :page-size="10"
+                layout="total,sizes, prev, pager, next, jumper"
+                :total="total">
+            </el-pagination>
+          </div>
+        </el-col>-->
       </el-row>
       </el-row>
-
-
     </div>
     </div>
-
+    <div>
+      <p class="title">{{projectTile}}</p>
+      <tableTemp :layout="tablecols" :data="projectList" :opwidth="200" :custom="true"  :height="tableHieght">
+        <template v-slot:customcol="scope">
+          <p>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'&#45;&#45;'}}</p>
+        </template>
+      </tableTemp>
+      <div  style="text-align:right;margin-top: 10px">
+        <el-pagination
+            background
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="projectParam.content.pageNumber"
+            :page-sizes="[10, 10, 50, 100]"
+            :page-size="10"
+            layout="total,sizes, prev, pager, next, jumper"
+            :total="total">
+        </el-pagination>
+      </div>
+    </div>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
+import tableTemp from '@/components/table/index5'
 import { Funnel,G2 } from '@antv/g2plot';
 import { Funnel,G2 } from '@antv/g2plot';
 const G = G2.getEngine('canvas');
 const G = G2.getEngine('canvas');
 export default {
 export default {
+  components:{tableTemp},
   data () {
   data () {
     return {
     return {
       chartPie:null,
       chartPie:null,
+      tableHieght:'calc(10vh)',
       tableData:[],
       tableData:[],
       person:'',
       person:'',
       depment:'',
       depment:'',
       dateType:"",
       dateType:"",
+      projectTile:"",
+      fullscreenLoading:false,
+      total:0,
+      sa_projstagemagid:'',
       data:[{ stagename: '简历筛选', sequence1: 253 },],
       data:[{ stagename: '简历筛选', sequence1: 253 },],
       activeName: '部门',
       activeName: '部门',
       dataid:'',
       dataid:'',
@@ -87,6 +132,8 @@ export default {
       visible:false,
       visible:false,
       deplist:[],
       deplist:[],
       personnelList:[],
       personnelList:[],
+      projectList:[],
+      tablecols:[],
       depmentParam:{
       depmentParam:{
         "id": 20230620102004,
         "id": 20230620102004,
         "content": {
         "content": {
@@ -104,6 +151,17 @@ export default {
             "departmentid":""
             "departmentid":""
           }
           }
         }
         }
+      },
+      projectParam:{
+        "id": 20230719085004,
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 10,
+          "type": '',
+          "dataid": '',
+          "dateType": '',
+          "sa_projstagemagid":''
+        }
       }
       }
     }
     }
   },
   },
@@ -169,18 +227,15 @@ export default {
       return arr
       return arr
     },
     },
     selectDep(val) {
     selectDep(val) {
-      console.log(val)
       this.person = ''
       this.person = ''
       this.dataParam.content.type = 1
       this.dataParam.content.type = 1
-      this.dataParam.content.dataid = val[0]
+      this.dataParam.content.dataid = val[val.length -1]
       this.getProportionOfFileModel()
       this.getProportionOfFileModel()
     },
     },
     selectPerson(val){
     selectPerson(val){
-      console.log(val)
       this.depment = ''
       this.depment = ''
       this.dataParam.content.type = 0
       this.dataParam.content.type = 0
       this.dataParam.content.dataid = val
       this.dataParam.content.dataid = val
-      console.log(this.dataParam)
       this.getProportionOfFileModel()
       this.getProportionOfFileModel()
     },
     },
     dataChange(val){
     dataChange(val){
@@ -188,15 +243,16 @@ export default {
       this.getProportionOfFileModel()
       this.getProportionOfFileModel()
     },
     },
     renderPie() {
     renderPie() {
-      const colorArray = ['#6395fa','#63daab','#657798','#f7c122','#7666fa','#75cbed'];
+      const colorArray = ['#6395fa','#63daab','#657798','#f7c122','#7666fa','#75cbed','#6FD26C','#DFC064'];
       this.chartPie = new Funnel('containerFunnel', {
       this.chartPie = new Funnel('containerFunnel', {
-        data: this.data,
+        data: this.tableData,
         maxSize:0.6,
         maxSize:0.6,
         xField: 'stagename',
         xField: 'stagename',
-        yField: 'sequence1',
+        yField: 'wide',
         shape: 'pyramid',
         shape: 'pyramid',
         dynamicHeight: false,
         dynamicHeight: false,
         legend: false,
         legend: false,
+        interactions: [{ type: 'element-active'}],
         label: {
         label: {
           layout:"fixedOverlap",
           layout:"fixedOverlap",
           position:'right',
           position:'right',
@@ -205,7 +261,7 @@ export default {
             const group = new G.Group({});
             const group = new G.Group({});
             const content = ()=>{
             const content = ()=>{
                 if (this.tableData[0]) {
                 if (this.tableData[0]) {
-                  const text = `${datum.stagename}  当前项目数: ${datum.projectqty} 项目数: ${this.tableData[0].projectqty} 转化率: ${datum.zhl?Math.round((datum.zhl* 100)*100)/100 + '%':'--'}  预计签约金额: ${datum.signamount_due}万元`
+                  const text = `${datum.stagename}  当前项目数: ${datum.projectqty} 项目数: ${datum.sequence1} 转化率: ${datum.zhl?Math.round((datum.zhl* 100)*100)/100 + '%':'--'}  预计签约金额: ${datum.signamount_due}万元`
                   const lines = text.split('  ');
                   const lines = text.split('  ');
                   return lines.join('\n');
                   return lines.join('\n');
                 }
                 }
@@ -242,7 +298,7 @@ export default {
           customContent: (title, items) => {
           customContent: (title, items) => {
             // 构建自定义内容
             // 构建自定义内容
             const content = `<div>
             const content = `<div>
-              <ul style="padding:10px">
+              <ul style="padding:10px;">
                 ${items.map((item) => `
                 ${items.map((item) => `
                 <li>
                 <li>
                 <p style="margin-bottom:10px">${title}</p>
                 <p style="margin-bottom:10px">${title}</p>
@@ -261,6 +317,18 @@ export default {
         },
         },
       });
       });
       this.chartPie.render();
       this.chartPie.render();
+      document.addEventListener('click',(evt) => {
+        const states = this.chartPie.getStates();
+        let dataList = []
+        dataList = states
+        if (dataList.length > 0){
+          this.projectTile = dataList[0].data.stagename
+          this.sa_projstagemagid = dataList[0].data.sa_projstagemagid
+          this.getProjectList()
+        }
+
+      })
+
       /*this.departmentrtment()*/
       /*this.departmentrtment()*/
       this.getProportionOfFileModel()
       this.getProportionOfFileModel()
     },
     },
@@ -277,15 +345,41 @@ export default {
           }
           }
         }
         }
       }*/
       }*/
-      console.log(this.dataParam,'dataParam')
       const res = await this.$api.requested(this.dataParam)
       const res = await this.$api.requested(this.dataParam)
       this.tableData = res.data
       this.tableData = res.data
+      let dataList = []
+      dataList = res.data
+      this.sa_projstagemagid = dataList[0].sa_projstagemagid
+      this.projectTile = dataList[0].stagename
+      this.getProjectList()
       this.chartPie.changeData(res.data)
       this.chartPie.changeData(res.data)
-    }
+    },
+    async getProjectList(){
+      this.projectParam.content.type = this.dataParam.type
+      this.projectParam.content.dataid = this.dataParam.dataid
+      this.projectParam.content.dateType = this.dataParam.dateType
+      this.projectParam.content.sa_projstagemagid = this.sa_projstagemagid
+      const res = await this.$api.requested(this.projectParam)
+      this.projectList = res.data
+      this.total = res.total
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.projectParam.content.pageSize = val
+      this.getProjectList()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.projectParam.content.pageNumber = val
+      this.getProjectList()
+    },
   },
   },
   mounted () {
   mounted () {
    /* this.renderPie()*/
    /* this.renderPie()*/
     this.departmentrtment()
     this.departmentrtment()
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).projectTable.tablecols
   }
   }
 }
 }
 
 
@@ -304,6 +398,6 @@ export default {
   border-left: .3rem solid #3874F6;
   border-left: .3rem solid #3874F6;
 }
 }
 .container{
 .container{
-  height:calc(100vh - 180px)
+ /* height:calc(100vh)*/
 }
 }
 </style>
 </style>