Jelajahi Sumber

fix databig

scorpio 2 tahun lalu
induk
melakukan
5730f4d314

+ 15 - 6
src/views/home/component/params/params3.vue

@@ -122,6 +122,7 @@
 
 <script>
 import baseButton from '@/components/base-button.vue'
+import { deepClone } from '@/utils/tools.js'
 
 export default {
   name: 'params3',
@@ -254,6 +255,7 @@ export default {
         return sub
       })
       // 复制差集
+      console.log(d)
       if (res.month_complete_amount.length === this.completeCount) {
         d.forEach(sub => {
           if (res.month_plan_complete_amount.findIndex(ele => ele.year === sub.year) === -1) {
@@ -282,7 +284,6 @@ export default {
         if (this.form.month_complete_amount[this.current.index] !== undefined && this.form.month_complete_amount.length > 0) {
           this.form.month_complete_amount[this.current.index].sum = this.getSum(this.form.month_complete_amount[this.current.index].monthlyData)
         }
-        console.log(this.form.month_plan_investment)
         if (this.form.month_plan_investment[this.current.index] !== undefined && this.form.month_plan_investment.length > 0) {
           this.form.month_plan_investment[this.current.index].sum = this.getSum(this.form.month_plan_investment[this.current.index].monthlyData)
         }
@@ -340,13 +341,21 @@ export default {
      */
     showMonth (year, type, index) {
       this.$nextTick(() => {
-        const item = { editType: type, year, index }
+        const item = { editType: type, year, index, planMonths: [], months: [] }
         if (type === 1) {
-          item.planMonths = this.form.month_plan_complete_amount.find(sub => sub.year === year).monthlyData
-          item.months = this.form.month_complete_amount.find(sub => sub.year === year).monthlyData
+          this.form.month_plan_complete_amount.find(sub => sub.year === year).monthlyData.forEach(sub => {
+            item.planMonths.push(deepClone(sub))
+          })
+          this.form.month_complete_amount.find(sub => sub.year === year).monthlyData.forEach(sub => {
+            item.months.push(deepClone(sub))
+          })
         } else if (type === 2) {
-          item.planMonths = this.form.month_plan_investment.find(sub => sub.year === year).monthlyData
-          item.months = this.form.month_investment_amount.find(sub => sub.year === year).monthlyData
+          this.form.month_plan_investment.find(sub => sub.year === year).monthlyData.forEach(sub => {
+            item.planMonths.push(deepClone(sub))
+          })
+          this.form.month_investment_amount.find(sub => sub.year === year).monthlyData.forEach(sub => {
+            item.months.push(deepClone(sub))
+          })
         }
         this.current = Object.assign({}, item)
         for (let i = 1; i <= 11; i++) {

+ 21 - 12
src/views/invest/components/left.vue

@@ -2,8 +2,11 @@
   <div>
     <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'/>
+      <div v-if='user.info.viewStage === 1'>
+        <base-button  class="mt-20" title="全县投资情况" icon=""
+                     :type='active === -1 ? "1" :"2" ' @click='viewAll'/>
+        <el-link type='primary' class='mt-20 pointer' @click='download("https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/0c8500447e3947cab5a1353b891db963.docx")'>智能监测预警分析报告</el-link>
+      </div>
       <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">
@@ -23,28 +26,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
@@ -59,13 +62,19 @@ export default {
       })
     },
 
-    change(index) {
+    change (index) {
       this.active = index
       this.$emit('change', this.deptList[index])
     },
-    viewAll() {
+    viewAll () {
       this.active = -1
       this.$emit('change', null)
+    },
+    download (url) {
+      window.open(
+        url,
+        '_blank' // <- This is what makes it open in a new window.
+      )
     }
   }
 }