scorpioyq 2 rokov pred
rodič
commit
39e41b47d2

+ 1 - 1
src/views/home/component/dash.vue

@@ -454,7 +454,7 @@ export default {
       })
     },
     exportExcelTotal(item) {
-      const data = {projectIds: this.selectList.join(',')}
+      const data = {...this.queryData, projectIds: this.selectList.join(',')}
       this.$api.params.summaryExport(Object.assign(item, data)).then(res => {
         if (res.hasOwnProperty('code')) {
           this.$message.error(res.msg)

+ 13 - 11
src/views/home/component/summary_dialog.vue

@@ -50,7 +50,7 @@ import BaseButton from '@/components/base-button.vue'
 
 export default {
   name: 'summary_dialog',
-  components: { BaseButton },
+  components: {BaseButton},
   props: {
     dialogType: {
       type: String,
@@ -63,16 +63,18 @@ export default {
   },
   watch: {
     dialogType: {
-      handler (val) {
+      handler(val) {
         if (val === 2) {
           this.showSummary = true
           this.getDict('summary_field')
+        } else if (val === -1) {
+          this.showSummary = false
         }
       },
       immediate: true
     }
   },
-  data () {
+  data() {
     return {
       year: '',
       loading: false,
@@ -83,30 +85,30 @@ export default {
       yearList: []
     }
   },
-  created () {
+  created() {
     this.init()
   },
   methods: {
-    init () {
+    init() {
       const year = new Date().getFullYear()
       for (let i = year - 10; i <= year; i++) {
         this.yearList.push(i)
       }
     },
-    getDict (code) {
-      this.$api.common.dicList({ code }).then(res => {
+    getDict(code) {
+      this.$api.common.dicList({code}).then(res => {
         if (res.code === 200) {
           this.fieldType = res.data.map(e => {
-            e.checked = false
+            e.checked = true
             return e
           })
         }
       })
     },
-    close () {
+    close() {
       this.$emit('close')
     },
-    exportExcel () {
+    exportExcel() {
       const tmp = this.fieldType.filter(e => e.checked).map(sub => sub.dictKey)
       if (this.year.length === 0) {
         this.$message.error('请选择年份')
@@ -116,7 +118,7 @@ export default {
         this.$message.error('请选择要导出的字段')
         return
       }
-      const data = { dictKey: tmp.join(','), year: this.year }
+      const data = {columnName: tmp.join(','), year: this.year}
       this.$emit('export', data)
     }
   }