Quellcode durchsuchen

客户数据国际化调整

qymljy vor 1 Monat
Ursprung
Commit
470d3e5685
1 geänderte Dateien mit 77 neuen und 10 gelöschten Zeilen
  1. 77 10
      src/HDrpManagement/customerData/index.vue

+ 77 - 10
src/HDrpManagement/customerData/index.vue

@@ -1664,8 +1664,22 @@ export default {
         }
       }
       this.uvBillData = lastYear.concat(nowYear)
+      this.uvBillData = this.uvBillData.map(item=>{
+        return {
+          date: item.date,
+          key:this.$t(item.key),
+          value: item.value
+        }
+      })
       /*res.data.lineChart.forEach(item => item[`同比增长率`] = item.value)*/
       this.transformData = res.data.lineChart
+      this.transformData = this.transformData.map(item=>{
+        return {
+          date: item.date,
+          key:this.$t(item.key),
+          value: item.value
+        }
+      })
       if (init) {
         this.dualAxes = new DualAxes(this.$refs.chart1, {
           data: [this.uvBillData,this.transformData],
@@ -1698,7 +1712,7 @@ export default {
           ],
           tooltip: {
             formatter: (datum) => {
-              return { name: datum.key, value: datum.key == '同比增长率'? datum.value + '%' : datum.value };
+              return { name: datum.key, value: datum.key == this.$t('同比增长率')? datum.value + '%' : datum.value };
             },
           },
         });
@@ -1739,14 +1753,20 @@ export default {
       }
 
       this.newFollowup = lastYear.concat(nowYear)
-
-      /*this.lineChart = res.data.tbzzl.map(item=>{
+      this.newFollowup = this.newFollowup.map(item=>{
+        return {
+          key:this.$t(item.key),
+          value: item.value,
+          date: item.date
+        }
+      })
+      this.chartMapData.tbzzl = res.data.tbzzl.map(item=>{
         return {
           date: item.date,
-          type:"同比增长率",
+          key:this.$t("同比增长率"),
           value: item.value
         }
-      })*/
+      })
      /* this.chartMapData.tbzzl.forEach(item => item.key = '同比增长率(%)')*/
       if (init) {
         this.chartMap = new DualAxes(this.$refs.chart2, {
@@ -1778,7 +1798,7 @@ export default {
           ],
           tooltip: {
             formatter: (datum) => {
-              return { name: datum.key, value: datum.key == '同比增长率'? datum.value + '%' : datum.value };
+              return { name: datum.key, value: datum.key == this.$t('同比增长率')? datum.value + '%' : datum.value };
             },
           },
         });
@@ -1797,6 +1817,14 @@ export default {
       }
       let res = await this.$api.requested(this.typeMapParam)
       this.customerTypeData.map = res.data
+      this.customerTypeData.map = this.customerTypeData.map.map(item=>{
+        return {
+          ratio: item.ratio,
+          key:this.$t(item.key),
+          value: item.value,
+          totalqty: item.totalqty
+        }
+      })
       if (init) {
         this.customerTypeMap = new Pie(this.$refs.customerTypeEl, {
           appendPadding: 10,
@@ -1819,7 +1847,7 @@ export default {
               style: {
                 fontSize:'16px'
               },
-              content:'客户总数'
+              content:this.$t('客户总数')
             },
             content: {
               offsetY: 4,
@@ -1943,6 +1971,14 @@ export default {
       }
       let res = await this.$api.requested(this.contactMapParam)
       this.customerContactData.map = res.data
+      this.customerContactData.map = this.customerContactData.map.map(item=>{
+        return {
+          ratio: item.ratio,
+          key:this.$t(item.key),
+          value: item.value,
+          totalqty: item.totalqty
+        }
+      })
       console.log(this.customerContactData,'客户数据');
       if (init) {
         this.customerContactMap = new Pie(this.$refs.customerContactEl, {
@@ -1966,7 +2002,7 @@ export default {
               style: {
                 fontSize:'16px'
               },
-              content:'客户总数'
+              content:this.$t('客户总数')
             },
             content: {
               offsetY: 4,
@@ -2014,6 +2050,14 @@ export default {
       }
       let res = await this.$api.requested(this.projectMapParam)
       this.customerProjectData.map = res.data
+      this.customerProjectData.map = this.customerProjectData.map.map(item=>{
+        return {
+          ratio: item.ratio,
+          key:this.$t(item.key),
+          value: item.value,
+          totalqty: item.totalqty
+        }
+      })
       console.log(this.customerProjectData,'关联项目数据');
       if (init) {
         this.customerProjectMap = new Pie(this.$refs.customerProjectEl, {
@@ -2037,7 +2081,7 @@ export default {
               style: {
                 fontSize:'16px'
               },
-              content:'客户总数'
+              content:this.$t('客户总数')
             },
             content: {
               offsetY: 4,
@@ -2089,6 +2133,14 @@ export default {
       }
       let res = await this.$api.requested(param)
       this.customerFllowData.map = res.data
+      this.customerFllowData.map = this.customerFllowData.map.map(item=>{
+        return {
+          ratio: item.ratio,
+          key:this.$t(item.key),
+          value: item.value,
+          totalqty: item.totalqty
+        }
+      })
       if (init) {
         this.customerFllowMap = new Pie(this.$refs.customerFllowEl, {
           appendPadding: 10,
@@ -2111,7 +2163,7 @@ export default {
               style: {
                 fontSize:'16px'
               },
-              content:'客户总数'
+              content:this.$t('客户总数')
             },
             content: {
               offsetY: 4,
@@ -2160,6 +2212,14 @@ export default {
       this.unfllowMapParam.content.date = new Date().getTime()
       let res = await this.$api.requested(this.unfllowMapParam)
       this.customerUnfllowData.map = res.data
+      this.customerUnfllowData.map = this.customerUnfllowData.map.map(item=>{
+        return {
+          datetype: this.$t(item.datetype),
+          key:this.$t(item.key),
+          value: item.value,
+          sequence: item.sequence
+        }
+      })
       if (init) {
         this.customerUnfllowMap = new Column(this.$refs.customerUnfllowEl, {
           data:this.customerUnfllowData.map,
@@ -2218,6 +2278,13 @@ export default {
       }
       let res = await this.$api.requested(param)
       this.projectMapData = res.data
+      this.projectMapData = res.data.map(item=>{
+        return {
+          date: item.date,
+          key:this.$t(item.key),
+          value: Math.round((item.value * 100)*100)/100
+        }
+      })
       if (init) {
         this.projectMap = new Line(this.$refs.chart3, {
           data:this.projectMapData,