diff --git a/src/main.js b/src/main.js index 58388e8..bbd531c 100644 --- a/src/main.js +++ b/src/main.js @@ -11,7 +11,7 @@ import './style/index.less' import '@/icons' import _ from 'lodash' import VueCookie from 'vue-cookies' -import { debounce, departGetForm, personlGetForm, handleInput, messageSuccess, loading, loadingClose } from '@/utils/common' +import { debounce, departGetForm, personlGetForm, handleInput, messageSuccess, loading, loadingClose, handleBlur } from '@/utils/common' import { format } from '@/utils/dateFormat' Vue.prototype._ = _ Vue.mixin(Mixin) @@ -24,6 +24,8 @@ Vue.prototype.debounce = debounce Vue.prototype.$personlGetForm = personlGetForm Vue.prototype.$departGetForm = departGetForm Vue.prototype.$handleInputInt = handleInput + +Vue.prototype.$handleBlur = handleBlur Vue.prototype.$msg = messageSuccess /* eslint-disable no-new */ diff --git a/src/utils/common.js b/src/utils/common.js index 5937513..9ac9b57 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -78,9 +78,14 @@ export function departGetForm (arr = []) { export function handleInput (form) { let value = this[form.split('.')[0]][form.split('.')[1]] + console.log('value: ', typeof value) 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) || 0 + this[form.split('.')[0]][form.split('.')[1]] = String(a) +} + +export function handleBlur (form) { + this[form.split('.')[0]][form.split('.')[1]] = this[form.split('.')[0]][form.split('.')[1]] || '0' } export function messageSuccess (params) { diff --git a/src/views/kpi/assessment/goals/index.vue b/src/views/kpi/assessment/goals/index.vue index 0a01b4f..ff8acce 100644 --- a/src/views/kpi/assessment/goals/index.vue +++ b/src/views/kpi/assessment/goals/index.vue @@ -96,7 +96,7 @@ - + @@ -331,7 +331,7 @@ export default { bottom: 0; left: 0; &-content{ - width: 1360px; + padding: 0 80px; margin: 0 auto; height: 100%; display: flex; diff --git a/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue b/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue index 0b08e98..200fc67 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue @@ -45,7 +45,7 @@
评分权重:
- +
diff --git a/src/views/kpi/workbench/assessmentGroup/edit/components/templateSet.vue b/src/views/kpi/workbench/assessmentGroup/edit/components/templateSet.vue index 94280d5..8184463 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/components/templateSet.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/components/templateSet.vue @@ -164,7 +164,7 @@ 不限权重 自定义 - + @@ -190,7 +190,7 @@ - + @@ -227,7 +227,10 @@ export default { weight: 0, // 整个info info: info, - form: {}, // 控制维度管理的表单 + form: { + weight: '', + maxCount: '' + }, // 控制维度管理的表单 rules: { name: [{ required: true, message: '请输入维度名称', @@ -338,7 +341,9 @@ export default { // 添加考核维度 handleAdd () { this.form = { - type: this.dimensionsList.length > 0 ? this.dimensionsList[0].id : '' + type: this.dimensionsList.length > 0 ? this.dimensionsList[0].id : '', + weight: '', + maxCount: '' } this.weiduTitle = '添加维度' this.show = true @@ -412,7 +417,8 @@ export default { this.zanshi = item this.zhibiaoTitle = '添加指标' this.formIndicators = { - zhibiao: item.type + zhibiao: item.type, + weight: '' } this.showIndicators = true },