Browse Source

数据看板样式调整

qymljy 2 years ago
parent
commit
99aa33a0dc

+ 4 - 0
src/HDrpManagement/customerData/index.vue

@@ -1860,9 +1860,13 @@ export default {
 }
 .data-all .data-left {
   border-right: 1rem solid rgb(136,136,146);
+  display: flex;
+  flex-wrap: wrap;
 }
 .data-all .data-right {
   padding-left: 50rem;
+  display: flex;
+  flex-wrap: wrap;
 }
 .data-all .data-left,.data-right {
   display: flex;

+ 1 - 1
src/HDrpManagement/projectData/index.vue

@@ -43,7 +43,7 @@
                     </p>
                   </div>
                   <div class="data-item">
-                    <p>{{ tool.formatAmount(dataAll.startproject) }}</p>
+                    <p>{{ dataAll.startproject?tool.formatAmount(dataAll.startproject):0 }}</p>
                     <p>
                       进行中项目数
                       <el-tooltip class="item" effect="dark" content="参与项目客户数:参与有下订单的项目的关联客户数" placement="top">

+ 15 - 3
src/HManagement/marketing2/agent/index.vue

@@ -16,7 +16,8 @@
         :isExport="false"
         @listCreate="list">
         <div slot="titleRight">
-          <importFile
+          <exportFile :param="param" :columns="tablecols" fileName="合作伙伴档案"></exportFile>
+<!--          <importFile
             ref="importFile"
             class="inline-16"
             :bindData="{ownertable:'sa_agents',ownerid:$route.query.id,usetype:'default'}"
@@ -24,7 +25,7 @@
             @clearUrl="errorUrl = null"
             @onSuccess="bindImportOrder"
             v-if="tool.checkAuth($route.name,'export')"
-          ></importFile>
+          ></importFile>-->
         </div>
         <template #custom>
           <div class="mt-10">
@@ -130,6 +131,8 @@ import editArea from './area/modules/edit_area'
 import startArea from './area/modules/start_area'
 import delArea from './area/modules/del_area'
 import importFile from './importFile.vue'
+
+import exportFile from '@/components/export_file/index'
 import { log } from '@antv/g2plot/lib/utils'
 
 export default {
@@ -139,7 +142,8 @@ export default {
     editArea,
     delArea,
     startArea,
-    importFile
+    importFile,
+    exportFile
   },
   data () {
     return {
@@ -159,6 +163,8 @@ export default {
           label:'意向'
         },
       ],
+      tablecols:[],
+      param:{}
     }
   },
   provide () {
@@ -169,6 +175,7 @@ export default {
   created () {
     this.userstatus()
     this.queryType()
+    this.tablecols = this.tool.tabelCol(this.$route.name).agentTable.tablecols
   },
   methods:{
     async userstatus() {
@@ -196,6 +203,7 @@ export default {
         this.errorUrl = res.data
       }
       this.tool.showMessage(res,() => {
+        this.param = this.$refs.basicLayout.param
         this.$refs.basicLayout.listData()
       })
     },
@@ -204,6 +212,7 @@ export default {
       this.$refs['basicLayout'].param.content.where.type = this.type
       this.$refs['basicLayout'].param.content.where.cooperationstatus = this.cooperations
        this.$refs['basicLayout'].param.content.pageNumber = 1
+      this.param = this.$refs.basicLayout.param
       this.$refs['basicLayout'].listData()
     },
     onClick (data) {
@@ -213,6 +222,7 @@ export default {
         this.$refs['basicLayout'].param.content.isAll = 1
         this.$refs['basicLayout'].param.content.sa_saleareaids = []
         this.$refs['basicLayout'].param.content.containssub = 1
+        this.param = this.$refs.basicLayout.param
         this.$refs['basicLayout'].listData()
       } else {
         this.areaInfo = data
@@ -220,6 +230,7 @@ export default {
         this.$refs['basicLayout'].param.content.sa_saleareaids = [data.sa_saleareaid]
         this.$refs['basicLayout'].param.content.containssub = 1
         this.$refs['basicLayout'].param.content.isAll = 0
+        this.param = this.$refs.basicLayout.param
         this.$refs['basicLayout'].listData()
         this.$store.dispatch('sendDataToForm',data)
       }
@@ -243,6 +254,7 @@ export default {
     },
     list(param) {
       param.content.isAll = 0
+      this.param = param
     },
     /*合作伙伴类型*/
     async queryType(){

+ 9 - 2
src/SDrpManagement/salerPrivatecustomer/index.vue

@@ -12,7 +12,8 @@
       :detailPath="{path:'/customerDetail',param:{tabIndex:tabIndex,portrait:''}}"
      >
       <template #titleRight>
-        <el-button type="primary" size="small" @click="onExport" plain>导 出</el-button>
+<!--        <el-button type="primary" size="small" @click="onExport" plain>导 出</el-button>-->
+        <exportFile :param="param" :columns="tablecols" fileName="我的客户"></exportFile>
       </template>
       <template #custom>
         <div class="mt-10">
@@ -177,8 +178,10 @@
 </template>
 
 <script>
+import exportFile from '@/components/export_file/index1'
 export default {
   name: "index",
+  components:{exportFile},
   data() {
     return {
       value:'',
@@ -189,6 +192,7 @@ export default {
       tabIndex:"1",
       options:[],
       listData:[],
+      tablecols:[],
       option:{
         typeData:[],
         customerClassification:[],
@@ -238,7 +242,8 @@ export default {
       },
       depment:'',
       deplist:[],
-      dateSelect:''
+      dateSelect:'',
+      param:{}
     }
   },
   mounted() {
@@ -260,6 +265,7 @@ export default {
       this.$refs.list.param.content.deleted = 0
       this.$refs.list.param.content.isend = 0
       this.$refs.list.param.content.nocache = true
+      this.param = this.$refs.list.param
       this.$refs['list'].listData()
       // this.$store.dispatch('sendDataToForm',)
     },
@@ -485,6 +491,7 @@ export default {
     this.queryUserInfo()
     this.querytemplet()
     this.departmentrtment()
+    this.tablecols = this.tool.tabelCol(this.$route.name).salerPrivatecustomerTable.tablecols
   },
 }
 </script>

+ 51 - 0
src/components/export_file/index1.vue

@@ -0,0 +1,51 @@
+<template>
+  <el-button type="primary" size="small" @click="exportData" plain>导 出</el-button>
+</template>
+
+<script>
+export default {
+  props:['param','type','columns','columnsIndex','fileName','dataid'],
+  data(){
+    return{
+      columnsData:[]
+    }
+  },
+  methods:{
+    async exportData(){
+      let rs = []
+      this.columnsData = JSON.parse(JSON.stringify(this.columns))
+      if (this.columnsData) {
+        this.columns.filter(p=>{
+          rs.push({
+            fieldlabel:p.title,
+            fieldname:p.columnname
+          })
+        })
+      }
+      this.param.content.dataid = this.dataid
+      /*this.param.content.exportFields = rs*/
+      this.param.content.isExport = 1
+      /*导出数据*/
+      const res = await this.$api.requested(this.param)
+      this.downFile(res.data,this.fileName)
+      this.param.content.isExport = 0
+    },
+    downFile(url, fileName) {
+      console.log(url,'url')
+      const x = new XMLHttpRequest()
+      x.open('GET', url, true)
+      x.responseType = 'blob'
+      x.onload = function() {
+        const url = window.URL.createObjectURL(x.response)
+        const a = document.createElement('a')
+        a.href = url
+        a.download = fileName
+        a.click()
+      }
+      x.send()
+    }
+  }
+}
+</script>
+<style>
+</style>

+ 26 - 3
src/views/clueData/modules/clueAdd.vue

@@ -59,7 +59,8 @@ export default {
       histogram:[],
       lineChart:[],
       heightChart:'100%',
-      isFull:false
+      isFull:false,
+      newHistogram:[]
     }
   },
   methods:{
@@ -71,6 +72,22 @@ export default {
       this.param.content.enddate = this.enddate
       const res = await this.$api.requested(this.param)
       this.histogram = res.data.histogram
+      let lastYear = []
+      let nowYear = []
+      let k=0
+      for (var i=0;i<this.histogram.length;i++){
+        if (this.histogram[i].type === '去年同期新增'){
+          lastYear[k]=this.histogram[i]
+          k++
+        }
+      }
+      let x=0
+      for (var i=0;i<this.histogram.length;i++){
+        if (this.histogram[i].type === '本期新增'){
+          nowYear[x]=this.histogram[i]
+          x++
+        }
+      }
       this.lineChart = res.data.lineChart.map(item=>{
         return {
           date: item.date,
@@ -78,11 +95,12 @@ export default {
           value: item.value
         }
       })
-      this.chartDualAxes.changeData([this.histogram,this.lineChart])
+      this.newHistogram = lastYear.concat(nowYear)
+      this.chartDualAxes.changeData([this.newHistogram,this.lineChart])
     },
     renderPie(val){
       this.chartDualAxes = new DualAxes('clueAddAnalysisChart', {
-        data:[this.histogram,this.lineChart],
+        data:[this.newHistogram,this.lineChart],
         xField: 'date',
         yField: ['value','value'],
         seriesField: 'type',
@@ -91,10 +109,15 @@ export default {
             geometry: 'column',
             isGroup: true,
             seriesField: 'type',
+            color:['#62daab','#6395fa'],
+            label: {
+              position:top
+            },
           },
           {
             geometry: 'line',
             seriesField: 'type',
+            color: '#657798',
             lineStyle: {
               lineWidth: 2,
             },

+ 29 - 3
src/views/clueData/modules/clueFollow.vue

@@ -60,7 +60,8 @@ export default {
       histogram:[],
       lineChart:[],
       heightChart:'100%',
-      isFull:false
+      isFull:false,
+      newHistogram:[]
     }
   },
   methods:{
@@ -72,6 +73,25 @@ export default {
       this.param.content.enddate = this.enddate
       const res = await this.$api.requested(this.param)
       this.histogram = res.data.histogram
+      console.log(this.histogram)
+      let lastYear = []
+      let nowYear = []
+      let k=0
+      for (var i=0;i<this.histogram.length;i++){
+        if (this.histogram[i].key === '去年同期跟进'){
+          lastYear[k]=this.histogram[i]
+          k++
+        }
+      }
+      let x=0
+      for (var i=0;i<this.histogram.length;i++){
+        if (this.histogram[i].key === '本期跟进'){
+          nowYear[x]=this.histogram[i]
+          x++
+        }
+      }
+      console.log(lastYear,'lastYear')
+      console.log(nowYear,'nowYear')
       this.lineChart = res.data.lineChart.map(item=>{
         return {
           date: item.date,
@@ -79,11 +99,12 @@ export default {
           value: item.value
         }
       })
-      this.chartDualAxes.changeData([this.histogram,this.lineChart])
+      this.newHistogram = lastYear.concat(nowYear)
+      this.chartDualAxes.changeData([this.newHistogram,this.lineChart])
     },
     renderPie(val){
       this.chartDualAxes = new DualAxes('clueFollowAnalysisChart', {
-        data:[this.histogram,this.lineChart],
+        data:[this.newHistogram,this.lineChart],
         xField: 'date',
         yField: ['value','value'],
         geometryOptions: [
@@ -91,10 +112,15 @@ export default {
             geometry: 'column',
             isGroup: true,
             seriesField: 'key',
+            color:['#62daab','#6395fa'],
+            label: {
+              position:top
+            },
           },
           {
             geometry: 'line',
             seriesField: 'key',
+            color: '#657798',
             lineStyle: {
               lineWidth: 2,
             },

+ 12 - 1
src/views/clueData/modules/clueUnFollow.vue

@@ -42,6 +42,14 @@
             <p v-if="scope.column.columnname === 'province'">
               {{scope.column.data.province !== '' && scope.column.data.city !== '' && scope.column.data.county !== ''?scope.column.data.province+scope.column.data.city+scope.column.data.county:'--'}}
             </p>
+            <div v-else-if="scope.column.columnname == 'status'">
+              <span style="color:#999999" 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:#3874f6" 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>
+              <span v-else>{{scope.column.data[[scope.column.columnname]]}}</span>
+            </div>
             <p v-else-if="scope.column.columnname === 'unqty'">
               <span> {{scope.column.data[scope.column.columnname] == 0?0:scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</span>
             </p>
@@ -167,7 +175,10 @@ export default {
         xField: 'key',
         yField: 'value',
         seriesField: 'type',
-        interactions: [{ type: 'element-single-selected' }]
+        interactions: [{ type: 'element-single-selected' }],
+        label: {
+          position:top
+        },
       });
       /*this.chartColumn.on('tooltip:change',ev=>{
         this.hoverData = ev.data.items[0]

+ 5 - 1
src/views/clueData/modules/digitalSigns.vue

@@ -5,7 +5,11 @@
       <div class="div-border-new">
         <div class="item">
           <p class="title">{{list.total}}</p>
-          <p class="content-font-new">线索总数</p>
+          <span class="content-font-new">线索总数</span>
+          <el-tooltip placement="top">
+            <div slot="content">线索总数:包含待分配、已分配线索数。</div>
+            <img style="vertical-align: middle" width="14px" height="14px" src="../../../assets/icons/prompt_icon.svg" >
+          </el-tooltip>
         </div>
         <div class="item">
           <p class="title">{{ list.dfp }}</p>

+ 0 - 3
src/views/salesData/modules/customerAccountBalanceAnalysis.vue

@@ -158,9 +158,6 @@ export default {
       this.accountList = res.data.accountclass
       this.balance = res.data.balance.map((item)=>{
         let value = item.value/10000
-        let value1 = Math.round(((value * 100)*100)/100)
-        console.log(value,'value')
-        console.log(value1,'value1')
         return {
           "date":item.date,
           "name":item.name + '(万元)',

+ 2 - 1
src/views/salesData/modules/financialCollectionAnalysis.vue

@@ -123,10 +123,11 @@ export default {
       this.param.content.dataid = val || this.dataid
       const res = await this.$api.requested(this.param)
       this.chartData = res.data.map(item=>{
+        let value = item.value/10000
         return {
           key: item.key + '(万元)',
           type: item.type,
-          value: Math.round(((item.value/10000)*100)/100)
+          value: value
         }
       })
       this.chartBar.changeData(this.chartData)

+ 4 - 2
src/views/salesData/modules/invoiceAmountAnalysis.vue

@@ -79,16 +79,18 @@ export default {
       this.param.content.year = new Date(this.yearNow).getFullYear()
       const res = await this.$api.requested(this.param)
       let amount = res.data.map(item=>{
+        let value = item.amount/10000
         return {
-          "value":Math.round(((item.amount/10000)*100)/100),
+          "value":value,
           "date":item.date,
           "type":'本期金额(万元)'
         }
       })
       let oldamount = res.data.map(item=>{
+        let value = item.oldamount/10000
         return {
           "date":item.date,
-          "value":Math.round(((item.oldamount/10000)*100)/100),
+          "value":value,
           "type":'去年同期金额(万元)'
         }
       })

+ 5 - 3
src/views/salesData/modules/orderTrendAnalysis.vue

@@ -79,15 +79,17 @@ export default {
       this.param.content.year = new Date(this.yearNow).getFullYear()
       const res = await this.$api.requested(this.param)
       this.list2 = res.data.map(item=>{
+        let value = item.oldamount/10000
         return {
           "date":item.date,
-          "value":Math.round(((item.oldamount/10000)*100)/100),
+          "value":value,
           "type":'去年同期金额(万元)'
         }
       })
       let list3 = res.data.map(item=>{
+        let value = item.amount/10000
         return {
-          "value":Math.round(((item.amount/10000)*100)/100),
+          "value":value,
           "date":item.date,
           "type":'本期金额(万元)',
         }
@@ -99,7 +101,7 @@ export default {
           "value":Math.round(((item.tbzzl * 100)*100)/100)
         }
       })
-      this.list = this.list2.concat(list3)
+      this.list = list3.concat(this.list2)
 
       this.chartDualAxes.changeData([this.list,this.list1])
     },

+ 6 - 0
src/views/salesData/modules/orderType.vue

@@ -221,6 +221,12 @@ export default {
 
         },
         label:{
+          /*type: 'inner',
+          offset: '-50%',
+          style: {
+            textAlign: 'center',
+          },
+          autoRotate: false,*/
           formatter: (datum) => `${datum.ratio}%`,
         },
         tooltip: {

+ 4 - 2
src/views/salesData/modules/shippingTrendAnalysis.vue

@@ -86,15 +86,17 @@ export default {
       this.param.content.year = new Date(this.yearNow).getFullYear()
       const res = await this.$api.requested(this.param)
       const amount = res.data.map(item=>{
+        let value = item.amount/10000
         return {
-          "value":Math.round(((item.amount/10000)*100)/100),
+          "value":value,
           "date":item.date,
           "type":'本期金额(万元)'
         }
       })
       const oldamount = res.data.map(item=>{
+        let value = item.oldamount/10000
         return {
-          "value":Math.round(((item.oldamount/10000)*100)/100),
+          "value":value,
           "date":item.date,
           "type":'去年同期金额(万元)'
         }

+ 2 - 1
src/views/salesData/modules/shippingUninvoiceAnalysis.vue

@@ -140,8 +140,9 @@ export default {
       }
       this.chartData = res.data[0].Trend
       this.chartData = this.chartData.map(item=>{
+        let value = item.value/10000
         return {
-          "value": Math.round(((item.value/10000)*100)/100),
+          "value": value,
           "key": item.key + '(万元)',
           "type":"出货未开票金额(万元)"
         }

+ 8 - 4
src/views/salesData/modules/uninvoiceAmountAnalysis.vue

@@ -102,12 +102,16 @@ export default {
       this.param.content.enddate = this.endDate
       const res = await this.$api.requested(this.param)
       this.list = res.data.map(item=>{
+        let zerotothree = item.zerotothree/10000
+        let threetosix = item.threetosix/10000
+        let sixtotwelve = item.sixtotwelve/10000
+        let twelveup = item.twelveup/10000
         return {
-          "zerotothree":Math.round(((item.zerotothree/10000)*100)/100),
-          "threetosix":Math.round(((item.threetosix/10000)*100)/100),
+          "zerotothree":zerotothree,
+          "threetosix":threetosix,
           "date":item.date,
-          "sixtotwelve":Math.round(((item.sixtotwelve/10000)*100)/100),
-          "twelveup":Math.round(((item.twelveup/10000)*100)/100),
+          "sixtotwelve":sixtotwelve,
+          "twelveup":twelveup,
         }
       })
       this.chartLine.changeData(this.processData(this.list, ['zerotothree', 'threetosix','sixtotwelve','twelveup'], meta))