scorpio il y a 2 ans
Parent
commit
4d13898bea

+ 20 - 14
src/views/invest/components/amount.vue

@@ -39,25 +39,25 @@ export default {
   },
   watch: {
     type: {
-      handler(val) {
+      handler (val) {
         this.initOption(val)
       },
       immediate: true
     },
     deptId: {
-      handler(val) {
+      handler (val) {
         this.onLoad()
       },
       immediate: true
     },
     year: {
-      handler(val) {
+      handler (val) {
         this.onLoad()
       },
       immediate: true
     }
   },
-  data() {
+  data () {
     return {
       month: '',
       quarter: '',
@@ -82,12 +82,18 @@ export default {
           {
             label: '责任目标',
             prop: 'planCompleteAmount',
-            sortable: true
+            sortable: true,
+            formatter: (row, value) => {
+              return value.toLocaleString()
+            }
           },
           {
             label: '完成投资(万元)',
             prop: 'totalCompleteAmount',
-            sortable: true
+            sortable: true,
+            formatter: (row, value) => {
+              return value.toLocaleString()
+            }
           },
           {
             label: '完成率',
@@ -105,7 +111,7 @@ export default {
     }
   },
   methods: {
-    onLoad() {
+    onLoad () {
       this.$api.invest.list({
         deptId: this.deptId === null ? '' : this.deptId,
         year: this.year === null ? '' : this.year,
@@ -117,41 +123,41 @@ export default {
         }
       })
     },
-    initOption(res) {
+    initOption (res) {
       this.month = ''
       this.selectOption.length = 0
       switch (res.value) {
         case 1:
           for (let i = 1; i <= 3; i++) {
-            const item = {label: i + '月', value: i}
+            const item = { label: i + '月', value: i }
             this.selectOption.push(item)
           }
           this.quarter = 1
           break
         case 2:
           for (let i = 4; i <= 6; i++) {
-            const item = {label: i + '月', value: i}
+            const item = { label: i + '月', value: i }
             this.selectOption.push(item)
           }
           this.quarter = 2
           break
         case 3:
           for (let i = 7; i <= 9; i++) {
-            const item = {label: i + '月', value: i}
+            const item = { label: i + '月', value: i }
             this.selectOption.push(item)
           }
           this.quarter = 3
           break
         case 4:
           for (let i = 10; i <= 12; i++) {
-            const item = {label: i + '月', value: i}
+            const item = { label: i + '月', value: i }
             this.selectOption.push(item)
           }
           this.quarter = 4
           break
         default:
           for (let i = 1; i <= 12; i++) {
-            const item = {label: i + '月', value: i}
+            const item = { label: i + '月', value: i }
             this.selectOption.push(item)
             this.month = ''
             this.quarter = ''
@@ -160,7 +166,7 @@ export default {
       }
       this.onLoad()
     },
-    changeMonth(res) {
+    changeMonth (res) {
       this.month = res
       this.onLoad()
     }

+ 16 - 16
src/views/invest/components/chart.vue

@@ -8,7 +8,7 @@
 import charts from '../../../components/echarts/index.vue'
 
 export default {
-  components: {charts},
+  components: { charts },
   props: {
     deptId: {
       type: String,
@@ -25,29 +25,29 @@ export default {
   },
   watch: {
     deptId: {
-      handler(val) {
+      handler (val) {
         this.init()
       },
       immediate: true
     },
     quarter: {
-      handler(val) {
+      handler (val) {
         this.init()
       },
       immediate: true
     },
     year: {
-      handler(val) {
+      handler (val) {
         this.init()
       },
       immediate: true
     }
   },
-  data() {
+  data () {
     return {
       option: {
         title: {
-          text: '单位:(元)',
+          text: '单位:(亿元)',
           textStyle: {
             color: 'white',
             fontSize: '12'
@@ -58,8 +58,8 @@ export default {
         xAxis: [
           {
             type: 'category',
-            axisTick: {show: false},
-            splitLine: {show: false},
+            axisTick: { show: false },
+            splitLine: { show: false },
             data: [],
             axisPointer: {
               type: 'shadow'
@@ -76,8 +76,8 @@ export default {
         yAxis: [
           {
             type: 'value',
-            axisTick: {show: false},
-            splitLine: {show: false},
+            axisTick: { show: false },
+            splitLine: { show: false },
             axisLine: {
               show: true,
               lineStyle: {
@@ -89,8 +89,8 @@ export default {
           {
             type: 'value',
             name: '',
-            axisTick: {show: true},
-            splitLine: {show: true},
+            axisTick: { show: true },
+            splitLine: { show: true },
             interval: 5,
             axisLabel: {
               formatter: '',
@@ -124,7 +124,7 @@ export default {
               show: true,
               position: 'top'
             },
-            lineStyle: {color: '#528BEC', type: 'solid', borderColor: 'red'},
+            lineStyle: { color: '#528BEC', type: 'solid', borderColor: 'red' },
             data: []
           },
           {
@@ -149,7 +149,7 @@ export default {
               show: true,
               position: 'top'
             },
-            lineStyle: {color: 'red', type: 'solid', borderColor: 'red'},
+            lineStyle: { color: 'red', type: 'solid', borderColor: 'red' },
             data: []
           }
         ]
@@ -157,10 +157,10 @@ export default {
       type: 1
     }
   },
-  created() {
+  created () {
   },
   methods: {
-    init() {
+    init () {
       this.$api.invest.count({
         deptId: this.deptId === null ? '' : this.deptId,
         year: this.year === null ? '' : this.year,

+ 18 - 18
src/views/invest/index.vue

@@ -26,7 +26,7 @@
         <basic-container>
           <div class='flex '>
             <div class='flex-child-average full-width flex flex-col flex-justify-start'>
-              <span class='font-16 bold full-width text-left '>投资数据统计 单位(元)</span>
+              <span class='font-16 bold full-width text-left '>投资数据统计 单位(亿元)</span>
               <div class='full-width mt-10' style='background-color: #F7FAFD'>
                 <chart :dept-id='dept' :quarter='yearType.value === 0 ? "":yearType ' :year="year"/>
               </div>
@@ -64,16 +64,16 @@ import amount from '@/views/invest/components/amount.vue'
 import chart from '@/views/invest/components/chart.vue'
 import chart2 from '@/views/invest/components/chart2.vue'
 import complete from '@/views/invest/components/complete.vue'
-import {useStore} from '@/store/user.js'
+import { useStore } from '@/store/user.js'
 
 export default {
   name: 'index',
-  components: {BasicContainer, left, years, amount, chart, chart2, complete},
-  setup() {
+  components: { BasicContainer, left, years, amount, chart, chart2, complete },
+  setup () {
     const user = useStore()
-    return {user}
+    return { user }
   },
-  data() {
+  data () {
     return {
       yearType: {
         value: 0
@@ -82,44 +82,44 @@ export default {
       year: '',
       years: [
         {
-          value: 2023,
+          value: 2023
         },
         {
-          value: 2022,
+          value: 2022
         },
         {
-          value: 2021,
+          value: 2021
         },
         {
-          value: 2020,
+          value: 2020
         },
         {
-          value: 2019,
+          value: 2019
         },
         {
-          value: 2018,
+          value: 2018
         },
         {
-          value: 2017,
-        },
+          value: 2017
+        }
       ]
     }
   },
-  created() {
+  created () {
     this.year = new Date().getFullYear()
   },
   methods: {
-    changeDept(res) {
+    changeDept (res) {
       if (res === null) {
         this.dept = null
         return
       }
       this.dept = res.id
     },
-    change(index) {
+    change (index) {
       this.yearType = index
     },
-    yearSelect(res) {
+    yearSelect (res) {
       this.year = res
     }
   }