优化
This commit is contained in:
parent
d5bebe8583
commit
c280814d02
@ -256,8 +256,13 @@ export default {
|
||||
handler (n, o) {
|
||||
console.log('nxcq: ', n)
|
||||
if (n.isActive !== 0) {
|
||||
if (n.optType === 0) n.optType = 1
|
||||
n.name = this.options.filter(i => i.id === n.optType)[0].name
|
||||
if (n.optType === 0 && n.optType !== -1) {
|
||||
n.name = this.options.filter(i => i.id === n.optType)[0].name
|
||||
n.optType = 1
|
||||
}
|
||||
if (n.optType === -1) {
|
||||
n.name = '考核人员自己'
|
||||
}
|
||||
} else {
|
||||
if (n.list) {
|
||||
n.name = this.handleTitle(n.list)
|
||||
|
||||
@ -264,6 +264,13 @@ export default {
|
||||
if (n.isActive !== 0) {
|
||||
if (n.optType === 0) n.optType = 1
|
||||
n.name = this.options.filter(i => i.id === n.optType)[0].name
|
||||
} else {
|
||||
// n.name
|
||||
if (n.list) {
|
||||
n.name = this.handleTitle(n.list)
|
||||
} else {
|
||||
n.name = '未指定成员'
|
||||
}
|
||||
}
|
||||
n.weight = n.weight1 / 100
|
||||
if (n.weight1 >= 0) {
|
||||
|
||||
@ -150,7 +150,7 @@
|
||||
<el-radio label="">不限数量</el-radio>
|
||||
<el-radio label="1">自定义</el-radio>
|
||||
</el-radio-group>
|
||||
<el-input clearable size="small" style="width:160px;'" v-if="maxCount==1" v-model="form.maxCount"></el-input>
|
||||
<el-input clearable size="small" style="width:160px;'" v-if="maxCount" v-model="form.maxCount"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所含指标总权重">
|
||||
<div slot="label">所含指标总权重
|
||||
@ -162,7 +162,7 @@
|
||||
<el-radio :label="0">不限权重</el-radio>
|
||||
<el-radio :label="1">自定义</el-radio>
|
||||
</el-radio-group>
|
||||
<el-input clearable size="small" style="width:160px;'" v-if="weight===1" v-model="form.weight">
|
||||
<el-input clearable size="small" style="width:160px;'" v-if="weight!==0" v-model="form.weight">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -340,13 +340,13 @@ export default {
|
||||
handleSubmit () {
|
||||
this.$refs.form.validate((v) => {
|
||||
if (v) {
|
||||
this.form.weight = this.form.weight / 100 > 1 ? 1 : this.form.weight / 100
|
||||
if (this.form.isEdit) {
|
||||
this.info.modelItems[this.form.index] = Object.assign({}, this.form)
|
||||
this.form = {}
|
||||
this.show = false
|
||||
return
|
||||
}
|
||||
this.form.weight = this.form.weight / 100 > 1 ? 1 : this.form.weight / 100
|
||||
this.info.modelItems.push(Object.assign({}, this.form, {isDelete: 0}))
|
||||
this.form = {}
|
||||
this.show = false
|
||||
@ -355,15 +355,19 @@ export default {
|
||||
},
|
||||
// 编辑
|
||||
hanidleEdit (item, index, type) {
|
||||
this.maxCount = item.maxCount > 0 ? '1' : ''
|
||||
this.weight = item.weight > 0 ? 1 : 0
|
||||
if (type === -1) {
|
||||
this.weiduTitle = '编辑维度'
|
||||
this.form = Object.assign({}, item, {index, index2: type, isEdit: true})
|
||||
console.log(' this.form: ', this.form)
|
||||
this.form.weight = this.form.weight * 100
|
||||
console.log('this.form: ', this.form)
|
||||
this.show = true
|
||||
} else {
|
||||
this.zhibiaoTitle = '编辑指标'
|
||||
this.formIndicators = Object.assign({}, item, {index, index2: type, isEdit: true})
|
||||
this.formIndicators.weight = this.formIndicators.weight * 100
|
||||
this.formIndicators.weight = this.formIndicators.weight
|
||||
this.showIndicators = true
|
||||
}
|
||||
},
|
||||
@ -394,16 +398,17 @@ export default {
|
||||
},
|
||||
handleSubmitZhibiao () {
|
||||
this.$refs.formIndicators.validate((v) => {
|
||||
console.log('v: ', v)
|
||||
if (v) {
|
||||
this.formIndicators.weight = this.formIndicators.weight / 100 > 1 ? 1 : this.formIndicators.weight / 100
|
||||
if (this.formIndicators.isEdit) {
|
||||
this.info.modelItems[this.formIndicators.index].tagetLibItems[this.formIndicators.index2] = Object.assign({}, this.formIndicators)
|
||||
this.showIndicators = false
|
||||
return
|
||||
}
|
||||
if (!this.zanshi.tagetLibItems) this.zanshi.tagetLibItems = []
|
||||
this.formIndicators.weight = this.formIndicators.weight / 100 > 1 ? 1 : this.formIndicators.weight / 100
|
||||
this.zanshi.tagetLibItems.push(Object.assign({}, this.formIndicators, {isDelete: 0}))
|
||||
this.showIndicators = false
|
||||
// this.showIndicators = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -66,34 +66,36 @@ export default {
|
||||
console.log('this.basisForm: ', this.basisForm)
|
||||
try {
|
||||
let res = await saveBaseSet(this.basisForm)
|
||||
let res2 = await saveTemSet(this.templateForm)
|
||||
|
||||
this.basisForm = res
|
||||
this.templateForm.evaluationGroupId = res.id
|
||||
for (let i in this.processInfo) {
|
||||
console.log('processInfo: ', i)
|
||||
let res3 = await saveDetailProcs(Object.assign({}, this.processInfo[i].chartDetails, {evaluationGroupId: res.id}))
|
||||
console.log('res: ', res3)
|
||||
try {
|
||||
let res1 = await saveDetailProcs(Object.assign({}, this.processInfo[i].chartDetails, {evaluationGroupId: res.id}))
|
||||
console.log('res: ', res1)
|
||||
} catch (error) {
|
||||
console.log('error: ', error)
|
||||
}
|
||||
}
|
||||
console.log('res: ', res)
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
onClose: () => {
|
||||
this.$router.replace({name: 'workbench-group'})
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
this.$message.error(error.msg)
|
||||
}
|
||||
// console.log('this.templateForm: ', JSON.stringify(this.templateForm))
|
||||
// try {
|
||||
// let res2 = await saveTemSet(this.templateForm)
|
||||
// // this.basisForm = res
|
||||
// console.log('res: ', res2)
|
||||
// } catch (error) {
|
||||
// this.$message.error(error.msg)
|
||||
// }
|
||||
console.log('this.templateForm: ', JSON.stringify(this.templateForm))
|
||||
try {
|
||||
let res = await saveTemSet(this.templateForm)
|
||||
// this.basisForm = res
|
||||
console.log('res: ', res)
|
||||
} catch (error) {
|
||||
this.$message.error(error.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
onClose: () => {
|
||||
this.$router.replace({name: 'workbench-group'})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user