From dd54864b23fd422677720d825e5a3396e4b9ca6c Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 26 Jun 2023 10:35:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=88=E6=9B=B4=E6=94=B9=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=85=B6=E4=BB=96=E4=B8=80=E4=BA=9B=E5=B0=8F=E6=94=B9?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/store/getters.js | 1 + client/src/store/modules/user.js | 12 +++++-- .../views/supervisionNew/basicGoalDept.vue | 12 ++++--- client/src/views/supervisionNew/mytask.vue | 19 +++++----- .../src/views/supervisionNew/statistics.vue | 35 ++++++++++++++----- 5 files changed, 53 insertions(+), 26 deletions(-) diff --git a/client/src/store/getters.js b/client/src/store/getters.js index 8563769..7ec2560 100644 --- a/client/src/store/getters.js +++ b/client/src/store/getters.js @@ -4,6 +4,7 @@ const getters = { token: state => state.user.token, avatar: state => state.user.avatar, dept: state => state.user.dept, + dept_name: state => state.user.dept_name, name: state => state.user.name, perms: state => state.user.perms, permission_routes: state => state.permission.routes diff --git a/client/src/store/modules/user.js b/client/src/store/modules/user.js index 18712d5..1b23525 100644 --- a/client/src/store/modules/user.js +++ b/client/src/store/modules/user.js @@ -8,7 +8,8 @@ const getDefaultState = () => { name: '', avatar: '', perms: [], - dept:'' + dept:'', + dept_name:'', } } @@ -32,7 +33,10 @@ const mutations = { }, SET_DEPT: (state, dept) => { state.dept = dept - } + }, + SET_DEPTNAME: (state, dept_name) => { + state.dept_name = dept_name + }, } const actions = { @@ -51,6 +55,7 @@ const actions = { }) }) }, + fulllogin({ commit }, userInfo) { const { username, password } = userInfo return new Promise((resolve, reject) => { @@ -104,7 +109,7 @@ const actions = { reject('验证失败,重新登陆.') } - const { perms, name, avatar, dept } = data + const { perms, name, avatar, dept, dept_name} = data // perms must be a non-empty array if (!perms || perms.length <= 0) { @@ -115,6 +120,7 @@ const actions = { commit('SET_NAME', name) commit('SET_AVATAR', avatar) commit('SET_DEPT', dept) + commit('SET_DEPTNAME', dept_name) resolve(data) }).catch(error => { reject(error) diff --git a/client/src/views/supervisionNew/basicGoalDept.vue b/client/src/views/supervisionNew/basicGoalDept.vue index 41486d7..8cbd20f 100644 --- a/client/src/views/supervisionNew/basicGoalDept.vue +++ b/client/src/views/supervisionNew/basicGoalDept.vue @@ -65,6 +65,7 @@ page: 0, year:'', goal_key__in:'pgoal_1,pgoal_2,pgoal_3,pgoal_4,pgoal_5', + belong_dept__in:'' }, taskList:[], heightTable:null, @@ -72,7 +73,7 @@ }; }, mounted(){ - this.getList(); + this.getOrgList(); let height = document.getElementsByClassName('app-main')[0].clientHeight; this.heightTable = height-90; }, @@ -84,8 +85,9 @@ if (that.checkPermission(["record_confirm"])) { getOrgList({ can_supervision: true }).then((res) => { let data = res.data; + debugger; for(let i=0;i { let data = res.data; + debugger; for(let i=0;i { if (res.data) { let data0 = res.data; diff --git a/client/src/views/supervisionNew/mytask.vue b/client/src/views/supervisionNew/mytask.vue index 7af223c..8a78bb3 100644 --- a/client/src/views/supervisionNew/mytask.vue +++ b/client/src/views/supervisionNew/mytask.vue @@ -5,7 +5,7 @@
任务列表
@@ -151,7 +151,7 @@
- 公司文件: + 相应实施细则: { that.orgData = res.data; that.orgData.filter(item=>{ - if(item.id==that.listQuery.dept){ + if(item.id==that.listQuery.belong_dept){ that.deptName = item.name; } }) @@ -734,7 +734,7 @@ import user from "@/store/modules/user"; getSubOrgList().then((res) => { that.orgData = res.data; that.orgData.filter(item=>{ - if(item.id==that.listQuery.dept){ + if(item.id==that.listQuery.belong_dept){ that.deptName = item.name; } }) @@ -747,8 +747,7 @@ import user from "@/store/modules/user"; this.dataList.count =0; getMyTask2Do(this.listQuery).then((response) => { if (response.data) { - this.dataList.results = response.data; - this.dataList.count = response.data.length; + this.dataList = response.data; } this.listLoading = false; }); @@ -767,7 +766,7 @@ import user from "@/store/modules/user"; that.numbers.num_issue = ''; that.listQuery.page = 1; that.orgData.filter(item=>{ - if(item.id==that.listQuery.dept){ + if(item.id==that.listQuery.belong_dept){ that.deptName = item.name; } }) @@ -776,7 +775,7 @@ import user from "@/store/modules/user"; resetFilter() { this.listQuery = { page: 1, - search:'', + belong_dept:'', page_size: 20, } this.getList(); diff --git a/client/src/views/supervisionNew/statistics.vue b/client/src/views/supervisionNew/statistics.vue index 5ded3ba..13d808a 100644 --- a/client/src/views/supervisionNew/statistics.vue +++ b/client/src/views/supervisionNew/statistics.vue @@ -36,7 +36,7 @@ > - +
-

{{ fileName }}

-

{{ listQuery.task2__year }}年 1—12月质量目标双月报

+

{{ deptName }}

+

{{ listQuery.task2__year }}年 1—12月质量目标双月报

@@ -310,7 +310,6 @@ ], orgData:[], barChart1:null, - bar1option:{}, barchart2:null, lineChart1:null, lineChart2:null, @@ -332,16 +331,31 @@ }; }, mounted() { - this.getGroup(); + this.supTate = this.checkPermission(["record_confirm"]); + if(this.supTate ){ + }else{ + let date = new Date(); + this.listQuery.task2__year = date.getFullYear()+''; + this.deptName = this.$store.getters.dept_name; + this.listQuery.belong_dept = this.$store.getters.dept; + this.handleFilter(); + } this.optionSet(); + this.getGroup(); }, methods: { belongDeptChange(a){ - this.fileName = ''; let selectItem = this.orgData.filter(item=>{ return item.id==a }) this.deptName = selectItem[0].name; + this.bar1Data=[]; + this.bar2Data=[]; + this.line1Data=[]; + this.line2Data =[]; + this.line3Data=[]; + this.line4Data=[]; + this.tableDatas=[[],[],[],[],[],[],[],[],[],[],[],[],[]]; }, optionSet(){ let chartDom1 = document.getElementById('bar1'); @@ -405,9 +419,11 @@ text: '报告/证书合格率(%)' }, tooltip: { - trigger: 'axis' + trigger: 'axis', + }, legend: { + right:30, data: ['报告/证书合格率'] }, grid: { @@ -454,6 +470,7 @@ trigger: 'axis' }, legend: { + right:30, data: ['报告/证书及时率'] }, grid: { @@ -500,6 +517,7 @@ trigger: 'axis' }, legend: { + right:30, data: ['能力验证满意率'] }, grid: { @@ -546,6 +564,7 @@ trigger: 'axis' }, legend: { + right:30, data: ['客户投诉处理满意率'] }, grid: { @@ -593,7 +612,6 @@ that.line2Data = []; that.line3Data = []; that.line4Data = []; - that.fileName = that.deptName; that.tableData1 = []; that.tableDatas = [ [],[],[],[],[],[],[],[],[],[],[],[],[]]; getTask2Do(that.listQuery).then(res=>{ @@ -746,7 +764,6 @@ }else{ this.$message.warning('请选择部门') } - }, handlePrint() { this.$PRINT('#myReport');