scorpioyq 2 jaren geleden
bovenliggende
commit
ab02a48cb3

+ 22 - 11
src/views/invest/components/amount.vue

@@ -31,23 +31,33 @@ export default {
     deptId: {
       type: String,
       default: ''
+    },
+    year: {
+      type: String,
+      default: ''
     }
   },
   watch: {
     type: {
-      handler (val) {
+      handler(val) {
         this.initOption(val)
       },
       immediate: true
     },
     deptId: {
-      handler (val) {
+      handler(val) {
+        this.onLoad()
+      },
+      immediate: true
+    },
+    year: {
+      handler(val) {
         this.onLoad()
       },
       immediate: true
     }
   },
-  data () {
+  data() {
     return {
       month: '',
       quarter: '',
@@ -95,9 +105,10 @@ export default {
     }
   },
   methods: {
-    onLoad () {
+    onLoad() {
       this.$api.invest.list({
         deptId: this.deptId === null ? '' : this.deptId,
+        year: this.year === null ? '' : this.year,
         month: this.month,
         quarter: this.quarter
       }).then(res => {
@@ -106,41 +117,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 = ''
@@ -149,7 +160,7 @@ export default {
       }
       this.onLoad()
     },
-    changeMonth (res) {
+    changeMonth(res) {
       this.month = res
       this.onLoad()
     }

+ 14 - 13
src/views/invest/components/left.vue

@@ -1,8 +1,9 @@
 <template>
   <div>
-    <div class="flex flex-col flex-center">
+    <div class="flex flex-col flex-center full-height">
       <span class="font-16 grey-6 bold">年度资金管理</span>
-      <base-button v-if='user.info.viewStage === 1' class="mt-20" title="全县投资情况" icon="" :type='active === -1 ? "1" :"2" ' @click='viewAll'/>
+      <base-button v-if='user.info.viewStage === 1' class="mt-20" title="全县投资情况" icon=""
+                   :type='active === -1 ? "1" :"2" ' @click='viewAll'/>
       <div v-else style='height: 55px'></div>
       <div class='full-width flex flex-center mt-20'>
         <el-tabs v-model="activeName" class="font-16" @tab-change="getOrg">
@@ -22,28 +23,28 @@
 
 <script>
 import baseButton from '@/components/base-button.vue'
-import { useStore } from '@/store/user.js'
+import {useStore} from '@/store/user.js'
 
 export default {
   name: 'left',
-  components: { baseButton },
-  setup () {
+  components: {baseButton},
+  setup() {
     const user = useStore()
-    return { user }
+    return {user}
   },
-  data () {
+  data() {
     return {
       activeName: '1',
       deptList: [],
       active: -1
     }
   },
-  created () {
+  created() {
     this.getOrg()
   },
   methods: {
-    getOrg () {
-      this.$api.common.deptList({ type: this.activeName }).then(res => {
+    getOrg() {
+      this.$api.common.deptList({type: this.activeName}).then(res => {
         if (res.code === 200) {
           this.deptList = res.data.map(e => {
             e.checked = false
@@ -58,11 +59,11 @@ export default {
       })
     },
 
-    change (index) {
+    change(index) {
       this.active = index
       this.$emit('change', this.deptList[index])
     },
-    viewAll () {
+    viewAll() {
       this.active = -1
       this.$emit('change', null)
     }
@@ -72,7 +73,7 @@ export default {
 
 <style lang='scss' scoped>
 .content {
-  height: 785px;
+  height: 830px;
   overflow-y: scroll
 }
 

+ 4 - 1
src/views/invest/components/years.vue

@@ -188,7 +188,10 @@ export default {
                 data = {number: value}
                 break
             }
-            this.$api.invest.savePlan(Object.assign({deptId: this.deptId === null ? '' : this.deptId}, data)).then(res => {
+            this.$api.invest.savePlan(Object.assign({
+              deptId: this.deptId === null ? '' : this.deptId,
+              year: this.year === null ? '' : this.year
+            }, data)).then(res => {
               if (res.code === 200) {
                 this.$message.success(res.msg)
                 this.info[item.prop] = value

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

@@ -39,7 +39,7 @@
             </div>
             <div class='white-bg padding'></div>
             <div class='flex-child-average'>
-              <amount v-if='dept===null && user.info.viewStage === 1' :type='yearType' :deptId='dept'/>
+              <amount v-if='dept===null && user.info.viewStage === 1' :type='yearType' :deptId='dept' :year="year"/>
               <complete v-else :type='yearType' :deptId='dept' :year="year"/>
             </div>
           </div>