Commit 66cdb552 authored by 姬鋆屾's avatar 姬鋆屾

pref:添加人员绩效汇总一张表功能

parent ddcd918e
......@@ -97,11 +97,11 @@ export default {
required: false,
default: () => {},
},
tableRowClassName: {
type: Function,
required: false,
default: () => {},
},
// tableRowClassName: {
// type: Function,
// required: false,
// default: () => {},
// },
loading: {
type: Boolean,
required: false,
......@@ -143,7 +143,7 @@ export default {
// }
},
toggleRowSelection: {
handler: function(v) {
handler: function (v) {
v.forEach((element) => {
this.$refs.eltable.toggleRowSelection(element, true);
});
......@@ -152,7 +152,13 @@ export default {
immediate: true,
},
},
methods: {},
methods: {
tableRowClassName({ row }) {
if (row.dataType == 2) {
return "red";
}
},
},
data() {
return {
emptytxt: "",
......@@ -160,3 +166,8 @@ export default {
},
};
</script>
<style lang="less" scoped>
/deep/.el-table .red {
background: rgba(255, 233, 233);
}
</style>
......@@ -34,6 +34,7 @@
:placeholder="placeholder"
@change="emit"
@input="emit"
:min="min"
v-if="type === 'num'"
></el-input-number>
......@@ -50,7 +51,34 @@
:autosize="textareaSize"
:class="inputClass"
></el-input>
<el-select
v-model="field"
:clearable="true"
@change="salaChange"
v-if="type === 'selectSalaId'"
:placeholder="'请选择大厅'"
>
<el-option
:label="label.deptName"
:value="label.id"
v-for="(label, value) in salaArr"
:key="value"
></el-option>
</el-select>
<el-select
v-model="field"
:clearable="true"
@change="deptChange"
v-if="type === 'selectDeptId'"
:placeholder="'请选择部门'"
>
<el-option
:label="label.deptName"
:value="label.id"
v-for="(label, value) in deptArr"
:key="value"
></el-option>
</el-select>
<!-- 一级 -->
<el-select
:disabled="disabled"
......@@ -60,7 +88,7 @@
:filterable="filterable"
:clearable="clearable"
v-if="type === 'select'"
style="width: 100%;"
style="width: 100%"
>
<el-option
v-for="($label, $value) in enumData"
......@@ -103,7 +131,7 @@
v-for="($label, $value) in enumData"
:key="$value"
:label="$value"
style="margin-bottom: 10px;"
style="margin-bottom: 10px"
>{{ $label }}</el-radio
>
</el-radio-group>
......@@ -112,13 +140,13 @@
v-model="field"
@change="emit"
v-if="type === 'radioCol'"
style="display: flex;margin-top: 12px;"
style="display: flex; margin-top: 12px"
>
<el-radio
v-for="($label, $value) in enumData"
:key="$value"
:label="$value"
style="margin-bottom: 15px;"
style="margin-bottom: 15px"
>{{ $label }}</el-radio
>
</el-radio-group>
......@@ -145,9 +173,35 @@
@change="emit"
@input="emit"
placeholder="选择日期"
style="width: 100%;"
style="width: 100%"
v-if="type === 'date'"
></el-date-picker>
<el-date-picker
:disabled="disabled"
type="month"
v-model="field"
@change="emit"
@input="emit"
placeholder="选择月"
style="width: 100%"
v-if="type === 'month'"
:append-to-body="false"
popper-class="due_month"
value-format="M"
format="M月"
></el-date-picker>
<el-date-picker
:disabled="disabled"
type="year"
v-model="field"
@change="emit"
@input="emit"
placeholder="选择年"
value-format="yyyy"
format="yyyy年"
style="width: 100%"
v-if="type === 'year'"
></el-date-picker>
<el-date-picker
:disabled="disabled"
type="datetime"
......@@ -157,7 +211,7 @@
@input="emit"
placeholder="选择日期"
v-if="type === 'datetime'"
style="width: 100%;"
style="width: 100%"
></el-date-picker>
</slot>
</el-form-item>
......@@ -242,6 +296,14 @@ export default {
maxLength: {
type: Number,
},
min: {
type: Number,
},
},
created() {
if (this.type == "selectDeptId" || this.type == "selectSalaId") {
this.getArr();
}
},
methods: {
emit() {
......@@ -250,15 +312,53 @@ export default {
//this.$emit('focus', this.newVal)
this.$emit("cascaderChange", this.newVal);
},
deptChange() {
this.page = 1;
},
salaChange() {
this.$get("/dept/getDeptBySalaId", { salaId: this.form.salaId })
.then((res) => {
if (res.code == 1) {
this.deptArr = res.data.data;
this.page = 1;
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
getArr() {
this.$get("/dept/getSalaList")
.then((res) => {
if (res.code == 1) {
this.salaArr = res.data.data;
}
})
.catch((error) => {
this.$message.error(error.message);
});
this.$get("/dept/getDeptBySalaId")
.then((res) => {
if (res.code == 1) {
this.deptArr = res.data.data;
console.log(123);
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
},
computed: {
field: {
get() {
if (Array.isArray(this.value)) {
this.value = this.value.map((v) => {
return typeof v == 'number' ? v + "" : v;
return typeof v == "number" ? v + "" : v;
});
}
console.log(this.value);
return this.value;
},
set(val) {
......@@ -270,7 +370,15 @@ export default {
data() {
return {
newVal: this.value,
salaArr: [],
deptArr: [],
page: 1,
};
},
};
</script>
<style lang="less" scoped>
/deep/.due_month .el-date-picker__header {
display: none;
}
</style>
......@@ -77,11 +77,6 @@
v-if="item.type === 'selectDeptId'"
:placeholder="'请选择' + item.label"
>
<!-- <el-option
label=""
value=""
v-if="!item.multiple && !item.notShowAll"
></el-option> -->
<el-option
:label="label.deptName"
:value="label.id"
......
......@@ -151,6 +151,7 @@ const router = new Router({
...restBuilder("feedback/answer/option", "feedback/answer/option"), //回答问题选项
...restBuilder("staff/perform/summary", "staff/perform/summary"), //员工绩效统计汇总
...restBuilder("staff/perform/summary/edit", "staff/perform/summary/edit"), //人员绩效统计汇总
...restBuilder("window/perform/summary", "window/perform/summary"), //窗口绩效统计汇总
...restBuilder("door", "door"), //门禁设备管理
......
<template>
<!-- 弹出框表单 -->
<el-dialog
:title="title"
:visible.sync="open"
width="50%"
height="300px"
append-to-body
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<div class="userName">
<div class="user-left">
<div class="user-name">
{{ form.staffName }}
</div>
<div class="user-info">
<span class="user-i">工号:{{ form.workNum }}</span>
<span class="user-i">所属部门:{{ form.deptName }}</span>
</div>
</div>
<div class="user-right">
<!-- <div class="n">{{ form.otherScore }}</div>
<div class="m">{{ form.month }}月自评绩效得分</div> -->
<div class="n" style="margin-top: 10px; color: #409eff">
{{ form.totalScore }}
</div>
<div class="m">{{ form.month }}月绩效得分</div>
<div class="m" style="color: #aaa">
绩效分数更新时间:{{ momentVal(form.updateTime) }}
</div>
</div>
</div>
<div class="dialog_box" v-if="pageInfo.type == 'view'">
<div
class="userName user-t-item"
:class="{ t2: item.subAddType == 1, t1: item.subAddType == 2 }"
v-for="item in list"
:key="item.id"
>
<div class="user-left">
<div class="user-name">
{{ dictVal("checkType", item.checkType) }}
</div>
<div class="user-info">
<span class="user-i">绩效规则:{{ item.ruleName }}</span>
</div>
<div class="user-info">
<span class="user-i"
>{{
item.subAddType == 1
? "加分方式:"
: item.subAddType == 2
? "扣分方式:"
: "方式:"
}}{{ util_formatter("subMethod", item.subMethod) }}</span
>
</div>
<div class="user-info" v-if="item.performType == 'attend'">
<span class="user-i">异常时间:{{ momentVal(item.remark) }}</span>
</div>
<div class="user-info">
<span class="user-i"
>核查时间:{{ momentVal(item.checkTime) }}</span
>
</div>
<div class="user-info" v-if="item.auditStatus == 2">
<span class="user-i"
>核查结果:{{ item.subAddType == 1 ? "+" : "-"
}}{{ item.score }}{{ item.checkResult }}</span
>
</div>
</div>
<div class="user-right">
<div class="n">
{{ item.subAddType == 1 ? "+" : "-"
}}{{ item.auditStatus == 2 ? 0 : item.score }}
</div>
</div>
</div>
</div>
<div class="dialog_box" v-else style="margin-top: 20px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row v-if="form.label == '备注1'">
<el-col :span="2" style="width: 5.3333%"> <div>备注:</div></el-col>
<el-col :span="22">
<span>
<el-input
type="textarea"
v-model="form.remark"
:autosize="{ minRows: 2, maxRows: 8 }"
placeholder="请输入备注内容"
style="
font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica,
STHeiTi, Arial, sans-serif;
"
></el-input>
</span>
</el-col>
</el-row>
<el-row v-if="form.label == '备注2'">
<el-col :span="2" style="width: 5.3333%"> <div>备注:</div></el-col>
<el-col :span="22">
<template v-if="typeof form.remarkAdd != 'string'">
<div
class="attend_box"
v-for="(val, i) in form.remarkAdd"
:key="i"
>
<div class="text_box" style="width: 50%">
<el-autocomplete
class="inline-input"
v-model="val.name"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
style="width: 100%"
clearable
@clear="handleClear(val)"
@blur="handleBlur"
></el-autocomplete>
</div>
<div class="score_box">
<el-input-number
v-model="val.score"
@blur="handleBlur"
@change="handleBlur"
controls-position="right"
></el-input-number>
</div>
<div class="icon_box">
<i
class="el-icon-circle-plus-outline"
style="
width: 100%;
height: 100%;
font-size: 30px;
color: #409eff;
margin-right: 10px;
"
@click="handlePlus"
v-if="i + 1 == form.remarkAdd.length"
></i>
<i
class="el-icon-remove-outline"
@click="handleRemove(i)"
style="
width: 100%;
height: 100%;
font-size: 30px;
color: #f56c6c;
"
></i>
</div>
</div>
</template>
</el-col>
</el-row>
</el-form>
</div>
<div
slot="footer"
class="dialog-footer"
style="display: flex; align-items: center"
>
<el-col :span="20">
<el-col :span="4" style="width: 15.7%" v-if="form.label == '备注2'">
<div>当前累计加分:</div></el-col
>
<el-col :span="1" v-if="form.label == '备注2'" style="text-align: left">
<span style="color: #f56c6c; font-weight: 600">
{{ form.addTotalScore ? form.addTotalScore : 0 }}
</span>
</el-col>
</el-col>
<el-button
type="primary"
v-if="pageInfo.type !== 'view'"
@click="submitForm"
>确 定</el-button
>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import form from "@/assets/mixins/formdialog";
import dialogShow from "./dialogshow";
import moment from "moment";
export default {
mixins: [form],
components: {
dialogShow,
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "员工绩效统计",
// 是否显示弹出层
open: false,
toString: ["month"],
// 表单校验
rules: {},
list: [],
dict: {},
rulesList: [],
};
},
methods: {
handleBlur() {
this.form.addTotalScore = 0;
this.form.remarkAdd && this.form.remarkAdd.length > 0
? this.form.remarkAdd.forEach((v) => {
if (v.name && v.name != "") {
v.score ? v.score : (v.score = 0);
this.form.addTotalScore += v.score;
}
})
: "";
this.form.addTotalScore = this.form.addTotalScore.toFixed(2);
this.$forceUpdate();
},
handlePlus() {
this.form.remarkAdd.push({
name: "",
score: 0,
});
},
handleRemove(i) {
if (i == 0 && this.form.remarkAdd.length == 1) {
this.form.remarkAdd = [
{
name: "",
score: 0,
},
];
} else {
this.form.remarkAdd = this.form.remarkAdd.filter(
(v, index) => index != i
);
}
this.handleBlur();
},
handleClear(val) {
val.name = "";
val.score = 0;
},
handleSelect(item) {
this.form.remarkAdd.forEach((val) => {
this.rulesList.forEach((v) => {
if (val.name == v.value) {
v.subAddType == 2
? (val.score = Number("-" + v.score))
: (val.score = Number("+" + v.score));
}
});
});
this.handleBlur();
},
querySearch(queryString, cb) {
let rulesList = this.rulesList;
let results = queryString
? rulesList.filter(this.createFilter(queryString))
: rulesList;
// 调用 callback 返回建议列表的数据
cb(results);
},
createFilter(queryString) {
return (rule) => {
return (
rule.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
);
};
},
// 日期
momentVal(v) {
return moment(v).format("YYYY-MM-DD HH:SS");
},
// 字典转换
dictVal(key, val) {
return this.dict[key][val];
},
/** 查看汇总 */
checkAll(id) {
this.$post("/check/all/record/list", {
checkStatus: 2,
staffId: id,
checkTimeStart: this.$route.query.yearmonth
? this.$route.query.yearmonth + "-01"
: "",
checkTimeEnd: this.$route.query.yearmonth
? this.$route.query.yearmonth + "-31"
: "",
}).then((res) => {
const { code, data, dict } = res;
if (code == 1) {
const row = data.data || [];
//deductTime申诉时间 checkTime 核查时间 ruleName规则checkType字典 subAddType:1增加2减score
this.list = row;
this.dict = dict;
this.open = true;
}
});
},
/** 编辑 */
async edit(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "staff/perform/summary/edit/edit";
this.pageInfo.type = "edit";
this.title = "员工绩效统计";
await this.getData();
row.label && row.label != "" ? (this.form.label = row.label) : "";
this.$nextTick(async () => {
if (row.label == "备注2") {
await this.$post("/perform/rules/list", { size: -1 }).then(
async (res) => {
if (res.code == 1) {
this.rulesList = res.data.data;
this.rulesList && this.rulesList.length > 0
? this.rulesList.forEach((v) => {
v.value = v.name + "--" + v.content;
})
: "";
if (
this.form.remarkAdd === "[]" ||
this.form.remarkAdd == undefined ||
this.form.remarkAdd == null ||
this.form.remarkAdd.length == 0 ||
this.form.remarkAdd == ""
) {
this.form.remarkAdd = [
{
name: "",
score: 0,
},
];
console.log(this.form.remarkAdd);
this.handleBlur();
this.$forceUpdate();
} else {
this.handleBlur();
this.$forceUpdate();
}
}
}
);
}
});
},
/** 新增 */
add(row) {
this.reset();
this.urls.currUrl = "staff/perform/summary/edit/add";
this.getData();
this.pageInfo.type = "add";
this.title = "新增员工绩效统计";
},
/** 查看*/
view(row) {
this.reset();
this.query = {
id: row.id,
};
this.urls.currUrl = "staff/perform/summary/edit/view";
this.getData();
this.pageInfo.type = "view";
this.title = "员工绩效统计详细";
this.checkAll(row.staffId);
},
/**取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/**获取数据后弹框 */
afterRender(data) {
this.pageInfo.type != "view" ? (this.open = true) : "";
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
staffId: 0,
workNum: "",
staffName: "",
deptId: 0,
deptName: "",
attendScore: null,
assessScore: null,
workScore: null,
effectScore: null,
otherScore: null,
errorScore: null,
totalScore: null,
remark: "",
year: null,
month: null,
remarkAdd: "[]",
addTotalScore: 0,
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<style lang="less" scoped>
.userName {
background: rgba(242, 246, 252, 1);
display: flex;
align-items: center;
padding: 15px;
.user-left {
flex: 1;
}
.user-name {
font-size: 18px;
font-weight: bold;
}
.user-info {
margin-top: 10px;
.user-i {
margin-right: 40px;
}
}
.user-right {
text-align: center;
.n {
font-size: 16px;
font-weight: bold;
}
.m {
font-size: 12px;
}
}
}
.user-t-item {
margin-top: 20px;
border-left: 4px solid #ff4242;
}
.t1 {
border-color: #ff4242;
background: rgba(255, 66, 66, 0.07);
.user-name,
.n {
color: #ff4242;
}
}
.t2 {
border-color: rgba(27, 198, 167, 1);
background: rgba(27, 198, 167, 0.07);
.user-name,
.n {
color: rgba(27, 198, 167, 1);
}
}
/deep/.el-dialog__body {
height: 650px;
.dialog_box {
height: 85%;
overflow-y: auto;
.attend_box {
display: flex;
align-items: center;
margin-bottom: 20px;
.score_box {
margin: 0 15px;
}
.icon_box {
display: flex;
}
/deep/.el-input__inner {
width: 100%;
}
}
/deep/.el-autocomplete {
width: 100% !important;
}
}
/deep/.el-textarea input::-moz-input-placeholder {
font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, STHeiTi, Arial,
sans-serif !important;
}
/deep/.el-textarea input::-webkit-input-placeholder {
font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, STHeiTi, Arial,
sans-serif !important;
}
}
</style>
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
size="50%"
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="120px"
style="padding: 0 20px"
>
<el-row>
<Field
label="考评年份"
prop="year"
v-model="form.year"
type="year"
placeholder="请选择考评年份"
/>
<Field
label="考评月份"
prop="month"
type="month"
v-model="form.month"
placeholder="请选择考评月份"
/>
</el-row>
<el-row>
<Field
label="员工姓名"
prop="staffName"
v-model="form.staffName"
placeholder="请输入员工姓名"
/>
<Field
label="工号"
prop="workNum"
v-model="form.workNum"
placeholder="请输入工号"
/>
</el-row>
<el-row>
<Field label="所属大厅" prop="salaId">
<el-select
v-model="form.salaId"
:clearable="true"
@change="salaChange"
:placeholder="'请选择大厅'"
>
<el-option
:label="label.deptName"
:value="label.id"
v-for="(label, value) in salaArr"
:key="value"
></el-option>
</el-select>
</Field>
<Field label="所属部门" prop="deptId">
<el-select
v-model="form.deptId"
:clearable="true"
@change="deptChange"
:placeholder="'请选择部门'"
>
<el-option
:label="label.deptName"
:value="label.id"
v-for="(label, value) in deptArr"
:key="value"
></el-option>
</el-select>
</Field>
</el-row>
<el-row>
<Field
label="工作纪律"
prop="effectScore"
type="num"
v-model="form.effectScore"
placeholder="请输入工作纪律分数"
/>
<Field
label="服务规范"
prop="attendScore"
type="num"
v-model="form.attendScore"
placeholder="请输入服务规范分数"
/>
</el-row>
<el-row>
<Field
label="综合管理"
prop="complainScore"
type="num"
v-model="form.complainScore"
placeholder="请输入综合管理分数"
/>
<Field
label="群众评议"
prop="reviewScore"
type="num"
v-model="form.reviewScore"
placeholder="请输入群众评议分数"
/>
</el-row>
<el-row>
<Field
label="工作效能"
prop="goworkScore"
type="num"
v-model="form.goworkScore"
placeholder="请输入工作效能分数"
/>
<Field
label="其他绩效"
prop="otherScore"
type="num"
v-model="form.otherScore"
placeholder="请输入其他绩效分数"
/>
</el-row>
<div class="bl_line">
<span>{{ form.month }} 月得分</span>
<span>{{
(
form.otherScore +
form.goworkScore +
form.reviewScore +
form.complainScore +
form.attendScore +
form.effectScore
).toFixed(2)
}}</span>
</div>
<el-row>
<Field
label="备注1"
prop="remark"
v-model="form.remark"
type="textarea"
placeholder="请输入备注1"
/>
</el-row>
<el-row style="padding-left: 70px">
<el-col :span="3" style="width: 5.9%; font-size: 14px; color: #606266">
<div>备注2</div></el-col
>
<el-col :span="20">
<template v-if="typeof form.remarkAdd != 'string'">
<div class="attend_box" v-for="(val, i) in form.remarkAdd" :key="i">
<div class="text_box" style="width: 50%">
<el-autocomplete
class="inline-input"
v-model="val.name"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
style="width: 100%"
clearable
@clear="handleClear(val)"
@blur="handleBlur"
></el-autocomplete>
</div>
<div class="score_box">
<el-input-number
v-model="val.score"
@blur="handleBlur"
@change="handleBlur"
controls-position="right"
></el-input-number>
</div>
<div class="icon_box">
<i
class="el-icon-circle-plus-outline"
style="
width: 100%;
height: 100%;
font-size: 30px;
color: #409eff;
margin-right: 10px;
"
@click="handlePlus"
v-if="i + 1 == form.remarkAdd.length"
></i>
<i
class="el-icon-remove-outline"
@click="handleRemove(i)"
style="
width: 100%;
height: 100%;
font-size: 30px;
color: #f56c6c;
"
></i>
</div>
</div>
</template>
</el-col>
</el-row>
<div class="bl_line">
<span>加分</span>
<span>{{ form.addTotalScore }}</span>
</div>
<el-row>
<Field label="服务明星推荐" prop="recommend">
<el-select
v-model="form.recommend"
:clearable="true"
:placeholder="'请选择'"
>
<el-option label="服务明星" value="服务明星"></el-option>
</el-select>
</Field>
</el-row>
<el-row>
<Field label="政务服务管理科审核等次" prop="auditLevel" class="level">
<el-select
v-model="form.auditLevel"
:clearable="true"
:placeholder="'请选择'"
>
<el-option
:label="label.label"
:value="label.value"
v-for="(label, value) in options"
:key="value"
></el-option>
</el-select>
</Field>
</el-row>
<el-row
style="
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1px solid #eee;
padding: 10px 0 0 0;
"
>
<div style="width: 80%">
本月得分
<span style="font-size: 16px; color: #ff4242">
{{
(
Number(form.addTotalScore) +
Number(form.otherScore) +
Number(form.goworkScore) +
Number(form.reviewScore) +
Number(form.complainScore) +
Number(form.attendScore) +
Number(form.effectScore)
).toFixed(2)
}}
</span>
</div>
<form-buttons @submit="submitForm" noCancelBtn />
</el-row>
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "StaffPerformSummaryEditDetail",
mixins: [form],
components: {},
created() {
this.getArr();
},
data() {
return {
total: 0,
// 遮罩层
loading: true,
// 弹出层标题
title: "新增人员",
// 是否显示弹出层
open: false,
direction: "rtl",
toString: ["year", "month"],
// 表单校验
rules: {
month: [{ required: true, message: "请选择月份", trigger: "blur" }],
year: [{ required: true, message: "请选择年份", trigger: "blur" }],
staffName: [
{ required: true, message: "请输入员工姓名", trigger: "blur" },
],
},
form: {},
salaArr: [],
deptArr: [],
rulesList: [],
options: [
{
label: "",
value: "",
},
{
label: "较好",
value: "较好",
},
{
label: "一般",
value: "一般",
},
{
label: "不合格",
value: "不合格",
},
{
label: "不确定",
value: "不确定",
},
],
};
},
methods: {
handleBlur() {
this.form.addTotalScore = 0;
this.form.remarkAdd && this.form.remarkAdd.length > 0
? this.form.remarkAdd.forEach((v) => {
if (v.name && v.name != "") {
v.score ? v.score : (v.score = 0);
this.form.addTotalScore += v.score;
}
})
: "";
this.form.addTotalScore = this.form.addTotalScore.toFixed(2);
this.$forceUpdate();
},
handlePlus() {
this.form.remarkAdd.push({
name: "",
score: 0,
});
},
handleRemove(i) {
if (i == 0 && this.form.remarkAdd.length == 1) {
this.form.remarkAdd = [
{
name: "",
score: 0,
},
];
} else {
this.form.remarkAdd = this.form.remarkAdd.filter(
(v, index) => index != i
);
}
this.handleBlur();
},
handleClear(val) {
val.name = "";
val.score = 0;
},
handleSelect(item) {
this.form.remarkAdd.forEach((val) => {
this.rulesList.forEach((v) => {
if (val.name == v.value) {
v.subAddType == 2
? (val.score = Number("-" + v.score))
: (val.score = Number("+" + v.score));
}
});
});
this.handleBlur();
},
querySearch(queryString, cb) {
let rulesList = this.rulesList;
let results = queryString
? rulesList.filter(this.createFilter(queryString))
: rulesList;
// 调用 callback 返回建议列表的数据
cb(results);
},
createFilter(queryString) {
return (rule) => {
return (
rule.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
);
};
},
deptChange() {
this.page = 1;
let arr = this.deptArr.filter((v) => v.id == this.form.deptId);
if (arr && arr.length > 0) {
this.form.deptName = arr[0].deptName;
}
},
salaChange() {
this.$get("/dept/getDeptBySalaId", { salaId: this.form.salaId })
.then((res) => {
if (res.code == 1) {
this.deptArr = res.data.data;
this.page = 1;
let arr = this.salaArr.filter((v) => v.id == this.form.salaId);
if (arr && arr.length > 0) {
this.form.salaName = arr[0].deptName;
}
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
getArr() {
this.$get("/dept/getSalaList")
.then((res) => {
if (res.code == 1) {
this.salaArr = res.data.data;
}
})
.catch((error) => {
this.$message.error(error.message);
});
this.$get("/dept/getDeptBySalaId")
.then((res) => {
if (res.code == 1) {
this.deptArr = res.data.data;
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
/** 编辑 */
edit(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "/staff/perform/summary/edit/edit";
this.getData();
this.pageInfo.type = "edit";
this.title = "修改员工分数统计";
},
/** 新增 */
async add(row) {
this.reset();
this.urls.currUrl = "/staff/perform/summary/edit/add";
this.pageInfo.type = "add";
this.title = "新增员工分数统计";
await this.$post("/perform/rules/list", { size: -1 }).then(
async (res) => {
if (res.code == 1) {
this.rulesList = res.data.data;
this.rulesList && this.rulesList.length > 0
? this.rulesList.forEach((v) => {
v.value = v.name + "--" + v.content;
})
: "";
if (
this.form.remarkAdd === "[]" ||
this.form.remarkAdd == undefined ||
this.form.remarkAdd == null ||
this.form.remarkAdd.length == 0 ||
this.form.remarkAdd == ""
) {
this.form.remarkAdd = [
{
name: "",
score: 0,
},
];
this.handleBlur();
this.$forceUpdate();
} else {
this.handleBlur();
this.$forceUpdate();
}
this.open = true;
}
}
);
},
/** 查看*/
view(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "/staff/perform/summary/edit/view";
this.getData();
this.pageInfo.type = "view";
this.title = "员工分数统计详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
this.reset();
},
// 表单重置
reset() {
this.form = {
staffName: "",
year: "",
month: "",
salaId: "",
selectDeptId: 0,
effectScore: 0,
attendScore: 0,
complainScore: 0,
reviewScore: 0,
goworkScore: 0,
otherScore: 0,
remark: null,
remarkAddDesc: null,
auditLevel: null,
recommend: null,
remark: "",
remarkAdd: [],
addTotalScore: 0,
workNum: "",
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<style lang="less" scoped>
.due_month .el-date-picker__header {
display: none;
}
.bl_line {
margin: 0 auto;
background: inherit;
background-color: rgba(0, 102, 255, 0.0470588235294118);
box-sizing: border-box;
border-width: 3px;
border-style: solid;
border-color: rgba(36, 104, 242, 1);
border-top: 0px;
border-right: 0px;
border-bottom: 0px;
border-radius: 4px;
height: 52px;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 10px;
margin: 5px 0 20px 20px;
}
.attend_box {
display: flex;
align-items: center;
margin-bottom: 20px;
.score_box {
margin: 0 15px;
}
.icon_box {
display: flex;
}
/deep/.el-input__inner {
width: 100%;
}
}
/deep/.el-autocomplete {
width: 100% !important;
}
</style>
\ No newline at end of file
<template>
<div class="page">
<LayoutTable :data="tableData" notDel :config="tableConfig">
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="doExport"
:disabled="isExport"
>导出</el-button
>
<el-button
type="primary"
size="mini"
slot="table-head-left2"
v-if="showBtn"
style="margin-left: 10px"
@click="handleRefresh"
:loading="btnFreshLoading"
>手动更新</el-button
>
<span class="freshTime" slot="table-head-left2">
<i class="el-icon-refresh"></i>
<span
>上次绩效汇总时间:{{
tableData.dict.summaryTime ? tableData.dict.summaryTime : "--"
}}</span
>
</span>
</LayoutTable>
<dialog-show ref="dialogform" @ok="getData" />
<drawer-show ref="drawerform" @ok="getData" />
<div class="mask" v-if="progress">
<el-progress :stroke-width="26" :percentage="percent"></el-progress>
</div>
<el-dialog
title="系统提示"
:visible.sync="dialogOpen"
width="500px"
append-to-body
@close="cancleFresh"
:close-on-press-escape="false"
:close-on-click-modal="false"
:show-close="false"
>
<div class="fresh_box" v-if="showContent">
<div class="title_box" style="margin-bottom: 20px">
仅支持手动更新月度绩效数据,请选择需要更新的月份:
</div>
<el-date-picker
v-model="freshDate"
type="month"
format="yyyy 年 MM 月"
value-format="yyyy-MM"
placeholder="请选择月"
>
</el-date-picker>
</div>
<div class="fresh_box" v-else>
<div
class="title_box"
style="margin-bottom: 20px; line-height: 30px"
v-if="showTip"
>
请确认是否开始进行{{ freshDate }}的绩效数据重新汇总;此过程预计需要
<span style="color: #ff0000">15</span> 分钟,请勿关闭或刷新页面
</div>
<div
class="title_box"
style="margin-bottom: 20px; line-height: 30px"
v-else
>
正在进行{{ freshDate }}的绩效数据重新汇总;此过程预计还需要
<span style="color: #ff0000">{{ restTime }}</span>
分钟,请勿关闭或刷新页面
</div>
</div>
<div slot="footer" class="dialog-footer" v-if="showTip">
<el-button
type="primary"
@click="() => (showContent = false)"
v-if="showContent"
>确 定</el-button
>
<el-button
type="primary"
@click="submitFresh"
v-else
:loading="submitLoad"
>确 定</el-button
>
<el-button @click="cancleFresh">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow";
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "StaffPerformSummaryEditList",
components: {
dialogShow,
drawerShow,
},
mixins: [table],
created() {},
methods: {
countDown() {
if (this.percent == 95) {
if (this.selection.length > 0) {
this.query["idList"] = this.selection;
}
this.$download(
"/staff/perform/summary/edit/exportExcel",
{
...this.query,
page: 1,
size: -1,
},
{ type: "excel", name: "绩效汇总" }
)
.then(() => {
this.percent = 100;
this.progress = false;
this.isExport = false;
})
.catch((error) => {
this.isExport = false;
this.progress = false;
this.$message.error(error.message);
});
return;
} else {
this.percent = this.percent + 1;
let that = this;
setTimeout(function () {
that.countDown();
}, 200);
}
},
/** 导出Excel */
doExport() {
this.isExport = true;
this.progress = true;
this.percent = 0;
this.countDown();
},
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.dialogform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
},
afterRender(data) {
data.dict.sortKind = {
2: "正序",
1: "倒序",
};
this.config.columns.forEach((v) => {
v.label == "服务规范"
? (v.label = (
<p>
<span>服务规范</span>
<p>
{"(考勤绩效/" + data.dict.weightPdu.attendWeight + "分)"}
</p>
</p>
))
: v.label == "群众评议"
? (v.label = (
<p>
<span>群众评议</span>
<p>
{"(评价绩效/" + data.dict.weightPdu.reviewWeight + "分)"}
</p>
</p>
))
: v.label == "工作效能"
? (v.label = (
<p>
<span>工作效能</span>
<p>
{"(办件绩效/" + data.dict.weightPdu.goworkWeight + "分)"}
</p>
</p>
))
: v.label == "工作纪律"
? (v.label = (
<p>
<span>工作纪律</span>
<p>
{"(效能绩效/" + data.dict.weightPdu.effectWeight + "分)"}
</p>
</p>
))
: v.label == "综合管理"
? (v.label = (
<p>
<span>综合管理</span>
<p>{"(自评绩效 *" + data.dict.weightPdu.selfWeight + "%)"}</p>
</p>
))
: v.label == "其他绩效"
? (v.label = (
<p>
<span>其他绩效</span>
<p>{"(其他绩效)"}</p>
</p>
))
: "";
// if(||v.label='评价绩效分数'||v.label='办件绩效分数'||v.label='效能绩效分数'||v.label='自评绩效分数'){
// }
});
},
handleRefresh() {
this.dialogOpen = true;
this.btnFreshLoading = true;
},
submitFresh() {
if (this.freshDate) {
this.submitLoad = true;
this.$post("/staff/perform/summary/summary", {
checkTimeStart: this.freshDate + "-01",
checkTimeEnd: this.freshDate + "-31",
})
.then((res) => {
if (res.code == 1) {
// this.$message.success(res.msg);
this.showTip = false;
this.btnFreshLoading = false;
this.submitLoad = false;
this.endTime = Date.parse(new Date()) + 15 * 60 * 1000;
this.countdown();
}
})
.catch((error) => {
this.$message.error(res.msg);
this.submitLoad = false;
this.dialogOpen = false;
this.btnFreshLoading = false;
this.showContent = true;
this.showTip = true;
this.freshDate = "";
});
} else {
this.$message.error("请选择需要更新的月份!");
}
},
cancleFresh() {
this.dialogOpen = false;
this.btnFreshLoading = false;
this.showContent = true;
this.showTip = true;
this.freshDate = "";
},
//倒计时
countdown() {
let now = Date.parse(new Date());
let msec = this.endTime - now;
if (msec < 0) return;
// let day = parseInt(msec / 1000 / 60 / 60 / 24);
let hr = parseInt((msec / 1000 / 60 / 60) % 24);
let min = parseInt((msec / 1000 / 60) % 60);
let sec = parseInt((msec / 1000) % 60);
min = min > 9 ? min : "0" + min;
sec = sec > 9 ? sec : "0" + sec;
this.restTime = min + "" + sec + "";
const that = this;
if (min >= 0 && sec >= 0) {
if (min == 0 && sec == 0) {
this.submitLoad = false;
this.dialogOpen = false;
this.btnFreshLoading = false;
this.showContent = true;
this.showTip = true;
this.freshDate = "";
this.getData();
return;
}
setTimeout(function () {
that.countdown();
}, 1000);
}
},
handleCellClick(row, column, event, cell) {
if (column.label == "备注1" || column.label == "备注2") {
row.label = column.label;
this.toEdit(row);
}
},
// 表格内下拉选框得触发事件
handleChange(v, row) {
this.$post("/staff/perform/summary/edit/save", row).then((res) => {
const { code, msg } = res;
code == 1 ? this.$message.success(msg) : this.$message.error(msg);
});
},
handleBlur(row) {
row.dataType = 2;
this.$post("/staff/perform/summary/edit/save", row).then((res) => {
const { code, msg } = res;
console.log(res);
code == 1 ? this.$message.success(msg) : this.$message.error(msg);
});
},
},
data() {
return {
endTime: "",
restTime: "15",
freshDate: "",
btnFreshLoading: false,
sortList: "",
dialogOpen: false,
isExport: false,
showBtn: true,
showTip: true,
showContent: true,
submitLoad: false,
progress: false,
percent: 0,
config: {
isshowTabPane: true,
search: [
{
name: "yearmonth",
type: "month",
label: "请选择月份",
fuzzy: false,
},
{
name: "sortKind",
type: "select",
label: "总分排序方式",
fuzzy: false,
},
{
name: "salaId",
type: "selectSalaId",
label: "大厅",
fuzzy: false,
},
{
name: "deptId",
type: "selectDeptId",
label: "部门",
fuzzy: false,
},
{
name: "staffName",
type: "text",
label: "员工姓名",
fuzzy: true,
},
],
columns: [
{ type: "selection", width: 60, fixed: "left" },
{ type: "index", label: "序号", width: 50, fixed: "left" },
{
label: "姓名",
prop: "staffName",
formatter: this.formatter,
fixed: "left",
},
{
label: "工号",
prop: "workNum",
formatter: this.formatter,
width: 80,
fixed: "left",
},
{
label: "",
prop: "year",
formatter: this.formatter,
fixed: "left",
},
{
label: "",
prop: "month",
formatter: this.formatter,
fixed: "left",
},
{
label: "手机号",
prop: "phoneNumber",
formatter: this.formatter,
},
{
label: "所属大厅",
prop: "salaName",
formatter: this.formatter,
},
{
label: "所属部门",
prop: "deptName",
formatter: this.formatter,
},
{
label: "所属中心",
formatter: (row) => {
return "宜宾市民中心";
},
},
{
label: "工作纪律",
prop: "effectScore",
width: 150,
formatter: (row) => {
return (
<el-input
v-model={row.effectScore}
onBlur={() => {
this.handleBlur(row);
}}
></el-input>
);
},
},
{
label: "服务规范",
prop: "attendScore",
width: 150,
formatter: (row) => {
return (
<el-input
v-model={row.attendScore}
onBlur={() => {
this.handleBlur(row);
}}
></el-input>
);
},
},
{
label: `综合管理`,
prop: "complainScore",
width: 150,
formatter: (row) => {
return (
<el-input
v-model={row.complainScore}
onBlur={() => {
this.handleBlur(row);
}}
></el-input>
);
},
},
{
label: "群众评议",
prop: "reviewScore",
width: 150,
formatter: (row) => {
return (
<el-input
v-model={row.reviewScore}
onBlur={() => {
this.handleBlur(row);
}}
></el-input>
);
},
},
{
label: "工作效能",
prop: "goworkScore",
width: 150,
formatter: (row) => {
return (
<el-input
v-model={row.goworkScore}
onBlur={() => {
this.handleBlur(row);
}}
></el-input>
);
},
},
{
label: `其他绩效`,
prop: "otherScore",
width: 150,
formatter: (row) => {
return (
<el-input
v-model={row.otherScore}
onBlur={() => {
this.handleBlur(row);
}}
></el-input>
);
},
},
// {
// label: "累计异常分数",
// prop: "errorScore",
// },
{
label: "绩效分数",
prop: "totalScore",
sortable: true,
width: 120,
},
{
label: "备注1",
prop: "remark",
formatter: (row) => {
return row.remark && row.remark != "" ? (
row.remark
) : (
<span style="color:#409eff">添加备注1</span>
);
},
width: 240,
},
{
label: "备注2",
prop: "remarkAddDesc",
formatter: (row) => {
return row.remarkAddDesc &&
row.remarkAddDesc != "" &&
row.remarkAddDesc != "(0);" ? (
row.remarkAddDesc
) : (
<span style="color:#409eff">添加备注2</span>
);
},
width: 240,
},
{
label: "政务服务管理科审核等次",
prop: "auditLevel",
width: 120,
formatter: (row) => {
const options = [
{
label: "",
value: "",
},
{
label: "较好",
value: "较好",
},
{
label: "一般",
value: "一般",
},
{
label: "不合格",
value: "不合格",
},
{
label: "不确定",
value: "不确定",
},
];
return (
<el-select
v-model={row.auditLevel}
placeholder="请选择"
clearable
onChange={(v) => this.handleChange(v, row)}
>
{options.map((item) => (
<el-option
key={item.value}
value={item.value}
label={item.label}
/>
))}
</el-select>
);
},
},
{
label: "服务明星推荐",
prop: "recommend",
width: 120,
formatter: (row) => {
const options = [
{
label: "服务明星",
value: "服务明星",
},
];
return (
<el-select
v-model={row.recommend}
clearable
placeholder="请选择"
onChange={(v) => this.handleChange(v, row)}
>
{options.map((item) => (
<el-option
key={item.value}
value={item.value}
label={item.label}
/>
))}
</el-select>
);
},
},
{
label: "加分",
prop: "addTotalScore",
width: 120,
formatter: (row) => {
return row.addTotalScore || row.addTotalScore == 0
? row.addTotalScore > 0
? "+" + row.addTotalScore
: row.addTotalScore
: 0;
},
},
{
label: "本月得分",
prop: "sumScore",
sortable: true,
width: 120,
fixed: "right",
},
{
label: "操作",
width: 120,
fixed: "right",
formatter: (row) => {
return (
<table-buttons
noAdd
noDel
noEdit
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
);
},
},
],
},
};
},
};
</script>
<style lang="less" scoped>
.mask {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 99;
padding: 0 30%;
padding-top: 20%;
background: rgba(0, 0, 0, 0.6);
}
::v-deep .el-progress__text {
color: #409eff;
font-weight: 600;
}
::v-deep.el-dialog__wrapper {
overflow: hidden;
top: -50px;
}
.freshTime {
color: #999;
font-size: 14px;
}
/deep/.el-table .red {
background: rgba(255, 233, 233);
}
</style>
<template>
<layout-view>
<el-descriptions
:title="title"
:column="column"
:size="size"
:colon="false"
border
>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small"
>返回</el-button
>
</template>
<el-descriptions-item
label="人员id"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.staffId }}
</el-descriptions-item>
<el-descriptions-item
label="工号"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.workNum }}
</el-descriptions-item>
<el-descriptions-item
label="人员名称"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.staffName }}
</el-descriptions-item>
<el-descriptions-item
label="部门id号"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.deptId }}
</el-descriptions-item>
<el-descriptions-item
label="部门名称"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.deptName }}
</el-descriptions-item>
<el-descriptions-item
label="考勤绩效指标分数"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.attendScore }}
</el-descriptions-item>
<el-descriptions-item
label="评价绩效指标分数"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.assessScore }}
</el-descriptions-item>
<el-descriptions-item
label="办件绩效分数"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.workScore }}
</el-descriptions-item>
<el-descriptions-item
label="效能绩效分数"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.effectScore }}
</el-descriptions-item>
<el-descriptions-item
label="自评绩效分数"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.otherScore }}
</el-descriptions-item>
<el-descriptions-item
label="累计异常分数"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.errorScore }}
</el-descriptions-item>
<el-descriptions-item
label="当月得分数"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.totalScore }}
</el-descriptions-item>
<el-descriptions-item
label="备注"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.remark }}
</el-descriptions-item>
<el-descriptions-item
label="年"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.year }}
</el-descriptions-item>
<el-descriptions-item
label="月"
label-class-name="labelClass"
content-class-name="contentClass"
>
{{ form.month }}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
export default {
mixins: [view],
components: {},
methods: {},
data() {
return {
size: "small",
column: 2,
toString: ["month"],
toArrays: [],
toDate: [],
};
},
};
</script>
<style lang="less">
.labelClass {
width: 200px;
}
.el-descriptions__body {
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #fff;
}
.contentClass {
width: 600px;
}
</style>
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