指定目标

考核模板
添加选择指标项
This commit is contained in:
zhujida 2021-01-22 16:57:03 +08:00
parent 654de5b250
commit 449613c13e
8 changed files with 997 additions and 551 deletions

View File

@ -9,36 +9,60 @@
subumitText="确定"
class="popup commonFont"
>
<div slot="content">
<div class="search-header">
<div
slot="content"
class="popup-choose-target"
>
<div class="popup-choose-target-header">
<el-button
@click="handleFiltrate"
@click="isShowPopupFiltrate = true"
type="primary"
plain
size="small"
>筛选</el-button>
<el-input
@change="handleSearch"
v-model="searchInputValue"
v-model="queryData.name"
placeholder="请输入内容"
prefix-icon="el-icon-search"
size="small"
clearable
></el-input>
</div>
<!-- <div
class="popup-choose-target-tags"
v-if="this.selectedTargetType"
>筛选条件<el-tag
@close="handleFilterTagClose"
type="warning"
closable
size="small"
>{{this.selectedTargetType.name}}</el-tag>共筛选出<span class="target-main-header-tags-sum">{{this.tableData.length}}</span>个指标</div> -->
<el-table
data="tableData"
selection-change="handleSelectionChange"
:data="tableData"
@selection-change="handleSelectionChange"
>
<div
slot="empty"
class="comonPromptFont"
>{{$isStringEmpty(this.queryData.name)?'暂无数据':'未找到关于'+this.queryData.name+'的结果'}}</div>
<el-table-column
type="selection"
width="40"
>
</el-table-column>
<el-table-column
label="全选"
prop="name"
></el-table-column>
<el-table-column
align="right"
label=""
prop="quanzhong"
width="60px"
></el-table-column>
prop="weight"
width="100px"
:formatter="(row,column,cellValue,index)=> cellValue*100+'%'"
>
</el-table-column>
</el-table>
<div class="comonPromptFont filtrate-prompt">没有更多了</div>
<div
@ -50,48 +74,104 @@
</popup-right>
<target-filtrate
:isShowTargetFiltrate.sync="isShowPopupFiltrate"
@cb="handelTargetFilter"
:indicatorType.sync="queryData.indicatorType"
@cd="handelTargetFilterSubmit"
:isClasseType="true"
/>
</div>
</template>
<script>
import PopupRight from '@/components/PopupRight'
import TargetFiltrate from '@/components/TargetFiltrate'
import { apiGetIndicatorLibraryList } from '@/api/target'
export default {
methods: {
handleFiltrate () {
console.log('筛选-标签类别')
},
handleSearch (val) {
console.log('搜索-----')
console.log(val)
this.handleGetTargetList(this.queryData.indicatorType, this.queryData.name)
},
handleSelectionChange (val) {
//
this.selectedList = val
console.log('选中------')
console.log(val)
},
handelTargetFilter (list) {
handelTargetFilterSubmit (val) {
//
this.isShowPopupFiltrate = true
console.log(list)
this.selectedTargetType = val
this.queryData.indicatorType = val ? val.id : -1
this.handleGetTargetList(this.queryData.indicatorType, this.queryData.name)
},
handleFilterTagClose () {
//
this.selectedTargetType = null
this.queryData.type = -1
this.handleGetTargetList(this.queryData.indicatorType, this.queryData.name)
},
hundlePopupHide () {
this.$emit('update:isShowPopup', false)
},
handleSubmitPopup () {
this.$emit('cd', this.selectedList)
// this.$emit('update:isShowPopup', false)
console.log('选中')
console.dir(this.selectedList)
this.$emit('update:isShowPopup', false)
},
//
handleGetTargetList (indicatorType = -1, name = '') {
this.selectedList = []
this.queryData.name = name
this.queryData.indicatorType = indicatorType
let para = {
currPage: 1,
pageSize: 2000,
name: name
}
if (indicatorType !== -1) {
para['indicatorType'] = indicatorType
}
if (this.dimensionTypeId !== -1) {
para['type'] = this.dimensionTypeId
}
apiGetIndicatorLibraryList(para).then(res => {
if (res.code === 200) {
let data = res.data
let nowDataList = data.list.filter(item => {
let nowItem = this.filtersList.filter(filter => {
return item.name === filter.name
})
return nowItem.length === 0
})
this.$nextTick(res => {
this.tableData = nowDataList
})
}
})
}
},
data () {
return {
isShowPopupFiltrate: false,
searchInputValue: '',
selectedTargetType: null,
queryData: {
name: '',
indicatorType: -1 //
},
tableData: [],
selectedList: []
}
},
watch: {
isShowPopup (now) {
if (now) {
this.handleGetTargetList()
} else {
this.queryData.indicatorType = -1
this.queryData.name = ''
this.tableData = []
}
}
},
components: {
PopupRight,
TargetFiltrate
@ -101,17 +181,42 @@ export default {
type: Boolean,
default: false
},
dataList: {
//
filtersList: {
type: Array,
default: () => {
return [{ id: 1, name: '全部指标' }, { id: 2, name: '全部指标' }]
return []
}
},
// ID
dimensionTypeId: {
type: Number,
default: -1
}
}
}
</script>
<style lang="less" scoped>
.popup {
&-choose-target {
&-header {
display: flex;
margin-bottom: 10px;
.el-button {
margin-right: 10px;
}
}
}
&-tags {
padding: 10px 0px;
.el-tag {
margin-right: 10px;
}
&-sum {
color: @fontBlue;
font-size: 14px;
}
}
.filtrate-prompt {
text-align: center;
padding: 15px;

View File

@ -42,6 +42,7 @@ export default {
apiGetIndicatorType({ type: 0 }).then(res => {
if (res.code === 200) {
this.tableData = res.data.list
this.tableData.push({ id: 0, name: '未分类指标' })
}
})
}
@ -67,6 +68,9 @@ export default {
isShowPopupRadio (now) {
if (now) {
this.handleGetClasseList()
} else {
this.radioSelectedId = ''
this.tableData = []
}
}
},

View File

@ -33,6 +33,8 @@
<script>
import PopupRight from '@/components/PopupRight'
import { apiGetIndicatorType } from '@/api/target'
import { getDimensions } from '@/api/data'
export default {
methods: {
hundlePopupHide () {
@ -53,11 +55,12 @@ export default {
this.areaSelectedDic = val.id === -1 ? null : val
},
handleGetTargetTypelist () {
//
//
if (this.isClasseType) {
let para = {
currPage: 1,
pageSize: 200,
type: 1
type: 0
}
apiGetIndicatorType(para).then(res => {
if (res.code === 200) {
@ -68,6 +71,20 @@ export default {
})
}
})
} else {
//
//
getDimensions().then(res => {
this.$nextTick(() => {
if (res.code !== 200) {
this.listData[0].list = []
this.$message.error(res.msg)
return
}
this.listData[0].list = [{ id: -1, name: '全部' }].concat(res.data)
})
})
}
}
},
data () {
@ -81,9 +98,9 @@ export default {
radioTage: 1,
listData: [
{
title: '类型',
title: this.isClasseType ? '分类' : '类型',
id: 'id',
selectedId: -1,
selectedId: this.indicatorType,
btnDef: 'area-content-item btn-def',
btnSelected: 'area-content-item btn-def btn-def-selected',
list: []
@ -104,12 +121,11 @@ export default {
},
watch: {
isShowTargetFiltrate (now, old) {
console.log('old:' + old)
console.log('now:' + now)
if (now) {
this.handleGetTargetTypelist()
}
}
},
props: {
isShowTargetFiltrate: {
@ -119,6 +135,14 @@ export default {
popupRightTitle: {
default: '筛选',
type: String
},
isClasseType: {
type: Boolean,
default: false // FALSE true
},
indicatorType: {
default: -1,
type: Number
}
},
components: {

View File

@ -135,7 +135,7 @@
</div>
<div style=" padding: 10px;">
<el-button
@click="handelChooseTarger(i,index)"
@click="handelChooseTarger(i,-1,index)"
icon="el-icon-finished"
type="primary"
size="small"
@ -299,6 +299,12 @@
>提交</el-button>
</div>
</div>
<!-- 选择指标项 -->
<ChooseTarget
:isShowPopup.sync="popupChooseTargetModel.isShow"
:dimensionTypeId.sync="popupChooseTargetModel.dimensionTypeId"
@cd="handleChooseTargetSubmit"
/>
</div>
</template>
@ -306,81 +312,13 @@
import SmallNav from '@/components/kpi-layout/SmallNav'
import InfoHeader from '@/components/InfoHeader'
import PopupRight from '@/components/PopupRight'
import ChooseTarget from '@/components/ChooseTarget'
import draggable from 'vuedraggable'
import { getDimensions } from '@/api/data'
import { apiResultGetDetail, apiSaveDetail, apiSaveapproval } from '@/api/assessment'
import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete'
export default {
data () {
return {
showTask: false,
taskTitle: '添加任务',
formItem: {},
editItem: {},
formTask: {
name: '',
processRate: '0'
},
zhibiaoTitle: '添加指标',
showIndicators: false,
dimensionsList: [],
formIndicators: {},
ruleIndicators: {
name: [{
required: true,
message: '请输入任务名称',
trigger: 'blur'
}
],
target: [{
required: true,
message: '请输入指标名称',
trigger: 'blur'
}
],
keyResult: [{
required: true,
message: '请输入考核标准',
trigger: 'blur'
}
],
checkWeight: [{
required: true,
message: '请输入权重大小',
trigger: 'blur'
}
]
},
activeId: null,
obj: {
recortModelDto: []
},
options1: {
group: 'names',
draggable: '.items',
handle: '.my-handle',
scroll: true,
sort: true, //
delay: 0, //
touchStartThreshold: 0, // px,?
disabled: false, // sortable
store: null, // @see Store
animation: 150 // ms, ' 0 ' -
}
}
},
components: {
SmallNav,
InfoHeader,
draggable,
PopupRight
},
computed: {},
beforeMount () { },
mounted () {
this.handleGetDimensions()
this.handleGetTbale()
},
methods: {
//
handleDeleteTask (parent, item) {
@ -622,6 +560,7 @@ export default {
this.$refs.formIndicators.validate((v) => {
if (v) {
if (this.formIndicators.index === -1) {
let sssf = Object.assign({}, this.formIndicators, { checkWeight: this.formIndicators.checkWeight / 100 })
arr.push(Object.assign({}, this.formIndicators, { checkWeight: this.formIndicators.checkWeight / 100 }))
} else {
let _index = 0
@ -640,11 +579,33 @@ export default {
}
})
},
handelChooseTarger (item, index) {
handelChooseTarger (item, index, type) {
//
console.log('选择指标项-------')
console.dir(item)
console.log(index)
if (item.maxCount !== null) {
const len = this.handleNumber(item)
if (item.maxCount <= len) {
this.$message.info('指标数量不能大于' + item.maxCount)
return
}
}
this.popupChooseTargetModel.dimensionTypeId = item.type
this.popupChooseTargetModel.dazhibiaoIndex = type
this.$forceUpdate()
this.popupChooseTargetModel.isShow = true
},
handleChooseTargetSubmit (list) {
if (list.length <= 0) {
return
}
//
const index = this.popupChooseTargetModel.dazhibiaoIndex
const arr = this.obj.recortModelDtos[index].detailDtos
let nowList = list.map(item => {
return { isDelete: 0, checkWeight: item.weight * 100 / 100, target: item.name, keyResult: item.keyResult, type: item.type }
})
this.obj.recortModelDtos[index].detailDtos = arr.concat(nowList)
},
//
hanidleEdit (item, index, type) {
@ -697,7 +658,83 @@ export default {
this.activeId = String(res.data.recortModelDtos[0].id)
}
},
watch: {}
watch: {},
data () {
return {
showTask: false,
taskTitle: '添加任务',
formItem: {},
editItem: {},
formTask: {
name: '',
processRate: '0'
},
zhibiaoTitle: '添加指标',
showIndicators: false,
dimensionsList: [],
formIndicators: {},
ruleIndicators: {
name: [{
required: true,
message: '请输入任务名称',
trigger: 'blur'
}
],
target: [{
required: true,
message: '请输入指标名称',
trigger: 'blur'
}
],
keyResult: [{
required: true,
message: '请输入考核标准',
trigger: 'blur'
}
],
checkWeight: [{
required: true,
message: '请输入权重大小',
trigger: 'blur'
}
]
},
activeId: null,
obj: {
recortModelDto: []
},
options1: {
group: 'names',
draggable: '.items',
handle: '.my-handle',
scroll: true,
sort: true, //
delay: 0, //
touchStartThreshold: 0, // px,?
disabled: false, // sortable
store: null, // @see Store
animation: 150 // ms, ' 0 ' -
},
popupChooseTargetModel: {
isShow: false, //
dimensionTypeId: -1, //
dazhibiaoIndex: 0 //
}
}
},
components: {
SmallNav,
InfoHeader,
draggable,
PopupRight,
ChooseTarget
},
computed: {},
beforeMount () { },
mounted () {
this.handleGetDimensions()
this.handleGetTbale()
}
}

View File

@ -76,8 +76,8 @@
v-model="formData.weight"
placeholder="请输入指标名称"
clearable
oninput="value=value.replace(/^\.+|[^\d.]/g,'')"
@change="handleWeightChange"
@blur="$handleBlur('formData.weight')"
@input.native="$handleInputInt('formData.weight')"
>
<el-button slot="append">%</el-button>
</el-input>
@ -96,59 +96,73 @@
</template>
<script>
import { apiGetIndicatorType, apiGetIndicatorLibraryEdit } from '@/api/target'
import { getDimensions } from '@/api/data'
export default {
methods: {
handleWeightChange (val) {
if (val) {
if (val.length > 0) {
let weight = parseFloat(this.formData.weight)
this.formData.weight = weight
}
console.log(this.formData.weight)
// handleWeightChange (val) {
// if (val) {
// if (val.length > 0) {
// let weightTwo = weight.toFixed(2).toString()
// let arr = weightTwo.split('.')
// if (arr.length === 2) {
// /* eslint-disable */
// for (let index = weightTwo.length - 1;index < weightTwo.length;index--) {
// let sub = weightTwo.substring(index, 1)
// if (sub !== '0' && sub !== '.') {
// weightTwo = weightTwo.substring(0, index)
// break
// let weight = parseFloat(this.formData.weight)
// this.formData.weight = weight
// }
// console.log(this.formData.weight)
// // if (val.length > 0) {
// // let weightTwo = weight.toFixed(2).toString()
// // let arr = weightTwo.split('.')
// // if (arr.length === 2) {
// // /* eslint-disable */
// // for (let index = weightTwo.length - 1;index < weightTwo.length;index--) {
// // let sub = weightTwo.substring(index, 1)
// // if (sub !== '0' && sub !== '.') {
// // weightTwo = weightTwo.substring(0, index)
// // break
// // }
// // }
// // console.log(weightTwo)
// // }
// // }
// }
// console.log(weightTwo)
// }
// }
}
},
// },
handleSaveSet () {
//
this.$refs.formTarget.validate((valid) => {
if (valid) {
apiGetIndicatorLibraryEdit(this.formData).then(res => {
let weight = this.formData.weight
if (weight) {
weight = this.formData.weight / 100 > 1 ? 1 : this.formData.weight / 100
}
let para = {
indicatorType: this.formData.indicatorType,
type: this.formData.type,
name: this.formData.name,
keyResult: this.formData.keyResult,
weight: weight
}
if (this.formData.id) {
para['id'] = this.formData.id
}
apiGetIndicatorLibraryEdit(para).then(res => {
if (res.code === 200) {
this.$message.success(res.msg)
this.$router.go(-1)
}
})
} else {
console.log('error submit!!')
return false
}
})
},
handleGetIndicatorType (type = 0) {
handleGetIndicatorType () {
let para = {
currPage: 1,
type: type,
type: 0,
pageSize: 40
}
apiGetIndicatorType(para).then(res => {
if (res.code === 200) {
let data = res.data
if (type === 0) {
//
this.calsseDataList = data.list
this.calsseDataList.push({ id: 0, name: '未分类指标' })
@ -157,18 +171,23 @@ export default {
this.formData.indicatorType = item.id
}
} else {
//
this.targetTypeList = data.list
this.$message.error(res.msg)
}
})
},
handleGetDimensionsList () {
//
getDimensions().then(res => {
if (res.code !== 200) {
this.targetTypeList = []
this.$message.error(res.msg)
return
}
this.targetTypeList = res.data
if (this.targetTypeList.length > 0 && this.changeTargetId === -1) {
let item = data.list[0]
let item = res.data[0]
this.formData.type = item.id
}
}
} else {
if (type === 0) {
this.formData.indicatorType = 0
}
}
})
}
},
@ -180,14 +199,14 @@ export default {
this.formData = this.$route.query
}
//
this.handleGetIndicatorType(0)
this.handleGetIndicatorType(1)
this.handleGetIndicatorType()
this.handleGetDimensionsList()
},
data () {
return {
changeTargetId: -1, // id
// indicatorType: 0, type: 0, name: '', keyResult: '', weight: ''
formData: {},
formData: { indicatorType: 0, type: 0, name: '', keyResult: '', weight: '' },
formRules: {
indicatorType: [{ required: true, message: '请选择指标分类', trigger: 'blur' }],
name: [{ required: true, message: '请选择指标名称', trigger: 'blur' }]

View File

@ -132,7 +132,7 @@
<el-table-column
label="指标类型"
sortable
prop="type"
prop="typeName"
></el-table-column>
<el-table-column
label="考核标准"
@ -142,10 +142,8 @@
label="权重"
sortable
prop="weight"
:formatter="(row, column, cellValue, index)=>cellValue*100+'%'"
>
<template slot-scope="scope">
{{scope.row.weight}}%
</template>
</el-table-column>
</el-table>
<el-pagination
@ -348,10 +346,12 @@ export default {
id: val.id,
name: val.name,
keyResult: val.keyResult,
weight: val.weight,
weight: val.weight * 100,
type: val.type,
indicatorType: val.indicatorType
}
console.log('跳转')
console.dir(val)
this.$router.push({ name: 'workbench-target-add', query: changeVal })
},
handleSelectionChange (val) {

View File

@ -4,18 +4,31 @@
<div class="set-top">
<div class="set-top-title">总分规则</div>
<div class="set-top-content">
<el-form label-position='left' :model="info">
<el-form
label-position='left'
:model="info"
>
<el-form-item label="指标评分计算方式">
<el-radio-group v-model="radio">
<el-radio :label="3">加权计算
<el-popover
placement="top-start"
trigger="hover">
trigger="hover"
>
<div>
<img style="width:450px;" src="@/assets/workbench/jiaquan.png" alt="" srcset="">
<img
style="width:450px;"
src="@/assets/workbench/jiaquan.png"
alt=""
srcset=""
>
</div>
<span slot="reference" class="wenhao">?</span>
</el-popover></el-radio>
<span
slot="reference"
class="wenhao"
>?</span>
</el-popover>
</el-radio>
</el-radio-group>
</el-form-item>
@ -25,22 +38,37 @@
active-color="#3ba1ff"
:active-value='1'
:inactive-value='2'
inactive-color="#dcdfe6">
inactive-color="#dcdfe6"
>
</el-switch>
<el-popover
placement="top-start"
trigger="hover">
trigger="hover"
>
<div>
<img style="width:450px;" src="@/assets/workbench/pingfen.png" alt="" srcset="">
<img
style="width:450px;"
src="@/assets/workbench/pingfen.png"
alt=""
srcset=""
>
</div>
<span slot="reference" class="wenhao">?</span>
<span
slot="reference"
class="wenhao"
>?</span>
</el-popover>
</el-form-item>
</el-form>
</div>
</div>
<div class="set-add">
<el-button icon="el-icon-plus" size="small" @click="handleAdd" round>添加考核维度</el-button>
<el-button
icon="el-icon-plus"
size="small"
@click="handleAdd"
round
>添加考核维度</el-button>
</div>
<div class="set-content">
<draggable
@ -51,17 +79,37 @@
@end="end"
@move="move"
>
<div class="set-content-item item" v-for="(i,index) in handleFilter(info.modelItems)" :key="index">
<div
class="set-content-item item"
v-for="(i,index) in handleFilter(info.modelItems)"
:key="index"
>
<div class="set-content-item-top commonFont">
<div class="set-content-item-top-left my-handle sortable-drag">
{{i.name}}
</div>
<div class="set-content-item-top-right">
<el-tooltip class="item" effect="dark" content="编辑维度" placement="top">
<i @click="hanidleEdit(i,index,-1)" class="el-icon-edit"></i>
<el-tooltip
class="item"
effect="dark"
content="编辑维度"
placement="top"
>
<i
@click="hanidleEdit(i,index,-1)"
class="el-icon-edit"
></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除维度" placement="top">
<i @click="handleDelateWeidu(i,index,-1)" class="el-icon-delete"></i>
<el-tooltip
class="item"
effect="dark"
content="删除维度"
placement="top"
>
<i
@click="handleDelateWeidu(i,index,-1)"
class="el-icon-delete"
></i>
</el-tooltip>
</div>
</div>
@ -69,14 +117,23 @@
<div class="set-content-item-center-item">
{{handleWeiDu(i)}}
</div>
<div v-if="i.maxCount" class="set-content-item-center-item">
<div
v-if="i.maxCount"
class="set-content-item-center-item"
>
所含指标数量 {{i.maxCount}}
</div>
<div v-if="i.weight !==0 && i.weight" class="set-content-item-center-item">
<div
v-if="i.weight !==0 && i.weight"
class="set-content-item-center-item"
>
所含指标总权重 {{Math.round((i.weight * 100)*1000)/1000}}%
</div>
</div>
<div v-if="handleFilter(i.tagetLibItems).length!==0" class="set-content-item-table">
<div
v-if="handleFilter(i.tagetLibItems).length!==0"
class="set-content-item-table"
>
<div class="set-content-item-table-header commonFont">
<span style="width:30%">指标名称</span>
<span style="width:30%">考核标准</span>
@ -96,22 +153,32 @@
v-for="(j,indexJ) in handleFilter(i.tagetLibItems)"
:key="indexJ"
>
<div style="width:30%" class="pre"><pre>{{j.name}}</pre></div>
<div style="width:30%" class="pre">
<pre >{{j.keyResult}}</pre>
<div
style="width:30%"
class="pre"
>
<pre>{{j.name}}</pre>
</div>
<div
style="width:30%"
class="pre"
>
<pre>{{j.keyResult}}</pre>
</div>
<div style="width:30%">{{j.weight * 100}}%</div>
<div style="width:10%">
<el-button
@click="hanidleEdit(j,indexJ,index)"
type="text"
size="small">
size="small"
>
编辑
</el-button>
<el-button
@click="handleDelateWeidu(j,indexJ,index)"
@click="handleDelateWeidu(j,indexJ,index,true)"
type="text"
size="small">
size="small"
>
删除
</el-button>
</div>
@ -119,198 +186,238 @@
</draggable>
</div>
<div class="set-content-item-bottom">
<!-- <el-button size="mini" plain>选择指标项</el-button> -->
<el-button @click="handleAddIndicators(i)" type="primary" icon="el-icon-plus" size="small" plain>增加指标项</el-button>
<el-button
@click="handelChooseTarger(i,index)"
icon="el-icon-finished"
type="primary"
size="small"
plain
>选择指标项</el-button>
<el-button
@click="handleAddIndicators(i)"
type="primary"
icon="el-icon-plus"
size="small"
plain
>增加指标项</el-button>
</div>
</div>
</draggable>
</div>
<div>
<popup-right v-if="show" @cancel='handleCancel' @submit="handleSubmit" :title="weiduTitle">
<div slot="content" class="weiduManage">
<el-form label-position="left" ref="form" :model="form" :rules="rules" label-width="180px">
<el-form-item prop="name" label='维度名称'>
<el-input clearable size="small" v-model="form.name"></el-input>
<popup-right
v-if="show"
@cancel='handleCancel'
@submit="handleSubmit"
:title="weiduTitle"
>
<div
slot="content"
class="weiduManage"
>
<el-form
label-position="left"
ref="form"
:model="form"
:rules="rules"
label-width="180px"
>
<el-form-item
prop="name"
label='维度名称'
>
<el-input
clearable
size="small"
v-model="form.name"
></el-input>
</el-form-item>
<el-form-item label="维度类型">
<el-select v-model="form.type" placeholder="请选择维度类型">
<el-select
v-model="form.type"
placeholder="请选择维度类型"
>
<el-option
v-for="i in dimensionsList"
:key="i.id"
:label="i.name"
:value="i.id"></el-option>
:value="i.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所含指标数量">
<div slot="label">
所含指标数量
<el-tooltip class="item" effect="dark" content="设定这个维度下所含的指标数量,在制定目标、确认目标环节将校验指标的数量" placement="right-start">
<i style="margin:0 10px;" class="el-icon-location"></i>
<el-tooltip
class="item"
effect="dark"
content="设定这个维度下所含的指标数量,在制定目标、确认目标环节将校验指标的数量"
placement="right-start"
>
<i
style="margin:0 10px;"
class="el-icon-location"
></i>
</el-tooltip>
</div>
<el-radio-group v-model="maxCount" size="medium">
<el-radio-group
v-model="maxCount"
size="medium"
>
<el-radio label="">不限数量</el-radio>
<el-radio label="1">自定义</el-radio>
</el-radio-group>
<el-input @input="handleInputWeiduZhi" clearable size="small" style="width:160px;'" v-if="maxCount" v-model="form.maxCount"></el-input>
<el-input
@input="handleInputWeiduZhi"
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">
<div>所含指标总权重
<el-tooltip class="item" effect="dark" content="设定这个维度下所含指标的总权重,在制定目标、确认目标环节将校验权重总和" placement="right-start">
<i style="margin:0 10px;" class="el-icon-location"></i>
</el-tooltip></div>
<el-tooltip
class="item"
effect="dark"
content="设定这个维度下所含指标的总权重,在制定目标、确认目标环节将校验权重总和"
placement="right-start"
>
<i
style="margin:0 10px;"
class="el-icon-location"
></i>
</el-tooltip>
</div>
<div style="font-size:12px;">(所有指标之和等于100%)</div>
</div>
<el-radio-group v-model="weight" size="medium">
<el-radio-group
v-model="weight"
size="medium"
>
<el-radio :label="0">不限权重</el-radio>
<el-radio :label="1">自定义</el-radio>
</el-radio-group>
<el-input @blur="$handleBlur('form.weight')" @input.native="$handleInputInt('form.weight')" size="small" style="width:160px;'" v-if="weight!==0" v-model="form.weight">
<el-input
@blur="$handleBlur('form.weight')"
@input.native="$handleInputInt('form.weight')"
size="small"
style="width:160px;'"
v-if="weight!==0"
v-model="form.weight"
>
<template slot="append">%</template>
</el-input>
</el-form-item>
</el-form>
</div>
</popup-right>
<popup-right v-if="showIndicators" @cancel='handleCancelZhibiao' @submit="handleSubmitZhibiao" :title="zhibiaoTitle">
<div slot="content" class="weiduManage">
<el-form label-position="left" ref="formIndicators" :model="formIndicators" :rules="ruleIndicators" label-width="180px">
<popup-right
v-if="showIndicators"
@cancel='handleCancelZhibiao'
@submit="handleSubmitZhibiao"
:title="zhibiaoTitle"
>
<div
slot="content"
class="weiduManage"
>
<el-form
label-position="left"
ref="formIndicators"
:model="formIndicators"
:rules="ruleIndicators"
label-width="180px"
>
<el-form-item label="指标类型">
<el-select v-model="formIndicators.zhibiao" disabled placeholder="请选择维度类型">
<el-select
v-model="formIndicators.zhibiao"
disabled
placeholder="请选择维度类型"
>
<el-option
v-for="i in dimensionsList"
:key="i.id"
:label="i.name"
:value="i.id"></el-option>
:value="i.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item prop="name" label='指标名称'>
<el-input clearable size="small" :rows="4" type="textarea" v-model="formIndicators.name"></el-input>
<el-form-item
prop="name"
label='指标名称'
>
<el-input
clearable
size="small"
:rows="4"
type="textarea"
v-model="formIndicators.name"
></el-input>
</el-form-item>
<el-form-item label="考核标准" prop="keyResult">
<el-input size="small" resize='vertical' :rows="24" clearable type="textarea" v-model="formIndicators.keyResult"></el-input>
<el-form-item
label="考核标准"
prop="keyResult"
>
<el-input
size="small"
resize='vertical'
:rows="24"
clearable
type="textarea"
v-model="formIndicators.keyResult"
></el-input>
</el-form-item>
<el-form-item label="权重" prop="weight">
<el-input size="small" @blur="$handleBlur('formIndicators.weight')" @input.native="$handleInputInt('formIndicators.weight')" v-model="formIndicators.weight">
<el-form-item
label="权重"
prop="weight"
>
<el-input
size="small"
@blur="$handleBlur('formIndicators.weight')"
@input.native="$handleInputInt('formIndicators.weight')"
v-model="formIndicators.weight"
>
<template slot="append">%</template>
</el-input>
</el-form-item>
</el-form>
</div>
</popup-right>
<!-- 选择指标项 -->
<ChooseTarget
:isShowPopup.sync="popupChooseTargetModel.isShow"
:filtersList.sync="popupChooseTargetModel.filter"
:dimensionTypeId.sync="popupChooseTargetModel.dimensionTypeId"
@cd="handleChooseTargetSubmit"
/>
</div>
</div>
</template>
<script>
import PopupRight from '@/components/PopupRight'
import ChooseTarget from '@/components/ChooseTarget'
import draggable from 'vuedraggable'
import {getDimensions} from '@/api/data'
import { getDimensions } from '@/api/data'
import { getByGroupId } from '@/api/workbench'
// const info =
export default {
props: ['templateForm'],
data () {
return {
id: '',
isEditForm: {},
zhibiaoTitle: '添加指标',
weiduTitle: '添加维度',
dimensionsList: [], //
show: false, //
radio: 3,
maxCount: '',
weight: 0,
// info
info: {
gradeGroupId: 1,
modelItems: [
]
},
form: {
weight: '',
maxCount: ''
}, //
rules: {
name: [{ required: true,
message: '请输入维度名称',
trigger: 'blur' }
]
}, //
showIndicators: false, //
formIndicators: {}, //
ruleIndicators: {
name: [{ required: true,
message: '请输入指标名称',
trigger: 'blur' }
],
keyResult: [{ required: true,
message: '请输入考核标准',
trigger: 'blur' }
],
weight: [{ required: true,
message: '请输入权重大小',
trigger: 'blur' }
]
}, // rule
zanshi: {},
options: {
group: 'name',
draggable: '.item',
handle: '.my-handle',
dragClass: 'sortable-drag',
scroll: true,
sort: true, //
delay: 0, //
touchStartThreshold: 0, // px,?
disabled: false, // sortable
store: null, // @see Store
animation: 150 // ms, ' 0 ' -
},
options1: {
group: 'names',
draggable: '.items',
scroll: true,
sort: true, //
delay: 0, //
touchStartThreshold: 0, // px,?
disabled: false, // sortable
store: null, // @see Store
animation: 150 // ms, ' 0 ' -
}
}
},
components: {
PopupRight,
draggable
},
computed: {},
beforeMount () {},
mounted () {
this.info = {
gradeGroupId: 1,
modelItems: [
]
}
const id = this.$route.query.id || ''
this.id = id
if (id) {
this.handleGetByGroupId(id)
}
this.handleGetDimensions()
},
methods: {
handleInputWeiduZhi (value) {
this.form.maxCount = value.replace(/[^\d]/g, '')
},
async handleGetByGroupId (id) {
try {
let res = await getByGroupId({id})
let res = await getByGroupId({ id })
res = res.data
res = Object.assign({}, res, {
evaluationGroupId: res.id,
calculateId: 1 }
calculateId: 1
}
)
this.info = res
this.$forceUpdate()
@ -339,10 +446,10 @@ export default {
this.$message.error(error.msg)
}
},
change () {},
start () {},
end () {},
move () {},
change () { },
start () { },
end () { },
move () { },
//
handleAdd () {
this.form = {
@ -385,7 +492,7 @@ export default {
this.show = false
return
}
this.info.modelItems.push(Object.assign({}, this.form, {isDelete: 0}))
this.info.modelItems.push(Object.assign({}, this.form, { isDelete: 0 }))
this.form = {}
this.show = false
}
@ -397,19 +504,20 @@ export default {
this.weight = item.weight > 0 ? 1 : 0
if (type === -1) {
this.weiduTitle = '编辑维度'
this.form = Object.assign({}, item, {index, index2: type, isEdit: true})
this.form = Object.assign({}, item, { index, index2: type, isEdit: true })
this.form.weight = this.form.weight * 100
this.show = true
} else {
this.zhibiaoTitle = '编辑指标'
this.formIndicators = Object.assign({}, item, {index: type, index2: index, isEdit: true})
this.formIndicators = Object.assign({}, item, { index: type, index2: index, isEdit: true })
this.formIndicators.weight = this.formIndicators.weight * 100
this.showIndicators = true
}
},
//
handleDelateWeidu (item, index, type) {
if (item.id) {
handleDelateWeidu (item, index, type, isTarget = false) {
if (item.id && !isTarget) {
//
item.isDelete = 1
this.$forceUpdate()
return
@ -421,6 +529,16 @@ export default {
}
this.$forceUpdate()
},
handelChooseTarger (item, index) {
//
this.zanshi = item
this.popupChooseTargetModel.dimensionTypeId = item.type
this.popupChooseTargetModel.filter = item.tagetLibItems
this.popupChooseTargetModel.isShow = true
console.log('选择指标项')
console.dir(item)
console.dir(this.popupChooseTargetModel)
},
handleAddIndicators (item) {
this.zanshi = item
this.zhibiaoTitle = '添加指标'
@ -430,6 +548,7 @@ export default {
}
this.showIndicators = true
},
handleCancelZhibiao () {
this.showIndicators = false
},
@ -443,12 +562,126 @@ export default {
return
}
if (!this.zanshi.tagetLibItems) this.zanshi.tagetLibItems = []
this.zanshi.tagetLibItems.push(Object.assign({}, this.formIndicators, {isDelete: 0}))
this.zanshi.tagetLibItems.push(Object.assign({}, this.formIndicators, { isDelete: 0 }))
this.showIndicators = false
}
})
},
handleChooseTargetSubmit (list) {
//
console.log('选择指标项')
console.dir(list)
if (!this.zanshi.tagetLibItems) { this.zanshi.tagetLibItems = [] }
let nowList = list.map(item => {
return Object.assign({}, item, { isDelete: 0 })
})
this.zanshi.tagetLibItems = this.zanshi.tagetLibItems.concat(list)
}
},
props: ['templateForm'],
data () {
return {
id: '',
isEditForm: {},
zhibiaoTitle: '添加指标',
weiduTitle: '添加维度',
dimensionsList: [], //
show: false, //
radio: 3,
maxCount: '',
weight: 0,
// info
info: {
gradeGroupId: 1,
modelItems: [
]
},
form: {
weight: '',
maxCount: ''
}, //
rules: {
name: [{
required: true,
message: '请输入维度名称',
trigger: 'blur'
}
]
}, //
showIndicators: false, //
formIndicators: {}, //
ruleIndicators: {
name: [{
required: true,
message: '请输入指标名称',
trigger: 'blur'
}
],
keyResult: [{
required: true,
message: '请输入考核标准',
trigger: 'blur'
}
],
weight: [{
required: true,
message: '请输入权重大小',
trigger: 'blur'
}
]
}, // rule
zanshi: {},
options: {
group: 'name',
draggable: '.item',
handle: '.my-handle',
dragClass: 'sortable-drag',
scroll: true,
sort: true, //
delay: 0, //
touchStartThreshold: 0, // px,?
disabled: false, // sortable
store: null, // @see Store
animation: 150 // ms, ' 0 ' -
},
options1: {
group: 'names',
draggable: '.items',
scroll: true,
sort: true, //
delay: 0, //
touchStartThreshold: 0, // px,?
disabled: false, // sortable
store: null, // @see Store
animation: 150 // ms, ' 0 ' -
},
popupChooseTargetModel: {
isShow: false, //
dimensionTypeId: -1, //
filter: [] //
}
}
},
components: {
PopupRight,
draggable,
ChooseTarget
},
computed: {},
beforeMount () { },
mounted () {
this.info = {
gradeGroupId: 1,
modelItems: [
]
}
const id = this.$route.query.id || ''
this.id = id
if (id) {
this.handleGetByGroupId(id)
}
this.handleGetDimensions()
},
watch: {
maxCount (n, o) {
if (!n) this.form.maxCount = ''
@ -468,11 +701,11 @@ export default {
</script>
<style lang='less' scoped>
.set{
&-top{
.set {
&-top {
padding: 10px;
background: rgb(242, 246, 253);
.wenhao{
.wenhao {
display: inline-block;
text-align: center;
width: 20px;
@ -482,41 +715,41 @@ export default {
border-radius: 50%;
background: rgb(211, 211, 211);
}
.el-form-item{
.el-form-item {
margin: 0;
}
&-title{
&-title {
font-size: 18px;
}
&-content{
&-content {
padding: 0 10px;
}
}
&-add{
&-add {
margin: 20px 0;
}
&-content{
&-item{
&-content {
&-item {
width: 100%;
margin-bottom: 20px;
min-height: 40px;
box-sizing: border-box;
border: 1px solid @borderColor;
&-top{
&-top {
display: flex;
align-items: center;
justify-content: space-between;
height: 50px;
background: #f7f7f7;
border-bottom: 1px solid @borderColor;
&-left{
&-left {
padding-left: 20px;
height: 100%;
.center();
cursor: move ;
cursor: move;
position: relative;
}
.my-handle::before{
.my-handle::before {
content: "";
position: absolute;
z-index: 10;
@ -524,74 +757,73 @@ export default {
top: 0;
bottom: 0;
margin: auto;
width:14px;
width: 14px;
height: 27px;
background: url('./imgs/before.png') no-repeat;
background: url("./imgs/before.png") no-repeat;
background-size: 100% 100%;
}
&-right{
&-right {
display: flex;
align-items: center;
i{
i {
margin-right: 20px;
cursor: pointer;
}
.el-icon-edit:hover{
.el-icon-edit:hover {
color: @fontBlue;
}
.el-icon-delete:hover{
.el-icon-delete:hover {
color: red;
}
}
}
&-center{
&-center {
height: 40px;
background: #f7f7f7;
padding: 0 20px;
display: flex;
font-size: 14px;
align-items: center;
&-item{
padding:0 20px;
&-item {
padding: 0 20px;
border-right: 1px solid @borderColor;
}
&-item:last-child{
&-item:last-child {
border-right: none;
}
}
&-table{
&-header{
&-table {
&-header {
display: flex;
justify-content: space-between;
align-items: center;
height: 60px;
border-bottom: 1px solid @borderColor;
span{
padding:0 0 0 20px;
span {
padding: 0 0 0 20px;
}
}
&-content{
&-content {
display: flex;
align-items: center;
min-height: 60px;
border-bottom: 1px solid @borderColor;
justify-content: space-between;
div{
padding:0 0 0 20px;
div {
padding: 0 0 0 20px;
}
}
}
&-bottom{
&-bottom {
padding: 10px;
}
}
}
.weiduManage{
.el-radio-group{
.weiduManage {
.el-radio-group {
display: flex;
flex-direction: column;
.el-radio{
.el-radio {
margin: 14px 0;
}
}

View File

@ -2,17 +2,42 @@
<template>
<div class="eidt">
<div class="eidt-header">
<div @click="handleChangle(1)" :class="{active:active===1}" class="a commonFont" ><span class="eidt-header-circle">1</span>基础设置</div>
<div @click="handleChangle(2)" :class="{active:active===2}" class="a commonFont"><span class="eidt-header-circle">2</span>模板设计</div>
<div @click="handleChangle(3)" :class="{active:active===3}" class="a commonFont"><span class="eidt-header-circle">3</span>流程设计</div>
<div
@click="handleChangle(1)"
:class="{active:active===1}"
class="a commonFont"
><span class="eidt-header-circle">1</span>基础设置</div>
<div
@click="handleChangle(2)"
:class="{active:active===2}"
class="a commonFont"
><span class="eidt-header-circle">2</span>模板设计</div>
<div
@click="handleChangle(3)"
:class="{active:active===3}"
class="a commonFont"
><span class="eidt-header-circle">3</span>流程设计</div>
</div>
<div class="eidt-right">
<el-button :loading='loadings' type="primary" @click="handSaveBasisc"> </el-button>
<el-button
:loading='loadings'
type="primary"
@click="handSaveBasisc"
> </el-button>
</div>
<div class="eidt-content boderAndRadius">
<basis :basisForm.sync='basisForm' v-show="active===1"/>
<template-set :templateForm.sync='templateForm' v-show="active===2"/>
<process :processInfo.sync='processInfo' v-show="active===3"/>
<basis
:basisForm.sync='basisForm'
v-show="active===1"
/>
<template-set
:templateForm.sync='templateForm'
v-show="active===2"
/>
<process
:processInfo.sync='processInfo'
v-show="active===3"
/>
</div>
</div>
</template>
@ -51,7 +76,7 @@ export default {
templateSet
},
computed: {},
beforeMount () {},
beforeMount () { },
created () {
const id = this.$route.query.id
this.$route.meta.title = !id ? '新增考评组' : '编辑考评组'
@ -106,7 +131,7 @@ export default {
this.loadings = true
try {
this.$loadingStart()
let res12 = await apiCheckStaff(Object.assign({}, this.basisForm, {confirm: 1}))
let res12 = await apiCheckStaff(Object.assign({}, this.basisForm, { confirm: 1 }))
let res = await saveBaseSet(this.basisForm)
if (res.code !== 200) {
this.loadings = false
@ -132,7 +157,7 @@ export default {
return i
})
}
let res1 = await saveDetailProcs(Object.assign({}, this.processInfo[i].chartDetails, {evaluationGroupId: this.basisForm.id}))
let res1 = await saveDetailProcs(Object.assign({}, this.processInfo[i].chartDetails, { evaluationGroupId: this.basisForm.id }))
if (res1.code !== 200) {
this.loadings = false
this.$loadingEnd()
@ -176,7 +201,7 @@ export default {
type: 'success',
duration: 1000,
onClose: () => {
this.$router.replace({name: 'workbench-group'})
this.$router.replace({ name: 'workbench-group' })
}
})
}
@ -188,23 +213,23 @@ export default {
</script>
<style lang='less' scoped>
.eidt{
.eidt {
position: relative;
&-right{
&-right {
position: absolute;
z-index: 50;
top: -(@headerHeight+30px);
right: 0;
height: @headerHeight;
.center()
.center();
}
&-content{
&-content {
min-height: 600px;
background: #fff;
padding: 40px 28px;
overflow: auto;
}
&-header{
&-header {
cursor: pointer;
position: absolute;
z-index: 50;
@ -216,18 +241,18 @@ export default {
margin: auto;
display: flex;
justify-content: space-between;
>div{
flex:1;
> div {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
letter-spacing:1px
letter-spacing: 1px;
}
.active{
.active {
background: @fontBlue;
color: #fff;
}
&-circle{
&-circle {
margin: 0 4px;
display: inline-block;
border: 1px solid #eeeeee;