Commit 75d04a79 authored by ww-xxy's avatar ww-xxy

优化绩效目标

parent 8781144f
...@@ -23,23 +23,50 @@ export default { ...@@ -23,23 +23,50 @@ export default {
type: Object, type: Object,
default: () => {}, default: () => {},
}, },
parameter: {
type: Object,
default: () => {}
}
}, },
data() { data() {
return {}; return {
myChart: null
};
}, },
watch: { watch: {
title(val) { title(val) {
console.log(val); this.myChart && this.myChart.setOption({title:{text:val}})
}, },
parameter: {
handler: function (v) {
this.drawLine(v)
},
deep: true
}
}, },
mounted() { mounted() {
this.drawLine(); this.drawLine();
}, },
methods: { methods: {
drawLine() { drawLine(obj) {
if (obj && this.myChart) {
// 更新
this.myChart.setOption({
xAxis: {
data: obj.x
},
series: [
{
data: obj.y,
},
]
})
return
}
// 基于dom,初始化echarts实例 // 基于dom,初始化echarts实例
let myChart = this.$echarts.init(document.getElementById(this.id)); let myChart = this.$echarts.init(document.getElementById(this.id));
this.myChart = myChart
// 绘制图表 // 绘制图表
myChart.setOption({ myChart.setOption({
title: { text: this.title }, title: { text: this.title },
...@@ -59,7 +86,7 @@ export default { ...@@ -59,7 +86,7 @@ export default {
color:'#6e98ed', color:'#6e98ed',
xAxis: { xAxis: {
type: "category", type: "category",
data: ["部门1", "部门2", "部门3", "部门4", "部门5", "部门6"], data: [],
}, },
grid: { grid: {
left: "3%", left: "3%",
...@@ -72,7 +99,7 @@ export default { ...@@ -72,7 +99,7 @@ export default {
{ {
name: this.legendName, name: this.legendName,
type: "line", type: "line",
data: [10, 20, 30, 90, 100, 100, 120], data: [],
smooth: true, smooth: true,
// itemStyle: { // itemStyle: {
// lineStyle: { // lineStyle: {
......
...@@ -23,23 +23,47 @@ export default { ...@@ -23,23 +23,47 @@ export default {
type: Object, type: Object,
default: () => {}, default: () => {},
}, },
parameter: {
type: Array,
default: () => []
}
}, },
data() { data() {
return {}; return {
myChart: null
};
}, },
watch: { watch: {
title(val) { title(val) {
console.log(val); this.myChart && this.myChart.setOption({title:{text:val}})
}, },
parameter: {
handler: function (v) {
this.drawLine(v)
},
deep: true
}
}, },
mounted() { mounted() {
this.drawLine(); this.drawLine();
}, },
methods: { methods: {
drawLine() { drawLine(obj) {
if (obj && this.myChart) {
// 更新
this.myChart.setOption({
series: [
{
data: obj,
},
]
})
return
}
// 基于dom,初始化echarts实例 // 基于dom,初始化echarts实例
let myChart = this.$echarts.init(document.getElementById(this.id)); let myChart = this.$echarts.init(document.getElementById(this.id));
this.myChart = myChart
// 绘制图表 // 绘制图表
myChart.setOption({ myChart.setOption({
title: { text: this.title }, title: { text: this.title },
...@@ -70,13 +94,7 @@ export default { ...@@ -70,13 +94,7 @@ export default {
name: this.legendName, name: this.legendName,
type: "pie", type: "pie",
radius: "65%", radius: "65%",
data: [ data: this.parameter,
{ value: 1048, name: "部门1" },
{ value: 735, name: "部门2" },
{ value: 580, name: "部门3" },
{ value: 484, name: "部门4" },
{ value: 300, name: "部门5" },
],
emphasis: { emphasis: {
itemStyle: { itemStyle: {
shadowBlur: 10, shadowBlur: 10,
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="周期" prop="year"> <el-form-item label="周期" prop="year">
<el-date-picker style="width: 100%;" v-model="form.year" type="year" placeholder="选择年"> <el-date-picker style="width: 100%;" format="yyyy" value-format="yyyy" v-model="form.year" type="year"
placeholder="选择年">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
...@@ -29,12 +30,12 @@ ...@@ -29,12 +30,12 @@
:enumData="dict.periodType" placeholder="请选择周期类型" /> :enumData="dict.periodType" placeholder="请选择周期类型" />
</el-col> </el-col>
</el-row> </el-row>
<el-row> <!-- <el-row>
<el-col :span="8"> <el-col :span="8">
<Field label="考核范围" :span="24" prop="assessmentScope" v-model="form.assessmentScope" type="select" <Field label="考核范围" :span="24" prop="assessmentScope" v-model="form.assessmentScope" type="select"
:enumData="dict.assessmentScope" placeholder="请选择考核范围" /> :enumData="dict.assessmentScope" placeholder="请选择考核范围" />
</el-col> </el-col>
</el-row> </el-row> -->
<el-row v-if="form.assessmentScope == 1"> <el-row v-if="form.assessmentScope == 1">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="选择部门"> <el-form-item label="选择部门">
...@@ -65,7 +66,7 @@ ...@@ -65,7 +66,7 @@
<el-input v-model="item.ownerName" placeholder="请输入姓名"></el-input> <el-input v-model="item.ownerName" placeholder="请输入姓名"></el-input>
</el-col> </el-col>
<el-col :span="12" style="padding:0 10px"> <el-col :span="12" style="padding:0 10px">
<el-input v-model="form.leaderMobiles" placeholder="请输入电话"></el-input> <el-input v-model="item.leaderMobiles" placeholder="请输入电话"></el-input>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<el-button type="primary" icon="el-icon-plus" circle v-if="index == 0" @click="addOwner"></el-button> <el-button type="primary" icon="el-icon-plus" circle v-if="index == 0" @click="addOwner"></el-button>
...@@ -146,10 +147,10 @@ export default { ...@@ -146,10 +147,10 @@ export default {
ownerList: [ ownerList: [
{ ownerId: "", ownerName: "", leaderMobiles: "" } { ownerId: "", ownerName: "", leaderMobiles: "" }
], ],
deptArr:[],//部门下拉 deptArr: [],//部门下拉
staffArr:[],//人员下拉 staffArr: [],//人员下拉
deptId:[],//部门选中 deptId: [],//部门选中
staffId:[],//人员选中数据 staffId: [],//人员选中数据
}; };
}, },
created() { created() {
...@@ -157,20 +158,46 @@ export default { ...@@ -157,20 +158,46 @@ export default {
this.staffList() this.staffList()
}, },
methods: { methods: {
beforeSubmit(form) {
// 个人/部门
const perposeStaffList = []//选中人员
const perposeDeptList = []//选中部门
this.deptId.forEach(element => {
perposeDeptList.push({ deptId: element })
});
this.staffId.forEach(element => {
perposeStaffList.push({ staffId: element })
});
form.perposeStaffList = perposeStaffList
form.perposeDeptList = perposeDeptList
// 负责人
const leaders = []//名
const leaderMobiles = []//电话
this.ownerList.forEach(element => {
leaders.push(element.ownerName)
leaderMobiles.push(element.leaderMobiles)
});
form.leaders = leaders.length > 0 ? leaders.join(",") : ""
form.leaderMobiles = leaderMobiles.length > 0 ? leaderMobiles.join(',') : ""
console.log(form, "入参")
return form
},
// 查询部门列表 // 查询部门列表
deptList(){ deptList() {
this.$post("/dept/list", {page:1,size:-1}).then((res) => { this.$post("/dept/list", { page: 1, size: -1 }).then((res) => {
const {code,data,dict} = res const { code, data, dict } = res
if(code == 1){ if (code == 1) {
this.deptArr = data.data this.deptArr = data.data
console.log(data.data, "部门")
} }
}); });
}, },
// 查询部门列表 // 查询部门列表
staffList(){ staffList() {
this.$post("/staff/list", {page:1,size:-1}).then((res) => { this.$post("/staff/list", { page: 1, size: -1 }).then((res) => {
const {code,data,dict} = res const { code, data, dict } = res
if(code == 1){ if (code == 1) {
this.staffArr = data.data this.staffArr = data.data
} }
}); });
...@@ -194,9 +221,9 @@ export default { ...@@ -194,9 +221,9 @@ export default {
}, },
/** 新增 */ /** 新增 */
add(row) { add(row) {
this.reset();
this.urls.currUrl = "perform/perpose/add"; this.urls.currUrl = "perform/perpose/add";
this.getData(); this.getData();
this.reset();
this.pageInfo.type = "add"; this.pageInfo.type = "add";
this.title = "新增考核目标"; this.title = "新增考核目标";
}, },
...@@ -216,6 +243,33 @@ export default { ...@@ -216,6 +243,33 @@ export default {
/**获取数据后弹框 */ /**获取数据后弹框 */
afterRender(data) { afterRender(data) {
this.open = true; this.open = true;
if (this.pageInfo.type == "add") {
// 新增
this.reset()
this.form.assessmentScope = this.$parent.query.assessmentScope + ''
}else{
// 编辑
this.form.year = this.form.year+''
const leaderMobiles = this.form.leaderMobiles.split(',')
// 回显负责人
const ownerList = []
this.form.leaders.split(',').forEach((v,i)=>{
ownerList.push({ ownerId: "", ownerName: v, leaderMobiles: leaderMobiles[i] || '' })
})
this.ownerList = ownerList
// 回显选中人员
const staffId = []
this.form.perposeStaffList && this.form.perposeStaffList.forEach(v=>{
staffId.push(v.staffId)
})
this.staffId = staffId
// 回显选中部门
const deptId = []
this.form.perposeDeptList && this.form.perposeDeptList.forEach(v=>{
deptId.push(v.deptId)
})
this.deptId = deptId
}
}, },
afterSubmit(data) { afterSubmit(data) {
...@@ -229,20 +283,26 @@ export default { ...@@ -229,20 +283,26 @@ export default {
ownerId: null, ownerId: null,
ownerName: "", ownerName: "",
staffId: null, staffId: null,
assessmentType: null, assessmentType: '1',
assessmentScope: 1, assessmentScope: '1',
compareScope: 1, compareScope: '1',
ratio: 0.0, ratio: 0.0,
periodType: 1, periodType: '1',
year: null, year: "",
month: null, // month: null,
halfYear: 1, // halfYear: 1,
halfYear: 1, // quarter: 1,
quarter: 1,
leaders: "", leaders: "",
leaderMobiles: "", leaderMobiles: "",
remark: "", remark: "",
perposeStaffList: [],
perposeDeptList: []
}; };
this.ownerList = [
{ ownerId: "", ownerName: "", leaderMobiles: "" }
]
this.deptId = []
this.staffId = []
this.resetForm("form"); this.resetForm("form");
}, },
resetForm(refName) { resetForm(refName) {
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<line-charts <line-charts
:title="'绩效平均分排名'" :title="'绩效平均分排名'"
:id="'jixiaopingjunfen'" :id="'jixiaopingjunfen'"
:parameter="depStatObj.averageScore"
:legendName="'绩效平均分'" :legendName="'绩效平均分'"
:styleObj="{ width: '100%', height: '300px' }" :styleObj="{ width: '100%', height: '300px' }"
/> />
...@@ -50,7 +51,7 @@ ...@@ -50,7 +51,7 @@
<bar-charts <bar-charts
:title="'部门加分排名TOP10'" :title="'部门加分排名TOP10'"
:id="'top_10'" :id="'top_10'"
:parameter="depStatObj.attendScoreAdd" :parameter="depStatObj.totalAddScore"
:legendName="'部门加分分值'" :legendName="'部门加分分值'"
:styleObj="{ width: '100%', height: '300px' }" :styleObj="{ width: '100%', height: '300px' }"
/> />
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
<pie-charts <pie-charts
:title="'部门加分整体分布'" :title="'部门加分整体分布'"
:id="'jiafen'" :id="'jiafen'"
:parameter="depStatObj.pieAddScore"
:legendName="'部门加分'" :legendName="'部门加分'"
:styleObj="{ width: '100%', height: '300px' }" :styleObj="{ width: '100%', height: '300px' }"
/> />
...@@ -67,16 +69,18 @@ ...@@ -67,16 +69,18 @@
<bar-charts <bar-charts
:title="'部门扣分排名TOP10'" :title="'部门扣分排名TOP10'"
:id="'koufen_10'" :id="'koufen_10'"
:parameter="depStatObj.totalSubScore"
:legendName="'部门扣分分值'" :legendName="'部门扣分分值'"
:styleObj="{ width: '100%', height: '300px' }" :styleObj="{ width: '100%', height: '300px' }"
/> />
</div> </div>
<div class="koufen box"> <div class="koufen box">
<pie-charts <pie-charts
:parameter="depStatObj.pieSubScore"
:title="'部门扣分整体分布'" :title="'部门扣分整体分布'"
:id="'koufen'" :id="'koufen'"
:legendName="'部门扣分'" :legendName="'部门扣分'"
:styleObj="{ width: '100%', height: '300px' }" :styleObj="{ onAssessmentScope2width: '100%', height: '300px' }"
/> />
</div> </div>
</div> </div>
...@@ -131,7 +135,7 @@ ...@@ -131,7 +135,7 @@
<el-tab-pane label="目标管理" name="3"> <el-tab-pane label="目标管理" name="3">
<div class="content"> <div class="content">
<div class="top"> <div class="top">
<el-radio-group v-model="type2"> <el-radio-group v-model="type2" @change="onAssessmentScope2">
<el-radio-button :label="1">按部门</el-radio-button> <el-radio-button :label="1">按部门</el-radio-button>
<el-radio-button :label="2">按个人</el-radio-button> <el-radio-button :label="2">按个人</el-radio-button>
</el-radio-group> </el-radio-group>
...@@ -144,17 +148,17 @@ ...@@ -144,17 +148,17 @@
<div class="goal_title"> <div class="goal_title">
<img src="../../../../assets/images/u17641.svg" alt="" /> <img src="../../../../assets/images/u17641.svg" alt="" />
<span> <span>
旷工率不高于10% {{dictString('assessmentType',val.assessmentType)}}{{dictString('compareScope',val.compareScope)}}{{val.ratio}}%
</span> </span>
</div> </div>
<p class="goal_txt"> <p class="goal_txt">
<span>{{ type2 == 1 ? "目标部门:" : "目标个人:" }}</span <span>{{ type2 == 1 ? "目标部门:" : "目标个人:" }}</span
><span>{{ ><span>{{
type2 == 1 ? "全部部门" : "张三、李四、王武、陈真" type2 == 1 ? val.deptPerpose : val.staffPerpose
}}</span> }}</span>
</p> </p>
<p class="goal_txt"> <p class="goal_txt">
<span>周期:</span><span>{{val.periodType}}</span> <span>周期:</span><span>{{val.year}} {{dictString('periodType',val.periodType)}}</span>
</p> </p>
<p class="goal_txt"> <p class="goal_txt">
<span>负责人:</span><span>{{val.leaders}}</span> <span>负责人:</span><span>{{val.leaders}}</span>
...@@ -162,7 +166,7 @@ ...@@ -162,7 +166,7 @@
<p class="goal_txt"> <p class="goal_txt">
<span>最近更新:</span><span>{{val.updateTime}}</span> <span>最近更新:</span><span>{{val.updateTime}}</span>
</p> </p>
<p class="goal_txt"><span>更新人员:</span><span>{{val.updateUserId}}</span></p> <p class="goal_txt"><span>更新人员:</span><span>{{dictString('updateUserId',val.updateUserId)}}</span></p>
<div class="button_box"> <div class="button_box">
<el-button <el-button
type="primary" type="primary"
...@@ -254,17 +258,22 @@ export default { ...@@ -254,17 +258,22 @@ export default {
// this.statArr = row // this.statArr = row
const x = [] const x = []
const y = [] const y = []
const xTop10 = [] const averageScore = [] //平均分数
row.forEach(element => { row.forEach(element => {
x.push(element.deptName) x.push(element.deptName)
y.push(element.totalScore) y.push(element.totalScore)
averageScore.push(element.averageScore)
}); });
this.depStatObj.totalScore.x = x this.depStatObj.totalScore.x = x
this.depStatObj.totalScore.y = y this.depStatObj.totalScore.y = y
// 平均值
this.depStatObj.averageScore.x = x
this.depStatObj.averageScore.y = averageScore
} }
}); });
// 加分top10 // 加分top10
const top10 = {...this.boardQuery,size:10} const top10 = {...this.boardQuery,size:10,orderColList:[{colName:'totalAddScore',sortKind:'desc'}]}
this.$post("/staff/perform/stat/list", top10).then((res) => { this.$post("/staff/perform/stat/list", top10).then((res) => {
const {code,data,dict} = res const {code,data,dict} = res
if(code == 1){ if(code == 1){
...@@ -274,11 +283,28 @@ export default { ...@@ -274,11 +283,28 @@ export default {
const y = [] const y = []
row.forEach(element => { row.forEach(element => {
x.push(element.deptName) x.push(element.deptName)
y.push(element.attendScoreAdd) y.push(element.totalAddScore)
}); });
this.depStatObj.attendScoreAdd.x = x this.depStatObj.totalAddScore.x = x
this.depStatObj.attendScoreAdd.y = y this.depStatObj.totalAddScore.y = y
console.log(this.depStatObj.attendScoreAdd,"`````",data)
}
});
// 减分
const top10Sub = {...this.boardQuery,size:10,orderColList:[{colName:'totalSubScore',sortKind:'desc'}]}
this.$post("/staff/perform/stat/list", top10Sub).then((res) => {
const {code,data,dict} = res
if(code == 1){
const row = data.data || []
// this.statArr = row
const x = []
const y = []
row.forEach(element => {
x.push(element.deptName)
y.push(element.totalSubScore)
});
this.depStatObj.totalSubScore.x = x
this.depStatObj.totalSubScore.y = y
} }
}); });
}, },
...@@ -332,16 +358,24 @@ export default { ...@@ -332,16 +358,24 @@ export default {
this.getData(); this.getData();
}); });
}, },
// 目标管理
getData() { getData() {
this.$post("/perform/perpose/list",this.query).then((res) => { this.$post("/perform/perpose/list",this.query).then((res) => {
console.log(res); console.log(res,"@@@@@@@@@@@@");
if (res.code == 1) { const {code,data,dict} = res
this.dataList = res.data.data; this.dict = dict || {}
if (code == 1) {
this.dataList = data.data;
} else { } else {
this.dataList = []; this.dataList = [];
} }
}); });
}, },
// 字典转换
dictString(key,id){
const keyName = this.dict[key]
return keyName?keyName[id]:""
},
// TAB个人/法人 // TAB个人/法人
onAssessmentScope(v){ onAssessmentScope(v){
if(v == 1){ if(v == 1){
...@@ -357,6 +391,15 @@ export default { ...@@ -357,6 +391,15 @@ export default {
}else{ }else{
this.staffList() this.staffList()
} }
},
onAssessmentScope2(v){
if(v == 1){
this.query.assessmentScope = 1
}else{
this.query.assessmentScope = 2
}
this.getData()
} }
}, },
computed: { computed: {
...@@ -471,15 +514,15 @@ export default { ...@@ -471,15 +514,15 @@ export default {
x:[], x:[],
y:[] y:[]
},//绩效总分排名 },//绩效总分排名
totalAverage:{ averageScore:{
x:[], x:[],
y:[] y:[]
},//绩效平均排名 },//绩效平均排名
attendScoreAdd:{ totalAddScore:{
x:[], x:[],
y:[] y:[]
},//加分 },//加分
attendScoreSub:{ totalSubScore:{
x:[], x:[],
y:[] y:[]
},//减分 },//减分
...@@ -487,19 +530,34 @@ export default { ...@@ -487,19 +530,34 @@ export default {
x:[], x:[],
y:[] y:[]
},//目标对齐 },//目标对齐
pieAddScore:[
{value:0,name:'考勤绩效'},
{value:0,name:'评价绩效'},
{value:0,name:'办件绩效'},
{value:0,name:'效能绩效'},
{value:0,name:'投诉绩效'},
{value:0,name:'其它绩效'},
],//部门加分分布
pieSubScore:[
{value:0,name:'考勤绩效'},
{value:0,name:'评价绩效'},
{value:0,name:'办件绩效'},
{value:0,name:'效能绩效'},
{value:0,name:'投诉绩效'},
{value:0,name:'其它绩效'},
]//部门减分分布
},//按部门 },//按部门
month:"",//月份 month:"",//月份
boardQuery:{ boardQuery:{
page:1, page:1,
size:-1, size:-1,
// year:parseInt(moment().format('YYYY')), year:parseInt(moment().format('YYYY')),
// month:parseInt(moment().format('MM')), month:parseInt(moment().format('MM')),
},//看板查询条件 },//看板查询条件
query:{ query:{
page:1, page:1,
size:-1, size:8,
// assessmentScope:1//考核范围(1.部门,2.个人) assessmentScope:1//考核范围(1.部门,2.个人)
},//目标管理查询条件 },//目标管理查询条件
StatQuery:{ StatQuery:{
page:1, page:1,
...@@ -507,6 +565,7 @@ export default { ...@@ -507,6 +565,7 @@ export default {
year:parseInt(moment().format('YYYY')), year:parseInt(moment().format('YYYY')),
month:parseInt(moment().format('MM')), month:parseInt(moment().format('MM')),
},//对齐方式入参 },//对齐方式入参
dict:{}//字典
}; };
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment