Commit 8cd12952 authored by 姬鋆屾's avatar 姬鋆屾

pref:代码优化

parent 07298ac7
<template> <template>
<div class="page"> <div class="page">
<!-- S 班次表格主体 -->
<LayoutTable :data="tableData" :config="tableConfig"></LayoutTable> <LayoutTable :data="tableData" :config="tableConfig"></LayoutTable>
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
<!-- E 班次表格主体 -->
</div> </div>
</template> </template>
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow"; import dialogShow from './dialogshow';
import table from "@/assets/mixins/table"; import table from '@/assets/mixins/table';
export default { export default {
name: "AttendanceClassList", name: 'AttendanceClassList',
components: { components: {
dialogShow, dialogShow
}, },
mixins: [table], mixins: [table],
created() {},
methods: {
renderTable(tableData) {
return (
<el-table stripe data={tableData} class="total-table">
{this.columnSet.map((item) => this.renderTableColumn(item))}
</el-table>
);
},
renderTableColumn(options) {
return (
<el-table-column
prop={options.prop}
label={options.label}
width={options.width}
align="center"
></el-table-column>
);
},
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.dialogform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
},
},
data() { data() {
return { return {
/** 子表列元素 */ /** 子表列元素 */
columnSet: [ columnSet: [
{ {
prop: "goWorkDate", prop: 'goWorkDate',
label: "上班打卡时间", label: '上班打卡时间',
width: 150, width: 150,
align: "center", align: 'center'
}, },
{ {
prop: "goWorkDateBefore", prop: 'goWorkDateBefore',
label: "上班前打卡(分钟)", label: '上班前打卡(分钟)',
width: 150, width: 150,
align: "center", align: 'center'
}, },
{ {
prop: "goWorkDateAfter", prop: 'goWorkDateAfter',
label: "上班后打卡(分钟)", label: '上班后打卡(分钟)',
width: 150, width: 150,
align: "center", align: 'center'
}, },
{ {
prop: "offWorkDate", prop: 'offWorkDate',
label: "下班打卡时间", label: '下班打卡时间',
width: 150, width: 150,
align: "center", align: 'center'
}, },
{ {
prop: "offWorkDateBefore", prop: 'offWorkDateBefore',
label: "下班前打卡(分钟)", label: '下班前打卡(分钟)',
width: 150, width: 150,
align: "center", align: 'center'
}, },
{ {
prop: "offWorkDateAfter", prop: 'offWorkDateAfter',
label: "下班后打卡(分钟)", label: '下班后打卡(分钟)',
width: 150, width: 150,
align: "center", align: 'center'
}, }
// {prop:"remark",label:"备注",width:150}, // {prop:"remark",label:"备注",width:150},
// {prop:"classId",label:"班次ID",width:150}, // {prop:"classId",label:"班次ID",width:150},
], ],
config: { config: {
search: [ search: [
{ {
name: "className", name: 'className',
type: "text", type: 'text',
label: "班次名称", label: '班次名称',
fuzzy: true, fuzzy: true
}, }
], ],
isshowTabPane: true, isshowTabPane: true,
columns: [ columns: [
{ type: "selection", width: 60 }, { type: 'selection', width: 60 },
{ type: "index", label: "序号", width: 50 }, { type: 'index', label: '序号', width: 50 },
{ label: "班次名称", prop: "className" }, { label: '班次名称', prop: 'className' },
// {label: "考勤时间", prop: "className"}, // {label: "考勤时间", prop: "className"},
{ {
label: "考勤班次详细信息", label: '考勤班次详细信息',
width: 200, width: 200,
prop: "subColumns", prop: 'subColumns',
formatter: (row) => { formatter: (row) => {
let widthsize = this.columnSet.reduce((pre, cur) => { let widthsize = this.columnSet.reduce((pre, cur) => {
return pre + Number(cur.width); return pre + Number(cur.width);
...@@ -121,10 +91,10 @@ export default { ...@@ -121,10 +91,10 @@ export default {
</el-button> </el-button>
</el-popover> </el-popover>
); );
}, }
}, },
{ {
label: "操作", label: '操作',
width: 240, width: 240,
formatter: (row) => { formatter: (row) => {
return ( return (
...@@ -137,11 +107,45 @@ export default { ...@@ -137,11 +107,45 @@ export default {
onDel={this.toDel} onDel={this.toDel}
/> />
); );
}, }
}, }
], ]
}, }
}; };
}, },
created() {},
methods: {
// 表格渲染数据
renderTable(tableData) {
return (
<el-table stripe data={tableData} class="total-table">
{this.columnSet.map((item) => this.renderTableColumn(item))}
</el-table>
);
},
// 表格渲染表头
renderTableColumn(options) {
return (
<el-table-column
prop={options.prop}
label={options.label}
width={options.width}
align="center"
></el-table-column>
);
},
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.dialogform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
}
}
}; };
</script> </script>
<template> <template>
<div class="page"> <div class="page">
<LayoutTable <!-- S 考勤组表格主体 -->
:data="tableData" <LayoutTable :data="tableData" notDel :config="tableConfig" v-if="isshow"></LayoutTable>
notDel
:config="tableConfig"
v-if="isshow"
></LayoutTable>
<group-template ref="groupTemplate" @ok="okFn" /> <group-template ref="groupTemplate" @ok="okFn" />
<!-- E 考勤组表格主体 -->
</div> </div>
</template> </template>
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import groupTemplate from "./groupTemplate"; import groupTemplate from './groupTemplate';
import table from "@/assets/mixins/table"; import table from '@/assets/mixins/table';
export default { export default {
name: "AttendanceGroupList", name: 'AttendanceGroupList',
components: { components: {
groupTemplate, groupTemplate
}, },
mixins: [table], mixins: [table],
created() {},
methods: {
renderTable(tableData) {
return (
<el-table stripe data={tableData} class="total-table">
{this.columnSet.map((item) => this.renderTableColumn(item))}
</el-table>
);
},
renderTableColumn(options) {
return (
<el-table-column
prop={options.prop}
label={options.label}
width={options.width}
></el-table-column>
);
},
/** 重写新增方法 */
toAdd(row) {
this.isshow = false;
this.$refs.groupTemplate.add(row);
// this.$router.push(
// {
// path:'/attendance/group/view'
// }
// )
},
/** 重写编辑方法 */
toEdit(row) {
this.isshow = false;
this.$refs.groupTemplate.edit(row);
// this.$router.push(
// {
// path:'/attendance/group/view'
// }
// )
},
/** 重写查看方法 */
toView(row) {
this.isshow = false;
this.$refs.groupTemplate.view(row);
},
okFn(val) {
this.getData();
this.isshow = val;
},
},
data() { data() {
return { return {
isshow: true, isshow: true,
/** 子表列元素 */ /** 子表列元素 */
columnSet: [ columnSet: [
{ prop: "groupId", label: "考勤组", width: 100 }, { prop: 'groupId', label: '考勤组', width: 100 },
{ prop: "groupName", label: "考勤组名称", width: 100 }, { prop: 'groupName', label: '考勤组名称', width: 100 },
{ prop: "staffId", label: "员工ID", width: 100 }, { prop: 'staffId', label: '员工ID', width: 100 },
{ prop: "staffName", label: "员工姓名", width: 100 }, { prop: 'staffName', label: '员工姓名', width: 100 },
{ prop: "partAttendance", label: "是否参与考勤,", width: 100 }, { prop: 'partAttendance', label: '是否参与考勤,', width: 100 },
{ prop: "remark", label: "备注", width: 100 }, { prop: 'remark', label: '备注', width: 100 }
], ],
config: { config: {
isshowTabPane: true, isshowTabPane: true,
search: [ search: [
{ {
name: "groupName", name: 'groupName',
type: "text", type: 'text',
label: "考勤组名称", label: '考勤组名称',
fuzzy: true, fuzzy: true
}, }
], ],
columns: [ columns: [
{ type: "selection", width: 60, fixed: "left" }, { type: 'selection', width: 60, fixed: 'left' },
{ type: "index", label: "序号", width: 50, fixed: "left" }, { type: 'index', label: '序号', width: 50, fixed: 'left' },
{ label: "考勤组名称", prop: "groupName", width: 200, fixed: "left" }, { label: '考勤组名称', prop: 'groupName', width: 200, fixed: 'left' },
{ label: "人数", prop: "personNum", width: 80, fixed: "left" }, { label: '人数', prop: 'personNum', width: 80, fixed: 'left' },
{ {
label: "负责人", label: '负责人',
prop: "responsibleName", prop: 'responsibleName',
width: 80, width: 80,
fixed: "left", fixed: 'left'
}, //未 }, //未
{ {
label: "类型", label: '类型',
prop: "type", prop: 'type',
formatter: this.formatterattendType, formatter: this.formatterattendType,
width: 100, width: 100,
fixed: "left", fixed: 'left'
}, },
// {label: "创建用户", prop: "createUserId", formatter: this.formatter}, // {label: "创建用户", prop: "createUserId", formatter: this.formatter},
...@@ -120,9 +69,9 @@ export default { ...@@ -120,9 +69,9 @@ export default {
// {label: "考勤方式", prop: "attendanceType"}, // {label: "考勤方式", prop: "attendanceType"},
{ {
label: "考勤时间", label: '考勤时间',
prop: "attendanceTime", prop: 'attendanceTime',
formatter: this.formatterBanci, formatter: this.formatterBanci
}, //未 }, //未
// {label: "考勤组人员信息", // {label: "考勤组人员信息",
...@@ -141,7 +90,7 @@ export default { ...@@ -141,7 +90,7 @@ export default {
// }, // },
// }, // },
{ {
label: "操作", label: '操作',
width: 240, width: 240,
formatter: (row) => { formatter: (row) => {
return ( return (
...@@ -154,12 +103,63 @@ export default { ...@@ -154,12 +103,63 @@ export default {
onDel={this.toDel} onDel={this.toDel}
/> />
); );
}, }
}, }
], ]
}, }
}; };
}, },
created() {},
methods: {
// 渲染表格数据
renderTable(tableData) {
return (
<el-table stripe data={tableData} class="total-table">
{this.columnSet.map((item) => this.renderTableColumn(item))}
</el-table>
);
},
// 处理表格头部
renderTableColumn(options) {
return (
<el-table-column
prop={options.prop}
label={options.label}
width={options.width}
></el-table-column>
);
},
/** 重写新增方法 */
toAdd(row) {
this.isshow = false;
this.$refs.groupTemplate.add(row);
// this.$router.push(
// {
// path:'/attendance/group/view'
// }
// )
},
/** 重写编辑方法 */
toEdit(row) {
this.isshow = false;
this.$refs.groupTemplate.edit(row);
// this.$router.push(
// {
// path:'/attendance/group/view'
// }
// )
},
/** 重写查看方法 */
toView(row) {
this.isshow = false;
this.$refs.groupTemplate.view(row);
},
// 确认操作
okFn(val) {
this.getData();
this.isshow = val;
}
}
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
<template> <template>
<div class="page"> <div class="page">
<!-- S 表格主体 -->
<LayoutTable :data="tableData" :config="tableConfig" notDel> <LayoutTable :data="tableData" :config="tableConfig" notDel>
<el-button <el-button
type="primary" type="primary"
...@@ -10,165 +11,134 @@ ...@@ -10,165 +11,134 @@
>导出 >导出
</el-button> </el-button>
</LayoutTable> </LayoutTable>
<!-- E 表格主体 -->
<!-- S 弹窗部分 -->
<drawer-show ref="drawerform" @ok="getData" /> <drawer-show ref="drawerform" @ok="getData" />
<drawer-audit ref="draweraudit" @ok="getData" /> <drawer-audit ref="draweraudit" @ok="getData" />
<!-- E 弹窗部分 -->
</div> </div>
</template> </template>
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import drawerShow from "./drawershow"; import drawerShow from './drawershow';
import drawerAudit from "./draweraudit"; import drawerAudit from './draweraudit';
import table from "@/assets/mixins/table"; import table from '@/assets/mixins/table';
export default { export default {
name: "AttendanceLeaveRecordList", name: 'AttendanceLeaveRecordList',
components: { components: {
drawerShow, drawerShow,
drawerAudit, drawerAudit
}, },
mixins: [table], mixins: [table],
created() {},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
audit(row) {
//todo 审核页面进行审核
this.$refs.drawerform.edit(row);
// this.$refs.draweraudit.view(row);
},
doExport() {
this.isExport = true;
this.$download(
"/attendance/leave/record/exportExcel",
{
idList: this.selection,
name: this.$route.query["name"],
startTimeEnd: this.query.startTimeEnd,
startTimeStart: this.query.startTimeStart,
},
{ type: "excel", name: "请假记录" }
)
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
},
},
data() { data() {
return { return {
// 导出加载状态
isExport: false, isExport: false,
// 表格配置项
config: { config: {
isshowTabPane: true, isshowTabPane: true,
search: [ search: [
{ {
name: "leavePerson", name: 'leavePerson',
type: "text", type: 'text',
label: "请假人", label: '请假人',
fuzzy: true, fuzzy: true
}, },
{ {
name: "phoneNumber", name: 'phoneNumber',
type: "text", type: 'text',
label: "电话号码", label: '电话号码',
fuzzy: true, fuzzy: true
}, },
{ {
name: "salaId", name: 'salaId',
type: "selectSalaId", type: 'selectSalaId',
label: "大厅", label: '大厅',
fuzzy: false, fuzzy: false
}, },
{ {
name: "deptId", name: 'deptId',
type: "selectDeptId", type: 'selectDeptId',
label: "部门", label: '部门',
fuzzy: false, fuzzy: false
}, },
{ {
name: "leaveType", name: 'leaveType',
type: "select", type: 'select',
label: "请假类型", label: '请假类型'
}, },
{ {
name: "startTimeStart", name: 'startTimeStart',
type: "date", type: 'date',
label: "开始时间", label: '开始时间',
fuzzy: false, fuzzy: false
}, },
{ {
name: "startTimeEnd", name: 'startTimeEnd',
type: "date", type: 'date',
label: "结束时间", label: '结束时间',
fuzzy: false, fuzzy: false
}, }
], ],
columns: [ columns: [
{ type: "selection", width: 40 }, { type: 'selection', width: 40 },
{ type: "index", label: "序号", width: 50 }, { type: 'index', label: '序号', width: 50 },
// {label: "请假人id", prop: "leavePersonId", formatter: this.formatter}, // {label: "请假人id", prop: "leavePersonId", formatter: this.formatter},
{ label: "请假人", prop: "leavePerson" }, { label: '请假人', prop: 'leavePerson' },
// {label: "所属部门id", prop: "deptId", formatter: this.formatter}, // {label: "所属部门id", prop: "deptId", formatter: this.formatter},
{ {
label: "大厅", label: '大厅',
prop: "salaName", prop: 'salaName',
formatter: this.formatter, formatter: this.formatter,
show: true, show: true
}, },
{ {
label: "部门", label: '部门',
prop: "deptName", prop: 'deptName',
formatter: this.formatter, formatter: this.formatter,
show: true, show: true
}, },
{ label: "电话号码", prop: "phoneNumber" }, { label: '电话号码', prop: 'phoneNumber' },
{ {
label: "请假类型", label: '请假类型',
prop: "leaveType", prop: 'leaveType',
formatter: this.formatterLeaveType, formatter: this.formatterLeaveType
}, },
{ {
label: "开始时间", label: '开始时间',
prop: "startTime", prop: 'startTime',
width: 150, width: 150,
formatter: this.formatterDate, formatter: this.formatterDate
}, },
{ {
label: "结束时间", label: '结束时间',
prop: "endTime", prop: 'endTime',
width: 150, width: 150,
formatter: this.formatterDate, formatter: this.formatterDate
}, },
{ {
label: "钉钉原始时间(换算时长)", label: '钉钉原始时间(换算时长)',
width: 190, width: 190,
formatter: (row) => { formatter: (row) => {
return ( return (
(row.sourceDingTime ? row.sourceDingTime : "--") + (row.sourceDingTime ? row.sourceDingTime : '--') +
(row.duration (row.duration
? "" + (row.duration / 60 / 60 / 8).toFixed(2) + "" + "" ? '' + (row.duration / 60 / 60 / 8).toFixed(2) + '' + ''
: "(--)") : '(--)')
); );
}, }
}, },
// {label: "审批负责人Id", prop: "approverId", formatter: this.formatter}, // {label: "审批负责人Id", prop: "approverId", formatter: this.formatter},
...@@ -176,27 +146,27 @@ export default { ...@@ -176,27 +146,27 @@ export default {
/* {label: "处理状态", prop: "processStatus", formatter: this.formatter},*/ /* {label: "处理状态", prop: "processStatus", formatter: this.formatter},*/
{ {
label: "状态", label: '状态',
prop: "auditResult", prop: 'auditResult',
formatter: this.formatter, formatter: this.formatter
}, },
// { label: "审批负责人", prop: "approver" }, // { label: "审批负责人", prop: "approver" },
{ {
label: "创建用户", label: '创建用户',
prop: "createUserId", prop: 'createUserId',
formatter: this.formatter, formatter: this.formatter
}, },
{ {
label: "创建时间", label: '创建时间',
prop: "createTime", prop: 'createTime',
width: 150, width: 150,
formatter: this.formatterDate, formatter: this.formatterDate
}, },
{ {
label: "操作", label: '操作',
width: 220, width: 220,
formatter: (row) => { formatter: (row) => {
return ( return (
...@@ -221,15 +191,54 @@ export default { ...@@ -221,15 +191,54 @@ export default {
审核 审核
</el-button> </el-button>
) : ( ) : (
"" ''
)} )}
</div> </div>
); );
}, }
}, }
], ]
}, }
}; };
}, },
created() {},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
audit(row) {
//todo 审核页面进行审核
this.$refs.drawerform.edit(row);
// this.$refs.draweraudit.view(row);
},
// 导出操作
doExport() {
this.isExport = true;
this.$download(
'/attendance/leave/record/exportExcel',
{
idList: this.selection,
name: this.$route.query['name'],
startTimeEnd: this.query.startTimeEnd,
startTimeStart: this.query.startTimeStart
},
{ type: 'excel', name: '请假记录' }
)
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
}
}
}; };
</script> </script>
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
<drawer-show ref="drawerShow" @ok="getData" /> <drawer-show ref="drawerShow" @ok="getData" />
<!-- 撤销提示 --> <!-- 撤销提示 -->
<el-dialog :visible.sync="dialogVisible" title="提示" width="40%"> <el-dialog :visible.sync="dialogVisible" title="提示" width="40%">
<div> <div>撤销异常处理结果后,当天的考勤结果将会重新计算,系统需要花费一点时间。</div>
撤销异常处理结果后,当天的考勤结果将会重新计算,系统需要花费一点时间。
</div>
<div class="flex flex_end"> <div class="flex flex_end">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="resetError">确定</el-button> <el-button type="primary" @click="resetError">确定</el-button>
...@@ -39,147 +37,44 @@ ...@@ -39,147 +37,44 @@
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import drawerShow from "./drawershow"; import drawerShow from './drawershow';
import table from "@/assets/mixins/table"; import table from '@/assets/mixins/table';
import { import {
getFirstDay, getFirstDay,
getLastDay, getLastDay,
getdiffdate, getdiffdate,
timestampToTime, timestampToTime,
getMyDay, getMyDay
} from "@/assets/utils/dateFormat.js"; } from '@/assets/utils/dateFormat.js';
export default { export default {
name: "AttendanceRecordErrorList", name: 'AttendanceRecordErrorList',
components: { components: {
drawerShow, drawerShow
}, },
mixins: [table], mixins: [table],
created() {
this.query.errorDateTimeStart = getFirstDay();
this.query.errorDateTimeEnd = getLastDay();
},
methods: {
countDown() {
if (this.percent == 95) {
let params = {};
for (let value of this.config.search) {
if (this.query[value.name]) {
params[value.name] = this.query[value.name];
}
}
if (this.selection.length > 0) {
params["idList"] = this.selection;
}
let that = this;
this.$download(
"/attendance/record/error/exportExcel",
{
...params,
},
{ type: "excel", name: "异常处理" }
)
.then(() => {
this.percent = 100;
this.progress = false;
that.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();
}, 100);
}
},
/** 导出Excel */
doExport() {
if (this.isExport == true) {
this.$message.info("数据正在导出中,请勿重复点击!");
return false;
}
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);
// },
morehandle() {
let arr = this.tableData.data.filter((item) => {
if (this.selection.includes(item.id) && item.processStatus == 0) {
return item;
}
});
this.$nextTick(() => {
this.selection = arr.map((item) => item.id);
});
if (arr.length < 1) {
this.$message.error("请至少选择一条处理");
return;
}
this.$refs.drawerShow.edit(arr[0], arr);
},
// 处理
handle(err) {
console.log(err);
this.$refs.drawerShow.edit(err, []);
},
// 撤销
reCancle(err) {
console.log(err);
this.currentParams = err;
this.dialogVisible = true;
},
resetError() {
this.$post("attendance/record/error/revokeError", {
id: this.currentParams.id,
}).then((res) => {
if (res.code == 1) {
this.dialogVisible = false;
this.getData();
}
});
},
},
data() { data() {
return { return {
// 进度
percent: 0, percent: 0,
// 导出加载状态
isExport: false, isExport: false,
// 是否显示进度
progress: false, progress: false,
// 表格配置项
config: { config: {
isshowTabPane: true, isshowTabPane: true,
search: [ search: [
{ {
name: "salaId", name: 'salaId',
type: "selectSalaId", type: 'selectSalaId',
label: "大厅", label: '大厅',
fuzzy: false, fuzzy: false
}, },
{ {
name: "deptId", name: 'deptId',
type: "selectDeptId", type: 'selectDeptId',
label: "部门", label: '部门',
fuzzy: false, fuzzy: false
}, },
// { // {
// name: "groupId", // name: "groupId",
...@@ -193,31 +88,31 @@ export default { ...@@ -193,31 +88,31 @@ export default {
fuzzy: false fuzzy: false
},*/ },*/
{ {
name: "errorStatus", name: 'errorStatus',
type: "select", type: 'select',
label: "异常状态", label: '异常状态'
}, },
{ {
name: "processStatus", name: 'processStatus',
type: "select", type: 'select',
label: "处理状态", label: '处理状态'
}, },
{ {
name: "errorDateTimeStart", name: 'errorDateTimeStart',
type: "date", type: 'date',
label: "异常开始时间", label: '异常开始时间'
}, },
{ {
name: "errorDateTimeEnd", name: 'errorDateTimeEnd',
type: "date", type: 'date',
label: "异常结束时间", label: '异常结束时间'
}, },
{ {
name: "staffName", name: 'staffName',
type: "text", type: 'text',
label: "员工姓名", label: '员工姓名',
fuzzy: true, fuzzy: true
}, }
// { // {
// name: "phoneNumber", // name: "phoneNumber",
// type: "text", // type: "text",
...@@ -226,68 +121,68 @@ export default { ...@@ -226,68 +121,68 @@ export default {
// }, // },
], ],
columns: [ columns: [
{ type: "selection", width: 60, fixed: "left" }, { type: 'selection', width: 60, fixed: 'left' },
{ type: "index", label: "序号", width: 50, fixed: "left" }, { type: 'index', label: '序号', width: 50, fixed: 'left' },
{ label: "员工姓名", prop: "staffName", fixed: "left", width: 100 }, { label: '员工姓名', prop: 'staffName', fixed: 'left', width: 100 },
{ label: "工号", prop: "workNum" }, { label: '工号', prop: 'workNum' },
{ {
label: "大厅", label: '大厅',
prop: "salaName", prop: 'salaName',
formatter: this.formatter, formatter: this.formatter,
show: true, show: true
}, },
{ {
label: "部门", label: '部门',
prop: "deptName", prop: 'deptName',
formatter: this.formatter, formatter: this.formatter,
show: true, show: true
}, },
{ label: "考勤组", prop: "attendanceGroupName" }, { label: '考勤组', prop: 'attendanceGroupName' },
/* {label: "班次", prop: "shiftsName"},*/ /* {label: "班次", prop: "shiftsName"},*/
{ {
label: "异常状态", label: '异常状态',
prop: "errorStatus", prop: 'errorStatus',
formatter: this.formattereErrorStatus, formatter: this.formattereErrorStatus
}, },
{ {
label: "异常时间", label: '异常时间',
prop: "errorDateTime", prop: 'errorDateTime',
width: 160, width: 160,
formatter: this.formatterDate, formatter: this.formatterDate
}, },
{ {
label: "处理结果", label: '处理结果',
prop: "processResult", prop: 'processResult',
formatter: this.formatters, formatter: this.formatters
}, },
{ {
label: "上下班时间", label: '上下班时间',
prop: "goOffDateTime", prop: 'goOffDateTime',
formatter: (row) => { formatter: (row) => {
return row.goOrOff + " " + row.goOffDateTime; return row.goOrOff + ' ' + row.goOffDateTime;
}, }
}, },
{ {
label: "实际打卡时间", label: '实际打卡时间',
prop: "actualAttendanceDateTime", prop: 'actualAttendanceDateTime',
formatter: this.formatterDate, formatter: this.formatterDate,
width: 160, width: 160
}, },
{ {
label: "处理时间", label: '处理时间',
prop: "operDateTime", prop: 'operDateTime',
formatter: this.formatterDate, formatter: this.formatterDate,
width: 160, width: 160
}, },
{ {
label: "处理状态", label: '处理状态',
prop: "processStatus", prop: 'processStatus',
formatter: this.formattereDealStatus, formatter: this.formattereDealStatus
}, },
{ label: "处理人", prop: "opertor", formatter: this.formatters }, { label: '处理人', prop: 'opertor', formatter: this.formatters },
{ label: "备注", prop: "remark", formatter: this.formatters }, { label: '备注', prop: 'remark', formatter: this.formatters },
{ {
label: "操作", label: '操作',
width: 100, width: 100,
formatter: (row) => { formatter: (row) => {
if (row.processStatus == 0 || !row.processStatus) { if (row.processStatus == 0 || !row.processStatus) {
...@@ -317,14 +212,124 @@ export default { ...@@ -317,14 +212,124 @@ export default {
</span> </span>
); );
} }
}, }
}, }
], ]
}, },
// 是否展示弹窗
dialogVisible: false, dialogVisible: false,
currentParams: {}, currentParams: {}
}; };
}, },
created() {
this.query.errorDateTimeStart = getFirstDay();
this.query.errorDateTimeEnd = getLastDay();
},
methods: {
// 进度条倒计时
countDown() {
if (this.percent == 95) {
let params = {};
for (let value of this.config.search) {
if (this.query[value.name]) {
params[value.name] = this.query[value.name];
}
}
if (this.selection.length > 0) {
params['idList'] = this.selection;
}
let that = this;
this.$download(
'/attendance/record/error/exportExcel',
{
...params
},
{ type: 'excel', name: '异常处理' }
)
.then(() => {
this.percent = 100;
this.progress = false;
that.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();
}, 100);
}
},
/** 导出Excel */
doExport() {
if (this.isExport == true) {
this.$message.info('数据正在导出中,请勿重复点击!');
return false;
}
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);
// },
//选择处理
morehandle() {
let arr = this.tableData.data.filter((item) => {
if (this.selection.includes(item.id) && item.processStatus == 0) {
return item;
}
});
this.$nextTick(() => {
this.selection = arr.map((item) => item.id);
});
if (arr.length < 1) {
this.$message.error('请至少选择一条处理');
return;
}
this.$refs.drawerShow.edit(arr[0], arr);
},
// 处理
handle(err) {
console.log(err);
this.$refs.drawerShow.edit(err, []);
},
// 撤销
reCancle(err) {
console.log(err);
this.currentParams = err;
this.dialogVisible = true;
},
// 重置
resetError() {
this.$post('attendance/record/error/revokeError', {
id: this.currentParams.id
}).then((res) => {
if (res.code == 1) {
this.dialogVisible = false;
this.getData();
}
});
}
}
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
:show-close="false" :show-close="false"
> >
<div class="fresh_box"> <div class="fresh_box">
<div class="title_box" style="margin-bottom: 20px;"> <div class="title_box" style="margin-bottom: 20px">
仅支持手动更新近90天的打卡数据,请选择需要更新的时间段: 仅支持手动更新近90天的打卡数据,请选择需要更新的时间段:
</div> </div>
<el-date-picker <el-date-picker
...@@ -76,18 +76,11 @@ ...@@ -76,18 +76,11 @@
</el-date-picker> </el-date-picker>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFresh" :loading="submitLoad" <el-button type="primary" @click="submitFresh" :loading="submitLoad">确 定</el-button>
>确 定</el-button
>
<el-button @click="cancleFresh">取 消</el-button> <el-button @click="cancleFresh">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload <el-upload
ref="upload" ref="upload"
:limit="1" :limit="1"
...@@ -107,10 +100,7 @@ ...@@ -107,10 +100,7 @@
</div> </div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据 <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据
<el-link <el-link type="primary" style="font-size: 14px" @click="downloadTemplate"
type="primary"
style="font-size: 14px"
@click="downloadTemplate"
>下载模板</el-link >下载模板</el-link
> >
</div> </div>
...@@ -124,11 +114,7 @@ ...@@ -124,11 +114,7 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 导出记录查看 --> <!-- 导出记录查看 -->
<el-drawer <el-drawer title="导出记录" :visible.sync="drawerhistory" :direction="direction">
title="导出记录"
:visible.sync="drawerhistory"
:direction="direction"
>
<div class="hisList"> <div class="hisList">
<div <div
class="list mt10" class="list mt10"
...@@ -141,23 +127,13 @@ ...@@ -141,23 +127,13 @@
<el-button type="text">导出成功</el-button> <el-button type="text">导出成功</el-button>
</div> </div>
<div class="details" v-if="item.islook"> <div class="details" v-if="item.islook">
<div class="mt10" v-if="item.recordIdList"> <div class="mt10" v-if="item.recordIdList">选择列表id: {{ item.recordIdList }}</div>
选择列表id: {{ item.recordIdList }} <div class="mt10" v-if="item.deptName">选择部门:{{ item.deptName }}</div>
</div> <div class="mt10" v-if="item.groupName">选择考勤组:{{ item.groupName }}</div>
<div class="mt10" v-if="item.deptName"> <div class="mt10" v-if="item.className">选择班次:{{ item.className }}</div>
选择部门:{{ item.deptName }}
</div>
<div class="mt10" v-if="item.groupName">
选择考勤组:{{ item.groupName }}
</div>
<div class="mt10" v-if="item.className">
选择班次:{{ item.className }}
</div>
<div class="mt10"> <div class="mt10">
<el-link :href="item.filePath" target="_blank" type="primary" <el-link :href="item.filePath" target="_blank" type="primary">重新下载</el-link>
>重新下载</el-link
>
</div> </div>
</div> </div>
<div class="times mt10">导出时间:{{ item.createTime }}</div> <div class="times mt10">导出时间:{{ item.createTime }}</div>
...@@ -172,33 +148,167 @@ ...@@ -172,33 +148,167 @@
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow"; import dialogShow from './dialogshow';
import table from "@/assets/mixins/table"; import table from '@/assets/mixins/table';
import { import { timestampToTime, getFirstDay, getLastDay } from '@/assets/utils/dateFormat';
timestampToTime,
getFirstDay,
getLastDay,
} from "@/assets/utils/dateFormat";
export default { export default {
name: "AttendanceRecordHikList", name: 'AttendanceRecordHikList',
components: { components: {
dialogShow, dialogShow
}, },
mixins: [table], mixins: [table],
data() {
return {
// 时间组件限制
pickerOptions0: {
disabledDate(time) {
let curDate = new Date().getTime();
let three = 90 * 24 * 3600 * 1000;
let threeMonths = curDate - three;
return time.getTime() > Date.now() || time.getTime() < threeMonths;
}
},
// 时间绑定
freshDate: '',
// 提交加载状态
submitLoad: false,
// 按钮加载状态
btnLoading: false,
// 更新按钮加载状态
btnFreshLoading: false,
// 弹窗展示
dialogOpen: false,
// 是否展示按钮
showBtn: false,
// 展示进度
progress: false,
// 导出加载状态
isExport: false,
// 进度
percent: 0,
upload: {
headers: {
Authorization: window.sessionStorage.getItem('token') || ''
},
// 是否显示弹出层(员工关怀信息导入)
open: false,
// 弹出层标题(员工关怀信息导入)
title: '导入员工关怀信息数据',
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的数据
updateSupport: 0,
// 上传的地址
url: process.env.VUE_APP_API_BASE_URL + '/attendance/attendance/record/hik/importData'
},
// 表格配置
config: {
isshowTabPane: true,
search: [
{
name: 'staffName',
type: 'text',
label: '员工姓名',
fuzzy: true
},
{
name: 'workNum',
type: 'text',
label: '工号',
fuzzy: false
},
// {
// name: "deptId",
// type: "select",
// label: "所属部门",
// fuzzy: false
// },
// {
// name: "attendanceGroupId",
// type: "select",
// label: "所属考勤组",
// fuzzy: false
// },
// {
// name: "shiftsId",
// type: "select",
// label: "班次",
// fuzzy: false
// },
{
name: 'attendanceDateStart',
type: 'date',
label: '考勤开始时间',
fuzzy: false
},
{
name: 'attendanceDateEnd',
type: 'date',
label: '考勤结束时间',
fuzzy: false
}
],
columns: [
{ type: 'selection', width: 60 },
{ type: 'index', label: '序号', width: 50 },
{ label: '员工姓名', prop: 'staffName' },
{ label: '工号', prop: 'workNum' },
{
label: '大厅',
prop: 'salaName',
formatter: this.formatter,
show: true
},
{
label: '部门',
prop: 'deptName',
formatter: this.formatter,
show: true
},
// {label: "考勤组", prop: "attendanceGroupName"},
// {label: "职位", prop: "positionName"},
// {label: "班次", prop: "shiftsName"},
{
label: '考勤时间',
prop: 'attendanceDate',
formatter: this.formatterDate
},
{ label: '考勤点名称', prop: 'attendanceAddress' },
{ label: '事件源', prop: 'eventSource' }
// {
// label: "操作",
// width: 240,
// formatter: row => {
// return (
// <table-buttons noAdd noDel noEdit noView row={row}
// onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
// )
// }
// }
]
},
// 历史记录
drawerhistory: false,
// 导出列表
exportList: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + '/'
};
},
created() { created() {
this.query.attendanceDateStart = timestampToTime(new Date(), 3); this.query.attendanceDateStart = timestampToTime(new Date(), 3);
this.query.attendanceDateEnd = timestampToTime(new Date(), 3); this.query.attendanceDateEnd = timestampToTime(new Date(), 3);
JSON.parse(sessionStorage.getItem("userData")).id == 1 JSON.parse(sessionStorage.getItem('userData')).id == 1
? (this.showBtn = true) ? (this.showBtn = true)
: (this.showBtn = false); : (this.showBtn = false);
}, },
methods: { methods: {
// 确认操作
submitFresh() { submitFresh() {
if (this.freshDate) { if (this.freshDate) {
this.submitLoad = true; this.submitLoad = true;
this.$post("/attendance/record/hik/addAttendanceHikRecordCustom", { this.$post('/attendance/record/hik/addAttendanceHikRecordCustom', {
attendanceDateStart: this.freshDate[0], attendanceDateStart: this.freshDate[0],
attendanceDateEnd: this.freshDate[1], attendanceDateEnd: this.freshDate[1]
}) })
.then((res) => { .then((res) => {
if (res.code == 1) { if (res.code == 1) {
...@@ -216,13 +326,14 @@ export default { ...@@ -216,13 +326,14 @@ export default {
this.btnFreshLoading = false; this.btnFreshLoading = false;
}); });
} else { } else {
this.$message.error("请选择时间范围!"); this.$message.error('请选择时间范围!');
} }
}, },
// 取消更新
cancleFresh() { cancleFresh() {
this.dialogOpen = false; this.dialogOpen = false;
this.btnFreshLoading = false; this.btnFreshLoading = false;
this.freshDate = ""; this.freshDate = '';
}, },
// 手动更新 // 手动更新
handleRefresh() { handleRefresh() {
...@@ -239,27 +350,27 @@ export default { ...@@ -239,27 +350,27 @@ export default {
} }
} }
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params['idList'] = this.selection;
} }
this.$post("/attendance/record/hik/addAttendanceRecord", { this.$post('/attendance/record/hik/addAttendanceRecord', {
...params, ...params
}).then((res) => { }).then((res) => {
this.btnLoading = false; this.btnLoading = false;
if (res.code == 1) { if (res.code == 1) {
this.$message.success("生成打卡记录成功!"); this.$message.success('生成打卡记录成功!');
} }
}); });
}, },
// 更改状态 // 更改状态
changeStatus(item) { changeStatus(item) {
this.$set(item, "islook", !item.islook); this.$set(item, 'islook', !item.islook);
}, },
// 导出记录 // 导出记录
lookexportHis() { lookexportHis() {
this.$post("/attendance/export/record/list", { this.$post('/attendance/export/record/list', {
type: 1, type: 1,
page: 1, page: 1,
size: -1, size: -1
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
let arr = res.data.data; let arr = res.data.data;
...@@ -275,16 +386,16 @@ export default { ...@@ -275,16 +386,16 @@ export default {
}, },
/** 导入 */ /** 导入 */
handleImport() { handleImport() {
this.upload.title = "打卡记录导入"; this.upload.title = '打卡记录导入';
this.upload.open = true; this.upload.open = true;
}, },
/** 下载模板操作 */ /** 下载模板操作 */
downloadTemplate() { downloadTemplate() {
this.isExport = true; this.isExport = true;
this.$download( this.$download(
"/attendance/record/hik/downloadTemplate", '/attendance/record/hik/downloadTemplate',
{}, {},
{ type: "excel", name: "打卡记录统计" } { type: 'excel', name: '打卡记录统计' }
) )
.then(() => (this.isExport = false)) .then(() => (this.isExport = false))
.catch((error) => { .catch((error) => {
...@@ -301,7 +412,7 @@ export default { ...@@ -301,7 +412,7 @@ export default {
this.upload.open = false; this.upload.open = false;
this.upload.isUploading = false; this.upload.isUploading = false;
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true }); this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true });
this.getData(); this.getData();
}, },
/** 提交上传文件 */ /** 提交上传文件 */
...@@ -318,15 +429,15 @@ export default { ...@@ -318,15 +429,15 @@ export default {
} }
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params['idList'] = this.selection;
} }
this.$download( this.$download(
"/attendance/record/hik/exportExcel", '/attendance/record/hik/exportExcel',
{ {
...params, ...params
}, },
{ type: "excel", name: "打卡记录统计" } { type: 'excel', name: '打卡记录统计' }
) )
.then(() => { .then(() => {
this.percent = 100; this.percent = 100;
...@@ -343,7 +454,7 @@ export default { ...@@ -343,7 +454,7 @@ export default {
} else { } else {
this.percent = this.percent + 1; this.percent = this.percent + 1;
let that = this; let that = this;
setTimeout(function() { setTimeout(function () {
that.countDown(); that.countDown();
}, 100); }, 100);
} }
...@@ -351,7 +462,7 @@ export default { ...@@ -351,7 +462,7 @@ export default {
/** 导出Excel */ /** 导出Excel */
doExport() { doExport() {
if (this.isExport == true) { if (this.isExport == true) {
this.$message.info("考勤数据正在导出中,请勿重复点击!"); this.$message.info('考勤数据正在导出中,请勿重复点击!');
return false; return false;
} }
...@@ -372,134 +483,8 @@ export default { ...@@ -372,134 +483,8 @@ export default {
toView(row) { toView(row) {
this.$refs.dialogform.view(row); this.$refs.dialogform.view(row);
}, },
afterRender(data) {}, afterRender(data) {}
}, }
data() {
return {
pickerOptions0: {
disabledDate(time) {
let curDate = new Date().getTime();
let three = 90 * 24 * 3600 * 1000;
let threeMonths = curDate - three;
return time.getTime() > Date.now() || time.getTime() < threeMonths;
},
},
freshDate: "",
submitLoad: false,
btnLoading: false,
btnFreshLoading: false,
dialogOpen: false,
showBtn: false,
progress: false,
isExport: false,
percent: 0,
upload: {
headers: {
Authorization: window.sessionStorage.getItem("token") || "",
},
// 是否显示弹出层(员工关怀信息导入)
open: false,
// 弹出层标题(员工关怀信息导入)
title: "导入员工关怀信息数据",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的数据
updateSupport: 0,
// 上传的地址
url:
process.env.VUE_APP_API_BASE_URL +
"/attendance/attendance/record/hik/importData",
},
config: {
isshowTabPane: true,
search: [
{
name: "staffName",
type: "text",
label: "员工姓名",
fuzzy: true,
},
{
name: "workNum",
type: "text",
label: "工号",
fuzzy: false,
},
// {
// name: "deptId",
// type: "select",
// label: "所属部门",
// fuzzy: false
// },
// {
// name: "attendanceGroupId",
// type: "select",
// label: "所属考勤组",
// fuzzy: false
// },
// {
// name: "shiftsId",
// type: "select",
// label: "班次",
// fuzzy: false
// },
{
name: "attendanceDateStart",
type: "date",
label: "考勤开始时间",
fuzzy: false,
},
{
name: "attendanceDateEnd",
type: "date",
label: "考勤结束时间",
fuzzy: false,
},
],
columns: [
{ type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 },
{ label: "员工姓名", prop: "staffName" },
{ label: "工号", prop: "workNum" },
{
label: "大厅",
prop: "salaName",
formatter: this.formatter,
show: true,
},
{
label: "部门",
prop: "deptName",
formatter: this.formatter,
show: true,
},
// {label: "考勤组", prop: "attendanceGroupName"},
// {label: "职位", prop: "positionName"},
// {label: "班次", prop: "shiftsName"},
{
label: "考勤时间",
prop: "attendanceDate",
formatter: this.formatterDate,
},
{ label: "考勤点名称", prop: "attendanceAddress" },
{ label: "事件源", prop: "eventSource" },
// {
// label: "操作",
// width: 240,
// formatter: row => {
// return (
// <table-buttons noAdd noDel noEdit noView row={row}
// onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
// )
// }
// }
],
},
drawerhistory: false,
exportList: [],
baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
};
},
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -36,13 +36,7 @@ ...@@ -36,13 +36,7 @@
</div> </div>
</div> </div>
</div> --> </div> -->
<LayoutTable <LayoutTable :data="tableData" :config="tableConfig" notDel notAdd ref="layoutTable">
:data="tableData"
:config="tableConfig"
notDel
notAdd
ref="layoutTable"
>
<el-button <el-button
slot="table-head-left2" slot="table-head-left2"
style="margin-left: 10px" style="margin-left: 10px"
...@@ -89,11 +83,7 @@ ...@@ -89,11 +83,7 @@
</LayoutTable> </LayoutTable>
<drawer-show ref="drawerform" @ok="getData" /> <drawer-show ref="drawerform" @ok="getData" />
<!-- 导出记录查看 --> <!-- 导出记录查看 -->
<el-drawer <el-drawer title="导出记录" :visible.sync="drawerhistory" :direction="direction">
title="导出记录"
:visible.sync="drawerhistory"
:direction="direction"
>
<div class="hisList"> <div class="hisList">
<div <div
class="list mt10" class="list mt10"
...@@ -106,24 +96,13 @@ ...@@ -106,24 +96,13 @@
<el-button type="text">导出成功</el-button> <el-button type="text">导出成功</el-button>
</div> </div>
<div class="details" v-if="item.islook"> <div class="details" v-if="item.islook">
<div class="mt10" v-if="item.recordIdList"> <div class="mt10" v-if="item.recordIdList">选择列表id: {{ item.recordIdList }}</div>
选择列表id: {{ item.recordIdList }} <div class="mt10" v-if="item.deptName">选择部门:{{ item.deptName }}</div>
</div> <div class="mt10" v-if="item.groupName">选择考勤组:{{ item.groupName }}</div>
<div class="mt10" v-if="item.deptName"> <div class="mt10" v-if="item.className">选择班次:{{ item.className }}</div>
选择部门:{{ item.deptName }}
</div>
<div class="mt10" v-if="item.groupName">
选择考勤组:{{ item.groupName }}
</div>
<div class="mt10" v-if="item.className">
选择班次:{{ item.className }}
</div>
<div class="mt10"> <div class="mt10">
<el-link <el-link :href="baseUrl + item.filePath" target="_blank" type="primary"
:href="baseUrl + item.filePath"
target="_blank"
type="primary"
>重新下载</el-link >重新下载</el-link
> >
</div> </div>
...@@ -134,49 +113,32 @@ ...@@ -134,49 +113,32 @@
</el-drawer> </el-drawer>
<!-- 导出表格设置 --> <!-- 导出表格设置 -->
<el-dialog :visible.sync="isdialog" title="导出表格设置"> <el-dialog :visible.sync="isdialog" title="导出表格设置">
<div class="tipsword"> <div class="tipsword">请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。</div>
请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。
</div>
<el-checkbox-group v-model="checkList"> <el-checkbox-group v-model="checkList">
<el-checkbox <el-checkbox v-for="(item, index) in setcolum" :key="index" :label="item.prop">
v-for="(item, index) in setcolum"
:key="index"
:label="item.prop"
>
{{ item.label }} {{ item.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<div class="mt20" style="text-align:right"> <div class="mt20" style="text-align: right">
<el-button @click="handleCancel(1)">取消</el-button> <el-button @click="handleCancel(1)">取消</el-button>
<el-button type="primary" @click="handleSubmit(1)">确定</el-button> <el-button type="primary" @click="handleSubmit(1)">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 显示表格设置 --> <!-- 显示表格设置 -->
<el-dialog :visible.sync="setDialog" title="表格显示设置"> <el-dialog :visible.sync="setDialog" title="表格显示设置">
<div class="tipsword"> <div class="tipsword">请选择表格展示字段,表格中的内容与选中的字段将保持一致。</div>
请选择表格展示字段,表格中的内容与选中的字段将保持一致。
</div>
<el-checkbox-group v-model="checkTableList"> <el-checkbox-group v-model="checkTableList">
<el-checkbox <el-checkbox v-for="(item, index) in setcolum" :key="index" :label="item.prop">
v-for="(item, index) in setcolum"
:key="index"
:label="item.prop"
>
{{ item.label }} {{ item.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<div class="mt20" style="text-align:right"> <div class="mt20" style="text-align: right">
<el-button @click="handleCancel(2)">取消</el-button> <el-button @click="handleCancel(2)">取消</el-button>
<el-button type="primary" @click="handleSubmit(2)">确定</el-button> <el-button type="primary" @click="handleSubmit(2)">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 上传 --> <!-- 上传 -->
<el-dialog <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload <el-upload
ref="upload" ref="upload"
:limit="1" :limit="1"
...@@ -196,10 +158,7 @@ ...@@ -196,10 +158,7 @@
</div> </div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据 <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据
<el-link <el-link type="primary" style="font-size: 14px" @click="downloadTemplate"
type="primary"
style="font-size: 14px"
@click="downloadTemplate"
>下载模板</el-link >下载模板</el-link
> >
</div> </div>
...@@ -220,16 +179,16 @@ ...@@ -220,16 +179,16 @@
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import drawerShow from "./drawershow"; import drawerShow from './drawershow';
import table from "@/assets/mixins/table"; import table from '@/assets/mixins/table';
import TabPane from "@/components/tabPane.vue"; import TabPane from '@/components/tabPane.vue';
import { timestampToTime } from "@/assets/utils/dateFormat"; import { timestampToTime } from '@/assets/utils/dateFormat';
import { formatterDateOnly } from "@/assets/utils/table"; import { formatterDateOnly } from '@/assets/utils/table';
export default { export default {
name: "AttendanceRecordList", name: 'AttendanceRecordList',
components: { components: {
drawerShow, drawerShow,
TabPane, TabPane
}, },
mixins: [table], mixins: [table],
computed: { computed: {
...@@ -239,10 +198,230 @@ export default { ...@@ -239,10 +198,230 @@ export default {
}, },
activeName() { activeName() {
return this.$store.state.ThirdPath; return this.$store.state.ThirdPath;
}, }
},
data() {
return {
isExport: false,
// 动态新增列表
addColumn: [],
progress: false,
percent: 0,
upload: {
// 是否显示弹出层(员工关怀信息导入)
open: false,
// 弹出层标题(员工关怀信息导入)
title: '每日打卡记录',
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的数据
updateSupport: 0,
// 上传的地址
url: '/attendance/record/importData'
},
/** 子表列元素 */
columnSet: [
{ prop: 'shiftsName', label: '班次名称', width: 150, show: true },
{
prop: 'goWorkDate',
label: '上班打卡时间',
width: 100,
formatter: this.formatterDate,
show: true
},
{
prop: 'goWorkResult',
label: '上班打卡结果',
width: 100,
formatter: this.formatterString,
show: true
},
{
prop: 'offWorkDate',
label: '下班打卡时间',
width: 100,
formatter: this.formatterDate,
show: true
},
{
prop: 'offWorkResult',
label: '下班打卡结果',
width: 100,
formatter: this.formatterString,
show: true
}
],
config: {
showType: 'tableSelect',
search: [
{
name: 'staffName',
type: 'text',
label: '员工姓名',
fuzzy: true
},
// {
// name: "workNum",
// type: "text",
// label: "员工工号",
// fuzzy: true,
// },
// {
// name: "phone",
// type: "text",
// label: "手机号",
// fuzzy: true,
// },
{
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: "punchResult",
// type: "select",
// label: "打卡结果",
// fuzzy: false,
// },
{
name: 'attendanceDateStart',
type: 'date',
label: '考勤开始时间',
fuzzy: false
},
{
name: 'attendanceDateEnd',
type: 'date',
label: '考勤结束时间',
fuzzy: false
}
],
columns: [
{ type: 'selection', width: 60, show: true },
{ type: 'index', label: '序号', width: 50, show: true },
{
label: '打卡日期',
prop: 'attendanceDate',
formatter: this.formatterDateOnly,
show: true
},
{ label: '员工姓名', prop: 'staffName', show: true },
{ label: '员工工号', prop: 'workNum', show: true },
{
label: '考勤组',
prop: 'attendanceGroupName',
show: true
},
{
label: '大厅',
prop: 'salaName',
formatter: this.formatter,
show: true
},
{
label: '部门',
prop: 'deptName',
formatter: this.formatter,
show: true
},
{ label: '职位', prop: 'positionName', show: true },
{
label: '班次',
prop: 'classId',
formatter: this.formatter,
show: true
}
// {
// label: "签到结果",
// prop: "signInResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "签退结果",
// prop: "signOutResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "打卡结果",
// prop: "punchResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "考勤类型",
// prop: "attendType",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "考勤打卡记录详细信息",
// width: 120,
// prop: "subColumns",
// show: true,
// formatter: (row) => {
// let widthsize = this.columnSet.reduce((pre, cur) => {
// return pre + Number(cur.width);
// }, 50);
// return (
// <el-popover placement="right" width={widthsize} trigger="click">
// {this.renderTable(row.attendanceRecordDetailList)}
// <el-button type="text" slot="reference">
// 详细
// </el-button>
// </el-popover>
// );
// },
// },
// {
// label: "操作",
// width: 240,
// formatter: row => {
// return (
// <table-buttons noAdd noEdit noView noDel
// row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
// );
// }
// }
]
},
drawerhistory: false,
isdialog: false,
setcolum: [],
checkList: [],
setDialog: false,
checkTableList: [],
exportList: [], //导出记录
baseUrl: process.env.VUE_APP_API_BASE_URL + '/',
initalArr: [],
attendStatInfo: {}
};
}, },
created() { created() {
this.$post("/attendance/record/stat", {}).then((res) => { this.$post('/attendance/record/stat', {}).then((res) => {
if (res.code === 1) { if (res.code === 1) {
this.attendStatInfo = res.data; this.attendStatInfo = res.data;
} }
...@@ -267,9 +446,7 @@ export default { ...@@ -267,9 +446,7 @@ export default {
this.isdialog = false; this.isdialog = false;
} else { } else {
this.config.columns.forEach((v) => { this.config.columns.forEach((v) => {
v.prop && v.prop != "attendanceStaffStatEntities" v.prop && v.prop != 'attendanceStaffStatEntities' ? (v.show = false) : (v.show = true);
? (v.show = false)
: (v.show = true);
this.checkTableList.forEach((val) => { this.checkTableList.forEach((val) => {
if (v.prop == val) { if (v.prop == val) {
v.show = true; v.show = true;
...@@ -288,23 +465,19 @@ export default { ...@@ -288,23 +465,19 @@ export default {
let obj = { let obj = {
show: true, show: true,
label: item.name, label: item.name,
prop: "", prop: '',
formatter: (row) => { formatter: (row) => {
if (row.attendanceRecordDetailList.length < 1) { if (row.attendanceRecordDetailList.length < 1) {
return "-"; return '-';
} else { } else {
return this.handleArr( return this.handleArr(row.attendanceRecordDetailList, item.orderNum, item.property);
row.attendanceRecordDetailList,
item.orderNum,
item.property
);
} }
}, }
}; };
addobjArr.push(obj); addobjArr.push(obj);
}); });
this.config.columns = [...this.initalArr, ...addobjArr]; this.config.columns = [...this.initalArr, ...addobjArr];
this.$refs.layoutTable.showType = "tableSelect"; this.$refs.layoutTable.showType = 'tableSelect';
this.$forceUpdate(); this.$forceUpdate();
}, },
// 表格接收数据前 // 表格接收数据前
...@@ -316,41 +489,34 @@ export default { ...@@ -316,41 +489,34 @@ export default {
let index = arr.findIndex((item) => item.orderNum === currentorderNum); let index = arr.findIndex((item) => item.orderNum === currentorderNum);
if (index > -1) { if (index > -1) {
if (!arr[index][property]) { if (!arr[index][property]) {
return "-"; return '-';
} else if (property === "goWorkDate" || property === "offWorkDate") { } else if (property === 'goWorkDate' || property === 'offWorkDate') {
// 打卡时间 // 打卡时间
return timestampToTime(arr[index][property], 6); return timestampToTime(arr[index][property], 6);
} else if ( } else if (property === 'goWorkResult' || property === 'offWorkResult') {
property === "goWorkResult" ||
property === "offWorkResult"
) {
let val = arr[index][property]; let val = arr[index][property];
return this.tableData.dict.goWorkResult[val] == "正常" ? ( return this.tableData.dict.goWorkResult[val] == '正常' ? (
<span>{this.tableData.dict.goWorkResult[val]}</span> <span>{this.tableData.dict.goWorkResult[val]}</span>
) : this.tableData.dict.goWorkResult[val] == "请假" ? ( ) : this.tableData.dict.goWorkResult[val] == '请假' ? (
<span style="color:#1a7af8"> <span style="color:#1a7af8">{this.tableData.dict.goWorkResult[val]}</span>
{this.tableData.dict.goWorkResult[val]}
</span>
) : ( ) : (
<span style="color:red"> <span style="color:red">{this.tableData.dict.goWorkResult[val]}</span>
{this.tableData.dict.goWorkResult[val]}
</span>
); );
} }
} else { } else {
return "-"; return '-';
} }
}, },
//改变状态
changeStatus(item) { changeStatus(item) {
this.$set(item, "islook", !item.islook); this.$set(item, 'islook', !item.islook);
}, },
// 导出记录 // 导出记录
lookexportHis() { lookexportHis() {
this.$post("/attendance/export/record/list", { this.$post('/attendance/export/record/list', {
type: 2, type: 2,
page: 1, page: 1,
size: -1, size: -1
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
let arr = res.data.data; let arr = res.data.data;
...@@ -366,16 +532,16 @@ export default { ...@@ -366,16 +532,16 @@ export default {
}, },
/** 导入 */ /** 导入 */
handleImport() { handleImport() {
this.upload.title = "打卡记录导入"; this.upload.title = '打卡记录导入';
this.upload.open = true; this.upload.open = true;
}, },
/** 下载模板操作 */ /** 下载模板操作 */
downloadTemplate() { downloadTemplate() {
this.isExport = true; this.isExport = true;
this.$download( this.$download(
"/attendance/record/downloadTemplate", '/attendance/record/downloadTemplate',
{}, {},
{ type: "excel", name: "每日打卡记录" } { type: 'excel', name: '每日打卡记录' }
) )
.then(() => (this.isExport = false)) .then(() => (this.isExport = false))
.catch((error) => { .catch((error) => {
...@@ -392,13 +558,14 @@ export default { ...@@ -392,13 +558,14 @@ export default {
this.upload.open = false; this.upload.open = false;
this.upload.isUploading = false; this.upload.isUploading = false;
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true }); this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true });
this.getData(); this.getData();
}, },
/** 提交上传文件 */ /** 提交上传文件 */
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
}, },
// 倒计时操作
countDown() { countDown() {
if (this.percent == 95) { if (this.percent == 95) {
let params = {}; let params = {};
...@@ -408,17 +575,17 @@ export default { ...@@ -408,17 +575,17 @@ export default {
} }
} }
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params['idList'] = this.selection;
} }
if (this.checkList.length > 0) { if (this.checkList.length > 0) {
params["properties"] = this.checkList; params['properties'] = this.checkList;
} }
this.$download( this.$download(
"/attendance/record/exportExcel", '/attendance/record/exportExcel',
{ {
...params, ...params
}, },
{ type: "excel", name: "每日打卡记录" } { type: 'excel', name: '每日打卡记录' }
) )
.then((res) => { .then((res) => {
this.percent = 100; this.percent = 100;
...@@ -437,7 +604,7 @@ export default { ...@@ -437,7 +604,7 @@ export default {
} else { } else {
this.percent = this.percent + 1; this.percent = this.percent + 1;
let that = this; let that = this;
setTimeout(function() { setTimeout(function () {
that.countDown(); that.countDown();
}, 100); }, 100);
} }
...@@ -451,16 +618,12 @@ export default { ...@@ -451,16 +618,12 @@ export default {
} }
} }
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params['idList'] = this.selection;
} }
if (this.checkList.length > 0) { if (this.checkList.length > 0) {
params["properties"] = this.checkList; params['properties'] = this.checkList;
} }
let flag = this.checkDate( let flag = this.checkDate(params.attendanceDateStart, params.attendanceDateEnd, 1);
params.attendanceDateStart,
params.attendanceDateEnd,
1
);
if (!flag) { if (!flag) {
this.isExport = true; this.isExport = true;
...@@ -469,21 +632,22 @@ export default { ...@@ -469,21 +632,22 @@ export default {
this.countDown(); this.countDown();
} }
}, },
// 设置时间并检查
checkDate(startTime, endTime, compDay) { checkDate(startTime, endTime, compDay) {
if (startTime == "" || startTime == null || startTime == undefined) { if (startTime == '' || startTime == null || startTime == undefined) {
this.$message.error("开始时间为空,请检查!"); this.$message.error('开始时间为空,请检查!');
return true; return true;
} }
if (endTime == "" || endTime == null || endTime == undefined) { if (endTime == '' || endTime == null || endTime == undefined) {
this.$message.error("结束时间为空,请检查!"); this.$message.error('结束时间为空,请检查!');
return true; return true;
} }
var data1 = Date.parse(startTime.replace(/-/g, "/")); var data1 = Date.parse(startTime.replace(/-/g, '/'));
var data2 = Date.parse(endTime.replace(/-/g, "/")); var data2 = Date.parse(endTime.replace(/-/g, '/'));
var datadiff = data2 - data1; var datadiff = data2 - data1;
var time = parseInt(compDay) * (60 * 60 * 24 * 1000); var time = parseInt(compDay) * (60 * 60 * 24 * 1000);
if (datadiff < 0) { if (datadiff < 0) {
this.$message.error("开始时间应小于结束时间"); this.$message.error('开始时间应小于结束时间');
return true; return true;
} }
// if (datadiff > time) { // if (datadiff > time) {
...@@ -492,17 +656,14 @@ export default { ...@@ -492,17 +656,14 @@ export default {
// } // }
return false; return false;
}, },
// 设置弹窗内的展示内容
setdialog(i) { setdialog(i) {
if (i == 1) { if (i == 1) {
this.isdialog = true; this.isdialog = true;
this.setcolum = this.config.columns.filter( this.setcolum = this.config.columns.filter((item) => item.label && item.prop);
(item) => item.label && item.prop
);
} else { } else {
this.setDialog = true; this.setDialog = true;
this.setcolum = this.config.columns.filter( this.setcolum = this.config.columns.filter((item) => item.label && item.prop);
(item) => item.label && item.prop
);
this.checkTableList = this.config.columns.map((item) => { this.checkTableList = this.config.columns.map((item) => {
if (item.show) { if (item.show) {
...@@ -511,6 +672,7 @@ export default { ...@@ -511,6 +672,7 @@ export default {
}); });
} }
}, },
// 表格数据渲染处理
renderTable(tableData) { renderTable(tableData) {
return ( return (
<el-table stripe data={tableData} class="total-table"> <el-table stripe data={tableData} class="total-table">
...@@ -518,6 +680,7 @@ export default { ...@@ -518,6 +680,7 @@ export default {
</el-table> </el-table>
); );
}, },
// 表格表头渲染处理
renderTableColumn(options) { renderTableColumn(options) {
return ( return (
<el-table-column <el-table-column
...@@ -540,233 +703,15 @@ export default { ...@@ -540,233 +703,15 @@ export default {
toView(row) { toView(row) {
this.$refs.drawerform.view(row); this.$refs.drawerform.view(row);
}, },
// 点击操作
handleClick(key) { handleClick(key) {
console.log(key); console.log(key);
this.$store.commit("setThirdPath", key); this.$store.commit('setThirdPath', key);
this.$router.push({ this.$router.push({
path: key, path: key
}); });
}, }
}, }
data() {
return {
isExport: false,
// 动态新增列表
addColumn: [],
progress: false,
percent: 0,
upload: {
// 是否显示弹出层(员工关怀信息导入)
open: false,
// 弹出层标题(员工关怀信息导入)
title: "每日打卡记录",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的数据
updateSupport: 0,
// 上传的地址
url: "/attendance/record/importData",
},
/** 子表列元素 */
columnSet: [
{ prop: "shiftsName", label: "班次名称", width: 150, show: true },
{
prop: "goWorkDate",
label: "上班打卡时间",
width: 100,
formatter: this.formatterDate,
show: true,
},
{
prop: "goWorkResult",
label: "上班打卡结果",
width: 100,
formatter: this.formatterString,
show: true,
},
{
prop: "offWorkDate",
label: "下班打卡时间",
width: 100,
formatter: this.formatterDate,
show: true,
},
{
prop: "offWorkResult",
label: "下班打卡结果",
width: 100,
formatter: this.formatterString,
show: true,
},
],
config: {
showType: "tableSelect",
search: [
{
name: "staffName",
type: "text",
label: "员工姓名",
fuzzy: true,
},
// {
// name: "workNum",
// type: "text",
// label: "员工工号",
// fuzzy: true,
// },
// {
// name: "phone",
// type: "text",
// label: "手机号",
// fuzzy: true,
// },
{
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: "punchResult",
// type: "select",
// label: "打卡结果",
// fuzzy: false,
// },
{
name: "attendanceDateStart",
type: "date",
label: "考勤开始时间",
fuzzy: false,
},
{
name: "attendanceDateEnd",
type: "date",
label: "考勤结束时间",
fuzzy: false,
},
],
columns: [
{ type: "selection", width: 60, show: true },
{ type: "index", label: "序号", width: 50, show: true },
{
label: "打卡日期",
prop: "attendanceDate",
formatter: this.formatterDateOnly,
show: true,
},
{ label: "员工姓名", prop: "staffName", show: true },
{ label: "员工工号", prop: "workNum", show: true },
{
label: "考勤组",
prop: "attendanceGroupName",
show: true,
},
{
label: "大厅",
prop: "salaName",
formatter: this.formatter,
show: true,
},
{
label: "部门",
prop: "deptName",
formatter: this.formatter,
show: true,
},
{ label: "职位", prop: "positionName", show: true },
{
label: "班次",
prop: "classId",
formatter: this.formatter,
show: true,
},
// {
// label: "签到结果",
// prop: "signInResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "签退结果",
// prop: "signOutResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "打卡结果",
// prop: "punchResult",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "考勤类型",
// prop: "attendType",
// formatter: this.formatter,
// show: true,
// },
// {
// label: "考勤打卡记录详细信息",
// width: 120,
// prop: "subColumns",
// show: true,
// formatter: (row) => {
// let widthsize = this.columnSet.reduce((pre, cur) => {
// return pre + Number(cur.width);
// }, 50);
// return (
// <el-popover placement="right" width={widthsize} trigger="click">
// {this.renderTable(row.attendanceRecordDetailList)}
// <el-button type="text" slot="reference">
// 详细
// </el-button>
// </el-popover>
// );
// },
// },
// {
// label: "操作",
// width: 240,
// formatter: row => {
// return (
// <table-buttons noAdd noEdit noView noDel
// row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
// );
// }
// }
],
},
drawerhistory: false,
isdialog: false,
setcolum: [],
checkList: [],
setDialog: false,
checkTableList: [],
exportList: [], //导出记录
baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
initalArr: [],
attendStatInfo: {},
};
},
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
......
<template> <template>
<div class="page"> <div class="page">
<LayoutTable <!-- S 表格主体部分 -->
:data="tableData" <LayoutTable :data="tableData" :config="tableConfig" notAdd notDel ref="layoutTable">
:config="tableConfig"
notAdd
notDel
ref="layoutTable"
>
<el-button <el-button
slot="table-head-left2" slot="table-head-left2"
style="margin-left: 10px" style="margin-left: 10px"
...@@ -64,23 +59,22 @@ ...@@ -64,23 +59,22 @@
<i class="el-icon-refresh"></i> <i class="el-icon-refresh"></i>
<span <span
>上次考勤汇总时间:{{ >上次考勤汇总时间:{{
tableData.dict.summaryTime ? tableData.dict.summaryTime : "--" tableData.dict.summaryTime ? tableData.dict.summaryTime : '--'
}}</span }}</span
> >
</span> </span>
</LayoutTable> </LayoutTable>
<!-- E 表格主体部分 -->
<!-- S 弹窗部分 -->
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
<!-- E 弹窗部分 -->
<!-- 导出表格设置 --> <!-- 导出表格设置 -->
<el-dialog :visible.sync="isdialog" title="导出表格设置"> <el-dialog :visible.sync="isdialog" title="导出表格设置">
<div class="tipsword"> <div class="tipsword">请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。</div>
请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。
</div>
<el-checkbox-group v-model="checkList"> <el-checkbox-group v-model="checkList">
<el-checkbox <el-checkbox v-for="(item, index) in setcolum" :key="index" :label="item.prop">
v-for="(item, index) in setcolum"
:key="index"
:label="item.prop"
>
{{ item.label }} {{ item.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
...@@ -91,15 +85,9 @@ ...@@ -91,15 +85,9 @@
</el-dialog> </el-dialog>
<!-- 显示表格设置 --> <!-- 显示表格设置 -->
<el-dialog :visible.sync="setDialog" title="表格显示设置"> <el-dialog :visible.sync="setDialog" title="表格显示设置">
<div class="tipsword"> <div class="tipsword">请选择表格展示字段,表格中的内容与选中的字段将保持一致。</div>
请选择表格展示字段,表格中的内容与选中的字段将保持一致。
</div>
<el-checkbox-group v-model="checkTableList"> <el-checkbox-group v-model="checkTableList">
<el-checkbox <el-checkbox v-for="(item, index) in setcolum" :key="index" :label="item.prop">
v-for="(item, index) in setcolum"
:key="index"
:label="item.prop"
>
{{ item.label }} {{ item.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
...@@ -109,11 +97,7 @@ ...@@ -109,11 +97,7 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 导出记录查看 --> <!-- 导出记录查看 -->
<el-drawer <el-drawer title="导出记录" :visible.sync="drawerhistory" :direction="direction">
title="导出记录"
:visible.sync="drawerhistory"
:direction="direction"
>
<div class="hisList"> <div class="hisList">
<div class="list mt10" v-for="item in 10" :key="item"> <div class="list mt10" v-for="item in 10" :key="item">
<div class="flex flex-align-center flex-pack-justify"> <div class="flex flex-align-center flex-pack-justify">
...@@ -157,38 +141,21 @@ ...@@ -157,38 +141,21 @@
</el-date-picker> --> </el-date-picker> -->
</div> </div>
<div class="fresh_box" v-else> <div class="fresh_box" v-else>
<div <div class="title_box" style="margin-bottom: 20px; line-height: 30px" v-if="showTip">
class="title_box" 请确认是否开始进行{{ freshDate + '' }}的考勤数据重新汇总;此过程预计需要
style="margin-bottom: 20px; line-height: 30px"
v-if="showTip"
>
请确认是否开始进行{{
freshDate + ""
}}的考勤数据重新汇总;此过程预计需要
<span style="color: #ff0000">10</span> 分钟左右,请勿关闭或刷新页面 <span style="color: #ff0000">10</span> 分钟左右,请勿关闭或刷新页面
</div> </div>
<div <div class="title_box" style="margin-bottom: 20px; line-height: 30px" v-else>
class="title_box" 正在进行{{ freshDate + '' }}的考勤数据重新汇总;此过程预计还需要
style="margin-bottom: 20px; line-height: 30px"
v-else
>
正在进行{{ freshDate + "" }}的考勤数据重新汇总;此过程预计还需要
<span style="color: #ff0000">{{ restTime }}</span> <span style="color: #ff0000">{{ restTime }}</span>
分钟左右,请勿关闭或刷新页面 分钟左右,请勿关闭或刷新页面
</div> </div>
</div> </div>
<div slot="footer" class="dialog-footer" v-if="showTip"> <div slot="footer" class="dialog-footer" v-if="showTip">
<el-button <el-button type="primary" @click="() => (showContent = false)" v-if="showContent"
type="primary"
@click="() => (showContent = false)"
v-if="showContent"
>确 定</el-button >确 定</el-button
> >
<el-button <el-button type="primary" @click="submitFresh" v-else :loading="submitLoad"
type="primary"
@click="submitFresh"
v-else
:loading="submitLoad"
>确 定</el-button >确 定</el-button
> >
<el-button @click="cancleFresh">取 消</el-button> <el-button @click="cancleFresh">取 消</el-button>
...@@ -199,19 +166,19 @@ ...@@ -199,19 +166,19 @@
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import DialogShow from "./dialogshow"; import DialogShow from './dialogshow';
import table from "@/assets/mixins/table"; import table from '@/assets/mixins/table';
import { import {
getFirstDay, getFirstDay,
getLastDay, getLastDay,
getdiffdate, getdiffdate,
timestampToTime, timestampToTime,
getMyDay, getMyDay
} from "@/assets/utils/dateFormat.js"; } from '@/assets/utils/dateFormat.js';
export default { export default {
name: "AttendanceStatList", name: 'AttendanceStatList',
components: { components: {
DialogShow, DialogShow
}, },
mixins: [table], mixins: [table],
data() { data() {
...@@ -223,16 +190,15 @@ export default { ...@@ -223,16 +190,15 @@ export default {
// 倒计时结束时间 // 倒计时结束时间
endTime: null, endTime: null,
// 倒计时结束限时 // 倒计时结束限时
restTime: "10", restTime: '10',
// 规定日期组件的选取范围 // 规定日期组件的选取范围
pickerOptions0: { pickerOptions0: {
disabledDate(v) { disabledDate(v) {
let limitDate = let limitDate =
v.getTime() < new Date().getTime() - 31 * 86400000 || v.getTime() < new Date().getTime() - 31 * 86400000 || v.getTime() > Date.now();
v.getTime() > Date.now();
return limitDate; return limitDate;
7; 7;
}, }
}, },
// 更新日期 // 更新日期
freshDate: null, freshDate: null,
...@@ -247,21 +213,21 @@ export default { ...@@ -247,21 +213,21 @@ export default {
isExport: false, isExport: false,
// 表格配置项 // 表格配置项
config: { config: {
showType: "tableSelect", showType: 'tableSelect',
isshowTabPane: true, isshowTabPane: true,
height: "680px", height: '680px',
search: [ search: [
{ {
name: "salaId", name: 'salaId',
type: "selectSalaId", type: 'selectSalaId',
label: "大厅", label: '大厅',
fuzzy: false, fuzzy: false
}, },
{ {
name: "deptId", name: 'deptId',
type: "selectDeptId", type: 'selectDeptId',
label: "部门", label: '部门',
fuzzy: false, fuzzy: false
}, },
// { // {
// name: "groupId", // name: "groupId",
...@@ -276,91 +242,91 @@ export default { ...@@ -276,91 +242,91 @@ export default {
// fuzzy: false, // fuzzy: false,
// }, // },
{ {
name: "summaryTimeStart", name: 'summaryTimeStart',
type: "date", type: 'date',
label: "考勤开始时间", label: '考勤开始时间',
fuzzy: false, fuzzy: false
}, },
{ {
name: "summaryTimeEnd", name: 'summaryTimeEnd',
type: "date", type: 'date',
label: "考勤结束时间", label: '考勤结束时间',
fuzzy: false, fuzzy: false
}, },
{ {
name: "staffName", name: 'staffName',
type: "text", type: 'text',
label: "员工姓名", label: '员工姓名',
fuzzy: true, fuzzy: true
}, }
], ],
columns: [ columns: [
{ type: "selection", width: 60, fixed: "left", show: true }, { type: 'selection', width: 60, fixed: 'left', show: true },
{ {
type: "index", type: 'index',
label: "序号", label: '序号',
width: 50, width: 50,
fixed: "left", fixed: 'left',
show: true, show: true
}, },
{ {
label: "窗口类别", label: '窗口类别',
prop: "windowCategory", prop: 'windowCategory',
fixed: "left", fixed: 'left',
width: 100, width: 100,
formatter: this.formatter, formatter: this.formatter,
show: true, show: true
}, },
{ {
label: "员工姓名", label: '员工姓名',
prop: "staffName", prop: 'staffName',
fixed: "left", fixed: 'left',
width: 100, width: 100,
show: true, show: true
}, },
{ {
label: "大厅", label: '大厅',
prop: "salaName", prop: 'salaName',
formatter: this.formatter, formatter: this.formatter,
show: true, show: true
}, },
{ {
label: "部门", label: '部门',
prop: "deptName", prop: 'deptName',
formatter: this.formatter, formatter: this.formatter,
show: true, show: true
}, },
{ {
label: "应到", label: '应到',
prop: "workDays", prop: 'workDays',
formatter: this.formatter, formatter: this.formatter,
show: true, show: true
}, },
{ {
label: "实到", label: '实到',
prop: "goWorks", prop: 'goWorks',
formatter: (row) => { formatter: (row) => {
return row.goWorks == 0 ? 0 : row.goWorks ? row.goWorks : "--"; return row.goWorks == 0 ? 0 : row.goWorks ? row.goWorks : '--';
}, },
show: true, show: true
}, },
{ {
label: "出勤率%", label: '出勤率%',
prop: "attendanceRate", prop: 'attendanceRate',
formatter: (row) => { formatter: (row) => {
return row.attendanceRate return row.attendanceRate
? (Number(row.attendanceRate) * 100).toFixed(2) + "%" ? (Number(row.attendanceRate) * 100).toFixed(2) + '%'
: "--"; : '--';
}, },
show: true, show: true
}, },
{ {
label: "缺卡次数", label: '缺卡次数',
prop: "morningTimes", prop: 'morningTimes',
formatter: this.formatter, formatter: this.formatter,
show: true, show: true
}, },
// { // {
// label: "上午缺卡次数", // label: "上午缺卡次数",
...@@ -373,65 +339,65 @@ export default { ...@@ -373,65 +339,65 @@ export default {
// prop: "afternoonTimes", // prop: "afternoonTimes",
// formatter: this.formatter, // formatter: this.formatter,
// }, // },
{ label: "回单位(天)", prop: "backToUnit", show: true }, { label: '回单位(天)', prop: 'backToUnit', show: true },
{ label: "因公请假(天)", prop: "onDutyLeave", show: true }, { label: '因公请假(天)', prop: 'onDutyLeave', show: true },
{ label: "外出勘验(天)", prop: "outOfOffice", show: true }, { label: '外出勘验(天)', prop: 'outOfOffice', show: true },
{ label: "值班补班(天)", prop: "shiftCompensation", show: true }, { label: '值班补班(天)', prop: 'shiftCompensation', show: true },
{ label: "体检(天)", prop: "physicalExamination", show: true }, { label: '体检(天)', prop: 'physicalExamination', show: true },
{ label: "隔离(天)", prop: "quarantine", show: true }, { label: '隔离(天)', prop: 'quarantine', show: true },
{ {
label: "因公外出(与窗口工作无关/天)", label: '因公外出(与窗口工作无关/天)',
prop: "businessTrip", prop: 'businessTrip',
show: true, show: true,
width: 140, width: 140
}, },
{ label: "公休(天)", prop: "publicHoliday", show: true }, { label: '公休(天)', prop: 'publicHoliday', show: true },
{ label: "病假(天)", prop: "sickLeave", show: true }, { label: '病假(天)', prop: 'sickLeave', show: true },
{ label: "丧假(天)", prop: "funeralLeave", show: true }, { label: '丧假(天)', prop: 'funeralLeave', show: true },
{ label: "婚假(天)", prop: "marriageLeave", show: true }, { label: '婚假(天)', prop: 'marriageLeave', show: true },
{ label: "育儿假(天)", prop: "childRearingLeave", show: true }, { label: '育儿假(天)', prop: 'childRearingLeave', show: true },
{ {
label: "产假(陪护假/天)", label: '产假(陪护假/天)',
prop: "maternityLeave", prop: 'maternityLeave',
show: true, show: true,
width: 140, width: 140
}, },
{ {
label: "调回单位(或离职/天)", label: '调回单位(或离职/天)',
prop: "transferBack", prop: 'transferBack',
show: true, show: true,
width: 140, width: 140
}, },
{ label: "探亲假(天)", prop: "homeLeave", show: true }, { label: '探亲假(天)', prop: 'homeLeave', show: true },
{ label: "事假(天)", prop: "personalLeave", show: true }, { label: '事假(天)', prop: 'personalLeave', show: true },
{ label: "旷工(天)", prop: "absenteeismDays", show: true }, { label: '旷工(天)', prop: 'absenteeismDays', show: true },
{ label: "其他(天)", prop: "otherDays", show: true }, { label: '其他(天)', prop: 'otherDays', show: true },
{ {
label: "未按规定打卡(含忘记打卡)", label: '未按规定打卡(含忘记打卡)',
prop: "nonCompliancePunch", prop: 'nonCompliancePunch',
show: true, show: true,
width: 140, width: 140
}, },
{ label: "迟到(次)", prop: "lateTimes", show: true }, { label: '迟到(次)', prop: 'lateTimes', show: true }
// { label: "上网耍手机(次)", prop: "surfingMobileTimes", show: true }, // { label: "上网耍手机(次)", prop: "surfingMobileTimes", show: true },
...@@ -453,7 +419,7 @@ export default { ...@@ -453,7 +419,7 @@ export default {
//}, //},
//{ label: "会议早退", prop: "earlyLeaveMeeting", show: true }, //{ label: "会议早退", prop: "earlyLeaveMeeting", show: true },
], ]
}, },
// 设置表格展示项 // 设置表格展示项
setcolum: [], setcolum: [],
...@@ -469,7 +435,7 @@ export default { ...@@ -469,7 +435,7 @@ export default {
// 动态新增列表 // 动态新增列表
addColumn: [], addColumn: [],
// 获取表格表头列表 // 获取表格表头列表
initalArr: [], initalArr: []
}; };
}, },
created() { created() {
...@@ -489,9 +455,9 @@ export default { ...@@ -489,9 +455,9 @@ export default {
let hr = parseInt((msec / 1000 / 60 / 60) % 24); let hr = parseInt((msec / 1000 / 60 / 60) % 24);
let min = parseInt((msec / 1000 / 60) % 60); let min = parseInt((msec / 1000 / 60) % 60);
let sec = parseInt((msec / 1000) % 60); let sec = parseInt((msec / 1000) % 60);
min = min > 9 ? min : "0" + min; min = min > 9 ? min : '0' + min;
sec = sec > 9 ? sec : "0" + sec; sec = sec > 9 ? sec : '0' + sec;
this.restTime = min + "" + sec + ""; this.restTime = min + '' + sec + '';
const that = this; const that = this;
if (min >= 0 && sec >= 0) { if (min >= 0 && sec >= 0) {
if (min == 0 && sec == 0) { if (min == 0 && sec == 0) {
...@@ -500,7 +466,7 @@ export default { ...@@ -500,7 +466,7 @@ export default {
this.btnFreshLoading = false; this.btnFreshLoading = false;
this.showContent = true; this.showContent = true;
this.showTip = true; this.showTip = true;
this.freshDate = ""; this.freshDate = '';
this.getData(); this.getData();
return; return;
} }
...@@ -513,9 +479,9 @@ export default { ...@@ -513,9 +479,9 @@ export default {
submitFresh() { submitFresh() {
if (this.freshDate) { if (this.freshDate) {
this.submitLoad = true; this.submitLoad = true;
this.$post("/attendance/stat/summary", { this.$post('/attendance/stat/summary', {
attendanceDateStart: this.freshDate + "-01", attendanceDateStart: this.freshDate + '-01',
attendanceDateEnd: this.freshDate + "-31", attendanceDateEnd: this.freshDate + '-31'
}) })
.then((res) => { .then((res) => {
if (res.code == 1) { if (res.code == 1) {
...@@ -533,10 +499,10 @@ export default { ...@@ -533,10 +499,10 @@ export default {
this.btnFreshLoading = false; this.btnFreshLoading = false;
this.showContent = true; this.showContent = true;
this.showTip = true; this.showTip = true;
this.freshDate = ""; this.freshDate = '';
}); });
} else { } else {
this.$message.error("请选择时间!"); this.$message.error('请选择时间!');
} }
}, },
// 取消操作 // 取消操作
...@@ -544,7 +510,7 @@ export default { ...@@ -544,7 +510,7 @@ export default {
this.dialogOpen = false; this.dialogOpen = false;
this.btnFreshLoading = false; this.btnFreshLoading = false;
this.showContent = true; this.showContent = true;
this.freshDate = ""; this.freshDate = '';
}, },
// 手动更新 // 手动更新
handleRefresh() { handleRefresh() {
...@@ -567,9 +533,7 @@ export default { ...@@ -567,9 +533,7 @@ export default {
this.isdialog = false; this.isdialog = false;
} else { } else {
this.config.columns.forEach((v) => { this.config.columns.forEach((v) => {
v.prop && v.prop != "attendanceStaffStatEntities" v.prop && v.prop != 'attendanceStaffStatEntities' ? (v.show = false) : (v.show = true);
? (v.show = false)
: (v.show = true);
this.checkTableList.forEach((val) => { this.checkTableList.forEach((val) => {
if (v.prop == val) { if (v.prop == val) {
v.show = true; v.show = true;
...@@ -585,10 +549,10 @@ export default { ...@@ -585,10 +549,10 @@ export default {
// 处理createTime相同的数据 // 处理createTime相同的数据
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
for (let j = i + 1; j < arr.length; j++) { for (let j = i + 1; j < arr.length; j++) {
if (arr[i]["createTime"] == arr[j]["createTime"]) { if (arr[i]['createTime'] == arr[j]['createTime']) {
if (arr[i]["attendanceSummary"].indexOf("; ") == -1) { if (arr[i]['attendanceSummary'].indexOf('; ') == -1) {
arr[i]["attendanceSummary"] = arr[i]['attendanceSummary'] =
arr[i]["attendanceSummary"] + "; " + arr[j].attendanceSummary; arr[i]['attendanceSummary'] + '; ' + arr[j].attendanceSummary;
} }
} }
} }
...@@ -597,7 +561,7 @@ export default { ...@@ -597,7 +561,7 @@ export default {
let index = arr.findIndex((item) => item.createTime == currentTime); let index = arr.findIndex((item) => item.createTime == currentTime);
if (index > -1) { if (index > -1) {
return arr[index].attendanceSummary ? ( return arr[index].attendanceSummary ? (
arr[index].remark && arr[index].remark != "" ? ( arr[index].remark && arr[index].remark != '' ? (
<el-tooltip <el-tooltip
class="item" class="item"
effect="light" effect="light"
...@@ -606,30 +570,30 @@ export default { ...@@ -606,30 +570,30 @@ export default {
> >
<el-tag <el-tag
type={ type={
arr[index].attendanceSummary.includes("缺卡") || arr[index].attendanceSummary.includes('缺卡') ||
arr[index].attendanceSummary.includes("迟到") || arr[index].attendanceSummary.includes('迟到') ||
arr[index].attendanceSummary.includes("早退") arr[index].attendanceSummary.includes('早退')
? "danger" ? 'danger'
: "success" : 'success'
} }
size="mini" size="mini"
> >
{arr[index].attendanceSummary} {arr[index].attendanceSummary}
</el-tag> </el-tag>
</el-tooltip> </el-tooltip>
) : arr[index].attendanceSummary.includes("缺卡") || ) : arr[index].attendanceSummary.includes('缺卡') ||
arr[index].attendanceSummary.includes("迟到") || arr[index].attendanceSummary.includes('迟到') ||
arr[index].attendanceSummary.includes("早退") ? ( arr[index].attendanceSummary.includes('早退') ? (
<el-tag type={"danger"} size="mini"> <el-tag type={'danger'} size="mini">
{arr[index].attendanceSummary} {arr[index].attendanceSummary}
</el-tag> </el-tag>
) : ( ) : (
<el-tag type={"success"} size="mini"> <el-tag type={'success'} size="mini">
{arr[index].attendanceSummary} {arr[index].attendanceSummary}
</el-tag> </el-tag>
) )
) : ( ) : (
"--" '--'
); );
} else { } else {
// if (currentTime < timestampToTime(new Date(), 3)) { // if (currentTime < timestampToTime(new Date(), 3)) {
...@@ -637,7 +601,7 @@ export default { ...@@ -637,7 +601,7 @@ export default {
// } else { // } else {
// return "--"; // return "--";
// } // }
return "--"; return '--';
} }
}, },
// 重置表格 // 重置表格
...@@ -646,55 +610,44 @@ export default { ...@@ -646,55 +610,44 @@ export default {
}, },
// 重写获取数据后渲染 // 重写获取数据后渲染
afterRender(data) { afterRender(data) {
this.addColumn = getdiffdate( this.addColumn = getdiffdate(this.query.summaryTimeStart, this.query.summaryTimeEnd);
this.query.summaryTimeStart,
this.query.summaryTimeEnd
);
// 动态处理 // 动态处理
let addobjArr = []; let addobjArr = [];
this.addColumn.map((item, index) => { this.addColumn.map((item, index) => {
let obj = { let obj = {
show: true, show: true,
label: item + "(" + getMyDay(new Date(item)) + ")", label: item + '(' + getMyDay(new Date(item)) + ')',
width: 100, width: 100,
formatter: (row) => { formatter: (row) => {
if ( if (row.attendanceStaffStatEntities && row.attendanceStaffStatEntities.length > 0) {
row.attendanceStaffStatEntities &&
row.attendanceStaffStatEntities.length > 0
) {
return this.handleArr(row.attendanceStaffStatEntities, item); return this.handleArr(row.attendanceStaffStatEntities, item);
} else { } else {
return "--"; return '--';
if (item < timestampToTime(new Date(), 3)) { if (item < timestampToTime(new Date(), 3)) {
return "正常"; return '正常';
} else { } else {
return "--"; return '--';
} }
} }
}, }
}; };
addobjArr.push(obj); addobjArr.push(obj);
}); });
let arr1 = this.initalArr.slice(0, 8); let arr1 = this.initalArr.slice(0, 8);
let arr2 = this.initalArr.slice(8); let arr2 = this.initalArr.slice(8);
this.config.columns = [...arr1, ...addobjArr, ...arr2]; this.config.columns = [...arr1, ...addobjArr, ...arr2];
this.$refs.layoutTable.showType = "tableSelect"; this.$refs.layoutTable.showType = 'tableSelect';
this.$forceUpdate(); this.$forceUpdate();
}, },
// 重写获取数据前渲染 // 重写获取数据前渲染
beforeRender(row) { beforeRender(row) {
this.tableData.dict = row.dict; this.tableData.dict = row.dict;
row.data.forEach((element) => { row.data.forEach((element) => {
if ( if (element.attendanceStaffStatEntities && element.attendanceStaffStatEntities.length > 0) {
element.attendanceStaffStatEntities &&
element.attendanceStaffStatEntities.length > 0
) {
element.attendanceStaffStatEntities.forEach((item1) => { element.attendanceStaffStatEntities.forEach((item1) => {
item1.createTime = timestampToTime(item1.createTime, 3); item1.createTime = timestampToTime(item1.createTime, 3);
let Arr = []; let Arr = [];
item1.remark && item1.remark.length > 0 item1.remark && item1.remark.length > 0 ? (Arr = JSON.parse(item1.remark)) : '';
? (Arr = JSON.parse(item1.remark))
: "";
Arr && Arr.length > 0 Arr && Arr.length > 0
? (item1.content = Arr.map((v) => { ? (item1.content = Arr.map((v) => {
return ( return (
...@@ -704,8 +657,8 @@ export default { ...@@ -704,8 +657,8 @@ export default {
打卡时间: 打卡时间:
{v.goWorkDate {v.goWorkDate
? (v.goWorkDate = timestampToTime(v.goWorkDate, 6)) ? (v.goWorkDate = timestampToTime(v.goWorkDate, 6))
: (v.goWorkDate = "--")} : (v.goWorkDate = '--')}
{" "} 打卡结果: {' '} 打卡结果:
{this.tableData.dict.goWorkResult[v.goWorkResult]} {this.tableData.dict.goWorkResult[v.goWorkResult]}
</span> </span>
) : ( ) : (
...@@ -713,8 +666,8 @@ export default { ...@@ -713,8 +666,8 @@ export default {
打卡时间: 打卡时间:
{v.goWorkDate {v.goWorkDate
? (v.goWorkDate = timestampToTime(v.goWorkDate, 6)) ? (v.goWorkDate = timestampToTime(v.goWorkDate, 6))
: (v.goWorkDate = "--")} : (v.goWorkDate = '--')}
{" "} 打卡结果: {' '} 打卡结果:
{this.tableData.dict.goWorkResult[v.goWorkResult]} {this.tableData.dict.goWorkResult[v.goWorkResult]}
</span> </span>
)} )}
...@@ -722,31 +675,25 @@ export default { ...@@ -722,31 +675,25 @@ export default {
<span> <span>
打卡时间: 打卡时间:
{v.offWorkDate {v.offWorkDate
? (v.offWorkDate = timestampToTime( ? (v.offWorkDate = timestampToTime(v.offWorkDate, 6))
v.offWorkDate, : (v.offWorkDate = '--')}
6 {' '} 打卡结果:
))
: (v.offWorkDate = "--")}
{" "} 打卡结果:
{this.tableData.dict.offWorkResult[v.offWorkResult]} {this.tableData.dict.offWorkResult[v.offWorkResult]}
</span> </span>
) : ( ) : (
<span style="color:red"> <span style="color:red">
打卡时间: 打卡时间:
{v.offWorkDate {v.offWorkDate
? (v.offWorkDate = timestampToTime( ? (v.offWorkDate = timestampToTime(v.offWorkDate, 6))
v.offWorkDate, : (v.offWorkDate = '--')}
6 {' '} 打卡结果:
))
: (v.offWorkDate = "--")}
{" "} 打卡结果:
{this.tableData.dict.offWorkResult[v.offWorkResult]} {this.tableData.dict.offWorkResult[v.offWorkResult]}
</span> </span>
)} )}
</p> </p>
); );
})) }))
: ""; : '';
}); });
} }
}); });
...@@ -769,20 +716,12 @@ export default { ...@@ -769,20 +716,12 @@ export default {
setdialog(i) { setdialog(i) {
if (i == 1) { if (i == 1) {
this.isdialog = true; this.isdialog = true;
this.setcolum = this.config.columns.filter( this.setcolum = this.config.columns.filter((item) => item.label && item.prop);
(item) => item.label && item.prop this.setcolum = this.setcolum.filter((val) => val.prop !== 'attendanceStaffStatEntities');
);
this.setcolum = this.setcolum.filter(
(val) => val.prop !== "attendanceStaffStatEntities"
);
} else { } else {
this.setDialog = true; this.setDialog = true;
this.setcolum = this.config.columns.filter( this.setcolum = this.config.columns.filter((item) => item.label && item.prop);
(item) => item.label && item.prop this.setcolum = this.setcolum.filter((val) => val.prop !== 'attendanceStaffStatEntities');
);
this.setcolum = this.setcolum.filter(
(val) => val.prop !== "attendanceStaffStatEntities"
);
this.checkTableList = this.config.columns.map((item) => { this.checkTableList = this.config.columns.map((item) => {
if (item.show) { if (item.show) {
return item.prop; return item.prop;
...@@ -805,17 +744,17 @@ export default { ...@@ -805,17 +744,17 @@ export default {
} }
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params['idList'] = this.selection;
} }
if (this.checkList.length > 0) { if (this.checkList.length > 0) {
params["properties"] = this.checkList; params['properties'] = this.checkList;
} }
this.$download( this.$download(
"/attendance/stat/exportExcelExt", '/attendance/stat/exportExcelExt',
{ {
...params, ...params
}, },
{ type: "excel", name: "考勤汇总" } { type: 'excel', name: '考勤汇总' }
) )
.then(() => { .then(() => {
this.isExport = false; this.isExport = false;
...@@ -825,13 +764,12 @@ export default { ...@@ -825,13 +764,12 @@ export default {
this.isExport = false; this.isExport = false;
this.$message.error(error.message); this.$message.error(error.message);
}); });
}, }
}, }
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.hisList { .hisList {
padding: 15px; padding: 15px;
.list { .list {
......
...@@ -59,13 +59,7 @@ ...@@ -59,13 +59,7 @@
</el-col> </el-col>
<el-col :span="18" :xs="12"> <el-col :span="18" :xs="12">
<el-row> <el-row>
<LayoutTable <LayoutTable notDel notAdd :data="tableData" :config="tableConfig" ref="layoutTable">
notDel
notAdd
:data="tableData"
:config="tableConfig"
ref="layoutTable"
>
<el-button <el-button
type="primary" type="primary"
@click="doExport" @click="doExport"
...@@ -74,57 +68,36 @@ ...@@ -74,57 +68,36 @@
slot="table-head-left2" slot="table-head-left2"
>导出</el-button >导出</el-button
> >
<el-dropdown <el-dropdown class="moreControll" slot="table-head-left2" style="margin-left: 20px">
class="moreControll"
slot="table-head-left2"
style="margin-left: 20px"
>
<el-button type="primary" size="mini"> <el-button type="primary" size="mini">
更多操作<i class="el-icon-arrow-down el-icon--right"></i> 更多操作<i class="el-icon-arrow-down el-icon--right"></i>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item> <el-dropdown-item>
<el-button type="text" @click="syncPerson" <el-button type="text" @click="syncPerson">同步数据</el-button>
>同步数据</el-button
>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item> <el-dropdown-item>
<el-button type="text" @click="handleImport" <el-button type="text" @click="handleImport">导入花名册</el-button>
>导入花名册</el-button
>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item> <el-dropdown-item>
<el-button type="text" @click="lookDetailHis" <el-button type="text" @click="lookDetailHis">历史花名册</el-button>
>历史花名册</el-button
>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item> <el-dropdown-item>
<el-button type="text" @click="SelectEXport" <el-button type="text" @click="SelectEXport">自定义列表字段</el-button>
>自定义列表字段</el-button
>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<span class="freshTime" slot="table-head-left2"> <span class="freshTime" slot="table-head-left2">
<i class="el-icon-refresh"></i> <i class="el-icon-refresh"></i>
<span <span>上次同步时间:{{ tableData.staff ? tableData.staff.refreshDate : '--' }}</span>
>上次同步时间:{{
tableData.staff ? tableData.staff.refreshDate : "--"
}}</span
>
</span> </span>
</LayoutTable> </LayoutTable>
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
<!-- 导入对话框 --> <!-- 导入对话框 -->
<el-dialog <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload <el-upload
ref="upload" ref="upload"
:limit="1" :limit="1"
...@@ -144,10 +117,7 @@ ...@@ -144,10 +117,7 @@
</div> </div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据 <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据
<el-link <el-link type="primary" style="font-size: 14px" @click="downloadTemplate"
type="primary"
style="font-size: 14px"
@click="downloadTemplate"
>下载模板</el-link >下载模板</el-link
> >
</div> </div>
...@@ -176,15 +146,9 @@ ...@@ -176,15 +146,9 @@
<!-- 表格设置 --> <!-- 表格设置 -->
<el-dialog :visible.sync="isdialog" title="自定义列表字段设置"> <el-dialog :visible.sync="isdialog" title="自定义列表字段设置">
<div class="tipsword"> <div class="tipsword">请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。</div>
请选择表格展示字段,导出的表格中的内容选中的字段将保持一致。
</div>
<el-checkbox-group v-model="checkList"> <el-checkbox-group v-model="checkList">
<el-checkbox <el-checkbox v-for="(item, index) in setcolum" :key="index" :label="item.label">
v-for="(item, index) in setcolum"
:key="index"
:label="item.label"
>
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<div class="mt20" style="text-align: right"> <div class="mt20" style="text-align: right">
...@@ -193,35 +157,156 @@ ...@@ -193,35 +157,156 @@
</div> </div>
</el-dialog> </el-dialog>
<drawer-show <drawer-show ref="drawerform" @ok="getData" :bumentree="areaData" :currentNode="currentNode" />
ref="drawerform"
@ok="getData"
:bumentree="areaData"
:currentNode="currentNode"
/>
</div> </div>
</template> </template>
<script> <script>
import { timestampToTime } from "@/assets/utils/dateFormat.js"; import { timestampToTime } from '@/assets/utils/dateFormat.js';
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import drawerShow from "./drawershow"; import drawerShow from './drawershow';
import table from "@/assets/mixins/table"; import table from '@/assets/mixins/table';
import tree from "@/assets/mixins/tree"; import tree from '@/assets/mixins/tree';
import TabPane from "@/components/tabPane.vue"; import TabPane from '@/components/tabPane.vue';
export default { export default {
name: "StaffList", name: 'StaffList',
components: { components: {
drawerShow, drawerShow,
TabPane, TabPane
}, },
mixins: [table, tree], mixins: [table, tree],
data() {
return {
// 用户导入参数
upload: {
headers: {
Authorization: window.sessionStorage.getItem('token') || ''
},
// 是否显示弹出层(员工关怀信息导入)
open: false,
// 弹出层标题(员工关怀信息导入)
title: '导入花名册数据',
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的数据
updateSupport: 0,
// 上传的地址
url: process.env.VUE_APP_API_BASE_URL + '/staff/importData'
},
config: {
showType: 'tableSelect',
search: [
{
name: 'name',
type: 'text',
label: '员工姓名',
fuzzy: true
},
{
name: 'phoneNumber',
type: 'text',
label: '手机号',
fuzzy: true
}
],
columns: [
{ type: 'selection', width: 60, show: true },
{ type: 'index', label: '序号', width: 50, show: true },
{ label: '员工姓名', prop: 'name', show: true },
{ label: '工号', prop: 'workNum', show: true },
{ label: '部门', prop: 'deptName', show: true },
{
label: '职位',
prop: 'positionName',
formatter: this.formatters,
show: true
},
{
label: '员工类型',
prop: 'staffType',
formatter: this.formatterType,
show: true
},
{
label: '员工状态',
prop: 'status',
formatter: this.formatter,
show: true
},
{
label: '是否在政务中心',
prop: 'source',
formatter: this.formatterSource,
show: true
}, //未对
{
label: '手机号',
prop: 'phoneNumber',
formatter: this.formatters,
show: true
},
{
label: '操作',
width: 240,
show: true,
formatter: (row) => {
return (
// <table-buttons
// noAdd
// noDel
// noEdit
// row={row}
// onView={this.toView}
// onEdit={this.toEdit}
// />
<table-buttons
noAdd
noAuth
noDel
noEdit
row={row}
onView={this.toView}
onEdit={this.toEdit}
/>
);
}
}
],
isshowTabPane: false
},
isshowHome: false,
personData: [],
// 导出加载状态
isExport: false,
// 人员信息
staffInfo: {},
// 历史记录
drawerhistory: false,
// 选中列表
checkList: [],
// 初始数组
setcolum: [],
// 弹窗是否显示
isdialog: false
};
},
computed: {
thirdList() {
if (!this.$store.state.CurrentThirdArr) return [];
return this.$store.state.CurrentThirdArr;
},
activeName() {
return this.$store.state.ThirdPath;
}
},
created() { created() {
this.$post("/dept/treeselect", {}).then(({ data }) => { this.$post('/dept/treeselect', {}).then(({ data }) => {
this.areaData = data.result; this.areaData = data.result;
}); });
}, },
methods: { methods: {
// 弹窗内确认事件
handleOk() { handleOk() {
this.config.columns.forEach((v) => { this.config.columns.forEach((v) => {
v.prop ? (v.show = false) : (v.show = true); v.prop ? (v.show = false) : (v.show = true);
...@@ -237,9 +322,7 @@ export default { ...@@ -237,9 +322,7 @@ export default {
}, },
// 自定义字段 // 自定义字段
SelectEXport() { SelectEXport() {
this.setcolum = this.config.columns.filter( this.setcolum = this.config.columns.filter((item) => item.label && item.prop);
(item) => item.label && item.prop
);
console.log(this.config.columns); console.log(this.config.columns);
this.checkList = this.setcolum.map((v) => { this.checkList = this.setcolum.map((v) => {
if (v.show) { if (v.show) {
...@@ -250,7 +333,7 @@ export default { ...@@ -250,7 +333,7 @@ export default {
}, },
/** 同步 */ /** 同步 */
syncPerson() { syncPerson() {
this.$post("/staff/syncPersons", {}).then((res) => { this.$post('/staff/syncPersons', {}).then((res) => {
if (res.code == 1) { if (res.code == 1) {
this.$message.success(res.msg); this.$message.success(res.msg);
} }
...@@ -258,14 +341,14 @@ export default { ...@@ -258,14 +341,14 @@ export default {
}, },
/** 导入 */ /** 导入 */
handleImport() { handleImport() {
this.upload.title = "员工导入"; this.upload.title = '员工导入';
this.upload.open = true; this.upload.open = true;
}, },
handleClick(key) { handleClick(key) {
console.log(key); console.log(key);
this.$store.commit("setThirdPath", key); this.$store.commit('setThirdPath', key);
this.$router.push({ this.$router.push({
path: key, path: key
}); });
}, },
/** 重写新增方法 */ /** 重写新增方法 */
...@@ -283,13 +366,13 @@ export default { ...@@ -283,13 +366,13 @@ export default {
// this.personData = row // this.personData = row
// this.isshowHome = true // this.isshowHome = true
this.$router.push({ this.$router.push({
path: "/staff/view", path: '/staff/view',
query: { query: {
id: row.id, id: row.id
}, }
}); });
}, },
// 节点点击事件
handleNodeClick(node) { handleNodeClick(node) {
this.currentNode = node; this.currentNode = node;
this.query = Object.assign({}, this.query, { deptId: node.id }); this.query = Object.assign({}, this.query, { deptId: node.id });
...@@ -297,11 +380,12 @@ export default { ...@@ -297,11 +380,12 @@ export default {
this.$router.push({ this.$router.push({
path: this.$route.path, path: this.$route.path,
query: { query: {
page: 1, page: 1
}, }
}); });
this.getData(); this.getData();
}, },
// 导出操作
doExport() { doExport() {
this.isExport = true; this.isExport = true;
let params = {}; let params = {};
...@@ -311,14 +395,14 @@ export default { ...@@ -311,14 +395,14 @@ export default {
} }
} }
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params['idList'] = this.selection;
} }
this.$download( this.$download(
"/staff/exportExcel", '/staff/exportExcel',
{ {
...params, ...params
}, },
{ type: "excel" } { type: 'excel' }
) )
.then(() => (this.isExport = false)) .then(() => (this.isExport = false))
.catch((error) => { .catch((error) => {
...@@ -329,7 +413,7 @@ export default { ...@@ -329,7 +413,7 @@ export default {
/** 下载模板操作 */ /** 下载模板操作 */
downloadTemplate() { downloadTemplate() {
this.isExport = true; this.isExport = true;
this.$download("/staff/downloadTemplate", {}, { type: "excel" }) this.$download('/staff/downloadTemplate', {}, { type: 'excel' })
.then(() => (this.isExport = false)) .then(() => (this.isExport = false))
.catch((error) => { .catch((error) => {
this.isExport = false; this.isExport = false;
...@@ -344,132 +428,12 @@ export default { ...@@ -344,132 +428,12 @@ export default {
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
}, },
// 获取数据后处理数据
afterRender(data) { afterRender(data) {
this.tableData.staff.refreshDate = timestampToTime( this.tableData.staff.refreshDate = timestampToTime(this.tableData.staff.refreshDate, 6);
this.tableData.staff.refreshDate, this.$refs.layoutTable.showType = 'tableSelect';
6 }
); }
this.$refs.layoutTable.showType = "tableSelect";
},
},
data() {
return {
// 用户导入参数
upload: {
headers: {
Authorization: window.sessionStorage.getItem("token") || "",
},
// 是否显示弹出层(员工关怀信息导入)
open: false,
// 弹出层标题(员工关怀信息导入)
title: "导入花名册数据",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的数据
updateSupport: 0,
// 上传的地址
url: process.env.VUE_APP_API_BASE_URL + "/staff/importData",
},
config: {
showType: "tableSelect",
search: [
{
name: "name",
type: "text",
label: "员工姓名",
fuzzy: true,
},
{
name: "phoneNumber",
type: "text",
label: "手机号",
fuzzy: true,
},
],
columns: [
{ type: "selection", width: 60, show: true },
{ type: "index", label: "序号", width: 50, show: true },
{ label: "员工姓名", prop: "name", show: true },
{ label: "工号", prop: "workNum", show: true },
{ label: "部门", prop: "deptName", show: true },
{
label: "职位",
prop: "positionName",
formatter: this.formatters,
show: true,
},
{
label: "员工类型",
prop: "staffType",
formatter: this.formatterType,
show: true,
},
{
label: "员工状态",
prop: "status",
formatter: this.formatter,
show: true,
},
{
label: "是否在政务中心",
prop: "source",
formatter: this.formatterSource,
show: true,
}, //未对
{
label: "手机号",
prop: "phoneNumber",
formatter: this.formatters,
show: true,
},
{
label: "操作",
width: 240,
show: true,
formatter: (row) => {
return (
// <table-buttons
// noAdd
// noDel
// noEdit
// row={row}
// onView={this.toView}
// onEdit={this.toEdit}
// />
<table-buttons
noAdd
noAuth
noDel
noEdit
row={row}
onView={this.toView}
onEdit={this.toEdit}
/>
);
},
},
],
isshowTabPane: false,
},
isshowHome: false,
personData: [],
isExport: false,
staffInfo: {},
drawerhistory: false,
checkList: [],
setcolum: [],
isdialog: false,
};
},
computed: {
thirdList() {
if (!this.$store.state.CurrentThirdArr) return [];
return this.$store.state.CurrentThirdArr;
},
activeName() {
return this.$store.state.ThirdPath;
},
},
}; };
</script> </script>
...@@ -547,18 +511,12 @@ export default { ...@@ -547,18 +511,12 @@ export default {
} }
.mytree ::v-deep { .mytree ::v-deep {
.el-tree--highlight-current .el-tree--highlight-current ::v-deep .el-tree-node.is-checked > .el-tree-node__content {
::v-deep
.el-tree-node.is-checked
> .el-tree-node__content {
background-color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);
color: rgb(64, 158, 255); color: rgb(64, 158, 255);
} }
.el-tree--highlight-current .el-tree--highlight-current ::v-deep .el-tree-node.is-current > .el-tree-node__content {
::v-deep
.el-tree-node.is-current
> .el-tree-node__content {
background-color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);
color: rgb(64, 158, 255); color: rgb(64, 158, 255);
} }
...@@ -594,7 +552,7 @@ export default { ...@@ -594,7 +552,7 @@ export default {
} }
.el-tree-node:before { .el-tree-node:before {
content: ""; content: '';
left: -4px; left: -4px;
position: absolute; position: absolute;
right: auto; right: auto;
...@@ -602,7 +560,7 @@ export default { ...@@ -602,7 +560,7 @@ export default {
} }
.el-tree-node:after { .el-tree-node:after {
content: ""; content: '';
left: -4px; left: -4px;
position: absolute; position: absolute;
right: auto; right: auto;
...@@ -631,7 +589,7 @@ export default { ...@@ -631,7 +589,7 @@ export default {
align-items: center; align-items: center;
} }
.titles::before { .titles::before {
content: ""; content: '';
width: 6px; width: 6px;
height: 16px; height: 16px;
background-color: #409eff; background-color: #409eff;
......
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