diff --git a/src/main.js b/src/main.js
index 0220c91..2111bb2 100644
--- a/src/main.js
+++ b/src/main.js
@@ -2,6 +2,7 @@
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
+import Mixin from './mixins/gload'
import router from './router'
import store from './store'
import './utils/elementConfig'
@@ -12,6 +13,7 @@ import VConsole from 'vconsole'
import VueCookie from 'vue-cookies'
import { debounce, departGetForm, personlGetForm, handleInput, messageSuccess, loading, loadingClose } from '@/utils/common'
import { format } from '@/utils/dateFormat'
+Vue.mixin(Mixin)
// }
// let hostList = ['lzmanagement.ldxinyong.com']
diff --git a/src/mixins/gload.js b/src/mixins/gload.js
new file mode 100644
index 0000000..4557b0d
--- /dev/null
+++ b/src/mixins/gload.js
@@ -0,0 +1,20 @@
+// src/mixins/index.js
+import { mapGetters } from 'vuex'
+let mixin = {
+ data () {
+ return {}
+ },
+ computed: {
+ ...mapGetters(['auth'])
+ },
+ methods: {
+ loadPage (routerName, param) {
+ if (param) {
+ this.$router.push({name: routerName, query: param})
+ } else {
+ this.$router.push({name: routerName})
+ }
+ }
+ }
+}
+export default mixin
diff --git a/src/store/getters.js b/src/store/getters.js
index 4d8ecc2..c5d3336 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -1,5 +1,6 @@
const getters = {
permission_routes: state => state.user.routes,
- userInfo: state => state.user.info
+ userInfo: state => state.user.info,
+ auth: state => state.user.auth
}
export default getters
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index b9d2fb4..b723734 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -2,16 +2,19 @@ import { getDepList } from '@/api/report'
const user = {
state: {
deplist: [],
- info: JSON.parse(localStorage.getItem('info')) || {}
+ info: JSON.parse(localStorage.getItem('info')) || {},
+ auth: JSON.parse(localStorage.getItem('auth')) || {}
},
mutations: {
SET_USER_INFO: (state, info) => {
- console.log('state: ', state)
- console.log('info: ', info)
localStorage.setItem('info', JSON.stringify(info))
state.info = info
},
+ SET_USER_AUTH: (state, auth) => {
+ localStorage.setItem('auth', JSON.stringify(auth))
+ state.auth = auth
+ },
SET_DEPLIST: (state, list = []) => {
state.deplist = list
}
diff --git a/src/views/kpi/assessment/homeList/index.vue b/src/views/kpi/assessment/homeList/index.vue
index ac98ee2..b5441d1 100644
--- a/src/views/kpi/assessment/homeList/index.vue
+++ b/src/views/kpi/assessment/homeList/index.vue
@@ -20,7 +20,7 @@
- 发起考核
+ 发起考核
-
+
@@ -33,16 +34,16 @@
{{child.keyResult || ''}}
-
+
{{child.checkResult || '--'}}
{{( Math.round((child.checkWeight * 100) * 1000) / 1000 )}}%
-
+
-
+
-
+
{{handleScore(child.scoreDtos[child.scoreDtos.length-1].acquireScore)}}
-
+
+ {{child.scoreDtos[child.scoreDtos.length-1].acquireScore || '--'}}
+
+
{{child.scoreComment || '--'}}
@@ -64,16 +68,17 @@
-
+
-
+
+ {{score.scoreLevel}}
-
- {{handleGetScorc()}}
+
+ {{score.lastScore}}
-
@@ -124,7 +129,7 @@ export default {
}
}
},
- auth: {
+ tableAuth: {
type: Object,
default: () => {
return {}
@@ -137,33 +142,44 @@ export default {
loadingZan: false,
input: '',
scoreList: []
+ // score: {
+ // lastScore: '',
+ // scoreLevel: ''
+ // }
+ }
+ },
+ computed: {
+ score () {
+ const result = this.obj.recortModelDtos.reduce((result, i) => {
+ i.detailDtos.map(j => {
+ j.scoreDtos.map(k => {
+ const str = j.calculate.replace(/{\w+}/g, (i) => {
+ i = i.replace(/{|}/g, '')
+ return k[i]
+ })
+ let a = eval(str)
+ result += a
+ })
+ })
+ return result
+ }, 0)
+ const arr = this.scoreList.filter(i => i.minScore <= result && i.maxScore > result)
+ return {
+ lastScore: result.toFixed(3),
+ scoreLevel: arr.length > 0 ? arr[0].name : ''
+ }
}
},
mounted () {
this.handleGrt375()
},
methods: {
- handleGetScorc (obj = this.obj) {
- const result = obj.recortModelDtos.reduce((result, i) => {
- i.detailDtos.map(j => {
- const str = j.calculate.replace(/{\w+}/g, (i) => {
- i = i.replace(/{|}/g, '')
- return j[i]
- })
- let a = eval(str)
- result += a
- })
- return result
- }, 0)
- return result.toFixed(3)
- },
handleScore (item) {
- console.log('this.scoreList: ', this.scoreList)
return this.scoreList.filter(i => i.score === item).length > 0 ? this.scoreList.filter(i => i.score === item)[0].name : 0
},
async handleGetNext () {
this.loadingTi = true
- let res1 = await apiSaveDetail(this.obj)
+ let res1 = await apiSaveDetail(Object.assign({}, this.score, this.obj))
if (res1.code !== 200) {
this.$message.error(res1.msg)
this.loadingTi = false
diff --git a/src/views/kpi/assessment/performance/index.vue b/src/views/kpi/assessment/performance/index.vue
index 7883e37..1e41e10 100644
--- a/src/views/kpi/assessment/performance/index.vue
+++ b/src/views/kpi/assessment/performance/index.vue
@@ -70,7 +70,7 @@
更多
@@ -127,6 +128,7 @@
- 考评组设置
- 权限设置
+ 考评组设置
+ 权限设置
diff --git a/src/views/kpi/workbench/assessmentGroup/groundTable.vue b/src/views/kpi/workbench/assessmentGroup/groundTable.vue
index e46d877..1e585dc 100644
--- a/src/views/kpi/workbench/assessmentGroup/groundTable.vue
+++ b/src/views/kpi/workbench/assessmentGroup/groundTable.vue
@@ -12,8 +12,8 @@
新增考评组
- 新增考评组
- 复制考评组
+ 新增考评组
+ 复制考评组
@@ -40,12 +40,14 @@
width="120">
编 辑
diff --git a/src/views/kpi/workbench/home/index.vue b/src/views/kpi/workbench/home/index.vue
index 10e088f..dbdc53b 100644
--- a/src/views/kpi/workbench/home/index.vue
+++ b/src/views/kpi/workbench/home/index.vue
@@ -18,9 +18,9 @@
快捷入口
考核管理
-
考评组
-
发起考核
-
指标库
+
考评组
+
发起考核
+
指标库
diff --git a/src/views/kpi/workbench/index.vue b/src/views/kpi/workbench/index.vue
index ef43859..c26d201 100644
--- a/src/views/kpi/workbench/index.vue
+++ b/src/views/kpi/workbench/index.vue
@@ -33,11 +33,12 @@ export default {
token: this.$cookies.get('token')
}
},
- computed: {},
+ computed: {
+ },
beforeMount () {},
mounted () {},
methods: {
- ...mapMutations(['SET_USER_INFO']),
+ ...mapMutations(['SET_USER_INFO', 'SET_USER_AUTH']),
handleClick () {
this.isShow = !this.isShow
},
@@ -45,14 +46,16 @@ export default {
localStorage.setItem('input', this.input)
const params = {'userName': this.input, 'password': 'admin', 'uuid': '', 'verify': this.verify, 'verifyCode': this.verify}
let res = await apiLogin(params)
+ console.log('res: ', res)
if (res.code === 200) {
+ this.SET_USER_AUTH(res.data)
this.token = res.token
this.$cookies.set('token', res.token, res.expire)
let ress = await apiUserInfo()
if (ress.code === 200) {
this.SET_USER_INFO(ress.user)
}
- location.reload()
+ // location.reload()
}
}
},