<template>
    <div class="prject-attendance-drawer">
        <el-drawer v-if="isOpen" :visible.sync="isOpen" direction="rtl" size="400" style="padding-left: 20px;">
            <template slot="title">
                <div>{{ title + ' 【今日出勤】' }}</div>
            </template>
            <el-form label-width="120px" ref="frm1" :model="formData" :rules="rules">
                <el-form-item label="劳务人员" prop="servicePersonnel">
          
          <el-input-number v-model="formData.servicePersonnel"  :min="0" :max="10000" label="请输入劳务人员"></el-input-number>
        </el-form-item>
        <el-form-item label="管理人员" prop="supervisorPersonnel">
          
          <el-input-number v-model="formData.supervisorPersonnel"  :min="0" :max="10000" label="请输入管理人员"></el-input-number>
        </el-form-item>
        <el-form-item label="总包人员" prop="contractorPersonnel">
          
          <el-input-number v-model="formData.contractorPersonnel"  :min="0" :max="10000" label="请输入总包人员"></el-input-number>
        </el-form-item>
            </el-form>
        <div style="text-align: center;">
            <el-button type="primary" @click="doOk">确定</el-button>
            <el-button  @click="doCanel">取消</el-button>
        </div>
        </el-drawer>
    </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { selectByDate } from "@/api/project/surProjectAttendance";
export default {
    name: 'RuoyiUiAttendanceDrawer',

    data() {
        return {
            isOpen: false,
            prj: null,
            title: '',
            oldData:null,
            formData:{
                servicePersonnel:0,
                supervisorPersonnel:0,
                contractorPersonnel:0
            },
            rules:{}
        };
    },
    computed: {
        ...mapGetters([
            'dept',
        ]),
    },
    mounted() {

    },

    methods: {
        doOk(){

        },
        doCanel(){
            this.isOpen=false;
        },
        show(prj) {
            this.prj = prj;
            this.title = prj.projectName;
            this.isOpen = true;
            selectByDate({
                prijectId: prj.id,
                deptId: this.dept.deptId,
                createTime: +new Date()
            }).then(d => {
                let tmps=d.data||[];
                this.oldData=tmps.length>0?tmps[0]:null;
            });
        }
    },
};
</script>

<style lang="scss" scoped></style>