<template>
    <!-- 弹出框表单 -->
    <el-drawer
            title="批量处理"
            :visible.sync="open"
            :direction="direction"
            size="50%">
        <div style="padding:20px;font-size:15px">
            <div>
                已选择{{selection.length}}个：
            </div>
            <div class="staffList mt20">
                <div v-for="item in selection" :key="item" class="mt10">
                    将<span> {{item.staffName}} </span>
                    <span>的 {{item.goOrOff}} 时间 {{item.goOffDateTime}} 打卡异常状态</span>
                    <span class="ml10" style="color:#f56c6c">
                        <!-- {{dict['errorStatus'][item.errorStatus]}} -->
                    </span>
                    <span class="ml10">修改为</span>
                </div>
                <div class="mt10">
                    <!-- 处理异常状态 -->
                    <el-select>
                        <el-option></el-option>
                    </el-select>
                    <!-- 早退/迟到 -->
                    <el-input style="width:220px" placeholder="请输入数字" :maxlength="4"
                    class="ml20" type="number">
                        <template slot="append">分钟</template>
                    </el-input>
                </div>
                <div class="mt10">
                    <span>备注：</span>
                    <el-input placeholder="请输入备注" type="textarea" show-word-limit class="mt10"
                     :maxlength="50" v-model="dealParams.remark"></el-input>
                </div>
            </div>            
        </div>

    </el-drawer>
</template>

<script>
    import form from "@/assets/mixins/formdialog";
    export default {
        name: "AttendanceRecordDetail",
        mixins: [form],
        components: {

        },
        created() {
            this.changePath("attendance/record")
        },
        data() {
            return {
                // 遮罩层
                loading: true,
                // 弹出层标题
                title: "考勤打卡记录信息",
                // 是否显示弹出层
                open: false,
                direction:"rtl",
                // 表单校验
                rules: {
                    staffName: [
                        {required: true,message: "请输入员工姓名", trigger: "blur" },
                        {max: 64,message: "最多只能录入64个字符",trigger: "blur",},
                    ],
                    createTime: [
                        {required: true,message: "请选择创建时间" },
                    ],
                },
                dealParams:{
                    remark:'',
                    errorStatus:''
                },
                selection:[]
            }
        },

        methods: {
            // 渲染前置处理
            beforeRender(data) {
                return data
            },
            /** 编辑 */
            edit(row,selection) {
                console.log(row,selection)
                if(this.selection.length<1){
                    this.selection = [row]
                }else{
                    this.selection = selection
                }
                this.open = true
                this.query = { id: row.id };
                this.urls.currUrl ="attendance/record/error/edit";
                this.getData();
                this.pageInfo.type="edit"
                this.title = "处理异常";
            },
            /**取消按钮 */
            cancel() {
                this.open = false;
            },
            /**获取数据后弹框 */
            afterRender(data) {
                console.log(data)
                this.open = true;
            },

            afterSubmit(data) {
                this.open = false;
                this.$emit("ok");
            }
        }
    }
</script>
