浏览代码

联系人画像

qymljy 1 年之前
父节点
当前提交
1f71583328

+ 267 - 18
src/HDrpManagement/contactProfile/modules/detail.vue

@@ -51,7 +51,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">跟进记录</span>
-              <myRadio :value1="followParam.content" :value2="followParam.content.where" key1="dateType" @clickBtn="refreshTable('followParam','followRef')"  :btnOptions="[{label:'全部',value:0},{label:'本年',value:1},{label:'本季',value:2},{label:'本月',value:3}]">
+              <myRadio :value1="followParam.content" :value2="followParam.content.where" key1="dateType" @clickBtn="refreshTable('followParam','followRef')"  :btnOptions="[{label:'全部',value:'全部'},{label:'本年',value:'本年'},{label:'本季',value:'本季'},{label:'本月',value:'本月'}]">
               </myRadio>
             </div>
             <myCard
@@ -60,7 +60,7 @@
                 {title:'跟进次数',value:$refs.followRef && $refs.followRef.total,bg:'#F3F9FC',color:'#3874F6'},
                 {title:'最近跟进人',value:$refs.followRef && $refs.followRef.list[0] && $refs.followRef.list[0].createby || '--',bg:'#E8F7EC',color:'#78B32B'},
                 {title:'最近跟进时间',value:$refs.followRef && $refs.followRef.list[0] && $refs.followRef.list[0].createdate || '--',bg:'#F9F2E5',color:'#FF7603'},
-                {title:'跟进频率',value:$refs.followRef && $refs.followRef.list[0] && $refs.followRef.list[0].followfrequency,descript:'定义:平均跟进天数;若有跟进次数,则按照:跟进频率=(首次跟进时间到当前时间的天数-节假日)÷跟进次数',bg:'#FDF3F3',color:'#E85B5B'},
+                {title:'跟进频率',value:$refs.followRef && $refs.followRef.list[0] && $refs.followRef.list[0].followfrequency,descript:'定义:每次平均跟进天数;若没有跟进次数,则跟进频率=0天/次;若有跟进次数,则按跟进频率=(首次跟进时间到当前时间的天数-节假日天数)÷跟进次数',bg:'#FDF3F3',color:'#E85B5B'},
               ]"
             >
             </myCard>
@@ -74,7 +74,7 @@
               >
               </myTag>
             </div>
-            <showIsNone title="项目跟进记录明细">
+            <showIsNone title="跟进记录明细">
               <pageTable
                   ref="followRef"
                   :tablecols="tool.tabelCol($route.name).followTable.tablecols"
@@ -92,6 +92,203 @@
             </showIsNone>
           </el-card>
         </div>
+        <!--   关联客户     -->
+        <div class="Mproject" style="margin-top:10px">
+          <el-card class="box-card">
+            <div slot="header">
+              <span class="myTitle">关联客户</span>
+              <myRadio :value1="customerParam.content" :value2="customerParam.content.where" key1="dateType" @clickBtn="refreshTable('customerParam','customerRef')"  :btnOptions="[{label:'全部',value:'全部'},{label:'本年',value:'本年'},{label:'本季',value:'本季'},{label:'本月',value:'本月'}]">
+              </myRadio>
+            </div>
+            <myNewCard
+                :list="
+              [
+                {title:'客户数',value:$refs.customerRef && $refs.customerRef.total,bg:'#F3F9FC',color:'#3874F6'},
+                {title:'客户成交数量/金额',
+                value:$refs.customerRef && $refs.customerRef.list[0] && $refs.customerRef.list[0].tradingqty,
+                value3: $refs.customerRef && $refs.customerRef.list[0] && $refs.customerRef.list[0].tradingamount,
+                value4:$refs.customerRef && $refs.customerRef.list[0] && $refs.customerRef.list[0].tradingcjl,
+                value2descript:'成交率',
+                bg:'#E8F7EC',color:'#78B32B'},
+              ]"
+            >
+            </myNewCard>
+            <showIsNone title="客户明细">
+              <pageTable
+                  ref="customerRef"
+                  :tablecols="tool.tabelCol($route.name).customerTable.tablecols"
+                  :param="customerParam"
+                  :custom="true"
+              >
+                <template v-slot:custom="scope">
+                  <div v-if="scope.data.columnname === 'tag'">
+                    <div v-if="scope.data.data[scope.data.columnname].length > 0">
+                      <el-tag v-for="item in scope.data.data[scope.data.columnname]" :key="item.index" style="margin-right: 5px">{{item}}</el-tag>
+                    </div>
+                    <div v-else>--</div>
+                  </div>
+                  <div v-else-if="scope.data.columnname === 'industry'">
+                    <div v-if="scope.data.data[scope.data.columnname].length > 0">
+                      <el-tag v-for="item in scope.data.data[scope.data.columnname]" :key="item.index" style="margin-right: 5px">{{item}}</el-tag>
+                    </div>
+                    <div v-else>--</div>
+                  </div>
+                  <div v-else>
+                    {{ scope.data.data[scope.data.columnname] || '--' }}
+                  </div>
+                </template>
+              </pageTable>
+            </showIsNone>
+          </el-card>
+        </div>
+        <!--   关联项目     -->
+        <div class="Mproject" style="margin-top:10px">
+          <el-card class="box-card">
+            <div slot="header">
+              <span class="myTitle">关联项目</span>
+              <myRadio :value1="projectParam.content" :value2="projectParam.content.where" key1="dateType" @clickBtn="refreshTable('projectParam','projectRef')"  :btnOptions="[{label:'全部',value:'全部'},{label:'本年',value:'本年'},{label:'本季',value:'本季'},{label:'本月',value:'本月'}]">
+              </myRadio>
+            </div>
+            <myNewCard
+                :list="
+              [
+                {title:'项目数',value:$refs.projectRef && $refs.projectRef.total,bg:'#F3F9FC',color:'#3874F6'},
+                {title:'成交项目数量/金额',
+                value:$refs.projectRef && $refs.projectRef.list[0] && $refs.projectRef.list[0].tradingqty,
+                value3: $refs.projectRef && $refs.projectRef.list[0] && $refs.projectRef.list[0].tradingamount,
+                value4:$refs.projectRef && $refs.projectRef.list[0] && $refs.projectRef.list[0].tradingcjl,
+                value2descript:'成交率',
+                bg:'#E8F7EC',color:'#78B32B'},
+              ]"
+            >
+            </myNewCard>
+            <showIsNone title="项目明细">
+              <pageTable
+                  ref="projectRef"
+                  :tablecols="tool.tabelCol($route.name).projectTable.tablecols"
+                  :param="projectParam"
+                  :custom="true"
+              >
+                <template v-slot:custom="scope">
+                  <div v-if="scope.data.columnname === 'tradingamount'">
+                    {{scope.data.data[scope.data.columnname]?'¥'+tool.formatAmount(scope.data.data[scope.data.columnname],2):'¥0.00'}}
+                  </div>
+                  <div v-else-if="scope.data.columnname === 'signamount_due'">
+                    {{scope.data.data[scope.data.columnname]?'¥'+tool.formatAmount(scope.data.data[scope.data.columnname],2):'¥0.00'}}
+                  </div>
+                  <div v-else>
+                    {{ scope.data.data[scope.data.columnname] || '--' }}
+                  </div>
+                </template>
+              </pageTable>
+            </showIsNone>
+          </el-card>
+        </div>
+        <!--   报价单     -->
+        <div class="Mproject" style="margin-top:10px">
+          <el-card class="box-card">
+            <div slot="header">
+              <span class="myTitle">报价单</span>
+              <myRadio class="inline-16" :value1="quotationParam.content" :value2="quotationParam.content.where" key1="dateType" @clickBtn="refreshTable('quotationParam','quotationRef')"  :btnOptions="[{label:'全部',value:'全部'},{label:'本年',value:'本年'},{label:'本季',value:'本季'},{label:'本月',value:'本月'}]">
+              </myRadio>
+              <el-select v-model="quotationParam.content.where.isproject" placeholder="请选择" @change="refreshTable('quotationParam','quotationRef')" clearable size="small">
+                <el-option label="全部" value=""></el-option>
+                <el-option label="项目报价单" value="1"></el-option>
+                <el-option label="客户报价单" value="0"></el-option>
+              </el-select>
+            </div>
+            <myCard
+                :list="
+              [
+                {title:'报价次数',value:$refs.quotationRef && $refs.quotationRef.total,bg:'#F3F9FC',color:'#3874F6'},
+                {title:'最近报价金额',value:unitCompile($refs.quotationRef && $refs.quotationRef.list[0] && $refs.quotationRef.list[0].sumamount || '0'),bg:'#E8F7EC',color:'#78B32B'},
+                {title:'最近报价时间',value:$refs.quotationRef && $refs.quotationRef.list[0] && $refs.quotationRef.list[0].submitdate || '--',bg:'#F9F2E5',color:'#FF7603'},
+              ]"
+            >
+            </myCard>
+            <showIsNone title="报价单明细">
+              <pageTable
+                  ref="quotationRef"
+                  :tablecols="tool.tabelCol($route.name).quotedPriceTable.tablecols"
+                  :param="quotationParam"
+                  :custom="true"
+              >
+                <template v-slot:custom="scope">
+                  <div v-if="scope.data.columnname === 'sumamount'">
+                    {{scope.data.data[scope.data.columnname]?'¥'+tool.formatAmount(scope.data.data[scope.data.columnname],2):'¥0.00'}}
+                  </div>
+                  <div v-else-if="scope.data.columnname === 'discountrate'">
+                    {{scope.data.data[scope.data.columnname]?Math.round((scope.data.data[scope.data.columnname] * 100)*100)/100 + '%':'--'}}
+                  </div>
+                  <div v-else-if="scope.data.columnname === 'specialoffer'">
+                    {{scope.data.data[scope.data.columnname] == '1'?'是':'否'}}
+                  </div>
+                  <div v-else-if="scope.data.columnname === 'begdate'">
+                    {{scope.data.data.begdate?scope.data.data.begdate +'至' + scope.data.data.enddate:'--'}}
+                  </div>
+                  <div v-else style="text-wrap:wrap;word-wrap: break-word;white-space: normal;">
+                    {{ scope.data.data[scope.data.columnname] || '--' }}
+                  </div>
+                </template>
+              </pageTable>
+            </showIsNone>
+          </el-card>
+        </div>
+        <!--   订单     -->
+        <div class="Mproject" style="margin-top:10px">
+          <el-card class="box-card">
+            <div slot="header">
+              <span class="myTitle">订单</span>
+              <myRadio :value1="orderParam.content" :value2="orderParam.content.where" key1="dateType" @clickBtn="refreshTable('orderParam','orderRef')"  :btnOptions="[{label:'全部',value:'全部'},{label:'本年',value:'本年'},{label:'本季',value:'本季'},{label:'本月',value:'本月'}]">
+              </myRadio>
+              <el-select style="margin-left:24px" v-model="orderParam.content.where.type" clearable size="mini" placeholder="请选择订单类型" @change="refreshTable('orderParam','orderRef')">
+                <el-option label="全部" value=""></el-option>
+                <el-option :label="item.value" :value="item.value" v-for="(item,index) in orderTypeList" :key="index"></el-option>
+              </el-select>
+            </div>
+            <myCard
+                :list="
+              [
+                {title:'订单数量',value:$refs.orderRef && $refs.orderRef.list && $refs.orderRef.list[0] && $refs.orderRef.list[0].allOrderQty,bg:'#F3F9FC',color:'#3874F6'},
+                {title:'订单总金额',value:unitCompile($refs.orderRef && $refs.orderRef.list && $refs.orderRef.list[0] && $refs.orderRef.list[0].allAmount || '0'),bg:'#E8F7EC',color:'#78B32B'},
+                {title:'订单回款金额',value:unitCompile($refs.orderRef && $refs.orderRef.list && $refs.orderRef.list[0] && $refs.orderRef.list[0].cashbillAmount || '0'),bg:'#F9F2E5',color:'#FF7603'},
+                {title:'订单未出货金额',value:unitCompile($refs.orderRef && $refs.orderRef.list && $refs.orderRef.list[0] && $refs.orderRef.list[0].allunAmount || '0'),bg:'#FDF3F3',color:'#E85B5B'},
+                {title:'已出货未开票金额',value:unitCompile($refs.orderRef && $refs.orderRef.list && $refs.orderRef.list[0] && $refs.orderRef.list[0].alluninvoicamount || '0'),bg:'#F9F2E5',color:'#FF7603'},
+                {title:'已开票未回款金额',value:unitCompile($refs.orderRef && $refs.orderRef.list && $refs.orderRef.list[0] && $refs.orderRef.list[0].allunwriteoffamount || '0'),bg:'#FDF3F3',color:'#E85B5B'},
+              ]"
+            >
+            </myCard>
+            <showIsNone title="订单明细">
+              <pageTable
+                  ref="orderRef"
+                  :tablecols="tool.tabelCol($route.name).orderTable.tablecols"
+                  :param="orderParam"
+                  :custom="true"
+              >
+                <template v-slot:custom="scope">
+                  <div v-if="scope.data.columnname == 'amount'">
+                    {{scope.data.data.amount && tool.formatAmount(scope.data.data.amount || 0,2,'¥')  }}
+                  </div>
+                  <div v-else-if="scope.data.columnname == 'writeoffamount'">
+                    {{scope.data.data.writeoffamount?'¥'+tool.formatAmount(scope.data.data.writeoffamount,2):'¥0.00' }}
+                  </div>
+                  <div v-else-if="scope.data.columnname == 'unoutOrderamount'">
+                    {{scope.data.data.unoutOrderamount && tool.formatAmount(scope.data.data.unoutOrderamount || 0,2,'¥')  }}
+                  </div>
+                  <div v-else-if="scope.data.columnname == 'uninvoicamount'">
+                    {{scope.data.data.uninvoicamount && tool.formatAmount(scope.data.data.uninvoicamount || 0,2,'¥')  }}
+                  </div>
+                  <div v-else-if="scope.data.columnname == 'unwriteoffamount'">
+                    {{scope.data.data.unwriteoffamount && tool.formatAmount(scope.data.data.unwriteoffamount || 0,2,'¥')  }}
+                  </div>
+                  <div v-else style="text-wrap:wrap;word-wrap: break-word;white-space: normal;">
+                    {{ scope.data.data[scope.data.columnname] || '--' }}
+                  </div>
+                </template>
+              </pageTable>
+            </showIsNone>
+          </el-card>
+        </div>
       </div>
     </div>
   </el-drawer>
@@ -102,12 +299,12 @@ import myRadio from '@/HDrpManagement/customerPortrait/modules/myRadio'
 import myCard from '@/HDrpManagement/customerPortrait/modules/myCrad'
 import pageTable from '@/HDrpManagement/customerPortrait/modules/pageTable'
 import showIsNone from '@/HDrpManagement/customerPortrait/modules/showIsNone'
-/*import myNewCard from './myNewCrad'*/
+import myNewCard from './myNewCrad'
 import myTag from '@/HDrpManagement/customerPortrait/modules/myTag'
 export default {
   name: "detail",
   props:['data'],
-  components:{myRadio,myCard,pageTable,showIsNone,myTag},
+  components:{myRadio,myCard,pageTable,showIsNone,myTag,myNewCard},
   data(){
     return {
       dialogFormVisible:false,
@@ -115,15 +312,61 @@ export default {
       followParam:{
         "id": 20240605110904,
         "content": {
-          "sys_phonebookid":'',
-          "dateType":"0",
+          "sys_phonebookid":this.$route.query.id,
+          "dateType":"全部",
+          "where":{
+            "begdate":"",
+            "enddate":""
+          }
+        }
+      },
+      customerParam:{
+        "id": 20240605124904,
+        "content": {
+          "sys_phonebookid":this.$route.query.id,
+          "dateType":"全部",// 全部 本年 本季 本月 自定义
           "where":{
             "begdate":"",
             "enddate":""
           }
         }
       },
-      follow:[]
+      projectParam:{
+        "id": 20240605131804,
+        "content": {
+          "sys_phonebookid":this.$route.query.id,
+          "dateType":"全部",// 全部 本年 本季 本月 自定义
+          "where":{
+            "begdate":"",
+            "enddate":""
+          }
+        }
+      },
+      quotationParam:{
+        "id": 20240605133604,
+        "content": {
+          "sys_phonebookid":this.$route.query.id,
+          "dateType":"全部",// 全部 本年 本季 本月 自定义
+          "where":{
+            "begdate":"",
+            "enddate":"",
+            "isproject":""
+          }
+        }
+      },
+      orderParam:{
+        "id": 20240605135904,
+        "content": {
+          "sys_phonebookid":this.$route.query.id,
+          "dateType":"全部",// 全部 本年 本季 本月 自定义
+          "where":{
+            "begdate":"",
+            "enddate":"",
+            "type":""//订单类型
+          }
+        }
+      },
+      orderTypeList:[],
     }
   },
   methods:{
@@ -138,22 +381,28 @@ export default {
       this.detailInfo = res.data[0]
       console.log(this.detailInfo,'detailInfo')
     },
-    /*跟进记录*/
-    async followData(){
-      this.followParam.content.sys_phonebookid = this.$route.query.id
-      const res = await this.$api.requested(this.followParam)
-      console.log(res,'跟进记录')
-    },
     refreshTable(param,el){
-      console.log(param,'param')
-      console.log(this[param],'111')
       this[param].content.pageNumber = 1
+      this[param].content.where.begdate = ''
+      this[param].content.where.enddate = ''
       this.$refs[el] && this.$refs[el].listData()
-    }
+    },
+    async queryType(){
+      const res = await this.$store.dispatch('optiontypeselect','ordertype')
+      this.orderTypeList = res.data
+    },
+    unitCompile (num) {
+      if (num == 0) {
+        return this.tool.formatAmount(num,0,'¥')
+      } else {
+        return this.tool.formatAmount(num / 10000,2,'¥') + '万'
+      }
+    },
   },
   mounted() {
     this.getDetailInfo()
-    this.followData()
+    this.queryType()
+    /*this.followData()*/
   }
 }
 </script>

+ 54 - 0
src/HDrpManagement/contactProfile/modules/myNewCrad.vue

@@ -0,0 +1,54 @@
+<template>
+  <div class="dataInfo">
+    <div :style="[{'background': item.bg}]" class="item" v-for="(item,index) in list" >
+        <div>
+          <p :style="[{'font-size': '14px'}]">{{ item.title }}</p>
+<!--          <p :style="[{'font-size': '14px','marginTop':'10px'}]">{{ item.titleRate }}</p>-->
+          <div style="display:flex;justify-content:space-between">
+            <p v-if="item.value2descript" :style="[{'font-weight': 'bold'},{'font-size':'18px'},{'color':item.color}]">{{ item.value || 0  }}/¥{{item.value3?tool.formatAmount(item.value3,2):0}}</p>
+            <p v-else :style="[{'font-weight': 'bold'},{'font-size':'18px'},{'color':item.color}]">{{ item.value || 0 }}</p>
+            <div style="position: relative;">
+              <span v-if="item.value2descript" style="position:absolute;top:-20px;right:0px;font-size:14px;white-space:nowrap;">{{ item.value2descript }}</span>
+              <p :style="[{'font-size':'16px'},{'color':+item.value2 > 0 ? '#000000' : item.color}]">{{ item.value4 }}</p>
+            </div>
+          </div>
+          <slot v-if="item.custom" :name="item.custom" :data="item"></slot>
+        </div>
+        <el-tooltip effect="dark" :content="item.descript" placement="top">
+          <i v-if="item.descript" style="cursor: pointer;position:absolute;right:10px;top:10px" class="el-icon-warning-outline"></i>
+        </el-tooltip>
+    </div>
+
+  </div>
+</template>
+<script>
+ export default {
+  name:'myCard',
+  props:{
+    list: {
+      type:Array,
+      default:() => []
+    },
+  },
+  data () {
+    return {
+
+    }
+  }
+ }
+</script>
+
+<style scoped>
+.dataInfo {
+  display: flex;
+  flex-wrap:wrap;
+}
+.item {
+  min-width:260px;
+  padding:10px 10px;
+  margin:0 10px 10px 0;
+  position:relative;
+}
+</style>
+
+

+ 35 - 1
src/HDrpManagement/customerPortrait/modules/myRadio.vue

@@ -93,16 +93,44 @@ export default {
           this.value2.begdate = ''
           this.value2.enddate = ''
         }
+      }else if (this.key1 === 'dateType'){
+        if (this.value === '全部'){
+          this.dateData = []
+          this.value2.begdate = ''
+          this.value2.enddate = ''
+        }else if(this.value === '本年') {
+          let year = new Date().getFullYear()
+          let begdate = year + '-01'
+          let enddate = year + '-12'
+          this.dateData = [begdate,enddate]
+          this.value2.begdate = ''
+          this.value2.enddate = ''
+        }else if (this.value === '本季'){
+          const now = new Date();
+          const quarterStartMonth = Math.floor(now.getMonth() / 3) * 3;
+          const quarterStartDate = new Date(now.getFullYear(), quarterStartMonth);
+          const quarterEndDate = new Date(now.getFullYear(), quarterStartMonth + 3);
+          this.dateData = [quarterStartDate,quarterEndDate]
+          this.value2.begdate = ''
+          this.value2.enddate = ''
+        }else if (this.value === '本月'){
+          const now = new Date();
+          const monthStartDate = new Date(now.getFullYear(), now.getMonth());
+          this.dateData = [monthStartDate,monthStartDate]
+          this.value2.begdate = ''
+          this.value2.enddate = ''
+        }
       }
 
       this.$emit('clickBtn',data)
     },
     dateClick(){
+      console.log(this.dateData,'33333')
       if (this.dateData){
         this.active = ''
         this.value2.begdate = this.dateData[0]
         this.value2.enddate = this.dateData[1]
-        this.value1[this.key1] = 99
+        this.value1[this.key1] = this.key1 === 'dateType'?'自定义':99
       }else {
         if (this.key1 === 'isAll'){
           this.value1[this.key1] = 1
@@ -114,6 +142,12 @@ export default {
           this.active = '全部'
           this.value2.begdate = ''
           this.value2.enddate = ''
+        }else if (this.key1 === 'dateType'){
+          console.log('执行了没有111')
+          this.value1[this.key1] = '全部'
+          this.active = '全部'
+          this.value2.begdate = ''
+          this.value2.enddate = ''
         }
       }
       this.$emit('clickBtn')

+ 1 - 2
src/HDrpManagement/customerPortrait/modules/pageTable.vue

@@ -2,7 +2,7 @@
 <template>
   <div>
     <div>
-      <tableLayout :layout="tablecols" :data="list2" :opwidth="200"  :custom="true" :width="false" fixedName="operation" :customHeader="true" :height="tableHeight">
+      <tableLayout :layout="tablecols" :data="list2" :opwidth="200"  :custom="true" :width="true" fixedName="operation" :customHeader="true" :height="tableHeight">
         <template v-slot:header="data">
           <div v-if="data.data.label == '综合折扣'" style="display:flex;align-items:center">
             <span>{{ data.data.label }}</span>
@@ -64,7 +64,6 @@ export default {
       this.list = res.data
       this.list2 = res.data.length && res.data[0].isEmpty ? [] : res.data
       this.total = res.data.length && res.data[0].isEmpty ? 0 : res.total
-      console.log(this.list,'list111')
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);