qymljy 10 месяцев назад
Родитель
Сommit
93adde7850

+ 251 - 3
src/HDrpManagement/contactData/index.vue

@@ -35,8 +35,95 @@
               <btnSelect :btn-title="['全部','本年','本季','本月','上月','去年']" :date-type="dateType" @btnClick="btnClick"></btnSelect>
             </div>
           </div>
-          <dataBoard title="联系人数据概况" :mainData="maninInfo" heightNew="145px"></dataBoard>
-          <dataDetail></dataDetail>
+          <dataBoard title="联系人数据概况" :mainData="maninInfo" heightNew="145px" @goDetail="goDetail"></dataBoard>
+          <dataDetail ref="detailRef" :param="paramDetail" :person="person" :departmentid="depment" :layout="tablecols" :title="detailTitle" :titleHeader="titleHeader" height="calc(100vh - 225px)" tableType="联系人数据概况">
+            <template slot="custom">
+              <div class="mt-10 inline-16">
+                <p class="search__label">{{$t('状态')}}:</p>
+                <el-select v-model="isleave" clearable style="margin-right:10px" size="small" :placeholder="$t('请选择状态')" @change="leaveChange" disabled>
+                  <el-option :label="$t('在职')" value="1"></el-option>
+                  <el-option :label="$t('离职')" value="2"></el-option>
+                </el-select>
+              </div>
+              <div class="inline-16 mt-10" v-if="typeSelect">
+                <label class="search__label">{{ $t("客户类型") }}:</label>
+                <el-select
+                    class="inline-16"
+                    v-model="paramDetail.content.where.type"
+                    size="small"
+                    :placeholder="$t('请选择')"
+                    @change="selectChange"
+                    clearable
+                >
+                  <el-option
+                      v-for="item in option.typeData"
+                      :key="item.value"
+                      :label="$t(item.value)"
+                      :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </div>
+              <div class="mt-10 inline-16" v-if="statusSelect">
+                <label class="search__label">{{ $t("合作状态") }}:</label>
+                <el-select
+                    class="inline-16"
+                    v-model="paramDetail.content.where.status"
+                    size="small"
+                    :placeholder="$t('请选择')"
+                    @change="selectChange"
+                    clearable
+                >
+                  <el-option
+                      v-for="item in option.status"
+                      :key="item.value"
+                      :label="$t(item.value)"
+                      :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </div>
+              <div class="mt-10 inline-16" v-if="tradingstatusSelect">
+                <label class="search__label">{{ $t("成交状态") }}:</label>
+                <el-select
+                    class="inline-16"
+                    v-model="paramDetail.content.where.tradingstatus"
+                    size="small"
+                    :placeholder="$t('请选择')"
+                    @change="selectChange"
+                    clearable
+                >
+                  <el-option
+                      v-for="item in option.tradingstatus"
+                      :key="item.value"
+                      :label="$t(item.value)"
+                      :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </div>
+              <div class="inline-16 mt-10" v-if="tagSelect">
+                <span class="search__label">{{$t('标签')}}:</span>
+                <el-select  v-model="tags" :placeholder="$t('请选择标签')" size="small" @change="selectChange" clearable @clear="selectChange" filterable class="inline-16" multiple>
+                  <el-option
+                      v-for="item in tagList"
+                      :key="item.index"
+                      :label="$t(item.tag)"
+                      :value="item.tag"
+                      :disabled="hasDisabledTag(item)">
+                  </el-option>
+                </el-select>
+              </div>
+              <div class="inline-16" v-if="associationSelect">
+                <label class="search__label">{{ $t('关联') }}:</label>
+                <el-select  v-model="paramDetail.content.where.contactstype" :placeholder="$t('请选择关联')" size="small" @change="selectChange" clearable @clear="selectChange" class="inline-16">
+                  <el-option :label="$t(`关联线索`)" value="关联线索"></el-option>
+                  <el-option :label="$t(`关联客户`)" value="关联客户"></el-option>
+                  <el-option :label="$t(`关联项目`)" value="关联项目"></el-option>
+                </el-select>
+              </div>
+            </template>
+          </dataDetail>
         </div>
       </template>
     </normal-layout>
@@ -80,7 +167,66 @@ export default {
           }
         },
       },
-      maninInfo:''
+      maninInfo:'',
+      paramDetail:{
+        "id": 2025072213574102,
+        "content": {
+          "type": 1,
+          "dataid": 58,
+          "dateType": "本年",
+          "where": {
+            "isleave": "",
+            "condition": "",
+            "tag": [],
+            "contactstype": "", //关联线索,关联客户,关联项目
+            "type":"",
+            "status":"",
+            "tradingstatus":""
+          }
+        },
+      },
+      tablecols:'',
+      detailTitle:'',
+      tagList:[],
+      tags:[],
+      tagSelect:false,
+      associationSelect:false,
+      typeSelect:false,
+      statusSelect:false,
+      tradingstatusSelect:false,
+      titleHeader:'',
+      option: {
+        typeData: [],
+        customerClassification: [],
+        customerGrade: [],
+        industryData: [],
+        tagData: [],
+        status: [
+          {
+            value: "潜在",
+          },
+          {
+            value: "合作中",
+          },
+          {
+            value: "暂缓",
+          },
+          {
+            value: "已终止",
+          },
+        ],
+        tradingstatus: [
+          {
+            value: "未成交",
+          },
+          {
+            value: "已成交",
+          },
+          {
+            value: "多次成交",
+          },
+        ],
+      },
     }
   },
   watch: {
@@ -271,6 +417,105 @@ export default {
           tooltip:'统计联系人关联的项目订单下单金额。'
         }
       ]
+    },
+    goDetail(data){
+      this.titleHeader = data
+      this.tagSelect = false
+      this.associationSelect = false
+      this.typeSelect = false
+      this.statusSelect = false
+      this.tradingstatusSelect = false
+      if (data == '联系人总数'){
+        this.paramDetail.id =2025072213574102
+        this.tablecols = this.tool.tabelCol(this.$route.name).contactsTotalTable.tablecols
+        this.tagSelect = true
+        this.associationSelect = true
+        this.getTagList()
+      }else if (data == '联系人跟进次数'){
+        this.paramDetail.id = 2025072213575402
+        this.tablecols = this.tool.tabelCol(this.$route.name).contactsFollowTable.tablecols
+      }else if (data == '关联客户数'){
+        this.paramDetail.id = 2025072213580402
+        this.tablecols = this.tool.tabelCol(this.$route.name).associatedCustomersTable.tablecols
+        this.typeSelect = true
+        this.statusSelect = true
+        this.tradingstatusSelect = true
+        this.tagSelect = true
+        this.getSelectData()
+        this.getTagList()
+      }else if (data == '关联项目数'){
+        this.paramDetail.id = 2025072213581302
+        this.tablecols = this.tool.tabelCol(this.$route.name).associatedProjectsTable.tablecols
+      }else if (data == '关联客户成交金额'){
+        this.paramDetail.id = 2025072213582002
+        this.tablecols = this.tool.tabelCol(this.$route.name).associatedAmountTable.tablecols
+      }else if (data == '关联项目成交金额'){
+        this.paramDetail.id = 2025072213582602
+        this.tablecols = this.tool.tabelCol(this.$route.name).associatedAmountTable.tablecols
+      }
+      this.detailTitle = this.$t(this.dateType) + '_' + this.$t(data)
+      this.titleHeader = data
+      this.paramDetail.content.dataid = this.paramMain.content.dataid
+      this.paramDetail.content.type = this.paramMain.content.type
+      this.paramDetail.content.dateType = this.paramMain.content.dateType
+      this.paramDetail.content.where.isleave = this.paramMain.content.where.isleave
+      this.$refs.detailRef.onShow()
+    },
+    /*获取联系人标签*/
+    async getTagList () {
+      console.log('联系人标签')
+      console.log(this.titleHeader,'titleHeader')
+      if (this.titleHeader == '联系人总数'){
+        let res = await this.$api.requested({
+          "id": 20220929085401,
+          "content": {
+            "ownertable":"sys_phonebook",
+            "ownerid":102
+          }
+        })
+        this.tagList = res.data.option
+      }else if (this.titleHeader == '关联客户数'){
+        const res = await this.$api.requested({
+          id: 20221013104401,
+          content: {
+            isExport: 1,
+            pageNumber: 1,
+            pageSize: 100,
+            sys_systemtagid: 2,
+            where: {
+              condition: "",
+            },
+          },
+        });
+        this.tagList = res.data
+
+      }
+    },
+    selectChange(){
+      this.paramDetail.content.where.tag = this.tags
+      this.$refs.detailRef.listData()
+    },
+    hasDisabledTag (item) {
+      let arr = []
+      let arr2 = []
+      arr = this.tagList.filter(item=>{
+        return this.tags.includes(item.tag)
+      })
+      arr.forEach(e=>{
+        arr2 = arr2.concat(e.mutextag)
+      })
+      arr2 = this.tags.length === 0?[]:arr2
+      let _isSame = arr2.some(tag=>item.tag === tag)
+      return _isSame
+    },
+    clearSearchValue () {
+      this.$store.dispatch('clearSearchValue')
+      this.$refs.detailRef.listData(this.paramDetail.content.pageNumber = 1)
+    },
+    /*获取自定义选项数据*/
+    async getSelectData(){
+      const res = await this.$store.dispatch("optiontypeselect", "customertypemx")
+      this.option.typeData = res.data
     }
   },
   mounted() {
@@ -284,6 +529,9 @@ export default {
         that.windowWidth = window.fullWidth; // 宽
       })()
     };
+  },
+  created() {
+    // this.tablecols = this.tool.tabelCol(this.$route.name).contactsTotalTable.tablecols
   }
 }
 </script>

+ 1 - 1
src/HManagement/addressList/addressBook/index.vue

@@ -38,7 +38,7 @@
         </div>
         <div class="inline-16">
           <label class="search__label">{{ $t('关联') }}:</label>
-          <el-select  v-model="contactstype" :placeholder="$t('请选择标签')" size="small" @change="selectChange" clearable @clear="selectChange" class="inline-16">
+          <el-select  v-model="contactstype" :placeholder="$t('请选择关联')" size="small" @change="selectChange" clearable @clear="selectChange" class="inline-16">
             <el-option :label="$t(`关联客户`)" value="关联客户"></el-option>
             <el-option :label="$t(`关联项目`)" value="关联项目"></el-option>
           </el-select>

+ 7 - 2
src/components/dataBoard/index.vue

@@ -4,7 +4,7 @@
       <div class="div-box-new" :style="{height:heightNew}">
         <div style="font-size: 16px;color: #333333;margin-bottom: 20px">{{$t(title)}}</div>
         <div class="div-border-new" :style="{height:heightNew}">
-          <div class="item div-click" v-for="item in mainData">
+          <div class="item div-click" v-for="item in mainData" @click="detailClick(item.label)">
             <p class="title">{{item.value}}</p>
             <span class="content-font-new">{{$t(item.label)}}</span>
             <el-tooltip placement="top" v-if="item.isTooltip">
@@ -21,7 +21,12 @@
 <script>
 export default {
   name: "index",
-  props:['title','mainData','heightNew']
+  props:['title','mainData','heightNew'],
+  methods:{
+    detailClick(title){
+      this.$emit('goDetail',title)
+    }
+  }
 }
 </script>
 

+ 50 - 1
src/template/dataDetail/index.vue

@@ -37,6 +37,53 @@
                 {{ scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation' ? scope.column.data[[scope.column.columnname]] : '--' }}
               </div>
             </div>
+            <div v-else-if="tableType == '联系人数据概况'">
+              <div v-if="titleHeader == '联系人总数' || titleHeader == '联系人跟进次数'">
+                <div v-if="scope.column.columnname === 'tag'">
+                  <div v-if="scope.column.data.sys_tag">
+                    <div v-for="item in scope.column.data.sys_tag" :key="item.index"  style="float: left;margin-left: 5px;margin-bottom: 5px">
+                      <el-tag  color="#3874F6" size="mini" type="primary" effect="dark">
+                        <span>{{$t(item)}}</span>
+                      </el-tag>
+                    </div>
+                    <div v-for="item in scope.column.data.tag" :key="item.index"  style="float: left;margin-left: 5px;margin-bottom: 5px">
+                      <el-tag color="#FA8C16" size="mini" type="warning" effect="dark">
+                        <span>{{$t(item)}}</span>
+                      </el-tag>
+                    </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>
+              </div>
+              <div v-else-if="titleHeader == '关联客户数'">
+                <div v-if="scope.column.columnname === 'tag'">
+                  <div v-if="scope.column.data.sys_tag">
+                    <div v-for="item in scope.column.data.sys_tag" :key="item.index"  style="float: left;margin-left: 5px;margin-bottom: 5px">
+                      <el-tag  color="#3874F6" size="mini" type="primary" effect="dark">
+                        <span>{{$t(item)}}</span>
+                      </el-tag>
+                    </div>
+                    <div v-for="item in scope.column.data.tag" :key="item.index"  style="float: left;margin-left: 5px;margin-bottom: 5px">
+                      <el-tag color="#FA8C16" size="mini" type="warning" effect="dark">
+                        <span>{{$t(item)}}</span>
+                      </el-tag>
+                    </div>
+                  </div>
+                </div>
+                <div v-else-if="scope.column.columnname === 'leader'">
+                  <span>{{scope.column.data['leader'][0]?scope.column.data['leader'][0].name:'--'}}</span>
+                </div>
+                <div v-else-if="scope.column.columnname === 'depname'">
+                  <span>{{scope.column.data['leader'][0]?scope.column.data['leader'][0].depname:'--'}}</span>
+                </div>
+                <div v-else>
+                  {{ scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation' ? scope.column.data[[scope.column.columnname]] : '--' }}
+                </div>
+              </div>
+            </div>
             <div v-else>
               <div v-if="scope.column.columnname === 'tag'">
                 <div v-if="scope.column.data.sys_tag">
@@ -124,7 +171,7 @@
 <script>
 export default {
   name: "index",
-  props:["title","layout","param","person","departmentid","isleave","height",'tableType'],
+  props:["title","layout","param","person","departmentid","isleave","height",'tableType','titleHeader'],
   data(){
     return {
       dialogFormVisible:false,
@@ -152,6 +199,7 @@ export default {
     },
     async listData(){
       const res = await this.$api.requested(this.param)
+      console.log(res.data,'222222')
       this.list = res.data
       this.total = res.total
       this.currentPage = res.pageNumber
@@ -171,6 +219,7 @@ export default {
       this.listData(this.param.content.pageNumber = 1)
     },
     onClose(){
+      this.param.content.where.condition = ''
       this.dialogFormVisible = false
     },
     async departmentrtment() {