<template>
    <!-- 弹出框表单 -->
    <el-drawer
            :title="title"
            :visible.sync="open"
            :direction="direction"
            size="50%">
        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
            <el-row>
                                            <Field label="部门id" prop="deptId" v-model="form.deptId" placeholder="请输入部门id"/>
                            <Field label="部门名称" prop="deptName" v-model="form.deptName" type="textarea" placeholder="请输入部门名称"/>
                            <Field label="考勤绩效指标数量" prop="attendCount" v-model="form.attendCount" placeholder="请输入考勤绩效指标数量"/>
                            <Field label="评价绩效指标数量" prop="assessCount" v-model="form.assessCount" placeholder="请输入评价绩效指标数量"/>
                            <Field label="办件绩效指标数量" prop="workCount" v-model="form.workCount" placeholder="请输入办件绩效指标数量"/>
                            <Field label="效能绩效指标数量" prop="effectCount" v-model="form.effectCount" placeholder="请输入效能绩效指标数量"/>
                            <Field label="其它绩效指标数量" prop="otherCount" v-model="form.otherCount" placeholder="请输入其它绩效指标数量"/>
                            <Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>

            </el-row>

            <form-buttons @submit='submitForm' noCancelBtn />
        </el-form>

    </el-drawer>
</template>

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

        },
        created() {
            this.changePath("perform/dept/conf")
        },
        data() {
            return {
                // 遮罩层
                loading: true,
                // 弹出层标题
                title: "部门自动考核信息",
                // 是否显示弹出层
                open: false,
                direction:"rtl",
                toString:[
                ],
                toDate:[
                ],
                // 表单校验
                rules: {
                }
            };
        },

        methods: {
            /** 编辑 */
            edit(row) {
                this.reset()
                this.query = { id: row.id };
                this.urls.currUrl ="perform/dept/conf/edit";
                this.getData();
                this.pageInfo.type="edit"
                this.title = "修改部门自动考核信息";
            },
            /** 新增 */
            add(row) {
                this.reset()
                this.urls.currUrl = "perform/dept/conf/add";
                this.getData();
                this.pageInfo.type="add"
                this.title = "新增部门自动考核信息";
            },
            /** 查看*/
            view(row) {
                this.reset()
                this.query = { id: row.id };
                this.urls.currUrl ="perform/dept/conf/view";
                this.getData();
                this.pageInfo.type="view"
                this.title = "部门自动考核信息详细";
            },
            /**取消按钮 */
            cancel() {
                this.open = false;
            },
            /**获取数据后弹框 */
            afterRender(data) {
                this.open = true;
            },

            afterSubmit(data) {
                this.open = false;
                this.$emit("ok");
            },

            // 表单重置
            reset() {
                this.form = {
                    deptId : null,
                    deptName : "",
                    attendCount : null,
                    assessCount : null,
                    workCount : null,
                    effectCount : null,
                    otherCount : null,
                    remark : "",
                };
                this.resetForm("form");
            },
            resetForm(refName) {
                if (this.$refs[refName]) {
                    this.$refs[refName].resetFields();
                }
            },
        },
    };
</script>
