所含指标总权重
@@ -162,7 +162,7 @@
不限权重
自定义
-
+
%
@@ -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
}
})
}
diff --git a/src/views/kpi/workbench/assessmentGroup/edit/index.vue b/src/views/kpi/workbench/assessmentGroup/edit/index.vue
index 24b5d77..0ac623e 100644
--- a/src/views/kpi/workbench/assessmentGroup/edit/index.vue
+++ b/src/views/kpi/workbench/assessmentGroup/edit/index.vue
@@ -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: {}