{extend name="../../base/view/common/base" /} {block name="style"} {/block} {block name="body"}
const is_auth = {$is_auth}; const moduleInit = ['tool','tablePlus','laydatePlus','oaPicker']; function gouguInit() { var table = layui.tablePlus, tool = layui.tool, form = layui.form, element = layui.element, laydatePlus = layui.laydatePlus; // Date range var entry_time = new laydatePlus({'target':'entry_time'}); // Tab switch element.on('tab(tab)', function(data){ $('[name="tab"]').val(data.index); $("#barsearchform")[0].reset(); layui.pageTable.reload({where:{tab:data.index},page:{curr:1}}); return false; }); layui.pageTable = table.render({ elem: "#table_talent" ,title: 'Onboarding Requests' ,toolbar: "#toolbarDemo" ,url: "/user/talent/datalist" ,page: true ,limit: 20 ,cellMinWidth: 60 ,height: 'full-154' ,cols: [[ {field:'id', title: 'ID', align: 'center', fixed:'left', width: 80} ,{field:'check_status',title: 'Approval Status',width:130, align:'center',templet: function(d){ var html = '['+d.check_status_str+']'; return html; }} ,{field: 'name', title: 'Name', width: 150} ,{field: 'thumb', title: 'Photo', toolbar: '#thumb', align: 'center', width: 80} ,{field: 'sex', title: 'Gender', align: 'center', width: 60, templet: function (d) { var html = 'Unknown'; if(d.sex == 1){ html = 'Male' } else if(d.sex == 2){ html = 'Female' } return html; }} ,{field: 'mobile', title: 'Mobile', align: 'center', width: 110} ,{field: 'department', title: 'Department', align: 'center', width: 120} ,{field: 'position', title: 'Position', align: 'center', width: 120} ,{field:'admin_name', title: 'Requester', width:90, align:'center'} ,{field:'create_time', title: 'Requested At', width:150, align:'center'} ,{field:'check_users', title: 'Current Approver'} ,{field: 'status', title: 'Onboarding Status', align: 'center', width: 120, templet: function (d) { var html = ''; if(d.status == 1){ html = 'Not Joined' } else if(d.status == 2){ html = 'Joined' } return html; }} ,{field: 'entry_time', title: 'Entry Date', align: 'center', width: 90} ,{width:190,fixed:'right',title: 'Actions', align:'center',ignoreExport:true,templet: function(d){ var btn1='Details'; var btn2='Edit'; var btn3='Delete'; var btn4='Convert'; var html = '
'+btn1+'
'; if((d.check_status==0 || d.check_status==4) && d.admin_id == login_admin){ html = '
'+btn1+btn2+btn3+'
'; } if(d.check_status==2 && d.status==1 && (d.admin_id == login_admin || is_auth==1)){ html = '
'+btn1+btn4+'
'; } return html; }} ]] }); table.on('tool(table_talent)',function (obj) { var data = obj.data; if (obj.event === 'view') { tool.side("/user/talent/view?id="+data.id); return; } if (obj.event === 'edit') { tool.side("/user/talent/add?id="+data.id); return; } if (obj.event === 'user') { tool.side("/user/talent/set?id="+data.id); return; } if (obj.event === 'del') { layer.confirm('Are you sure you want to delete this record?', { icon: 3, title: 'Confirm' }, function (index) { let callback = function (e) { layer.msg(e.msg); if (e.code == 0) { obj.del(); } } tool.delete("/user/talent/del", { id: data.id }, callback); layer.close(index); }); return; } }); } {/block}