<template>
    <el-container>
        <el-header>
            <div class="left-panel">
                <el-button type="primary" @click="handleAdd">新增</el-button>
            </div>
        </el-header>
        <el-main class="nopadding">
            <scTable
            ref="table"
            :apiObj="API.hrm.empneed.list"
            row-key="id"
            stripe
            :query="query"
            @row-click="(row)=>{t_id=row.id;mode='show';drawerVisible=true;}"
            >
            <el-table-column label="部门" prop="dept_need_name" width="80" show-overflow-tooltip></el-table-column>
            <el-table-column label="审批状态" width="200" show-overflow-tooltip>
                <template #default="scope">
                                <el-tag :type="actStateEnum[scope.row.ticket_?.act_state]?.type">
                        {{ actStateEnum[scope.row.ticket_?.act_state]?.text }}
                    </el-tag>
            <el-tag type="info" effect="plain">{{ scope.row.ticket_?.state_.name }}</el-tag>

                </template>
            </el-table-column>
            <el-table-column label="需求岗位" prop="post_name" width="80" show-overflow-tooltip></el-table-column>
            <el-table-column label="需求人数" prop="count_need" width="80" show-overflow-tooltip></el-table-column>
            <el-table-column label="工资报酬" prop="salary" width="80" show-overflow-tooltip></el-table-column>
            <el-table-column label="到岗日期" prop="arrival_date" width="80" show-overflow-tooltip></el-table-column>
            <el-table-column label="申请理由" prop="reason" width="100" show-overflow-tooltip></el-table-column>
            <el-table-column label="岗位人员职责描述" prop="duty" width="100" show-overflow-tooltip></el-table-column>
            <el-table-column label="性别要求" prop="gender" width="80" show-overflow-tooltip></el-table-column>
            <el-table-column label="学历要求" prop="education" width="80" show-overflow-tooltip></el-table-column>
            <el-table-column label="相关专业及技能要求" prop="professional_requirement" width="200" show-overflow-tooltip></el-table-column>
            </scTable>
        </el-main>
    </el-container>
    <el-drawer title="员工需求审核" v-model="drawerVisible" :size="'80%'" destroy-on-close>
        <empneed_form :mode="mode" :t_id="t_id"></empneed_form>
    </el-drawer>
</template>
<script setup>
import { ref } from 'vue'
import API from '@/api'
import empneed_form from './enpneed_form.vue'
import { actStateEnum, interveneTypeEnum } from "@/utils/enum.js";
const query = ref({});
const drawerVisible = ref(false);
const mode = ref('add');
const t_id = ref(null);
const handleAdd = () => {
    mode.value = 'add';
    drawerVisible.value = true;
}
</script>