<template>
    <div>
        <el-card>
            <div slot="header" class="clearfix">
                <span>科室预算审批基本信息</span>
            </div>
            <el-form ref="form" :model="infoForm" :rules="rules" label-width="100px">
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item label="科室">
                            <el-input :value="infoForm.deptName"></el-input>
                        </el-form-item>
                        <el-form-item label="填报人">
                            <el-input :value="infoForm.informant"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="分管领导">
                            <el-input :value="infoForm.leadershipName"></el-input>
                        </el-form-item>
                        <el-form-item label="填报时间">
                            <el-input :value="infoForm.tbTime"></el-input>
                        </el-form-item>
                    </el-col>

                </el-row>
            </el-form>
        </el-card>
        <TaskResolve v-if="!$attrs.readOnly" :taskId="this.$attrs.taskId" :instanceId="instanceId" :id="id"
            v-on="this.$listeners"></TaskResolve>

    </div>
</template>

<script>
import {
    queryDepart,//查看本单位预算填报列表;
} from '@/api/smartSchool/officialWork/budgetFilling'
import TaskResolve from "@/views/smartSchool/indexMould/myTask/depBudgetapproval/components/detaskResolve.vue"

export default {
    name: "deinfo",
    dicts: ['biz_leave_type', 'course_num'],
    components: { TaskResolve },
    props: {
        id: {
            type: [String, Number],
            default: ''
        },
        row: {},
        instanceId: {
            type: [String, Number],
            default: ''
        },

    },
    data() {
        const limitStartTime = {
            disabledDate: time => {
                if (this.infoForm.realityEndTime) {
                    return Date.parse(time) > Date.parse(this.infoForm.realityEndTime);
                }
                return false;
                // return Date.parse(time) < Date.parse(new Date());
            }
        };
        const limitEndTime = {
            disabledDate: time => {
                if (this.infoForm.realityStartTime) {
                    return Date.parse(time) < Date.parse(this.infoForm.realityStartTime);
                }
                return false;
            }
        };
        return {
            disable: true,
            limitEndTime,
            limitStartTime,
            infoForm: {},
            rules: {
                realityStartTime: [
                    { required: true, message: '实际开始时间不能为空', trigger: 'change' }
                ],
                realityEndTime: [
                    { required: true, message: '实际结束时间不能为空', trigger: 'change' }
                ]
            },

        }
    },
    created() {
        this.getDetailInfo();
    },
    methods: {
        /** 获取详情 */
        getDetailInfo() {
            queryDepart(this.id).then(res => {
                this.infoForm = res.data
            })
        },

        /** 销假 */
        // handleRevoke() {
        //   this.$refs.form.validate(valid => {
        //     if (valid) {
        //       this.$modal.loading('正在销假，请稍等...');
        //       cancelLeave(this.$attrs.taskId, this.infoForm).then(response => {
        //         this.$modal.closeLoading();
        //         this.$message.success('销假成功');
        //         this.$emit('submit');
        //       }).catch(error => {
        //         this.$modal.closeLoading();
        //       })
        //     }
        //   })
        // }
    }
}
</script>

<style scoped></style>
