Commit 07298ac7 authored by 姬鋆屾's avatar 姬鋆屾

pref:代码优化

parent acda6384
module.exports = {
printWidth: 100, // 每行最多 100 个字符
tabWidth: 2, // 每个缩进使用 2 个空格
useTabs: false, // 使用空格而不是制表符
semi: true, // 语句末尾加分号
singleQuote: true, // 使用单引号表示字符串
quoteProps: 'as-needed', // 对象属性名仅在必要时使用引号
jsxSingleQuote: false, // JSX 使用双引号
trailingComma: 'none', // 不添加尾逗号
bracketSpacing: true, // 对象花括号内有空格
jsxBracketSameLine: false, // JSX 的 `>` 换行
arrowParens: 'always', // 箭头函数参数始终带括号
rangeStart: 0, // 从文件开始格式化
rangeEnd: Infinity, // 格式化到文件结尾
requirePragma: false, // 不需要特定注释
insertPragma: false, // 不插入注释
proseWrap: 'preserve', // 保持原有换行
htmlWhitespaceSensitivity: 'css', // 按 CSS 规则处理 HTML 空白
endOfLine: 'lf' // 使用换行符 LF
};
\ No newline at end of file
......@@ -199,7 +199,7 @@
<script>
/** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow";
import DialogShow from "./dialogshow";
import table from "@/assets/mixins/table";
import {
getFirstDay,
......@@ -211,9 +211,267 @@ import {
export default {
name: "AttendanceStatList",
components: {
dialogShow,
DialogShow,
},
mixins: [table],
data() {
return {
// 是否展示提示
showTip: true,
// 提示内容切换
showContent: true,
// 倒计时结束时间
endTime: null,
// 倒计时结束限时
restTime: "10",
// 规定日期组件的选取范围
pickerOptions0: {
disabledDate(v) {
let limitDate =
v.getTime() < new Date().getTime() - 31 * 86400000 ||
v.getTime() > Date.now();
return limitDate;
7;
},
},
// 更新日期
freshDate: null,
// 提交按钮加载状态
submitLoad: false,
// 手动更新按钮加载状态
btnFreshLoading: false,
// 弹窗是否显示
dialogOpen: false,
showBtn: true,
// 导出按钮加载状态
isExport: false,
// 表格配置项
config: {
showType: "tableSelect",
isshowTabPane: true,
height: "680px",
search: [
{
name: "salaId",
type: "selectSalaId",
label: "大厅",
fuzzy: false,
},
{
name: "deptId",
type: "selectDeptId",
label: "部门",
fuzzy: false,
},
// {
// name: "groupId",
// type: "select",
// label: "全部考勤组",
// fuzzy: false,
// },
// {
// name: "classId",
// type: "select",
// label: "全部班次",
// fuzzy: false,
// },
{
name: "summaryTimeStart",
type: "date",
label: "考勤开始时间",
fuzzy: false,
},
{
name: "summaryTimeEnd",
type: "date",
label: "考勤结束时间",
fuzzy: false,
},
{
name: "staffName",
type: "text",
label: "员工姓名",
fuzzy: true,
},
],
columns: [
{ type: "selection", width: 60, fixed: "left", show: true },
{
type: "index",
label: "序号",
width: 50,
fixed: "left",
show: true,
},
{
label: "窗口类别",
prop: "windowCategory",
fixed: "left",
width: 100,
formatter: this.formatter,
show: true,
},
{
label: "员工姓名",
prop: "staffName",
fixed: "left",
width: 100,
show: true,
},
{
label: "大厅",
prop: "salaName",
formatter: this.formatter,
show: true,
},
{
label: "部门",
prop: "deptName",
formatter: this.formatter,
show: true,
},
{
label: "应到",
prop: "workDays",
formatter: this.formatter,
show: true,
},
{
label: "实到",
prop: "goWorks",
formatter: (row) => {
return row.goWorks == 0 ? 0 : row.goWorks ? row.goWorks : "--";
},
show: true,
},
{
label: "出勤率%",
prop: "attendanceRate",
formatter: (row) => {
return row.attendanceRate
? (Number(row.attendanceRate) * 100).toFixed(2) + "%"
: "--";
},
show: true,
},
{
label: "缺卡次数",
prop: "morningTimes",
formatter: this.formatter,
show: true,
},
// {
// label: "上午缺卡次数",
// prop: "morningTimes",
// formatter: this.formatter,
// },
// {
// label: "下午缺卡次数",
// prop: "afternoonTimes",
// formatter: this.formatter,
// },
{ label: "回单位(天)", prop: "backToUnit", show: true },
{ label: "因公请假(天)", prop: "onDutyLeave", show: true },
{ label: "外出勘验(天)", prop: "outOfOffice", show: true },
{ label: "值班补班(天)", prop: "shiftCompensation", show: true },
{ label: "体检(天)", prop: "physicalExamination", show: true },
{ label: "隔离(天)", prop: "quarantine", show: true },
{
label: "因公外出(与窗口工作无关/天)",
prop: "businessTrip",
show: true,
width: 140,
},
{ label: "公休(天)", prop: "publicHoliday", show: true },
{ label: "病假(天)", prop: "sickLeave", show: true },
{ label: "丧假(天)", prop: "funeralLeave", show: true },
{ label: "婚假(天)", prop: "marriageLeave", show: true },
{ label: "育儿假(天)", prop: "childRearingLeave", show: true },
{
label: "产假(陪护假/天)",
prop: "maternityLeave",
show: true,
width: 140,
},
{
label: "调回单位(或离职/天)",
prop: "transferBack",
show: true,
width: 140,
},
{ label: "探亲假(天)", prop: "homeLeave", show: true },
{ label: "事假(天)", prop: "personalLeave", show: true },
{ label: "旷工(天)", prop: "absenteeismDays", show: true },
{ label: "其他(天)", prop: "otherDays", show: true },
{
label: "未按规定打卡(含忘记打卡)",
prop: "nonCompliancePunch",
show: true,
width: 140,
},
{ label: "迟到(次)", prop: "lateTimes", show: true },
// { label: "上网耍手机(次)", prop: "surfingMobileTimes", show: true },
//{ label: "溜班(次)", prop: "overtimeTimes", show: true },
//{ label: "空岗(次)", prop: "vacancy", show: true },
//{
// label: "未规范着装(次)",
// prop: "nonStandardDressTimes",
// show: true,
//},
//{
// label: "无故缺席会议(次)",
// prop: "unexcusedMeetingAbsence",
// show: true,
// width: 140,
//},
//{ label: "会议早退", prop: "earlyLeaveMeeting", show: true },
],
},
// 设置表格展示项
setcolum: [],
isdialog: false,
// 设置表格项的弹窗
setDialog: false,
// 展示表格项列表
checkTableList: [],
// 选中展示表格项列表
checkList: [],
// 历史记录列表
drawerhistory: false,
// 动态新增列表
addColumn: [],
// 获取表格表头列表
initalArr: [],
};
},
created() {
this.query.summaryTimeStart = getFirstDay();
this.query.summaryTimeEnd = getLastDay();
......@@ -251,8 +509,8 @@ export default {
}, 1000);
}
},
// 确认手动更新
submitFresh() {
console.log(this.freshDate);
if (this.freshDate) {
this.submitLoad = true;
this.$post("/attendance/stat/summary", {
......@@ -281,6 +539,7 @@ export default {
this.$message.error("请选择时间!");
}
},
// 取消操作
cancleFresh() {
this.dialogOpen = false;
this.btnFreshLoading = false;
......@@ -321,7 +580,7 @@ export default {
this.setDialog = false;
}
},
// 处理
// 处理数组缺卡,早退,迟到等状态显示及对应的详细数据展示
handleArr(arr, currentTime) {
// 处理createTime相同的数据
for (let i = 0; i < arr.length; i++) {
......@@ -381,9 +640,11 @@ export default {
return "--";
}
},
// 重置表格
restTable() {
this.getTable();
},
// 重写获取数据后渲染
afterRender(data) {
this.addColumn = getdiffdate(
this.query.summaryTimeStart,
......@@ -420,6 +681,7 @@ export default {
this.$refs.layoutTable.showType = "tableSelect";
this.$forceUpdate();
},
// 重写获取数据前渲染
beforeRender(row) {
this.tableData.dict = row.dict;
row.data.forEach((element) => {
......@@ -503,6 +765,7 @@ export default {
toView(row) {
this.$refs.dialogform.view(row);
},
//设置表格显示
setdialog(i) {
if (i == 1) {
this.isdialog = true;
......@@ -527,6 +790,7 @@ export default {
});
}
},
//显示导出历史记录
lookexportHis() {
this.drawerhistory = true;
},
......@@ -563,250 +827,11 @@ export default {
});
},
},
data() {
return {
showTip: true,
showContent: true,
endTime: "",
restTime: "10",
pickerOptions0: {
disabledDate(v) {
let limitDate =
v.getTime() < new Date().getTime() - 31 * 86400000 ||
v.getTime() > Date.now();
return limitDate;
7;
},
},
freshDate: "",
submitLoad: false,
btnFreshLoading: false,
dialogOpen: false,
showBtn: true,
isExport: false,
config: {
showType: "tableSelect",
isshowTabPane: true,
height: "680px",
search: [
{
name: "salaId",
type: "selectSalaId",
label: "大厅",
fuzzy: false,
},
{
name: "deptId",
type: "selectDeptId",
label: "部门",
fuzzy: false,
},
// {
// name: "groupId",
// type: "select",
// label: "全部考勤组",
// fuzzy: false,
// },
// {
// name: "classId",
// type: "select",
// label: "全部班次",
// fuzzy: false,
// },
{
name: "summaryTimeStart",
type: "date",
label: "考勤开始时间",
fuzzy: false,
},
{
name: "summaryTimeEnd",
type: "date",
label: "考勤结束时间",
fuzzy: false,
},
{
name: "staffName",
type: "text",
label: "员工姓名",
fuzzy: true,
},
],
columns: [
{ type: "selection", width: 60, fixed: "left", show: true },
{
type: "index",
label: "序号",
width: 50,
fixed: "left",
show: true,
},
{
label: "窗口类别",
prop: "windowCategory",
fixed: "left",
width: 100,
formatter: this.formatter,
show: true,
},
{
label: "员工姓名",
prop: "staffName",
fixed: "left",
width: 100,
show: true,
},
{
label: "大厅",
prop: "salaName",
formatter: this.formatter,
show: true,
},
{
label: "部门",
prop: "deptName",
formatter: this.formatter,
show: true,
},
{
label: "应到",
prop: "workDays",
formatter: this.formatter,
show: true,
},
{
label: "实到",
prop: "goWorks",
formatter: (row) => {
return row.goWorks == 0 ? 0 : row.goWorks ? row.goWorks : "--";
},
show: true,
},
{
label: "出勤率%",
prop: "attendanceRate",
formatter: (row) => {
return row.attendanceRate
? (Number(row.attendanceRate) * 100).toFixed(2) + "%"
: "--";
},
show: true,
},
{
label: "缺卡次数",
prop: "morningTimes",
formatter: this.formatter,
show: true,
},
// {
// label: "上午缺卡次数",
// prop: "morningTimes",
// formatter: this.formatter,
// },
// {
// label: "下午缺卡次数",
// prop: "afternoonTimes",
// formatter: this.formatter,
// },
{ label: "回单位(天)", prop: "backToUnit", show: true },
{ label: "因公请假(天)", prop: "onDutyLeave", show: true },
{ label: "外出勘验(天)", prop: "outOfOffice", show: true },
{ label: "值班补班(天)", prop: "shiftCompensation", show: true },
{ label: "体检(天)", prop: "physicalExamination", show: true },
{ label: "隔离(天)", prop: "quarantine", show: true },
{
label: "因公外出(与窗口工作无关/天)",
prop: "businessTrip",
show: true,
width: 140,
},
{ label: "公休(天)", prop: "publicHoliday", show: true },
{ label: "病假(天)", prop: "sickLeave", show: true },
{ label: "丧假(天)", prop: "funeralLeave", show: true },
{ label: "婚假(天)", prop: "marriageLeave", show: true },
{ label: "育儿假(天)", prop: "childRearingLeave", show: true },
{
label: "产假(陪护假/天)",
prop: "maternityLeave",
show: true,
width: 140,
},
{
label: "调回单位(或离职/天)",
prop: "transferBack",
show: true,
width: 140,
},
{ label: "探亲假(天)", prop: "homeLeave", show: true },
{ label: "事假(天)", prop: "personalLeave", show: true },
{ label: "旷工(天)", prop: "absenteeismDays", show: true },
{ label: "其他(天)", prop: "otherDays", show: true },
{
label: "未按规定打卡(含忘记打卡)",
prop: "nonCompliancePunch",
show: true,
width: 140,
},
{ label: "迟到(次)", prop: "lateTimes", show: true },
// { label: "上网耍手机(次)", prop: "surfingMobileTimes", show: true },
//{ label: "溜班(次)", prop: "overtimeTimes", show: true },
//{ label: "空岗(次)", prop: "vacancy", show: true },
//{
// label: "未规范着装(次)",
// prop: "nonStandardDressTimes",
// show: true,
//},
//{
// label: "无故缺席会议(次)",
// prop: "unexcusedMeetingAbsence",
// show: true,
// width: 140,
//},
//{ label: "会议早退", prop: "earlyLeaveMeeting", show: true },
],
},
setcolum: [],
isdialog: false,
setDialog: false,
checkTableList: [],
checkList: [],
drawerhistory: false,
// 动态新增列表
addColumn: [],
initalArr: [],
};
},
};
</script>
<style scoped lang="less">
.hisList {
padding: 15px;
.list {
......
<template>
<!-- 弹出框表单 -->
<!-- S 弹出框表单 -->
<el-dialog
:title="title"
:visible.sync="open"
......@@ -26,9 +26,7 @@
{{ form.totalScore }}
</div>
<div class="m">{{ form.month }}月绩效得分</div>
<div class="m" style="color: #aaa">
绩效分数更新时间:{{ momentVal(form.updateTime) }}
</div>
<div class="m" style="color: #aaa">绩效分数更新时间:{{ momentVal(form.updateTime) }}</div>
</div>
</div>
<div class="dialog_box" v-if="pageInfo.type == 'view'">
......@@ -40,41 +38,39 @@
>
<div class="user-left">
<div class="user-name">
{{ dictVal("checkType", item.checkType) }}
{{ 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"
>{{
<span class="user-i">
{{
item.subAddType == 1
? "加分方式:"
? '加分方式:'
: item.subAddType == 2
? "扣分方式:"
: "方式:"
}}{{ util_formatter("subMethod", item.subMethod) }}</span
>
? '扣分方式:'
: '方式:'
}}{{ 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
>
<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
>
<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 }}
{{ item.subAddType == 1 ? '+' : '-' }}{{ item.auditStatus == 2 ? 0 : item.score }}
</div>
</div>
</div>
......@@ -91,8 +87,8 @@
:autosize="{ minRows: 2, maxRows: 8 }"
placeholder="请输入备注内容"
style="
font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica,
STHeiTi, Arial, sans-serif;
font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, STHeiTi, Arial,
sans-serif;
"
></el-input>
</span>
......@@ -103,11 +99,7 @@
<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="attend_box" v-for="(val, i) in form.remarkAdd" :key="i">
<div class="text_box" style="width: 50%">
<el-autocomplete
class="inline-input"
......@@ -145,12 +137,7 @@
<i
class="el-icon-remove-outline"
@click="handleRemove(i)"
style="
width: 100%;
height: 100%;
font-size: 30px;
color: #f56c6c;
"
style="width: 100%; height: 100%; font-size: 30px; color: #f56c6c"
></i>
</div>
</div>
......@@ -159,11 +146,7 @@
</el-row>
</el-form>
</div>
<div
slot="footer"
class="dialog-footer"
style="display: flex; align-items: center"
>
<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
......@@ -174,113 +157,113 @@
</span>
</el-col>
</el-col>
<el-button
type="primary"
v-if="pageInfo.type !== 'view'"
@click="submitForm"
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm"
>确 定</el-button
>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- E 弹出框表单 -->
</template>
<script>
import form from "@/assets/mixins/formdialog";
import dialogShow from "./dialogshow";
import moment from "moment";
import form from '@/assets/mixins/formdialog';
import dialogShow from './dialogshow';
import moment from 'moment';
export default {
mixins: [form],
components: {
dialogShow,
dialogShow
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "员工绩效统计",
title: '员工绩效统计',
// 是否显示弹出层
open: false,
toString: ["month"],
toString: ['month'],
// 表单校验
rules: {},
// 绩效分数展示列表
list: [],
// 字典集合
dict: {},
rulesList: [],
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 != "") {
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();
},
// 增加备注2的备注
handlePlus() {
this.form.remarkAdd.push({
name: "",
score: 0,
name: '',
score: 0
});
},
// 删除备注2的备注
handleRemove(i) {
if (i == 0 && this.form.remarkAdd.length == 1) {
this.form.remarkAdd = [
{
name: "",
score: 0,
},
name: '',
score: 0
}
];
} else {
this.form.remarkAdd = this.form.remarkAdd.filter(
(v, index) => index != i
);
this.form.remarkAdd = this.form.remarkAdd.filter((v, index) => index != i);
}
this.handleBlur();
},
// 清楚备注2当前的内容
handleClear(val) {
val.name = "";
val.name = '';
val.score = 0;
},
// 获取备注2 的加扣分选项
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));
? (val.score = Number('-' + v.score))
: (val.score = Number('+' + v.score));
}
});
});
this.handleBlur();
},
// 备注2 备注项的文字匹配
querySearch(queryString, cb) {
let rulesList = this.rulesList;
let results = queryString
? rulesList.filter(this.createFilter(queryString))
: rulesList;
let results = queryString ? rulesList.filter(this.createFilter(queryString)) : rulesList;
// 调用 callback 返回建议列表的数据
cb(results);
},
// 备注2 备注项的文字匹配
createFilter(queryString) {
return (rule) => {
return (
rule.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
);
return rule.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
};
},
// 日期
momentVal(v) {
return moment(v).format("YYYY-MM-DD HH:SS");
return moment(v).format('YYYY-MM-DD HH:SS');
},
// 字典转换
dictVal(key, val) {
......@@ -288,15 +271,11 @@ export default {
},
/** 查看汇总 */
checkAll(id) {
this.$post("/check/all/record/list", {
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"
: "",
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) {
......@@ -311,27 +290,27 @@ export default {
async edit(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "staff/perform/summary/edit";
this.urls.currUrl = 'staff/perform/summary/edit';
await this.getData();
this.pageInfo.type = "edit";
this.title = "员工绩效统计";
this.pageInfo.type = 'edit';
this.title = '员工绩效统计';
row.label && row.label != "" ? (this.form.label = row.label) : "";
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((res) => {
if (row.label == '备注2') {
await this.$post('/perform/rules/list', { size: -1 }).then((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;
v.value = v.name + '--' + v.content;
})
: "";
: '';
if (!this.form.remarkAdd || this.form.remarkAdd.length == 0) {
this.form.remarkAdd = [];
this.form.remarkAdd.push({
name: "",
score: 0,
name: '',
score: 0
});
}
this.handleBlur();
......@@ -344,21 +323,21 @@ export default {
/** 新增 */
add(row) {
this.reset();
this.urls.currUrl = "staff/perform/summary/add";
this.urls.currUrl = 'staff/perform/summary/add';
this.getData();
this.pageInfo.type = "add";
this.title = "新增员工绩效统计";
this.pageInfo.type = 'add';
this.title = '新增员工绩效统计';
},
/** 查看*/
view(row) {
this.reset();
this.query = {
id: row.id,
id: row.id
};
this.urls.currUrl = "staff/perform/summary/view";
this.urls.currUrl = 'staff/perform/summary/view';
this.getData();
this.pageInfo.type = "view";
this.title = "员工绩效统计详细";
this.pageInfo.type = 'view';
this.title = '员工绩效统计详细';
this.checkAll(row.staffId);
},
/**取消按钮 */
......@@ -372,38 +351,38 @@ export default {
afterSubmit(data) {
this.open = false;
this.$emit("ok");
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");
// 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>
......@@ -494,12 +473,10 @@ export default {
}
/deep/.el-textarea input::-moz-input-placeholder {
font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, STHeiTi, Arial,
sans-serif !important;
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;
font-family: 'Microsoft Yahei', 'Helvetica Neue', Helvetica, STHeiTi, Arial, sans-serif !important;
}
}
</style>
<template>
<div class="page">
<!-- S 页面表格 -->
<LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
<el-button
slot="table-head-left2"
......@@ -29,11 +30,19 @@
>
</span>
</LayoutTable>
<!-- E 页面表格 -->
<!-- S 页面查看信息详情弹出框组件 -->
<dialog-show ref="dialogform" @ok="getData" />
<!-- E 页面查看信息详情弹出框组件 -->
<!-- S 页面进度加载框组件 -->
<div class="mask" v-if="progress">
<el-progress :stroke-width="26" :percentage="percent"></el-progress>
</div>
<!--E 页面进度加载框组件 -->
<!-- S 页面弹出框组件 -->
<el-dialog
title="系统提示"
:visible.sync="dialogOpen"
......@@ -93,233 +102,37 @@
<el-button @click="cancleFresh">取 消</el-button>
</div>
</el-dialog>
<!-- E 页面弹出框组件 -->
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow";
import DialogShow from "./dialogshow";
// 表格引入
import table from "@/assets/mixins/table";
export default {
name: "StaffPerformSummaryList",
components: {
dialogShow,
DialogShow,
},
mixins: [table],
created() {
console.log();
},
methods: {
countDown() {
if (this.percent == 95) {
if (this.selection.length > 0) {
this.query["idList"] = this.selection;
}
this.$download(
"/staff/perform/summary/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.dialogform.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);
}
},
},
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,
endTime: null, //结束时间
restTime: "15", //更新过程预计时间初始值
freshDate: null, //日期组件绑定值
btnFreshLoading: false, //手动更新按钮加载状态
dialogOpen: false, //弹窗显示状态
isExport: false, //导出按钮禁用状态
showBtn: true, //是否展示手动更新按钮
showTip: true, //是否显示弹窗内得提示信息
showContent: true, //弹出框展示内容
submitLoad: false, //弹出框提交按钮加载状态
progress: false, //导出进度条显示
percent: 0, //导出进度百分比
//引入表格配置项
config: {
isshowTabPane: true,
search: [
......@@ -687,9 +500,211 @@ export default {
},
};
},
methods: {
// 进度条方法
countDown() {
if (this.percent == 95) {
if (this.selection.length > 0) {
this.query["idList"] = this.selection;
}
this.$download(
"/staff/perform/summary/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.dialogform.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);
}
},
},
};
</script>
<style lang="less" scoped>
@charset "UTF-8";
.mask {
width: 100%;
height: 100vh;
......
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