<template>
    <div class="page">
        <LayoutTable :data="tableData" :config="tableConfig" notDel notAdd>
            <el-button
                slot="table-head-left2"
                style="margin-left: 10px"
                size="mini"
                type="primary"
                @click="morehandle"
            >批量处理</el-button>
        </LayoutTable>
        <dialog-show ref="dialogform" @ok="getData" />
    </div>
</template>

<script>
    /** 表单弹出框模式需引入 */
    import dialogShow from "./dialogshow";
    import table from "@/assets/mixins/table";
    export default {
        name: "AttendanceRecordErrorList",
        components: {
            dialogShow
},
        mixins: [table],
        created() {
        },
        methods: {
            /** 重写新增方法 */
            toAdd(row) {
                this.$refs.dialogform.add(row);
            },
            /** 重写编辑方法 */
            toEdit(row) {
                this.$refs.dialogform.edit(row);
            },
            /** 重写查看方法 */
            toView(row) {
                this.$refs.dialogform.view(row);
            },
            morehandle(){
                console.log(this.selection)
            },
            // 处理
            handle(err){
                console.log(err)
            },
            // 撤销
            reCancle(err){
                console.log(err)
            }
        },
        data() {
            return {
                config: {
                    isshowTabPane:true,
                    search: [
                        {
                            name: "deptId",
                            type: "select",
                            label: "全部部门",
                            fuzzy: true
                        },
                        {
                            name: "deptId",
                            type: "select",
                            label: "全部考勤组",
                            fuzzy: true
                        },
                        {
                            name: "deptId",
                            type: "select",
                            label: "全部班次",
                            fuzzy: true
                        },
                        {
                            name: "errorStatus",
                            type: "select",
                            label: "全部异常状态",
                            fuzzy: true
                        },
                        {
                            name: "errorStatus",
                            type: "select",
                            label: "全部处理状态",
                            fuzzy: true
                        },
                        {
                            name:'startTime',
                            type: "date",
                            valueFormat:'YYYY-dd-MM',
                            label: "考勤开始时间",
                            fuzzy: true
                        },
                        {
                            name:'endTime',
                            type: "date",
                            valueFormat:'YYYY-dd-MM',
                            label: "考勤结束时间",
                            fuzzy: true
                        },
                        {
                            name: "staffName",
                            type: "text",
                            label: "员工姓名",
                            fuzzy: true
                        },
                        {
                            name: "phoneNumber",
                            type: "text",
                            label: "手机号",
                            fuzzy: true
                        },
                    ],
                    columns: [
                        {type: "selection", width: 60},
                        {type: "index",label: "序号",width: 50},

                        {label: "员工姓名", prop: "staffName"},
                        {label: "工号", prop: "staffName"},
                        {label: "部门", prop: "staffName"},
                        {label: "考勤组", prop: "staffName"},
                        {label: "班次", prop: "staffName"},
                        {label: "异常状态", prop: "errorStatus",formatter: this.formatter},
                        {label: "异常时间", prop: "errorDateTime", formatter: this.formatterDate},
                        {label: "处理结果", prop: "errorDateTime", formatter: this.formatterDate},
                        {label: "上下班时间", prop: "goOffDateTime", formatter: this.formatterDate},
                        {label: "实际打卡时间", prop: "actualAttendanceDateTime", formatter: this.formatterDate},
                        {label: "处理时间", prop: "operDateTime", formatter: this.formatterDate},
                        {label: "处理状态", prop: "processStatus",formatter: this.formatter},
                        {label: "处理人", prop: "processStatus",formatter: this.formatter},
                        {label: "备注", prop: "createUserId", formatter: this.formatter},
                        {
                            label: "操作",
                            width: 240,
                            formatter: row => {
                                return (
                                    <span>
                                        <el-button type="text" size='mini' onClick={(row) => {
                                            this.handle(row)
                                        }}>处理</el-button>
                                        <el-button type="text" size='mini' onClick={(row) => {
                                            this.reCancle(row)
                                        }}>撤销</el-button>
                                    </span>
                                )
                            }
                        }
                    ]
                }
            };
        }
    };
</script>