qymljy 1 year ago
parent
commit
986b49baa5

+ 39 - 17
src/HDrpManagement/customerPortrait/index.vue

@@ -4,7 +4,7 @@
       <div style="padding: 20px 20px 5px 20px;">
         <div class="mt-10">
           <label  class="search__label" >范围:</label>
-          <el-select class="inline-16" v-model="value" size="small" placeholder="请选择范围" clearable @change="selectChange" >
+          <el-select class="inline-16" v-model="value" size="small" placeholder="请选择范围" clearable @change="selectChange">
             <el-option
                 v-for="item in editableTabs"
                 :key="item.index"
@@ -15,17 +15,17 @@
         </div>
       </div>
       <el-scrollbar >
-      <div style="min-width: 1500px;padding: 10px 20px 5px 20px;height:calc(100vh - 350px)">
+      <div style="min-width: 1500px;padding: 10px 20px 5px 20px;height:calc(100vh - 300px)">
         <div style="width: 20%;float: left" >
-          <el-table border :data="list" >
+          <el-table border :data="list" ref="table" highlight-current-row  @row-click="rowClick">
             <el-table-column
                 prop="enterprisename"
                 label="客户名称"
                 width="180">
             </el-table-column>
             <el-table-column
-                prop="name"
-                label="type"
+                prop="type"
+                label="类型"
                 width="180">
             </el-table-column>
             <el-table-column
@@ -35,19 +35,22 @@
               </template>
             </el-table-column>
           </el-table>
-          <el-pagination
-              background
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
-              :current-page="param.content.pageNumber"
-              :page-sizes="[20, 50, 100, 200]"
-              :page-size="20"
-              layout="total,sizes, prev, pager, next, jumper"
-              :total="total">
-          </el-pagination>
+          <div style="width: 100%">
+            <el-pagination
+                background
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :current-page="param.content.pageNumber"
+                :page-sizes="[20, 50, 100, 200]"
+                :page-size="20"
+                layout="total, prev, pager, next, jumper"
+                :total="total">
+            </el-pagination>
+          </div>
+
         </div>
         <div style="width: 79%;float: right;">
-          <mindmap ref="custom" class="inline-16" style="width:calc(150vh - 130px);height:calc(100vh - 300px) " :id="2132" name="custom"></mindmap>
+          <mindmap v-if="flag" ref="custom" class="inline-16" style="width:calc(150vh - 130px);height:calc(100vh - 300px) " :id="sa_customersid" name="custom"></mindmap>
         </div>
       </div>
       </el-scrollbar>
@@ -65,6 +68,8 @@ export default {
       value:1,
       list:[],
       total:0,
+      flag:false,
+      sa_customersid:'',
       editableTabs:[
         {
           templetname:'我负责的',
@@ -103,6 +108,7 @@ export default {
   methods:{
     selectChange(){
       console.log(this.value,'value')
+      this.listData()
     },
     async listData(){
       this.param.content.type = this.value
@@ -110,7 +116,23 @@ export default {
       this.list = res.data
       this.total = res.total
       console.log(res.data,'客户')
-      this.$refs.custom.getData()
+      this.sa_customersid = res.data[0].sa_customersid
+      this.flag = true
+      this.$nextTick(()=>{
+        this.$refs.custom.getData()
+        this.$refs.table.setCurrentRow(this.list[0])
+      })
+
+    },
+    rowClick(val){
+      console.log(val)
+      this.sa_customersid = val.sa_customersid
+
+      this.$nextTick(()=>{
+        this.$refs.custom.getData()
+        this.flag = true
+      })
+
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);

+ 4 - 0
src/HDrpManagement/projectChange/components/putPeople.vue

@@ -7,6 +7,7 @@
         :visible.sync="drawer"
         append-to-body
         size="90%"
+        @close="onClose"
         :with-header="false">
       <report :url="url"></report>
     </el-drawer>
@@ -152,6 +153,9 @@ export default {
         }
       }
       console.log(this.flag,'报备状态')
+    },
+    onClose(){
+      this.$emit('onClose')
     }
   },
   mounted() {

+ 1 - 1
src/HDrpManagement/projectChange/modules/detail.vue

@@ -18,7 +18,7 @@
     <div slot="customOperation">
       <!-- 此区域提供了自定义操作按钮 -->
       <mindmap class="inline-16" :id="this.$route.query.id" name="project"></mindmap>
-      <putPeople style=" display: inline-block !important;" @putSuccess="putSuccess" v-if="flagTag !== ''" :rowData="mainData" :flagTag="flagTag" :disabled="mainData.disabled"/>
+      <putPeople style=" display: inline-block !important;" @putSuccess="putSuccess" v-if="flagTag !== ''" :rowData="mainData" :flagTag="flagTag" :disabled="mainData.disabled" @onClose="onSuccess"/>
       <projectRecovery class="inline-16" :data="mainData" v-if="tool.checkAuth($route.name,'recovery')  && mainData.status === '已失败'" :disabled="mainData.disabled" @onRecovery="onSuccess"></projectRecovery>
       <duplicatesProject class="inline-16" :data="mainData" v-if="tool.checkAuth($route.name,'queryDuplicates') " :disabled="mainData.disabled" @dialogClose="dialogClose"></duplicatesProject>
       <finish class="inline-16" v-if="tool.checkAuth($route.name,'finish')  && mainData.status === '跟进中'" :disabled="mainData.disabled" @onFinish="onSuccess"></finish>

+ 157 - 0
src/HDrpManagement/projectPortrait/index.vue

@@ -0,0 +1,157 @@
+<template>
+  <normalLayout>
+    <template #content>
+      <div style="padding: 20px 20px 5px 20px;">
+        <div class="mt-10">
+          <label  class="search__label" >范围:</label>
+          <el-select class="inline-16" v-model="value" size="small" placeholder="请选择范围" clearable @change="selectChange">
+            <el-option
+                v-for="item in editableTabs"
+                :key="item.index"
+                :label="item.templetname"
+                :value="item.templetid"
+            ></el-option>
+          </el-select>
+        </div>
+      </div>
+      <el-scrollbar >
+      <div style="min-width: 1500px;padding: 10px 20px 5px 20px;height:calc(100vh - 300px)">
+        <div style="width: 20%;float: left" >
+          <el-table border :data="list" ref="table" highlight-current-row  @row-click="rowClick">
+            <el-table-column
+                prop="projectname"
+                label="项目名称"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                prop="projecttype"
+                label="项目类型"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                prop="tradefield"
+                label="领域"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                label="负责人">
+              <template slot-scope="scope">
+                {{scope.row.leader[0].name}}
+              </template>
+            </el-table-column>
+          </el-table>
+          <div style="width: 100%">
+            <el-pagination
+                background
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :current-page="param.content.pageNumber"
+                :page-sizes="[20, 50, 100, 200]"
+                :page-size="20"
+                layout="total, prev, pager, next, jumper"
+                :total="total">
+            </el-pagination>
+          </div>
+
+        </div>
+        <div style="width: 79%;float: right;">
+          <mindmap v-if="flag" ref="project" class="inline-16" style="width:calc(150vh - 130px);height:calc(100vh - 300px) " :id="sa_projectid" ></mindmap>
+        </div>
+      </div>
+      </el-scrollbar>
+    </template>
+  </normalLayout>
+</template>
+
+<script>
+import mindmap from "@/components/mindmap/project.vue";
+export default {
+  name: "index",
+  components:{mindmap},
+  data() {
+    return {
+      value:1,
+      list:[],
+      total:0,
+      flag:false,
+      sa_projectid:'',
+      editableTabs:[
+        {
+          templetname:'我负责的',
+          templetid:1
+        },
+        {
+          templetname:'我参与的',
+          templetid:2
+        },
+        {
+          templetname:'我下属负责的',
+          templetid:3
+        },
+        {
+          templetname:'我下属参与的',
+          templetid:4
+        },
+        {
+          templetname:'我创建的',
+          templetid:5
+        }
+      ],
+      param:{
+        "id":20221020143502,
+        "content":{
+          "pageNumber": 1,
+          "pageSize": 20,
+          "type":'',
+          "deleted": 0,
+          "isExport": false,
+          "isend": 0
+        }
+      }
+    }
+  },
+  methods:{
+    selectChange(){
+      this.listData()
+    },
+    async listData(){
+      this.param.content.type = this.value
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+      this.sa_projectid = res.data[0].sa_projectid
+      this.flag = true
+      this.$nextTick(()=>{
+        this.$refs.project.getData()
+        this.$refs.table.setCurrentRow(this.list[0])
+      })
+    },
+    rowClick(val){
+      console.log(val)
+      this.sa_projectid = val.sa_projectid
+      this.$nextTick(()=>{
+        this.$refs.project.getData()
+        this.flag = true
+      })
+
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+  },
+  mounted() {
+    this.listData()
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 198 - 0
src/HDrpManagement/salerPortrait/index.vue

@@ -0,0 +1,198 @@
+<template>
+  <normalLayout>
+    <template #content>
+      <div style="padding: 20px 20px 5px 20px;">
+        <div class="mt-10">
+          <label  class="search__label" >范围:</label>
+            <el-cascader size="small" ref="selectdep" :options="deplist" :props="{emitPath:true,expandTrigger:'hover',checkStrictly:true,label:'label',value:'departmentid',children:'children'}"  @change="selectDep"  clearable></el-cascader>
+        </div>
+      </div>
+      <el-scrollbar >
+      <div style="min-width: 1500px;padding: 10px 20px 5px 20px;height:calc(100vh - 300px)">
+        <div style="width: 20%;float: left" >
+          <el-table border :data="list" ref="table" highlight-current-row  @row-click="rowClick">
+            <el-table-column
+                prop="projectname"
+                label="项目名称"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                prop="projecttype"
+                label="项目类型"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                prop="tradefield"
+                label="领域"
+                width="180">
+            </el-table-column>
+            <el-table-column
+                label="负责人">
+              <template slot-scope="scope">
+                {{scope.row.leader[0].name}}
+              </template>
+            </el-table-column>
+          </el-table>
+          <div style="width: 100%">
+            <el-pagination
+                background
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :current-page="param.content.pageNumber"
+                :page-sizes="[20, 50, 100, 200]"
+                :page-size="20"
+                layout="total, prev, pager, next, jumper"
+                :total="total">
+            </el-pagination>
+          </div>
+
+        </div>
+        <div style="width: 79%;float: right;">
+          <mindmap v-if="flag" ref="project" class="inline-16" style="width:calc(150vh - 130px);height:calc(100vh - 300px) " :id="sa_projectid" ></mindmap>
+        </div>
+      </div>
+      </el-scrollbar>
+    </template>
+  </normalLayout>
+</template>
+
+<script>
+import mindmap from "@/components/mindmap/project.vue";
+export default {
+  name: "index",
+  components:{mindmap},
+  data() {
+    return {
+      value:1,
+      list:[],
+      total:0,
+      flag:false,
+      sa_projectid:'',
+      depmentParam:{
+        "id": 20230620102004,
+        "content": {
+        }
+      },
+      deplist:[],
+      param:{
+        "id":20221020143502,
+        "content":{
+          "pageNumber": 1,
+          "pageSize": 20,
+          "type":'',
+          "deleted": 0,
+          "isExport": false,
+          "isend": 0
+        }
+      }
+    }
+  },
+  methods:{
+    selectChange(){
+      this.listData()
+    },
+    async departmentrtment() {
+      const res = await this.$api.requested(this.depmentParam)
+      this.deplist = this.createMenu(res.data.dep)
+      /*this.range = JSON.parse(window.sessionStorage.getItem('active_account')).name*/
+    },
+    createMenu (array) {
+      var that = this
+      let arr = []
+      function convertToElementTree(node) {
+        // 新节点
+        if (node.subdep.length === 0){
+          var elNode = {
+            label: node["depname"],
+            parentid:node['parentid'],
+            parentname:node['parentname'],
+            departmentid:node["departmentid"],
+            value:node["departmentid"],
+            remarks:node["remarks"],
+            isused:node["isused"],
+            changedate:node['changedate'],
+            changeby:node['changeby'],
+            createdate:node['createdate'],
+            createby:node['createby'],
+            depno:node['depno'],
+            disabled:that.pageOnlyRead,
+          }
+        }else {
+          var elNode = {
+            label: node["depname"],
+            parentid:node['parentid'],
+            parentname:node['parentname'],
+            departmentid:node["departmentid"],
+            value:node["departmentid"],
+            remarks:node["remarks"],
+            isused:node["isused"],
+            changedate:node['changedate'],
+            changeby:node['changeby'],
+            createdate:node['createdate'],
+            createby:node['createby'],
+            depno:node['depno'],
+            disabled:that.pageOnlyRead,
+            children: []
+          }
+        }
+        if (node.subdep && node.subdep.length > 0) {
+          // 如果存在子节点
+          for (var index = 0; index < node.subdep.length; index++) {
+            // 遍历子节点, 把每个子节点看做一颗独立的树, 传入递归构造子树, 并把结果放回到新node的children中
+            elNode.children.push(convertToElementTree(node.subdep[index]));
+          }
+        }
+        return elNode;
+      }
+      array.forEach((element) => {
+        arr.push(convertToElementTree(element))
+      });
+      return arr
+    },
+    selectDep(val) {
+      console.log(val,'val')
+      let dataDep = this.$refs.selectdep.getCheckedNodes(true)[0].data
+      this.range = dataDep.label
+    },
+    async listData(){
+      this.param.content.type = this.value
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+      this.sa_projectid = res.data[0].sa_projectid
+      this.flag = true
+      this.$nextTick(()=>{
+        this.$refs.project.getData()
+        this.$refs.table.setCurrentRow(this.list[0])
+      })
+    },
+    rowClick(val){
+      console.log(val)
+      this.sa_projectid = val.sa_projectid
+      this.$nextTick(()=>{
+        this.$refs.project.getData()
+        this.flag = true
+      })
+
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+  },
+  mounted() {
+    this.listData()
+    this.departmentrtment()
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 20 - 0
src/router/HDrpManagement.js

@@ -1028,6 +1028,26 @@ const HDrpManagement = [
       keeproute: true,
     },
     component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/customerPortrait/index')
+  },
+  {
+    path: '/projectportrait',
+    name: 'projectportrait',
+    meta: {
+      title: '项目画像',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/projectPortrait/index')
+  },
+  {
+    path: '/salerportrait',
+    name: 'salerportrait',
+    meta: {
+      title: '业务员画像',
+      ast_nav: true,
+      keeproute: true,
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/salerPortrait/index')
   }
 
 ];

+ 5 - 5
src/router/index.js

@@ -110,23 +110,23 @@ let routes = [
           ast_nav:true
         },
         component: () => import(/!* webpackChunkName: "about" *!/ '@/components/mindmap/custom.vue')
-      },*/{
+      },*//*{
         path: '/projectportrait',
         name: 'projectportrait',
         meta: {
           title: '项目画像',
           ast_nav:true
         },
-        component: () => import(/* webpackChunkName: "about" */ '@/components/mindmap/project.vue')
-      },{
+        component: () => import(/!* webpackChunkName: "about" *!/ '@/components/mindmap/project.vue')
+      }*//*{
         path: '/salerportrait',
         name: 'salerportrait',
         meta: {
           title: '业务员画像',
           ast_nav:true
         },
-        component: () => import(/* webpackChunkName: "about" */ '@/components/mindmap/saler.vue')
-      }]
+        component: () => import(/!* webpackChunkName: "about" *!/ '@/components/mindmap/saler.vue')
+      }*/]
   }
 ];