人力资源模块体验优化
This commit is contained in:
parent
a36e6401d9
commit
e45e08ffb9
@ -136,22 +136,22 @@ class Personal extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
$id = isset($param['id']) ? $param['id'] : 0;
|
$id = isset($param['id']) ? $param['id'] : 0;
|
||||||
$where = array();
|
$where = array();
|
||||||
if (!empty($id)) {
|
if ($id>0) {
|
||||||
$where['p.id'] = array('eq', $id);
|
$where['p.id'] = array('eq', $id);
|
||||||
|
$detail = Db::name('PersonalQuit')
|
||||||
|
->field('p.*,u.name as name,l.name as lead_admin_name,d.title as department')
|
||||||
|
->alias('p')
|
||||||
|
->join('admin u', 'p.uid = u.id', 'LEFT')
|
||||||
|
->join('admin l', 'p.lead_admin_id = l.id', 'LEFT')
|
||||||
|
->join('department d', 'u.did = d.id', 'LEFT')
|
||||||
|
->where($where)
|
||||||
|
->find();
|
||||||
|
$this_uids_name = Db::name('Admin')->where([['id','in', $detail['connect_uids']]])->column('name');
|
||||||
|
$detail['connect_names'] = implode(',', $this_uids_name);
|
||||||
|
$detail['quit_time'] = date('Y-m-d', $detail['quit_time']);
|
||||||
|
View::assign('detail', $detail);
|
||||||
}
|
}
|
||||||
$detail = Db::name('PersonalQuit')
|
|
||||||
->field('p.*,u.name as name,l.name as lead_admin_name,d.title as department')
|
|
||||||
->alias('p')
|
|
||||||
->join('admin u', 'p.uid = u.id', 'LEFT')
|
|
||||||
->join('admin l', 'p.lead_admin_id = l.id', 'LEFT')
|
|
||||||
->join('department d', 'u.did = d.id', 'LEFT')
|
|
||||||
->where($where)
|
|
||||||
->find();
|
|
||||||
$this_uids_name = Db::name('Admin')->where([['id','in', $detail['connect_uids']]])->column('name');
|
|
||||||
$detail['connect_names'] = implode(',', $this_uids_name);
|
|
||||||
$detail['quit_time'] = date('Y-m-d', $detail['quit_time']);
|
|
||||||
View::assign('id', $id);
|
View::assign('id', $id);
|
||||||
View::assign('detail', $detail);
|
|
||||||
return view();
|
return view();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<form class="layui-form body-content">
|
<form class="layui-form body-content">
|
||||||
|
<h3 class="h3-title">部门架构</h3>
|
||||||
{eq name="$id" value="0"}
|
{eq name="$id" value="0"}
|
||||||
<table class="layui-table layui-table-form">
|
<table class="layui-table layui-table-form">
|
||||||
<tr>
|
<tr>
|
||||||
@ -44,10 +45,10 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray2">部门负责人</td>
|
<td class="layui-td-gray2">部门负责人</td>
|
||||||
<td>
|
<td>
|
||||||
<select name="uid">
|
<select name="leader_id">
|
||||||
<option value="0">请选择部门负责人</option>
|
<option value="0">请选择部门负责人</option>
|
||||||
{volist name="users" id="v"}
|
{volist name="users" id="v"}
|
||||||
<option value="{$v.id}" {eq name="detail.uid" value="$v.id"} selected{/eq}>{$v.name}</option>
|
<option value="{$v.id}" {eq name="detail.leader_id" value="$v.id"} selected{/eq}>{$v.name}</option>
|
||||||
{/volist}
|
{/volist}
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
@ -62,7 +63,6 @@
|
|||||||
<input type="hidden" name="id" value="{$id}">
|
<input type="hidden" name="id" value="{$id}">
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
<button lay-event="back" class="layui-btn layui-btn-primary">返回</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{/block}
|
{/block}
|
||||||
@ -83,12 +83,8 @@
|
|||||||
data: data.field,
|
data: data.field,
|
||||||
success: function(e) {
|
success: function(e) {
|
||||||
if (e.code == 0) {
|
if (e.code == 0) {
|
||||||
layer.confirm('保存成功,返回列表页吗?', {
|
layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) {
|
||||||
icon: 3,
|
parent.location.reload();
|
||||||
title: '提示'
|
|
||||||
}, function(index) {
|
|
||||||
history.back(-1);
|
|
||||||
layer.close(index);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
layer.msg(e.msg);
|
layer.msg(e.msg);
|
||||||
@ -97,11 +93,6 @@
|
|||||||
})
|
})
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
//监听返回
|
|
||||||
$('.body-content').on('click', '[lay-event="back"]', function() {
|
|
||||||
history.back(-1);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{include file="common/layui" base="base" extend="[]" callback="init" /}
|
{include file="common/layui" base="base" extend="[]" callback="init" /}
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
{block name="style"}
|
{block name="style"}
|
||||||
<style>
|
<style>
|
||||||
html,
|
html,body {
|
||||||
body {
|
|
||||||
height: calc(100% - 20px);
|
height: calc(100% - 20px);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -12,8 +11,8 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<div class="body-content" style="height: 100%">
|
<div class="body-content" style="height: 100%">
|
||||||
<div style="height:39px;">
|
<div style="height:42px;">
|
||||||
<a class="layui-btn layui-btn-normal layui-btn-sm" href="{:url('home/department/add')}">+ 添加部门</a>
|
<button class="layui-btn layui-btn-normal layui-btn-sm add-menu">+ 添加部门</button>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: calc(100% - 30px)">
|
<div style="height: calc(100% - 30px)">
|
||||||
<table class="layui-hide" id="treeTable" lay-filter="treeTable"></table>
|
<table class="layui-hide" id="treeTable" lay-filter="treeTable"></table>
|
||||||
@ -28,6 +27,7 @@
|
|||||||
function init(layui) {
|
function init(layui) {
|
||||||
var treeGrid = layui.treeGrid,
|
var treeGrid = layui.treeGrid,
|
||||||
layer = layui.layer,
|
layer = layui.layer,
|
||||||
|
rightpage = layui.rightpage,
|
||||||
ptable = treeGrid.render({
|
ptable = treeGrid.render({
|
||||||
id: 'treeTable'
|
id: 'treeTable'
|
||||||
, elem: '#treeTable'
|
, elem: '#treeTable'
|
||||||
@ -45,16 +45,31 @@
|
|||||||
, { field: 'title', title: '部门名称'}
|
, { field: 'title', title: '部门名称'}
|
||||||
, { field: 'leader', title: '部门负责人',width: 120, align: 'center'}
|
, { field: 'leader', title: '部门负责人',width: 120, align: 'center'}
|
||||||
, { field: 'phone', title: '部门电话',width: 160,}
|
, { field: 'phone', title: '部门电话',width: 160,}
|
||||||
, { width: 200, title: '操作', align: 'center', templet: function (d) {
|
, { width:160, title: '操作', align: 'center', templet: function (d) {
|
||||||
var html = '<a class="layui-btn layui-btn-normal layui-btn-xs" href="/home/department/add?pid=' + d.id + '">添加下级部门</a><a class="layui-btn layui-btn-xs" href="/home/department/add?id=' + d.id + '">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>';
|
var html = '<span class="layui-btn-group"><button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="add">添加下级部门</button><button class="layui-btn layui-btn-xs" lay-event="edit">编辑</button><button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</button></span>';
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]]
|
]]
|
||||||
, page: false
|
, page: false
|
||||||
});
|
});
|
||||||
//删除
|
|
||||||
|
//表头工具栏事件
|
||||||
|
$('.body-content').on('click','.add-menu', function(){
|
||||||
|
rightpage.open("{:url('home/department/add')}");
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
|
||||||
|
//操作按钮
|
||||||
treeGrid.on('tool(treeTable)', function (obj) {
|
treeGrid.on('tool(treeTable)', function (obj) {
|
||||||
|
if (obj.event === 'add') {
|
||||||
|
rightpage.open('/home/department/add?pid='+obj.data.id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (obj.event === 'edit') {
|
||||||
|
rightpage.open('/home/department/add?id='+obj.data.id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (obj.event === 'del') {
|
if (obj.event === 'del') {
|
||||||
layer.confirm('确定要删除吗?', { icon: 3, title: '提示' }, function (index) {
|
layer.confirm('确定要删除吗?', { icon: 3, title: '提示' }, function (index) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -72,9 +87,8 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{include file="common/layui" base="base" extend="['treeGrid']" callback="init" /}
|
{include file="common/layui" base="base" extend="['treeGrid','rightpage']" callback="init" /}
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /脚本 -->
|
<!-- /脚本 -->
|
@ -27,7 +27,7 @@
|
|||||||
var ptable = null, treeGrid = null,rightpage=null, layer = null, tableId = "treeTable";
|
var ptable = null, treeGrid = null,rightpage=null, layer = null, tableId = "treeTable";
|
||||||
function init(layui) {
|
function init(layui) {
|
||||||
treeGrid = layui.treeGrid;
|
treeGrid = layui.treeGrid;
|
||||||
rightpage = layui.rightpage,
|
rightpage = layui.rightpage;
|
||||||
layer = layui.layer;
|
layer = layui.layer;
|
||||||
ptable = treeGrid.render({
|
ptable = treeGrid.render({
|
||||||
id: tableId
|
id: tableId
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<form class="layui-form body-content">
|
<form class="layui-form body-content">
|
||||||
<h3 class="h3-title">新增人事调动</h3>
|
<h3 class="h3-title">离职档案</h3>
|
||||||
{if condition="$id eq 0"}
|
{if condition="$id eq 0"}
|
||||||
<table class="layui-table">
|
<table class="layui-table">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<form class="layui-form body-content">
|
<form class="layui-form body-content">
|
||||||
|
<h3 class="h3-title">岗位职称</h3>
|
||||||
{if condition="$id eq 0"}
|
{if condition="$id eq 0"}
|
||||||
<table class="layui-table layui-table-form">
|
<table class="layui-table">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">岗位名称<font>*</font></td>
|
<td class="layui-td-gray">岗位名称<font>*</font></td>
|
||||||
<td>
|
<td>
|
||||||
@ -71,7 +72,6 @@
|
|||||||
<input type="hidden" name="id" value="{$id}">
|
<input type="hidden" name="id" value="{$id}">
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
<button lay-event="back" class="layui-btn layui-btn-primary">返回</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{/block}
|
{/block}
|
||||||
@ -81,8 +81,7 @@
|
|||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
function init(layui) {
|
function init(layui) {
|
||||||
var TAB = parent.layui.tab,
|
var form = layui.form,
|
||||||
form = layui.form,
|
|
||||||
layer = layui.layer;
|
layer = layui.layer;
|
||||||
|
|
||||||
//监听提交
|
//监听提交
|
||||||
@ -94,8 +93,7 @@
|
|||||||
success: function (e) {
|
success: function (e) {
|
||||||
if (e.code == 0) {
|
if (e.code == 0) {
|
||||||
layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) {
|
layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) {
|
||||||
history.back(-1);
|
parent.location.reload();
|
||||||
layer.close(index);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
layer.msg(e.msg);
|
layer.msg(e.msg);
|
||||||
@ -104,11 +102,6 @@
|
|||||||
})
|
})
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
//监听返回
|
|
||||||
$('.body-content').on('click', '[lay-event="back"]', function () {
|
|
||||||
history.back(-1);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -10,11 +10,11 @@
|
|||||||
</script>
|
</script>
|
||||||
<script type="text/html" id="toolbarDemo">
|
<script type="text/html" id="toolbarDemo">
|
||||||
<div class="layui-btn-container">
|
<div class="layui-btn-container">
|
||||||
<a class="layui-btn layui-btn-normal layui-btn-sm" href="{:url('home/position/add')}">+ 添加岗位</a>
|
<button class="layui-btn layui-btn-normal layui-btn-sm" lay-event="add">+ 添加岗位</button>
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
<script type="text/html" id="barDemo">
|
<script type="text/html" id="barDemo">
|
||||||
<div class="layui-btn-group"><span class="layui-btn layui-btn-xs layui-btn-normal" lay-event="view">详情</span><a class="layui-btn layui-btn-xs" href="/home/position/add?id={{d.id}}">编辑</a><span class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</span></div>
|
<div class="layui-btn-group"><button class="layui-btn layui-btn-xs layui-btn-normal" lay-event="view">详情</button><button class="layui-btn layui-btn-xs" lay-event="edit">编辑</button><button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</button></div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
@ -25,6 +25,8 @@
|
|||||||
<script>
|
<script>
|
||||||
function init(layui) {
|
function init(layui) {
|
||||||
var TAB = parent.layui.tab,
|
var TAB = parent.layui.tab,
|
||||||
|
layer = layui.layer,
|
||||||
|
rightpage = layui.rightpage,
|
||||||
table = layui.table;
|
table = layui.table;
|
||||||
var tableIns = table.render({
|
var tableIns = table.render({
|
||||||
elem: '#test',
|
elem: '#test',
|
||||||
@ -69,14 +71,31 @@
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//表头工具栏事件
|
||||||
|
table.on('toolbar(test)', function(obj){
|
||||||
|
if (obj.event === 'add') {
|
||||||
|
rightpage.open("{:url('home/position/add')}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
//监听行工具事件
|
//监听行工具事件
|
||||||
table.on('tool(test)', function (obj) {
|
table.on('tool(test)', function (obj) {
|
||||||
var data = obj.data;
|
var data = obj.data;
|
||||||
|
/*
|
||||||
if (obj.event === 'view') {
|
if (obj.event === 'view') {
|
||||||
TAB.sonAdd('/home/position/view?id='+data.id,'岗位详情');
|
TAB.sonAdd('/home/position/view?id='+data.id,'岗位详情');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (obj.event === 'del') {
|
*/
|
||||||
|
if(obj.event === 'view'){
|
||||||
|
rightpage.open('/home/position/view?id='+data.id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(obj.event === 'edit'){
|
||||||
|
rightpage.open('/home/position/add?id='+data.id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (obj.event === 'del') {
|
||||||
if (data.id == 1) {
|
if (data.id == 1) {
|
||||||
layer.msg('超级岗位不能删除');
|
layer.msg('超级岗位不能删除');
|
||||||
return;
|
return;
|
||||||
@ -103,6 +122,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{include file="common/layui" base='base' extend="[]" callback="init" /}
|
{include file="common/layui" base='base' extend="['rightpage']" callback="init" /}
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /脚本 -->
|
<!-- /脚本 -->
|
@ -2,7 +2,7 @@
|
|||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<form class="layui-form body-content">
|
<form class="layui-form body-content">
|
||||||
<h3 style="font-weight:600; padding:10px 0">岗位信息</h3>
|
<h3 class="h3-title">岗位信息</h3>
|
||||||
<table class="layui-table layui-table-form">
|
<table class="layui-table layui-table-form">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray2">岗位名称</td>
|
<td class="layui-td-gray2">岗位名称</td>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<h3 style="font-weight:600; padding:10px 0">岗位权限</h3>
|
<h3 class="h3-title">岗位权限</h3>
|
||||||
<table class="layui-table layui-table-form">
|
<table class="layui-table layui-table-form">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray2" style="vertical-align:top">权限配置<br>操作菜单可见</td>
|
<td class="layui-td-gray2" style="vertical-align:top">权限配置<br>操作菜单可见</td>
|
||||||
@ -105,9 +105,6 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div style="padding: 10px 0">
|
|
||||||
<button lay-event="back" class="layui-btn layui-btn-primary">关闭</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /主体 -->
|
<!-- /主体 -->
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
var ptable = null, treeGrid = null,rightpage=null, layer = null, tableId = "treeTable";
|
var ptable = null, treeGrid = null,rightpage=null, layer = null, tableId = "treeTable";
|
||||||
function init(layui) {
|
function init(layui) {
|
||||||
treeGrid = layui.treeGrid;
|
treeGrid = layui.treeGrid;
|
||||||
rightpage = layui.rightpage,
|
rightpage = layui.rightpage;
|
||||||
layer = layui.layer;
|
layer = layui.layer;
|
||||||
ptable = treeGrid.render({
|
ptable = treeGrid.render({
|
||||||
id: tableId
|
id: tableId
|
||||||
|
Loading…
x
Reference in New Issue
Block a user