diff --git a/src/utils/common.js b/src/utils/common.js index 6bf42e7..4d81d7a 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -81,7 +81,7 @@ export function handleInput (form) { let value = this[form.split('.')[0]][form.split('.')[1]] if (String(value).split('.').length > 2) value = String(parseFloat(value)) const a = Number(value) > 100 ? 0 : value.replace(/[^.\d]/g, '') - this[form.split('.')[0]][form.split('.')[1]] = String(a) + this[form.split('.')[0]][form.split('.')[1]] = String(a) || 0 } export function messageSuccess (params) { diff --git a/src/views/kpi/assessment/performance/components/table.vue b/src/views/kpi/assessment/performance/components/table.vue index 1471064..ee08d0d 100644 --- a/src/views/kpi/assessment/performance/components/table.vue +++ b/src/views/kpi/assessment/performance/components/table.vue @@ -2,99 +2,68 @@
- {{child.keyResult || ''}}
-
- {{child.checkResult || '--'}}
+
@@ -155,9 +124,9 @@ export default {
},
computed: {
score () {
- const result = this.obj.recortModelDtos && this.obj.recortModelDtos.reduce((result, i) => {
- i.detailDtos && i.detailDtos.map(j => {
- j.scoreDtos && j.scoreDtos.map(k => {
+ 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]
@@ -184,14 +153,11 @@ export default {
},
async handleGetNext () {
this.loadingTi = true
- let paramsObj = this.obj
- if ((this.tableInfo.score || this.tableAuth.showScore)) {
- paramsObj = Object.assign({}, paramsObj, this.score)
- }
- let res1 = await apiSaveDetail(paramsObj)
+ let res1 = await apiSaveDetail(Object.assign({}, this.obj, this.score))
if (res1.code !== 200) {
- this.loadingTi = false
this.$message.error(res1.msg)
+ this.loadingTi = false
+ return
}
const obj = {status: 1, menuName: this.tableInfo.result ? '提交了结果值' : '提交了评分'}
const params = Object.assign({}, {resultRecordId: this.$route.query.id || ''}, obj)
@@ -199,6 +165,7 @@ export default {
this.loadingTi = false
if (res.code !== 200) {
this.$message.error(res.msg)
+ return
}
this.$message({
message: res.msg,
@@ -214,13 +181,9 @@ export default {
if (res.code !== 200) return
this.scoreList = res.data
},
- async handleSaveDetail (params = this.obj) {
+ async handleSaveDetail (params = Object.assign({}, this.obj, this.score)) {
this.loadingZan = true
- let paramsObj = params
- if ((this.tableInfo.score || this.tableAuth.showScore)) {
- paramsObj = Object.assign({}, paramsObj, this.score)
- }
- let res = await apiSaveDetail(paramsObj)
+ let res = await apiSaveDetail(params)
this.loadingZan = false
if (res.code !== 200) {
this.$message.error(res.msg)
@@ -235,27 +198,83 @@ export default {
}