From d208ea23a79419982acc3792d6fa17d81de866f9 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Tue, 4 Mar 2025 14:01:57 +0800 Subject: [PATCH] up --- src/components/viewFile/viewDownload.vue | 2 +- src/components/viewFile/viewFile.vue | 30 +++- src/views/dashboard/index.vue | 75 ++++++--- src/views/record/index.vue | 204 ++++++++++++----------- src/views/report/filldata.vue | 15 +- src/views/report/yeardata.vue | 11 +- 6 files changed, 207 insertions(+), 130 deletions(-) diff --git a/src/components/viewFile/viewDownload.vue b/src/components/viewFile/viewDownload.vue index dafb9b8..2e72306 100644 --- a/src/components/viewFile/viewDownload.vue +++ b/src/components/viewFile/viewDownload.vue @@ -12,7 +12,7 @@
全选 - {{ btnloading ? '下载中...' : '批量下载' }} + {{ btnloading ? '下载中...' : '下载' }}
diff --git a/src/components/viewFile/viewFile.vue b/src/components/viewFile/viewFile.vue index 0fa663c..40d2f18 100644 --- a/src/components/viewFile/viewFile.vue +++ b/src/components/viewFile/viewFile.vue @@ -2,13 +2,21 @@ -
- {{title}} - + :visible.sync="diaShow" @close="coloseDia" :show-close="false" :width="width"> +
+
+ {{title}} + +
+
+ + + + +
-
+
@@ -129,7 +137,8 @@ coloseDia() { this.url = "" this.diaShow = false - this.typeName = 'file' + this.typeName = 'file' + this.isfullscreen = false this.$emit('update:isShow', false) } } @@ -151,5 +160,14 @@ display: block; height: 100vh; width: 100%; + } + .header-title{ + display: flex; + align-items: center; + justify-content: space-between; + i{ + font-size: 18px; + margin-left:10px; + } } diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index afd399a..8aff53f 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -22,7 +22,7 @@
-
+
@@ -49,7 +49,7 @@ placeholder="选择年">
-
+
@@ -115,7 +115,8 @@ } from "@/api/home" import { index - } from "@/api/system/baseForm.js" + } from "@/api/system/baseForm.js" + import state from '@/store/modules/user.js' export default { components: { myecharts, @@ -129,7 +130,8 @@ // areasTotal: 0, status1Total: 0, dateTotal: 0 - }, + }, + stateObj: {}, nowDate: '', // 月度统计 list_areas: [], @@ -160,7 +162,8 @@ }, created() { this.monthSelect.year = this.$moment(new Date).format("YYYY") - this.yearSelect.year = this.$moment(new Date).format("YYYY") + this.yearSelect.year = this.$moment(new Date).format("YYYY") + this.stateObj = state.state this.init() this.getRecords() this.getMonthList() @@ -215,9 +218,13 @@ // 获取 业务 changeBussiness(e) { this.list_business.map(item => { - if (e === item.id) { - this.list_areas = item.area_ids_details - this.monthSelect.area_id = this.list_areas[0].id + if (e === item.id) { + // 如果是管理员 变更 区域 + if(this.stateObj.is_admin){ + this.list_areas = item.area_ids_details + this.monthSelect.area_id = this.list_areas[0].id + } + this.list_type = item.id_business_types_business_id_relation.filter(item => { return item.area_id == this.monthSelect.area_id }) @@ -248,19 +255,33 @@ page: 1, table_name: 'businesses', json_data_fields: ['area_ids'], - }) - this.list_business = res.data.reverse() - // 初始化赋值 获取月度统计 - if (res.data.length > 0) { - this.monthSelect.business_id = res.data[0].id - this.list_areas = res.data[0].area_ids_details - this.monthSelect.area_id = this.list_areas[0].id - this.list_type = res.data[0].id_business_types_business_id_relation.filter(item => { - return item.area_id == this.monthSelect.area_id - }) - - this.monthSelect.business_type_id = this.list_type[0].id - } + }) + + // 区域只能查看自己的 业务 + // 初始化赋值 获取月度统计 + // 区域只能看到自己的 不用选择区域了,业务数据并选择 + if(!this.stateObj.is_admin){ + this.list_business = res.data.filter(item => { + return item.area_ids.includes(this.stateObj.area_id) + }) + this.monthSelect.business_id = this.list_business[0].id + this.monthSelect.area_id = this.stateObj.area_id + this.list_type = this.list_business[0].id_business_types_business_id_relation.filter(item => { + return item.area_id == this.monthSelect.area_id + }) + this.monthSelect.business_type_id = this.list_type[0].id + }else{ + this.list_business = res.data.reverse() + this.monthSelect.business_id = res.data[0].id + this.list_areas = res.data[0].area_ids_details + this.monthSelect.area_id = this.list_areas[0].id + this.list_type = res.data[0].id_business_types_business_id_relation.filter(item => { + return item.area_id == this.monthSelect.area_id + }) + this.monthSelect.business_type_id = this.list_type[0].id + } + + }, async getFillChart() { @@ -338,7 +359,8 @@ async getYearList() { await this.getAreas() await this.getYearChart() - }, + }, + async getAreas() { const res = await index({ page_size: 999, @@ -347,8 +369,13 @@ sort_type: 'ASC', sort_name: 'sort', }) - this.all_areas = res.data - this.yearSelect.area_id = this.all_areas[0].id + this.all_areas = res.data + // 只能查看自己区域的业务 + if(!this.stateObj.is_admin){ + this.yearSelect.area_id = this.stateObj.area_id + }else{ + this.yearSelect.area_id = this.all_areas[0].id + } }, async getYearChart() { const res = await yearChart({ diff --git a/src/views/record/index.vue b/src/views/record/index.vue index 830be1c..c15384b 100644 --- a/src/views/record/index.vue +++ b/src/views/record/index.vue @@ -100,10 +100,12 @@
- +