Browse Source

Merge branch 'dev_1114' of http://121.42.41.42:7070/r/esua-epdc-admin into dev_1114

master
gupeng 6 years ago
parent
commit
d11922b87b
  1. 1046
      src/element-ui/theme/cascader-new.css
  2. 1
      src/main.js
  3. 14
      src/views/modules/events/issue-change-list.vue
  4. 14
      src/views/modules/events/issue-close-list.vue
  5. 14
      src/views/modules/events/issue-process-list.vue
  6. 14
      src/views/modules/events/issue-reject-list.vue
  7. 14
      src/views/modules/events/issue-review-list.vue
  8. 14
      src/views/modules/events/item-close-list.vue
  9. 8
      src/views/modules/events/item-deal-list.vue
  10. 14
      src/views/modules/events/item-end-list.vue
  11. 14
      src/views/modules/group/leaderboard.vue
  12. 144
      src/views/modules/kpi/kpimanualscore-add-or-update.vue
  13. 126
      src/views/modules/kpi/kpimanualscore.vue
  14. 62
      src/views/modules/kpi/kpirule-add-or-update.vue
  15. 34
      src/views/modules/kpi/kpirule.vue
  16. 187
      src/views/modules/kpi/manual-score-add-or-update.vue

1046
src/element-ui/theme/cascader-new.css

File diff suppressed because it is too large

1
src/main.js

@ -10,6 +10,7 @@ import '@/assets/scss/aui.scss'
import http from '@/utils/request' import http from '@/utils/request'
import { hasPermission } from '@/utils' import { hasPermission } from '@/utils'
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
import '@/element-ui/theme/cascader-new.css'
Vue.config.productionTip = false Vue.config.productionTip = false

14
src/views/modules/events/issue-change-list.vue

@ -156,14 +156,22 @@ export default {
}, },
watch: { watch: {
'ids': function (val) { 'ids': function (val) {
if (val.length === 1){ if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
} }
if (val.length === 2){ if (val.length === 2) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
} }
if (val.length === 3){ if (val.length === 3) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2] this.dataForm.gridId = this.ids[2]

14
src/views/modules/events/issue-close-list.vue

@ -157,14 +157,22 @@ export default {
}, },
watch: { watch: {
'ids': function (val) { 'ids': function (val) {
if (val.length === 1){ if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
} }
if (val.length === 2){ if (val.length === 2) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
} }
if (val.length === 3){ if (val.length === 3) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2] this.dataForm.gridId = this.ids[2]

14
src/views/modules/events/issue-process-list.vue

@ -167,14 +167,22 @@ export default {
}, },
watch: { watch: {
'ids': function (val) { 'ids': function (val) {
if (val.length === 1){ if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
} }
if (val.length === 2){ if (val.length === 2) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
} }
if (val.length === 3){ if (val.length === 3) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2] this.dataForm.gridId = this.ids[2]

14
src/views/modules/events/issue-reject-list.vue

@ -136,14 +136,22 @@ export default {
}, },
watch: { watch: {
'ids': function (val) { 'ids': function (val) {
if (val.length === 1){ if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
} }
if (val.length === 2){ if (val.length === 2) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
} }
if (val.length === 3){ if (val.length === 3) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2] this.dataForm.gridId = this.ids[2]

14
src/views/modules/events/issue-review-list.vue

@ -136,14 +136,22 @@ export default {
}, },
watch: { watch: {
'ids': function (val) { 'ids': function (val) {
if (val.length === 1){ if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
} }
if (val.length === 2){ if (val.length === 2) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
} }
if (val.length === 3){ if (val.length === 3) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2] this.dataForm.gridId = this.ids[2]

14
src/views/modules/events/item-close-list.vue

@ -157,14 +157,22 @@ export default {
}, },
watch: { watch: {
'ids': function (val) { 'ids': function (val) {
if (val.length === 1){ if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
} }
if (val.length === 2){ if (val.length === 2) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
} }
if (val.length === 3){ if (val.length === 3) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2] this.dataForm.gridId = this.ids[2]

8
src/views/modules/events/item-deal-list.vue

@ -158,12 +158,20 @@ export default {
}, },
watch: { watch: {
'ids': function (val) { 'ids': function (val) {
if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) { if (val.length === 1) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
} }
if (val.length === 2) { if (val.length === 2) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
} }
if (val.length === 3) { if (val.length === 3) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]

14
src/views/modules/events/item-end-list.vue

@ -158,14 +158,22 @@ export default {
}, },
watch: { watch: {
'ids': function (val) { 'ids': function (val) {
if (val.length === 1){ if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
} }
if (val.length === 2){ if (val.length === 2) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
} }
if (val.length === 3){ if (val.length === 3) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2] this.dataForm.gridId = this.ids[2]

14
src/views/modules/group/leaderboard.vue

@ -125,14 +125,22 @@ export default {
this.getDataList() this.getDataList()
}, },
'ids': function (val) { 'ids': function (val) {
if (val.length === 1){ if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
} }
if (val.length === 2){ if (val.length === 2) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
} }
if (val.length === 3){ if (val.length === 3) {
this.dataForm.streetId = this.ids[0] this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1] this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2] this.dataForm.gridId = this.ids[2]

144
src/views/modules/kpi/kpimanualscore-add-or-update.vue

@ -0,0 +1,144 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '110px'">
<el-form-item label="考核名称" prop="scoreName">
<el-input v-model="dataForm.scoreName" placeholder="打分项名称"></el-input>
</el-form-item>
<el-form-item label="考核部门类别" prop="deptTypeKey">
<el-select v-model="dataForm.deptTypeKey" placeholder="考核部门类别">
<el-option
v-for="item in deptTypeKeyList"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="考核周期" prop="scoreCycle">
<el-select v-model="dataForm.scoreCycle" placeholder="考核周期">
<el-option
v-for="item in scoreCycleList"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="满分" prop="fullMarks">
<el-input v-model="dataForm.fullMarks" placeholder="满分"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
scoreCycleList: [],
deptTypeKeyList: [],
dataForm: {
id: '',
scoreName: '',
deptTypeKey: '',
scoreCycle: '',
fullMarks: ''
}
}
},
created () {
this.getScoreCycleList()
this.getDeptTypeKeyList()
},
computed: {
dataRule () {
return {
scoreName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
deptTypeKey: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
scoreCycle: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
fullMarks: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/kpi/kpimanualscore/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/kpi/kpimanualscore/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false }),
//
getScoreCycleList () {
this.$http
.get(`/sys/dict/listSimple/kpi_cycle`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.scoreCycleList = res.data
})
.catch(() => {})
},
//
getDeptTypeKeyList () {
this.$http.get(`/sys/dict/listSimple/org_type`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.deptTypeKeyList = res.data
}).catch(() => { })
}
}
}
</script>

126
src/views/modules/kpi/kpimanualscore.vue

@ -0,0 +1,126 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-kpi__kpimanualscore}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="考核名称">
<el-input v-model="dataForm.scoreName" placeholder="考核名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('kpi:kpimanualscore:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('kpi:kpimanualscore:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column prop="id" label="主键" header-align="center" align="center" v-if="false"></el-table-column>
<el-table-column prop="scoreName" label="考核名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptTypeKey" label="考核部门类别" header-align="center" align="center" :formatter="showDeptTypeKeyFormatter"></el-table-column>
<el-table-column prop="scoreCycle" label="考核周期" header-align="center" align="center" :formatter="showScoreCycleFormatter"></el-table-column>
<el-table-column prop="fullMarks" label="满分" header-align="center" align="center"></el-table-column>
<el-table-column prop="revision" label="乐观锁" header-align="center" align="center" v-if="false"></el-table-column>
<el-table-column prop="createdBy" label="创建人" header-align="center" align="center" v-if="false"></el-table-column>
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="updatedBy" label="更新人" header-align="center" align="center" v-if="false"></el-table-column>
<el-table-column prop="updatedTime" label="更新时间" header-align="center" align="center" v-if="false"></el-table-column>
<el-table-column prop="delFlag" label="删除标记" header-align="center" align="center" v-if="false"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('kpi:kpimanualscore:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('kpi:kpimanualscore:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './kpimanualscore-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/kpi/kpimanualscore/page',
getDataListIsPage: true,
deleteURL: '/kpi/kpimanualscore',
deleteIsBatch: true
},
dataForm: {
scoreName: ''
},
scoreCycleList: [],
deptTypeKeyList: []
}
},
components: {
AddOrUpdate
},
created () {
this.getScoreCycleList()
this.getDeptTypeKeyList()
},
methods: {
//
getScoreCycleList () {
this.$http
.get(`/sys/dict/listSimple/kpi_cycle`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.scoreCycleList = res.data
})
.catch(() => {})
},
//
showScoreCycleFormatter: function (row, column) {
if (row.scoreCycle) {
let dict = this.scoreCycleList.filter(item => item.dictValue === row.scoreCycle)[0]
if (dict) {
return dict.dictName
}
}
return ''
},
//
getDeptTypeKeyList () {
this.$http.get(`/sys/dict/listSimple/org_type`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.deptTypeKeyList = res.data
}).catch(() => { })
},
//
showDeptTypeKeyFormatter: function (row, column) {
if (row.deptTypeKey) {
let dict = this.deptTypeKeyList.filter(item => item.dictValue === row.deptTypeKey)[0]
if (dict) {
return dict.dictName
}
}
return ''
}
}
}
</script>

62
src/views/modules/kpi/kpirule-add-or-update.vue

@ -26,17 +26,6 @@
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="规则生成方式" prop="ruleMode">
<el-select v-model="dataForm.ruleMode" placeholder="规则生成方式" @change="handleRuleMode(dataForm.ruleMode)">
<el-option
v-for="item in ruleModeList"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="考核周期" prop="kpiCycle"> <el-form-item label="考核周期" prop="kpiCycle">
<el-select v-model="dataForm.kpiCycle" placeholder="考核周期"> <el-select v-model="dataForm.kpiCycle" placeholder="考核周期">
<el-option <el-option
@ -49,7 +38,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="考核部门类别" prop="deptTypeKey"> <el-form-item label="考核部门类别" prop="deptTypeKey">
<el-select v-model="dataForm.deptTypeKey" placeholder="考核周期"> <el-select v-model="dataForm.deptTypeKey" placeholder="考核部门类别">
<el-option <el-option
v-for="item in deptTypeKeyList" v-for="item in deptTypeKeyList"
:key="item.dictValue" :key="item.dictValue"
@ -59,7 +48,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="引用" prop="referenceId" v-if="dataForm.ruleMode === '0'"> <el-form-item label="引用" prop="referenceId">
<el-select v-model="dataForm.referenceId" clearable placeholder="引用" @change="handlereference(dataForm.referenceId)"> <el-select v-model="dataForm.referenceId" clearable placeholder="引用" @change="handlereference(dataForm.referenceId)">
<el-option <el-option
v-for="item in kpiFormulaList" v-for="item in kpiFormulaList"
@ -70,7 +59,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="入参" prop="metaDataCode" v-if="dataForm.ruleMode === '0'"> <el-form-item label="入参" prop="metaDataCode">
<el-select <el-select
v-model="dataForm.metaDataCode" v-model="dataForm.metaDataCode"
filterable filterable
@ -88,7 +77,7 @@
&nbsp; &nbsp; &nbsp; &nbsp;
<el-button type="primary" @click="addRuleParam(dataForm.metaDataCode)">添加</el-button> <el-button type="primary" @click="addRuleParam(dataForm.metaDataCode)">添加</el-button>
</el-form-item> </el-form-item>
<el-table :data="dataForm.ruleParamList" v-if="dataForm.ruleMode === '0' && dataForm.ruleParamList &&dataForm.ruleParamList.length>0" border> <el-table :data="dataForm.ruleParamList" v-if="dataForm.ruleParamList &&dataForm.ruleParamList.length>0" border>
<el-table-column type="index" width="50" label="序号"></el-table-column> <el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column prop="id" label="参数表主键" v-if="false"></el-table-column> <el-table-column prop="id" label="参数表主键" v-if="false"></el-table-column>
<el-table-column prop="metaDataCode" label="参数名称" :formatter="showMetaDataCodeFormatter"> </el-table-column> <el-table-column prop="metaDataCode" label="参数名称" :formatter="showMetaDataCodeFormatter"> </el-table-column>
@ -131,12 +120,12 @@ export default {
id: '', id: '',
ruleName: '', ruleName: '',
ruleCode: '', ruleCode: '',
ruleMode: '', ruleMode: '0', // (0-1-2-)
referenceId: '', referenceId: '', // id
kpiCycle: '', kpiCycle: '', //
deptTypeKey: '', deptTypeKey: '', //
metaDataCode: '', metaDataCode: '', //
ruleParamList: [] ruleParamList: []//
}, },
deptTypeKeyList: [] deptTypeKeyList: []
} }
@ -158,16 +147,9 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
ruleMode: [
{
required: true,
message: this.$t('validate.required'),
trigger: 'blur'
}
],
referenceId: [ referenceId: [
{ {
required: false, required: true,
message: this.$t('validate.required'), message: this.$t('validate.required'),
trigger: 'blur' trigger: 'blur'
} }
@ -197,7 +179,6 @@ export default {
} }
}, },
created () { created () {
this.getRuleModeList()
this.getKpiCycleList() this.getKpiCycleList()
this.getKpiFormulaList() this.getKpiFormulaList()
this.getMetaDataCodeList() this.getMetaDataCodeList()
@ -262,18 +243,6 @@ export default {
1000, 1000,
{ leading: true, trailing: false } { leading: true, trailing: false }
), ),
//
getRuleModeList () {
this.$http
.get(`/sys/dict/listSimple/rule_mode`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.ruleModeList = res.data
})
.catch(() => {})
},
// //
getKpiCycleList () { getKpiCycleList () {
this.$http this.$http
@ -339,15 +308,6 @@ export default {
this.dataForm.ruleParamList.push(temp) this.dataForm.ruleParamList.push(temp)
this.dataForm.metaDataCode = '' this.dataForm.metaDataCode = ''
}, },
// (0-1-2-)
handleRuleMode (ruleMode) {
// console.log('=' + ruleMode)
if (ruleMode === '0') {
this.dataForm.metaDataCode = '' //
this.dataForm.ruleParamList = [] //
this.dataForm.referenceId = ''// id
}
},
// id // id
handlereference (referenceId) { handlereference (referenceId) {
// console.log('id=' + referenceId) // console.log('id=' + referenceId)

34
src/views/modules/kpi/kpirule.vue

@ -9,7 +9,10 @@
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('kpi:kpirule:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> <el-button v-if="$hasPermission('kpi:kpirule:save')" type="primary" @click="addOrUpdateHandle('0')">新增公式规则</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('kpi:kpirule:save')" type="primary" @click="addOrUpdateHandle('1')">新增手动打分规则</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('kpi:kpirule:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> <el-button v-if="$hasPermission('kpi:kpirule:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
@ -29,7 +32,7 @@
<el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column> <el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="$hasPermission('kpi:kpirule:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> <el-button v-if="$hasPermission('kpi:kpirule:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.ruleMode,scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('kpi:kpirule:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> <el-button v-if="$hasPermission('kpi:kpirule:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -43,8 +46,10 @@
@size-change="pageSizeChangeHandle" @size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"> @current-change="pageCurrentChangeHandle">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改公式规则 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<!-- 弹窗, 新增 / 修改手动打分规则 -->
<manual-score-add-or-update v-if="manualScoreAddOrUpdateVisible" ref="manualScoreAddOrUpdate" @refreshDataList="getDataList"></manual-score-add-or-update>
</div> </div>
</el-card> </el-card>
</template> </template>
@ -52,6 +57,7 @@
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './kpirule-add-or-update' import AddOrUpdate from './kpirule-add-or-update'
import ManualScoreAddOrUpdate from './manual-score-add-or-update'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data () {
@ -65,13 +71,15 @@ export default {
dataForm: { dataForm: {
ruleName: '' ruleName: ''
}, },
manualScoreAddOrUpdateVisible: false, // visible
ruleModeList: [], ruleModeList: [],
kpiCycleList: [], kpiCycleList: [],
deptTypeKeyList: [] deptTypeKeyList: []
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
ManualScoreAddOrUpdate
}, },
created () { created () {
this.getRuleModeList() this.getRuleModeList()
@ -79,6 +87,24 @@ export default {
this.getDeptTypeKeyList() this.getDeptTypeKeyList()
}, },
methods: { methods: {
//
addOrUpdateHandle (ruleMode, id) {
if (ruleMode === '0') {
// console.log(+'ruleMode=' + ruleMode + ';id=' + id)
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.init()
})
} else if (ruleMode === '1') {
// console.log('ruleMode=' + ruleMode + ';id=' + id)
this.manualScoreAddOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.manualScoreAddOrUpdate.dataForm.id = id
this.$refs.manualScoreAddOrUpdate.init()
})
}
},
// //
getRuleModeList () { getRuleModeList () {
this.$http.get(`/sys/dict/listSimple/rule_mode`).then(({ data: res }) => { this.$http.get(`/sys/dict/listSimple/rule_mode`).then(({ data: res }) => {

187
src/views/modules/kpi/manual-score-add-or-update.vue

@ -0,0 +1,187 @@
<template>
<el-dialog
:visible.sync="visible"
:title="!dataForm.id ? $t('add') : $t('update')"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
:label-width="$i18n.locale === 'en-US' ? '120px' : '120px'"
>
<el-form-item label="考核规则名称" prop="ruleName">
<el-input
v-model="dataForm.ruleName"
placeholder="考核规则名称"
clearable
></el-input>
</el-form-item>
<el-form-item label="考核规则编码" prop="ruleCode">
<el-input
v-model="dataForm.ruleCode"
placeholder="考核规则编码"
clearable
></el-input>
</el-form-item>
<el-form-item label="关联的手动打分" prop="referenceId">
<el-select v-model="dataForm.referenceId" clearable placeholder="关联的手动打分" @change="handlereference(dataForm.referenceId)">
<el-option
v-for="item in kpiManualScoreList"
:key="item.id"
:label="item.scoreName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t("cancel") }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{
$t("confirm")
}}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
kpiFormulaList: [],
metaDataCodeList: [],
paramAmount: 100, //
kpiManualScoreList: [], //
dataForm: {
id: '',
ruleName: '',
ruleCode: '',
ruleMode: '1', // (0-1-2-)
referenceId: '', //
kpiCycle: '', //
deptTypeKey: '' //
}
}
},
computed: {
dataRule () {
return {
ruleName: [
{
required: true,
message: this.$t('validate.required'),
trigger: 'blur'
}
],
ruleCode: [
{
required: true,
message: this.$t('validate.required'),
trigger: 'blur'
}
],
referenceId: [
{
required: true,
message: this.$t('validate.required'),
trigger: 'blur'
}
]
}
}
},
created () {
this.getKpiManualScoreList()
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http
.get(`/kpi/kpirule/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
})
.catch(() => {})
},
//
dataFormSubmitHandle: debounce(
function () {
this.$refs['dataForm'].validate(valid => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put'](
'/kpi/kpirule/saveOrUpdate/',
this.dataForm
)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
})
.catch(() => {})
})
},
1000,
{ leading: true, trailing: false }
),
//
getKpiManualScoreList () {
this.$http
.get(`/kpi/kpimanualscore/getKpiManualScoreList`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.kpiManualScoreList = res.data
})
.catch(() => {})
},
//
handlereference (referenceId) {
console.log('当前选中的手动打分项id=' + referenceId)
if (referenceId) {
let kpiManualScoreArray = this.kpiManualScoreList
for (var i = 0; i < kpiManualScoreArray.length; i++) {
if (kpiManualScoreArray[i].id === referenceId) {
this.dataForm.kpiCycle = kpiManualScoreArray[i].scoreCycle
this.dataForm.deptTypeKey = kpiManualScoreArray[i].deptTypeKey
}
}
} else {
this.kpiCycle = ''
this.deptTypeKey = ''
}
}
}
}
</script>
Loading…
Cancel
Save