|
|
@@ -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)
|
|
|
}
|
|
|
}
|