Procházet zdrojové kódy

数据看板样式调整

qymljy před 1 rokem
rodič
revize
93fd8902c4

+ 2 - 6
src/HDrpManagement/dataanalysis/components/quickDate.vue

@@ -58,7 +58,7 @@ export default {
       }else {
         this.select = ''
       }
-      this.$emit('selectQuick',this.begindate,this.enddate)
+      this.$emit('selectQuick',this.begindate,this.enddate,this.select)
     },
     getMonday(type, dates) {
       var now = new Date()
@@ -131,12 +131,8 @@ export default {
         this.select = ''
         this.begindate = this.value[0]
         this.enddate = this.value[1]
-      }else {
-        this.select = '周'
-        this.getMonday('s')
-        this.getMonday('e')
       }
-      this.$emit('selectQuick',this.begindate,this.enddate)
+      this.$emit('selectQuick',this.begindate,this.enddate,this.select)
     }
   }
 }

+ 147 - 0
src/HDrpManagement/dataanalysis/components/quickDateCopy.vue

@@ -0,0 +1,147 @@
+<template>
+  <div style="float: right">
+    <el-button-group size="small" class="inline-24">
+      <el-button :type="select === '日'?'primary':''" size="small" @click="selectQuick(1)">日</el-button>
+      <el-button :type="select === '周'?'primary':''" size="small" @click="selectQuick(2)">周</el-button>
+      <el-button :type="select === '月'?'primary':''" size="small" @click="selectQuick(3)">月</el-button>
+      <el-button :type="select === '年'?'primary':''" size="small" @click="selectQuick(4)">年</el-button>
+    </el-button-group>
+    <span style="font-size: 13px">时间:</span>
+    <el-date-picker
+        value-format="yyyy-MM-dd"
+        @change="selectDate"
+        size="small"
+        v-model="value"
+        type="daterange"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期">
+    </el-date-picker>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "quickDate",
+  data(){
+    return {
+      select:'周',
+      value:'',
+      begindate:'',
+      enddate:''
+    }
+  },
+  methods:{
+    selectQuick(val){
+      this.value = ''
+      this.begindate = ''
+      this.enddate = ''
+      if (val === 1){
+        this.select = '日'
+        var year = new Date().getFullYear()
+        var month = new Date().getMonth()+1;
+        var day = new Date().getDate();
+        this.begindate = year + '-' + month + '-' + day
+        this.enddate = year + '-' + month + '-' + day
+      }else if (val === 2){
+        this.select = '周'
+        this.getMonday('s')
+        this.getMonday('e')
+      }else if (val === 3){
+        this.select = '月'
+        this.getMonth('s')
+        this.getMonth('e')
+      }else if (val === 4){
+        this.select = '年'
+        this.getYear('s')
+        this.getYear('e')
+      }else {
+        this.select = ''
+      }
+      this.$emit('selectQuick',this.begindate,this.enddate)
+    },
+    getMonday(type, dates) {
+      var now = new Date()
+      var nowTime = now.getTime()
+      var day = now.getDay()
+      var longTime = 24 * 60 * 60 * 1000
+      var n = longTime * 7 * (dates || 0)
+      if (type == "s") {
+        var dd = nowTime - (day - 1) * longTime + n
+      }
+      if (type == "e") {
+        var dd = nowTime + (7 - day) * longTime + n
+      }
+      dd = new Date(dd)
+      var y = dd.getFullYear()
+      var m = dd.getMonth() + 1
+      var d = dd.getDate();
+      m = m < 10 ? "0" + m: m
+      d = d < 10 ? "0" + d: d
+      var day = y + "-" + m + "-" + d
+      type == 's'?this.begindate = day : this.enddate = day
+    },
+    getMonth(type, months) {
+      var d = new Date();
+      var year = d.getFullYear()
+      var month = d.getMonth() + 1
+      month = month < 10 ? "0" + month: month
+      var date = d.getDate();
+      var firstday = year + "-" + month + "-" + "01"
+      var lastday = ""
+      if (month == "01" || month == "03" || month == "05" || month == "07" || month == "08" || month == "10" || month == "12") {
+        lastday = year + "-" + month + "-" + 31
+      } else if (month == "02") {
+        if ((year % 4 == 0 && year % 100 != 0) || (year % 100 == 0 && year % 400 == 0)) {
+          lastday = year + "-" + month + "-" + 29
+        } else {
+          lastday = year + "-" + month + "-" + 28
+        }
+      } else {
+        lastday = year + "-" + month + "-" + 30
+      }
+      var day = ""
+      if (type == "s") {
+        day = firstday
+        this.begindate = firstday
+      } else {
+        day = lastday
+        this.enddate = lastday
+      }
+    },
+    getYear(type, dates) {
+      var dd = new Date()
+      var n = dates || 0
+      var year = dd.getFullYear() + Number(n)
+      if (type == "s") {
+        var day = year + "-01-01"
+      }
+      if (type == "e") {
+        var day = year + "-12-31"
+      }
+      if (!type) {
+        var day = year + "-01-01/" + year + "-12-31"
+      }
+      type == 's'?this.begindate = day : this.enddate = day
+    },
+    selectDate(){
+      this.begindate = ''
+      this.enddate = ''
+      if (this.value){
+        this.select = ''
+        this.begindate = this.value[0]
+        this.enddate = this.value[1]
+      }else {
+        this.select = '周'
+        this.getMonday('s')
+        this.getMonday('e')
+      }
+      this.$emit('selectQuick',this.begindate,this.enddate)
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 4 - 3
src/HDrpManagement/dataanalysis/index.vue

@@ -20,8 +20,8 @@
             </el-option>
           </el-select>
         </div>
-        <el-scrollbar >
-          <div style="margin: auto;height: calc(100vh)">
+
+          <div style="margin: auto;">
             <div class="content" >
               作业数据
               <assignmentData ref="assignment" style="padding: 16px 2px 0px 2px" :param="dataParam" :isDep="isDep" :dataid="dataid" :isPerson="isPerson"></assignmentData>
@@ -49,7 +49,7 @@
               </el-tab-pane>
             </el-tabs>
           </div>
-        </el-scrollbar>
+
 
       </div>
 
@@ -104,6 +104,7 @@ export default {
           "dataType":"",//1 线索新增列表 2 线索更新列表 3 线索跟进列表4 客户新增列表 5 客户更新列表 6 客户跟进列表 7 项目新增列表8 项目更新列表 9 项目跟进列表 10 报价单列表 11 合同列表
           "type":'',//0 按人搜素 1 按部门搜索
           "dataid":"",// 人员id或部门id
+          "dateType":'',
           "where":{
             "begindate":"",
             "enddate":""

+ 17 - 10
src/HDrpManagement/dataanalysis/modules/clue.vue

@@ -107,7 +107,8 @@ export default {
       currentPageFollow:0,
       totalFollow:0,
       begindate:'',
-      enddate:''
+      enddate:'',
+      select:'周'
     }
   },
   methods:{
@@ -115,8 +116,9 @@ export default {
      /* this.isDep ? this.param.content.type = 1: this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
       this.param.content.dataType = 1
      /* this.param.content.dataid = this.dataid*/
-      this.param.content.where.begindate = this.begindate
-      this.param.content.where.enddate = this.enddate
+      this.param.content.where.begindate = this.select ? '' :this.begindate
+      this.param.content.where.enddate = this.select ? '' : this.enddate
+      this.param.content.dateType = this.select
       const res = await this.$api.requested(this.param)
       this.listAdd = res.data
       this.currentPageAdd = res.pageNumber
@@ -136,8 +138,9 @@ export default {
      /* this.isDep ? this.param.content.type = 1: this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
       this.param.content.dataType = 2
      /* this.param.content.dataid = this.dataid*/
-      this.param.content.where.begindate = this.begindate
-      this.param.content.where.enddate = this.enddate
+      this.param.content.where.begindate = this.select ? '' :this.begindate
+      this.param.content.where.enddate = this.select ? '' : this.enddate
+      this.param.content.dateType = this.select
       const res = await this.$api.requested(this.param)
       this.listUpdate = res.data
       this.currentPageUpdate = res.pageNumber
@@ -157,8 +160,9 @@ export default {
      /* this.isDep ? this.param.content.type = 1: this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
       this.param.content.dataType = 3
       /*this.param.content.dataid = this.dataid*/
-      this.param.content.where.begindate = this.begindate
-      this.param.content.where.enddate = this.enddate
+      this.param.content.where.begindate = this.select ? '' :this.begindate
+      this.param.content.where.enddate = this.select ? '' : this.enddate
+      this.param.content.dateType = this.select
       const res = await this.$api.requested(this.param)
       this.listFollow = res.data
       this.currentPageFollow = res.pageNumber
@@ -175,19 +179,22 @@ export default {
       this.queryFollow()
     },
     /*日期筛选*/
-    selectQuickAdd(begindate,enddate){
+    selectQuickAdd(begindate,enddate,select){
       this.begindate = begindate
       this.enddate = enddate
+      this.select = select
       this.queryAdd(this.param.content.pageNumber = 1)
     },
-    selectQuickUpd(begindate,enddate){
+    selectQuickUpd(begindate,enddate,select){
       this.begindate = begindate
       this.enddate = enddate
+      this.select = select
       this.queryUpdate(this.param.content.pageNumber = 1)
     },
-    selectQuickFow(begindate,enddate){
+    selectQuickFow(begindate,enddate,select){
       this.begindate = begindate
       this.enddate = enddate
+      this.select = select
       this.queryFollow(this.param.content.pageNumber = 1)
     }
   },

+ 17 - 10
src/HDrpManagement/dataanalysis/modules/customer.vue

@@ -119,7 +119,8 @@ export default {
       currentPageFollow:0,
       totalFollow:0,
       begindate:'',
-      enddate:''
+      enddate:'',
+      select:'周'
     }
   },
   methods:{
@@ -127,8 +128,9 @@ export default {
       /*this.isDep ? this.param.content.type = 1: this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
       this.param.content.dataType = 4
     /*  this.param.content.dataid = this.dataid*/
-      this.param.content.where.begindate = this.begindate
-      this.param.content.where.enddate = this.enddate
+      this.param.content.where.begindate = this.select ? '' :this.begindate
+      this.param.content.where.enddate = this.select ? '' : this.enddate
+      this.param.content.dateType = this.select
       const res = await this.$api.requested(this.param)
       this.listAdd = res.data
       this.currentPageAdd = res.pageNumber
@@ -148,8 +150,9 @@ export default {
      /* this.isDep ? this.param.content.type = 1: this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
       this.param.content.dataType = 5
       /*this.param.content.dataid = this.dataid*/
-      this.param.content.where.begindate = this.begindate
-      this.param.content.where.enddate = this.enddate
+      this.param.content.where.begindate = this.select ? '' :this.begindate
+      this.param.content.where.enddate = this.select ? '' : this.enddate
+      this.param.content.dateType = this.select
       const res = await this.$api.requested(this.param)
       this.listUpdate = res.data
       this.currentPageUpdate = res.pageNumber
@@ -169,8 +172,9 @@ export default {
      /* this.isDep ? this.param.content.type = 1: this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
       this.param.content.dataType = 6
      /* this.param.content.dataid = this.dataid*/
-      this.param.content.where.begindate = this.begindate
-      this.param.content.where.enddate = this.enddate
+      this.param.content.where.begindate = this.select ? '' :this.begindate
+      this.param.content.where.enddate = this.select ? '' : this.enddate
+      this.param.content.dateType = this.select
       const res = await this.$api.requested(this.param)
       this.listFollow = res.data
       this.currentPageFollow = res.pageNumber
@@ -187,19 +191,22 @@ export default {
       this.queryFollow()
     },
     /*日期筛选*/
-    selectQuickAdd(begindate,enddate){
+    selectQuickAdd(begindate,enddate,select){
       this.begindate = begindate
       this.enddate = enddate
+      this.select = select
       this.queryAdd(this.param.content.pageNumber = 1)
     },
-    selectQuickUpd(begindate,enddate){
+    selectQuickUpd(begindate,enddate,select){
       this.begindate = begindate
       this.enddate = enddate
+      this.select = select
       this.queryUpdate(this.param.content.pageNumber = 1)
     },
-    selectQuickFow(begindate,enddate){
+    selectQuickFow(begindate,enddate,select){
       this.begindate = begindate
       this.enddate = enddate
+      this.select = select
       this.queryFollow(this.param.content.pageNumber = 1)
     }
   },

+ 26 - 9
src/HDrpManagement/dataanalysis/modules/documents.vue

@@ -12,7 +12,13 @@
         </el-row>
         <tableLayout style="margin-top: 10px" :layout="quotationTablecols" :data="quotationList" :opwidth="200" :custom="true" :height="tableHeight">
           <template v-slot:customcol="scope">
-            <p>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
+            <div v-if="scope.column.columnname === 'status'">
+              <span style="color:#3874f6" v-if="scope.column.data[[scope.column.columnname]] == '新建'">{{scope.column.data[[scope.column.columnname]]}}</span>
+              <span style="color:#52c41a" v-else-if="scope.column.data[[scope.column.columnname]] == '提交'">{{scope.column.data[[scope.column.columnname]]}}</span>
+              <span style="color:#333333" v-else-if="scope.column.data[[scope.column.columnname]] == '审核'">{{scope.column.data[[scope.column.columnname]]}}</span>
+              <span style="color:#fa8c16" v-else-if="scope.column.data[[scope.column.columnname]] == '复核'">{{scope.column.data[[scope.column.columnname]]}}</span>
+            </div>
+            <p v-else>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
           </template>
         </tableLayout>
         <div class="container normal-panel" style="text-align:right">
@@ -37,7 +43,13 @@
         </el-row>
         <tableLayout style="margin-top: 10px" :layout="contractTablecols" :data="contractList" :opwidth="200" :custom="true" :height="tableHeight">
           <template v-slot:customcol="scope">
-            <p>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
+            <div v-if="scope.column.columnname == 'status'">
+              <span style="color:#3874f6" v-if="scope.column.data[[scope.column.columnname]] == '新建'">{{scope.column.data[[scope.column.columnname]]}}</span>
+              <span style="color:#52c41a" v-else-if="scope.column.data[[scope.column.columnname]] == '已提交'">{{scope.column.data[[scope.column.columnname]]}}</span>
+              <span style="color:#333333" v-else-if="scope.column.data[[scope.column.columnname]] == '审核'">{{scope.column.data[[scope.column.columnname]]}}</span>
+              <span style="color:#000000" v-else>{{scope.column.data[[scope.column.columnname]]}}</span>
+            </div>
+            <p v-else>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
           </template>
         </tableLayout>
         <div class="container normal-panel" style="text-align:right">
@@ -77,7 +89,8 @@ export default {
       contractCurrentPage:0,
       contractTotal:0,
       begindate:'',
-      enddate:''
+      enddate:'',
+      select:''
     }
   },
   methods: {
@@ -85,8 +98,9 @@ export default {
      /* this.isDep ? this.param.content.type = 1 : this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
       this.param.content.dataType = 10
     /*  this.param.content.dataid = this.dataid*/
-      this.param.content.where.begindate = this.begindate
-      this.param.content.where.enddate = this.enddate
+      this.param.content.where.begindate = this.select ? '' :this.begindate
+      this.param.content.where.enddate = this.select ? '' : this.enddate
+      this.param.content.dateType = this.select
       const res = await this.$api.requested(this.param)
       this.quotationList = res.data
       this.quotationCurrentPage = res.pageNumber
@@ -106,8 +120,9 @@ export default {
      /* this.isDep ? this.param.content.type = 1 : this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
       this.param.content.dataType = 11
      /* this.param.content.dataid = this.dataid*/
-      this.param.content.where.begindate = this.begindate
-      this.param.content.where.enddate = this.enddate
+      this.param.content.where.begindate = this.select ? '' :this.begindate
+      this.param.content.where.enddate = this.select ? '' : this.enddate
+      this.param.content.dateType = this.select
       const res = await this.$api.requested(this.param)
       this.contractList = res.data
       this.contractCurrentPage = res.pageNumber
@@ -124,14 +139,16 @@ export default {
       this.queryContract()
     },
     /*日期筛选*/
-    selectQuickQuotation(begindate,enddate){
+    selectQuickQuotation(begindate,enddate,select){
       this.begindate = begindate
       this.enddate = enddate
+      this.select = select
       this.queryQuotation(this.param.content.pageNumber = 1)
     },
-    selectQuickContract(begindate,enddate){
+    selectQuickContract(begindate,enddate,select){
       this.begindate = begindate
       this.enddate = enddate
+      this.select = select
       this.queryContract(this.param.content.pageNumber = 1)
     },
   },

+ 17 - 10
src/HDrpManagement/dataanalysis/modules/project.vue

@@ -119,7 +119,8 @@ export default {
       currentPageFollow:0,
       totalFollow:0,
       begindate:'',
-      enddate:''
+      enddate:'',
+      select:'周'
     }
   },
   methods:{
@@ -127,8 +128,9 @@ export default {
    /*   this.isDep ? this.param.content.type = 1: this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
       this.param.content.dataType = 7
      /* this.param.content.dataid = this.dataid*/
-      this.param.content.where.begindate = this.begindate
-      this.param.content.where.enddate = this.enddate
+      this.param.content.where.begindate = this.select ? '' :this.begindate
+      this.param.content.where.enddate = this.select ? '' : this.enddate
+      this.param.content.dateType = this.select
       const res = await this.$api.requested(this.param)
       this.listAdd = res.data
       this.currentPageAdd = res.pageNumber
@@ -148,8 +150,9 @@ export default {
      /* this.isDep ? this.param.content.type = 1: this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
       this.param.content.dataType = 8
      /* this.param.content.dataid = this.dataid*/
-      this.param.content.where.begindate = this.begindate
-      this.param.content.where.enddate = this.enddate
+      this.param.content.where.begindate = this.select ? '' :this.begindate
+      this.param.content.where.enddate = this.select ? '' : this.enddate
+      this.param.content.dateType = this.select
       const res = await this.$api.requested(this.param)
       this.listUpdate = res.data
       this.currentPageUpdate = res.pageNumber
@@ -169,8 +172,9 @@ export default {
    /*   this.isDep ? this.param.content.type = 1: this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
       this.param.content.dataType = 9
      /* this.param.content.dataid = this.dataid*/
-      this.param.content.where.begindate = this.begindate
-      this.param.content.where.enddate = this.enddate
+      this.param.content.where.begindate = this.select ? '' :this.begindate
+      this.param.content.where.enddate = this.select ? '' : this.enddate
+      this.param.content.dateType = this.select
       const res = await this.$api.requested(this.param)
       this.listFollow = res.data
       this.currentPageFollow = res.pageNumber
@@ -187,19 +191,22 @@ export default {
       this.queryFollow()
     },
     /*日期筛选*/
-    selectQuickAdd(begindate,enddate){
+    selectQuickAdd(begindate,enddate,select){
       this.begindate = begindate
       this.enddate = enddate
+      this.select = select
       this.queryAdd(this.param.content.pageNumber = 1)
     },
-    selectQuickUpd(begindate,enddate){
+    selectQuickUpd(begindate,enddate,select){
       this.begindate = begindate
       this.enddate = enddate
+      this.select = select
       this.queryUpdate(this.param.content.pageNumber = 1)
     },
-    selectQuickFow(begindate,enddate){
+    selectQuickFow(begindate,enddate,select){
       this.begindate = begindate
       this.enddate = enddate
+      this.select = select
       this.queryFollow(this.param.content.pageNumber = 1)
     }
   },

+ 6 - 2
src/components/table/index6.vue

@@ -2,13 +2,13 @@
   <div>
     <!-- :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%;" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
+              style="width:100%;" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}" tooltip-effect="dark"
               :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange" >
       <el-table-column
           type="selection"
           width="35" fixed v-if="checkbox">
       </el-table-column>
-      <el-table-column v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title"  :width="col.width" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?'right':false : false">
+      <el-table-column  v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title"  :width="col.width" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?'right':false : false">
         <template :slot="headerOptions ? headerOptions.includes(col.columnname) ? 'header' : '' : ''" slot-scope="scope">
           <slot name="header" :column="{data:scope.row,columnname:col.columnname}"></slot>
         </template>
@@ -67,4 +67,8 @@ export default {
 
 </script>
 <style>
+.el-tooltip__popper {
+  max-width: 90%;
+}
+
 </style>