diff --git a/src/views/kpi/assessment/goals/index.vue b/src/views/kpi/assessment/goals/index.vue
index c7f5574..d517df8 100644
--- a/src/views/kpi/assessment/goals/index.vue
+++ b/src/views/kpi/assessment/goals/index.vue
@@ -197,10 +197,16 @@
@@ -283,6 +289,7 @@ export default {
computed: {},
beforeMount () { },
mounted () {
+ console.log('auth', this.auth)
this.handleGetDimensions()
this.handleGetTbale()
},
@@ -451,7 +458,36 @@ export default {
arr.isTrue = (Math.round((weight * 100) * 1000) / 1000) === (Math.round((arr.weight * 100) * 1000) / 1000)
return Math.round((weight * 100) * 1000) / 1000
},
- async handleSaveDetail (params = this.obj) {
+ async handleSaveDetail (params = this.obj, type) {
+ if (type === 1) {
+ const arr = this.handleFilter(this.obj.recortModelDtos)
+ if (arr.some(i => i.weight === null)) {
+ let weight = 0
+ let maxWeight = 0
+ const nullArray = arr.map(i => {
+ i.detailDtos.map(j => {
+ if (i.weight === null) maxWeight += j.checkWeight
+ weight += j.checkWeight
+ })
+ })
+ if (weight !== 1) {
+ const noWeightArr = arr.filter(i => i.weight === null)
+ let str = noWeightArr.map(i => i.name).join(',')
+ this.$message.error(str + '维度内的权重和必须为100%!')
+ return
+ }
+ } else {
+ for (let i in arr) {
+ let num = 0
+ arr[i].detailDtos.map(l => {
+ num += l.checkWeight
+ })
+ if (num.toFixed(2) !== arr[i].weight.toFixed(2)) {
+ return this.$message.error(arr[i].name + '维度内的权重和必须为' + Math.round((arr[i].weight * 100) * 1000) / 1000)
+ }
+ }
+ }
+ }
params.recortModelDtos.map(i => {
i.detailDtos.map(j => {
const result = this.handleFilter(j.taskDtos).reduce((result, item) => {
diff --git a/src/views/kpi/assessment/performance/components/UseButton/index.vue b/src/views/kpi/assessment/performance/components/UseButton/index.vue
index cd45592..e52de53 100644
--- a/src/views/kpi/assessment/performance/components/UseButton/index.vue
+++ b/src/views/kpi/assessment/performance/components/UseButton/index.vue
@@ -502,7 +502,7 @@ export default {
handleZhiding () {
this.$router.push({
name: 'assessment-goals',
- query: {
+ query: {...this.formList.auth,
id: this.resultRecordId || ''
}
})
diff --git a/src/views/kpi/assessment/performance/components/table.vue b/src/views/kpi/assessment/performance/components/table.vue
index fc38681..9678673 100644
--- a/src/views/kpi/assessment/performance/components/table.vue
+++ b/src/views/kpi/assessment/performance/components/table.vue
@@ -251,7 +251,7 @@ export default {
return k.scoreDtos[index][l] || 0
})
// eslint-disable-next-line no-eval
- result += (k.scoreDtos[index].score || eval(str))
+ result += (eval(str))
!k.scoreDtos[index].score && (k.scoreDtos[index].score = result)
})
})