Преглед изворни кода

画像新增月份区间查询

qymljy пре 1 година
родитељ
комит
c25dc2c8a8

+ 28 - 10
src/HDrpManagement/customerPortrait/modules/detail.vue

@@ -67,7 +67,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">跟进记录</span>
-              <myRadio :value1="param1.content" key1="isAll" @clickBtn="refreshTable('param1','fllow')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param1.content" :value2="param1.content.where" key1="isAll"  @clickBtn="refreshTable('param1','fllow')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
             </div>
             <myCard
@@ -126,7 +126,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">项目</span>
-              <myRadio :value1="param2.content" key1="isAll" @clickBtn="refreshTable('param2','project')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param2.content" :value2="param2.content.where" key1="isAll" @clickBtn="refreshTable('param2','project')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
             </div>
             <myCard
@@ -173,7 +173,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">报价单</span>
-              <myRadio :value1="param3.content" key1="isAll" @clickBtn="refreshTable('param3','baojiadan')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param3.content" :value2="param3.content.where" key1="isAll" @clickBtn="refreshTable('param3','baojiadan')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
             </div>
             <myCard
@@ -215,7 +215,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">合同</span>
-              <myRadio :value1="param4.content" key1="isAll" @clickBtn="refreshTable('param4','hetong')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param4.content" :value2="param4.content.where" key1="isAll" @clickBtn="refreshTable('param4','hetong')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
               <el-select style="margin-left:24px" v-model="param4.content.where.type" clearable size="mini" placeholder="请选择合同类型" @change="typeChange('param4','hetong')">
                 <el-option label="全部" value=""></el-option>
@@ -260,7 +260,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">订单</span>
-              <myRadio :value1="param5.content" key1="isAll" @clickBtn="refreshTable('param5','dingdan')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param5.content" :value2="param5.content.where" key1="isAll" @clickBtn="refreshTable('param5','dingdan')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
               <el-select style="margin-left:24px" v-model="param5.content.where.type" clearable size="mini" placeholder="请选择订单类型" @change="typeChange('param5','dingdan')">
                 <el-option label="全部" value=""></el-option>
@@ -316,7 +316,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">服务</span>
-              <myRadio :value1="param6.content" key1="isAll" @clickBtn="refreshTable('param6','fuwu')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param6.content" :value2="param6.content.where" key1="isAll" @clickBtn="refreshTable('param6','fuwu')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
             </div>
             <myCard
@@ -443,7 +443,11 @@ export default {
             "pageNumber": 1,
             "pageSize": 20,
             "isAll":1,
-            "sa_customersid":this.$route.query.id
+            "sa_customersid":this.$route.query.id,
+          "where":{
+            "begdate":'',
+            "enddate":''
+          }
         }
       },
       //关联项目
@@ -455,7 +459,9 @@ export default {
           "isAll":1,
           "sa_customersid":this.$route.query.id,
           "where":{
-              "stagename":""
+            "stagename":"",
+            "begdate":'',
+            "enddate":''
           }
         }
       },
@@ -467,6 +473,10 @@ export default {
             "pageSize": 20,
             "isAll":1,
             "sa_customersid":this.$route.query.id
+        },
+        "where":{
+          "begdate":'',
+          "enddate":''
         }
       },
       //关联合同
@@ -478,7 +488,9 @@ export default {
           "isAll":1,
           "sa_customersid":this.$route.query.id,
           "where":{
-              "type":""
+            "type":"",
+            "begdate":'',
+            "enddate":''
           }
         }
       },
@@ -491,7 +503,9 @@ export default {
           "isAll":1,
           "sa_customersid":this.$route.query.id,
           "where":{
-              "type":""
+            "type":"",
+            "begdate":'',
+            "enddate":''
           }
         }
       },
@@ -503,6 +517,10 @@ export default {
             "pageSize": 20,
             "isAll":1,
             "sa_customersid":this.$route.query.id
+        },
+        "where":{
+          "begdate":'',
+          "enddate":''
         }
       },
       contractTypeList:[],

+ 84 - 2
src/HDrpManagement/customerPortrait/modules/myRadio.vue

@@ -2,7 +2,20 @@
   <div class="btn-wrapper">
     <div class="btn-box">
       <div :class="['btn-item',active == item.label ? 'active' : '']" v-for="item in btnOptions" @click="itemClick($event,item)" :key="item.value + 'a'">{{ item.label }}</div>
+      <el-date-picker
+          style="margin-left: 10px;width: 200px"
+          v-model="dateData"
+          @change="dateClick"
+          size="mini"
+          format="yyyy-MM"
+          value-format="yyyy-MM"
+          type="monthrange"
+          range-separator="至"
+          start-placeholder="开始月份"
+          end-placeholder="结束月份">
+      </el-date-picker>
     </div>
+
   </div>
 </template>
 
@@ -12,7 +25,8 @@ export default {
   data () {
     return {
       active:this.activeNormal ? this.btnOptions[0].label : '',
-      value:1
+      value:1,
+      dateData:[]
     }
   },
   props: {
@@ -24,6 +38,9 @@ export default {
     value1: {
       type:[Number,String,Object]
     },
+    value2: {
+      type:[Number,String,Object]
+    },
     key1: {
       type:String
     }
@@ -33,9 +50,74 @@ export default {
       this.value = data.value
       this.active = data.label
       this.value1[this.key1] = data.value
+      if (this.key1 === 'isAll'){
+        if (this.value === 1){
+          this.dateData = []
+          this.value2.begdate = ''
+          this.value2.enddate = ''
+        }else if(this.value === 0) {
+          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.key1 === 'type'){
+        if (this.value === 0){
+          this.dateData = []
+          this.value2.begdate = ''
+          this.value2.enddate = ''
+        }else if(this.value === 1) {
+          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 === 2){
+          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 === 3){
+          const now = new Date();
+          const monthStartDate = new Date(now.getFullYear(), now.getMonth());
+       /*   const monthEndDate = new Date(now.getFullYear(), now.getMonth() + 1);*/
+          this.dateData = [monthStartDate,monthStartDate]
+          this.value2.begdate = ''
+          this.value2.enddate = ''
+        }
+      }
+
       this.$emit('clickBtn',data)
+    },
+    dateClick(){
+      console.log(this.dateData,'执行')
+      if (this.dateData){
+        this.active = ''
+        this.value2.begdate = this.dateData[0]
+        this.value2.enddate = this.dateData[1]
+        this.value1[this.key1] = 99
+      }else {
+        if (this.key1 === 'isAll'){
+          this.value1[this.key1] = 1
+          this.active = '全部'
+          this.value2.begdate = ''
+          this.value2.enddate = ''
+        }else if (this.key1 === 'type'){
+          this.value1[this.key1] = 0
+          this.active = '全部'
+          this.value2.begdate = ''
+          this.value2.enddate = ''
+        }
+      }
+      this.$emit('clickBtn')
     }
-  }
+  },
 }
 </script>
 

+ 28 - 14
src/HDrpManagement/projectPortrait/modules/detail.vue

@@ -53,7 +53,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">项目评估</span>
-              <myRadio :value1="param1.content" key1="isAll" @clickBtn="refreshTable('param1','pinggu')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param1.content" :value2="param1.content.where" key1="isAll" @clickBtn="refreshTable('param1','pinggu')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
             </div>
             <myCard
@@ -96,7 +96,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">跟进记录</span>
-              <myRadio :value1="param2.content" key1="isAll" @clickBtn="refreshTable('param2','fllow')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param2.content" :value2="param2.content.where" key1="isAll" @clickBtn="refreshTable('param2','fllow')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
             </div>
             <myCard
@@ -262,7 +262,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">报价单</span>
-              <myRadio :value1="param6.content" key1="isAll" @clickBtn="refreshTable('param6','baojiadan')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param6.content" :value2="param6.content.where" key1="isAll" @clickBtn="refreshTable('param6','baojiadan')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
             </div>
             <myCard
@@ -304,7 +304,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">合同</span>
-              <myRadio :value1="param7.content" key1="isAll" @clickBtn="refreshTable('param7','hetong')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param7.content" :value2="param7.content.where" key1="isAll" @clickBtn="refreshTable('param7','hetong')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
               <el-select style="margin-left:24px" v-model="param7.content.where.type" clearable size="mini" placeholder="请选择合同类型" @change="typeChange('param7','hetong')">
                 <el-option label="全部" value=""></el-option>
@@ -349,7 +349,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">订单</span>
-              <myRadio :value1="param8.content" key1="isAll" @clickBtn="refreshTable('param8','dingdan')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param8.content" :value2="param8.content.where" key1="isAll" @clickBtn="refreshTable('param8','dingdan')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
             </div>
             <myCard
@@ -400,7 +400,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">服务</span>
-              <myRadio :value1="param9.content" key1="isAll" @clickBtn="refreshTable('param9','fuwu')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param9.content" :value2="param9.content.where" key1="isAll" @clickBtn="refreshTable('param9','fuwu')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
               </myRadio>
             </div>
             <myCard
@@ -525,8 +525,12 @@ export default {
             "pageNumber": 1,
             "pageSize": 20,
             "isAll":1,
-            "sa_projectid":this.$route.query.id
-        }
+            "sa_projectid":this.$route.query.id,
+          "where":{
+            "begdate":'',
+            "enddate":''
+          }
+        },
       },
       //跟进记录
       param2: {
@@ -535,8 +539,12 @@ export default {
             "pageNumber": 1,
             "pageSize": 20,
             "isAll":1,
-            "sa_projectid":this.$route.query.id
-        }
+            "sa_projectid":this.$route.query.id,
+          "where":{
+            "begdate":'',
+            "enddate":''
+          }
+        },
       },
       //关联客户
       param3: {
@@ -574,7 +582,9 @@ export default {
           "isAll":1,
           "sa_projectid":this.$route.query.id,
           "where":{
-              "type":""
+            "type":"",
+            "begdate":'',
+            "enddate":''
           }
         }
       },
@@ -587,7 +597,9 @@ export default {
           "isAll":1,
           "sa_projectid":this.$route.query.id,
           "where":{
-              "type":""
+            "type":"",
+            "begdate":'',
+            "enddate":''
           }
         }
       },
@@ -600,7 +612,8 @@ export default {
             "isAll":1,
             "sa_projectid":this.$route.query.id,
             "where": {
-
+              "begdate":'',
+              "enddate":''
             }
         }
       },
@@ -613,7 +626,8 @@ export default {
             "isAll":1,
             "sa_projectid":this.$route.query.id,
             "where": {
-
+              "begdate":'',
+              "enddate":''
             }
         }
       },

+ 62 - 17
src/HDrpManagement/salerPortrait/modules/detail.vue

@@ -39,7 +39,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">业绩</span>
-              <myRadio :value1="param1.content" key1="type" @clickBtn="getPerformance" :btnOptions="[{label:'本年',value:3},{label:'本季',value:2},{label:'本月',value:1}]">
+              <myRadio :value1="param1.content" :value2="param1.content.where" key1="type"  @clickBtn="getPerformance" :btnOptions="[{label:'全部',value:0},{label:'本年',value:1},{label:'本季',value:2},{label:'本月',value:3}]">
               </myRadio>
             </div>
             <myNewCard
@@ -84,7 +84,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">订单</span>
-              <myRadio :value1="param2.content" key1="isAll" @clickBtn="refreshTable('param2','dingdan')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param2.content" :value2="param2.content.where" key1="type" @clickBtn="refreshTable('param2','dingdan')" :btnOptions="[{label:'全部',value:0},{label:'本年',value:1},{label:'本季',value:2},{label:'本月',value:3}]">
               </myRadio>
               <el-select style="margin-left:24px" v-model="param2.content.where.type" clearable size="mini" placeholder="请选择订单类型" @change="typeChange('param2','dingdan')">
                 <el-option label="全部" value=""></el-option>
@@ -153,7 +153,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">销售线索</span>
-              <myRadio :value1="param3.content" key1="type" @clickBtn="refreshTable('param3','xiansuo');param8.content.type=param3.content.type;refreshTable('param8','fllow')" :btnOptions="[{label:'本年',value:3},{label:'本季',value:2},{label:'本月',value:1}]">
+              <myRadio :value1="param3.content" :value2="param3.content.where" key1="type" @clickBtn="refreshTable('param3','xiansuo');param8.content.type=param3.content.type;refreshTable('param8','fllow')" :btnOptions="[{label:'全部',value:0},{label:'本年',value:1},{label:'本季',value:2},{label:'本月',value:3}]">
               </myRadio>
             </div>
             <myCard
@@ -210,7 +210,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">客户</span>
-              <myRadio :value1="param4.content" key1="type" @clickBtn="refreshTable('param4','kehu');param9.content.type=param4.content.type;refreshTable('param9','fllowkehu')" :btnOptions="[{label:'本年',value:3},{label:'本季',value:2},{label:'本月',value:1}]">
+              <myRadio :value1="param4.content" :value2="param4.content.where" key1="type" @clickBtn="refreshTable('param4','kehu');param9.content.type=param4.content.type;refreshTable('param9','fllowkehu')" :btnOptions="[{label:'全部',value:0},{label:'本年',value:1},{label:'本季',value:2},{label:'本月',value:3}]">
               </myRadio>
             </div>
             <myCard
@@ -279,7 +279,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">项目</span>
-              <myRadio :value1="param5.content" key1="type" @clickBtn="refreshTable('param5','project');param10.content.type=param5.content.type;refreshTable('param10','projectfllow')" :btnOptions="[{label:'本年',value:3},{label:'本季',value:2},{label:'本月',value:1}]">
+              <myRadio :value1="param5.content" :value2="param5.content.where"  key1="type" @clickBtn="refreshTable('param5','project');param10.content.type=param5.content.type;refreshTable('param10','projectfllow')" :btnOptions="[{label:'全部',value:0},{label:'本年',value:1},{label:'本季',value:2},{label:'本月',value:3}]">
               </myRadio>
             </div>
             <myCard
@@ -353,7 +353,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">报价单</span>
-              <myRadio :value1="param6.content" key1="isAll" @clickBtn="refreshTable('param6','baojiadan')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param6.content" :value2="param6.content.where" key1="type" @clickBtn="refreshTable('param6','baojiadan')" :btnOptions="[{label:'全部',value:0},{label:'本年',value:1},{label:'本季',value:2},{label:'本月',value:3}]">
               </myRadio>
             </div>
             <myCard
@@ -396,7 +396,7 @@
           <el-card class="box-card">
             <div slot="header">
               <span class="myTitle">合同</span>
-              <myRadio :value1="param7.content" key1="isAll" @clickBtn="refreshTable('param7','hetong')" :btnOptions="[{label:'全部',value:1},{label:'本年',value:0}]">
+              <myRadio :value1="param7.content" :value2="param7.content.where" key1="type" @clickBtn="refreshTable('param7','hetong')" :btnOptions="[{label:'全部',value:0},{label:'本年',value:1},{label:'本季',value:2},{label:'本月',value:3}]">
               </myRadio>
               <el-select style="margin-left:24px" v-model="param7.content.where.type" clearable size="mini" placeholder="请选择合同类型" @change="typeChange('param7','hetong')">
                 <el-option label="全部" value=""></el-option>
@@ -463,7 +463,11 @@ export default {
         "id": 20230717100404,
         "content": {
             "type":3,
-            "hrid":this.$route.query.id
+            "hrid":this.$route.query.id,
+          "where":{
+            "begdate":'',
+            "enddate":''
+          }
         }
       },
       //订单
@@ -472,10 +476,12 @@ export default {
         "content": {
             "pageNumber": 1,
             "pageSize": 20,
-            "isAll":1,
+            "type":1,
             "hrid":this.$route.query.id,
             "where": {
-              "type":''
+              "type":'',
+              "begdate":'',
+              "enddate":''
             },
           "sort":[{
             "reversed": 1,//1降序,0升序
@@ -492,6 +498,10 @@ export default {
           "pageSize": 20,
           "type":3,
           "hrid":this.$route.query.id,
+          "where":{
+            "begdate":'',
+            "enddate":''
+          }
         }
       },
       //线索跟进
@@ -502,7 +512,12 @@ export default {
           "pageSize": 20,
           "type":3,
           "hrid":this.$route.query.id,
-        }
+          "where":{
+            "begdate":'',
+            "enddate":''
+          }
+        },
+
       },
       //客户
       param4: {
@@ -512,6 +527,10 @@ export default {
           "pageSize": 20,
           "type":3,
           "hrid":this.$route.query.id,
+          "where":{
+            "begdate":'',
+            "enddate":''
+          }
         }
       },
       //客户跟进
@@ -522,6 +541,10 @@ export default {
           "pageSize": 20,
           "type":3,
           "hrid":this.$route.query.id,
+          "where":{
+            "begdate":'',
+            "enddate":''
+          }
         }
       },
       //项目
@@ -531,7 +554,11 @@ export default {
             "pageNumber": 1,
             "pageSize": 20,
             "type":3,
-            "hrid":this.$route.query.id
+            "hrid":this.$route.query.id,
+          "where":{
+            "begdate":'',
+            "enddate":''
+          }
         }
       },
       //项目跟进
@@ -541,7 +568,11 @@ export default {
             "pageNumber": 1,
             "pageSize": 20,
             "type":3,
-            "hrid":this.$route.query.id
+            "hrid":this.$route.query.id,
+          "where":{
+            "begdate":'',
+            "enddate":''
+          }
         }
       },
       //报价单
@@ -550,10 +581,12 @@ export default {
         "content": {
           "pageNumber": 1,
           "pageSize": 20,
-          "isAll":1,
+          "type":1,
           "hrid":this.$route.query.id,
           "where":{
-              "type":""
+            "type":"",
+            "begdate":'',
+            "enddate":''
           }
         }
       },
@@ -563,10 +596,12 @@ export default {
         "content": {
           "pageNumber": 1,
           "pageSize": 20,
-          "isAll":1,
+          "type":1,
           "hrid":this.$route.query.id,
           "where":{
-              "type":""
+            "type":"",
+            "begdate":'',
+            "enddate":''
           }
         }
       },
@@ -617,6 +652,16 @@ export default {
       this.stageList = res3.data
     },
     refreshTable (param,el) {
+      if (param === 'param8'){
+        this.param8.content.where.begdate = this.param3.content.where.begdate
+        this.param8.content.where.enddate = this.param3.content.where.enddate
+      }else if (param === 'param9'){
+        this.param9.content.where.begdate = this.param4.content.where.begdate
+        this.param9.content.where.enddate = this.param4.content.where.enddate
+      }else if (param === 'param10'){
+        this.param10.content.where.begdate = this.param5.content.where.begdate
+        this.param10.content.where.enddate = this.param5.content.where.enddate
+      }
       this[param].content.pageNumber = 1
       this.$refs[el] && this.$refs[el].listData()
     },