diff --git a/src/views/modules/kpi/kpiresultsuperior-add-or-update.vue b/src/views/modules/kpi/kpiresultsuperior-add-or-update.vue index 24e6a36c..164f0379 100644 --- a/src/views/modules/kpi/kpiresultsuperior-add-or-update.vue +++ b/src/views/modules/kpi/kpiresultsuperior-add-or-update.vue @@ -1,148 +1,47 @@ diff --git a/src/views/modules/kpi/kpiresultsuperior.vue b/src/views/modules/kpi/kpiresultsuperior.vue index 630d690c..95d5f4ba 100644 --- a/src/views/modules/kpi/kpiresultsuperior.vue +++ b/src/views/modules/kpi/kpiresultsuperior.vue @@ -2,42 +2,31 @@
- - + + {{ $t('query') }} - {{ $t('add') }} - - - {{ $t('deleteBatch') }} + {{ $t('export') }} - - - + - - - - - - - - - - - - - - + + + + @@ -67,10 +56,96 @@ export default { getDataListURL: '/kpi/kpiresultsuperior/page', getDataListIsPage: true, deleteURL: '/kpi/kpiresultsuperior', - deleteIsBatch: true + deleteIsBatch: true, + exportURL: '/kpi/kpiresultsuperior/export' }, dataForm: { id: '' + }, + // 所属机构配置 + 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: { + // 考核周期开始日字段,格式化 + startDateFormat: function (row) { + return row.startDate.substring(0, 10) + }, + // 考核周期结束日字段,格式化 + endDateFormat: function (row) { + return row.endDate.substring(0, 10) + }, + // 考核周期,格式化 + kpiCycleFormat: function (row) { + if (row.kpiCycle === 'month') { + return '月' + } else if (row.kpiCycle === 'quarter') { + return '季' + } else if (row.kpiCycle === 'year') { + return '年' + } + }, + // 机构类别,格式化 + deptTypeKeyFormat: function (row) { + if (row.deptTypeKey === 'district_party') { + return '区党委' + } else if (row.deptTypeKey === 'district_dept') { + return '区直部门' + } else if (row.deptTypeKey === 'street_party') { + return '街道党工委' + } else if (row.deptTypeKey === 'street_dept') { + return '街道部门' + } else if (row.deptTypeKey === 'community_party') { + return '社区党工委' + } else if (row.deptTypeKey === 'grid_party') { + return '网格党支部' + } + }, + // 跳转到详情页 + detailQuery (id, startDate, endDate, deptId) { + 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] } } },