diff --git a/src/views/modules/kpi/kpiresultgrid-add-or-update.vue b/src/views/modules/kpi/kpiresultgrid-add-or-update.vue index 70040e4d..fa8dde44 100644 --- a/src/views/modules/kpi/kpiresultgrid-add-or-update.vue +++ b/src/views/modules/kpi/kpiresultgrid-add-or-update.vue @@ -1,76 +1,31 @@ + diff --git a/src/views/modules/kpi/kpiresultgrid.vue b/src/views/modules/kpi/kpiresultgrid.vue index b9ee2c1b..c5ccd4ec 100644 --- a/src/views/modules/kpi/kpiresultgrid.vue +++ b/src/views/modules/kpi/kpiresultgrid.vue @@ -2,45 +2,40 @@
- - + + - - {{ $t('query') }} + + + - {{ $t('add') }} + {{ $t('query') }} - {{ $t('deleteBatch') }} + {{ $t('export') }} - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + @@ -67,13 +62,66 @@ export default { data () { return { mixinViewModuleOptions: { - getDataListURL: '/kpi/kpiresultgrid/page', + getDataListURL: '/kpi/gridResult/page', getDataListIsPage: true, - deleteURL: '/kpi/kpiresultgrid', - deleteIsBatch: true + deleteURL: '/kpi/gridResult', + deleteIsBatch: true, + exportURL: '/kpi/gridResult/export' }, dataForm: { - id: '' + id: '', + gridId: '', + scoreStartDate: '' + }, + // 所属机构配置 + deptIdList: [], + options: [], + streetList: [], + communityList: [], + gridList: [] + } + }, + created () { + this.$http + .get(`/sys/user/deptOptions/getByLoginUser`) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.options = res.data.options + }) + .catch(() => {}) + }, + methods: { + detailQuery (id) { + this.addOrUpdateVisible = true + this.$nextTick(() => { + this.$refs.addOrUpdate.dataForm.id = id + this.$refs.addOrUpdate.init() + }) + } + }, + watch: { + 'deptIdList': function (val) { + if (val.length === 0) { + this.dataForm.streetId = '' + this.dataForm.communityId = '' + this.dataForm.gridId = '' + } + if (val.length === 1) { + this.dataForm.streetId = this.deptIdList[0] + this.dataForm.communityId = '' + this.dataForm.gridId = '' + } + if (val.length === 2) { + this.dataForm.streetId = this.deptIdList[0] + this.dataForm.communityId = this.deptIdList[1] + this.dataForm.gridId = '' + } + if (val.length === 3) { + this.dataForm.streetId = this.deptIdList[0] + this.dataForm.communityId = this.deptIdList[1] + this.dataForm.gridId = this.deptIdList[2] } } },