优化
This commit is contained in:
parent
8909867a0e
commit
2d72f07b73
@ -317,7 +317,8 @@ export default {
|
||||
if (!type) this.handleCancelTask()
|
||||
this.formTask = {
|
||||
name: '',
|
||||
processRate: '0'
|
||||
processRate: '0',
|
||||
isNew: true
|
||||
}
|
||||
console.log(this.formTask)
|
||||
}
|
||||
@ -398,6 +399,16 @@ export default {
|
||||
return
|
||||
}
|
||||
this.obj.commentId = res.commentId
|
||||
this.obj.recortModelDtos.map(i => {
|
||||
i.detailDtos.map(j => {
|
||||
const result = this.handleFilter(j.taskDtos).reduce((result, item) => {
|
||||
result += Number(item.processRate)
|
||||
return result
|
||||
}, 0)
|
||||
const _process = Number(result.toFixed(2)) / this.handleFilter(j.taskDtos).length || 0
|
||||
j.processRate = _process.toFixed(2) || 0
|
||||
})
|
||||
})
|
||||
let res1 = await apiSaveDetail(this.obj)
|
||||
if (res1.code !== 200) {
|
||||
this.$message.error(res1.msg)
|
||||
@ -427,10 +438,19 @@ export default {
|
||||
return Math.round((weight * 100) * 1000) / 1000
|
||||
},
|
||||
async handleSaveDetail (params = this.obj) {
|
||||
params.recortModelDtos.map(i => {
|
||||
i.detailDtos.map(j => {
|
||||
const result = this.handleFilter(j.taskDtos).reduce((result, item) => {
|
||||
result += Number(item.processRate)
|
||||
return result
|
||||
}, 0)
|
||||
const _process = Number(result.toFixed(2)) / this.handleFilter(j.taskDtos).length || 0
|
||||
j.processRate = _process.toFixed(2) || 0
|
||||
})
|
||||
})
|
||||
let res = await apiSaveDetail(Object.assign({}, params, { save: 1 }))
|
||||
if (res.code !== 200) {
|
||||
this.$message.error(res.msg)
|
||||
return
|
||||
}
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user