From e45e08ffb965d8eaf9926b083b8665f56bf17779 Mon Sep 17 00:00:00 2001 From: hdm Date: Tue, 23 Nov 2021 18:04:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=8A=9B=E8=B5=84=E6=BA=90=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=BD=93=E9=AA=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/home/controller/Personal.php | 26 +++++++++++----------- app/home/view/department/add.html | 19 +++++----------- app/home/view/department/index.html | 32 +++++++++++++++++++-------- app/home/view/menu/index.html | 2 +- app/home/view/personal/leave_add.html | 2 +- app/home/view/position/add.html | 15 ++++--------- app/home/view/position/index.html | 29 +++++++++++++++++++----- app/home/view/position/view.html | 7 ++---- app/home/view/rule/index.html | 2 +- 9 files changed, 74 insertions(+), 60 deletions(-) diff --git a/app/home/controller/Personal.php b/app/home/controller/Personal.php index 5616eb3..f8f4010 100644 --- a/app/home/controller/Personal.php +++ b/app/home/controller/Personal.php @@ -136,22 +136,22 @@ class Personal extends BaseController } else { $id = isset($param['id']) ? $param['id'] : 0; $where = array(); - if (!empty($id)) { + if ($id>0) { $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('detail', $detail); return view(); } } diff --git a/app/home/view/department/add.html b/app/home/view/department/add.html index 1b635c2..3f29249 100644 --- a/app/home/view/department/add.html +++ b/app/home/view/department/add.html @@ -2,6 +2,7 @@ {block name="body"}
+

部门架构

{eq name="$id" value="0"} @@ -44,10 +45,10 @@ @@ -62,7 +63,6 @@ - {/block} @@ -83,12 +83,8 @@ data: data.field, success: function(e) { if (e.code == 0) { - layer.confirm('保存成功,返回列表页吗?', { - icon: 3, - title: '提示' - }, function(index) { - history.back(-1); - layer.close(index); + layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) { + parent.location.reload(); }); } else { layer.msg(e.msg); @@ -97,11 +93,6 @@ }) return false; }); - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function() { - history.back(-1); - return false; - }); } {include file="common/layui" base="base" extend="[]" callback="init" /} diff --git a/app/home/view/department/index.html b/app/home/view/department/index.html index 203eba4..10761fd 100644 --- a/app/home/view/department/index.html +++ b/app/home/view/department/index.html @@ -2,8 +2,7 @@ {block name="style"} @@ -12,8 +11,8 @@ {block name="body"}
-
- + 添加部门 +
+
部门负责人 - {volist name="users" id="v"} - + {/volist}
@@ -28,6 +27,7 @@ function init(layui) { var treeGrid = layui.treeGrid, layer = layui.layer, + rightpage = layui.rightpage, ptable = treeGrid.render({ id: 'treeTable' , elem: '#treeTable' @@ -45,16 +45,31 @@ , { field: 'title', title: '部门名称'} , { field: 'leader', title: '部门负责人',width: 120, align: 'center'} , { field: 'phone', title: '部门电话',width: 160,} - , { width: 200, title: '操作', align: 'center', templet: function (d) { - var html = '添加下级部门编辑删除'; + , { width:160, title: '操作', align: 'center', templet: function (d) { + var html = ''; return html; } } ]] , page: false }); - //删除 + + //表头工具栏事件 + $('.body-content').on('click','.add-menu', function(){ + rightpage.open("{:url('home/department/add')}"); + return; + }); + + //操作按钮 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') { layer.confirm('确定要删除吗?', { icon: 3, title: '提示' }, function (index) { $.ajax({ @@ -72,9 +87,8 @@ }); } }); - } -{include file="common/layui" base="base" extend="['treeGrid']" callback="init" /} +{include file="common/layui" base="base" extend="['treeGrid','rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/home/view/menu/index.html b/app/home/view/menu/index.html index 575fe49..f99669f 100644 --- a/app/home/view/menu/index.html +++ b/app/home/view/menu/index.html @@ -27,7 +27,7 @@ var ptable = null, treeGrid = null,rightpage=null, layer = null, tableId = "treeTable"; function init(layui) { treeGrid = layui.treeGrid; - rightpage = layui.rightpage, + rightpage = layui.rightpage; layer = layui.layer; ptable = treeGrid.render({ id: tableId diff --git a/app/home/view/personal/leave_add.html b/app/home/view/personal/leave_add.html index 4a9bc9b..19a8bcf 100644 --- a/app/home/view/personal/leave_add.html +++ b/app/home/view/personal/leave_add.html @@ -8,7 +8,7 @@ {block name="body"}
-

新增人事调动

+

离职档案

{if condition="$id eq 0"} diff --git a/app/home/view/position/add.html b/app/home/view/position/add.html index 07c03ef..fe1fdad 100644 --- a/app/home/view/position/add.html +++ b/app/home/view/position/add.html @@ -2,8 +2,9 @@ {block name="body"} +

岗位职称

{if condition="$id eq 0"} -
+
岗位名称* @@ -71,7 +72,6 @@ - {/block} @@ -81,8 +81,7 @@ {block name="script"} diff --git a/app/home/view/position/index.html b/app/home/view/position/index.html index fa8a34c..48be0ae 100644 --- a/app/home/view/position/index.html +++ b/app/home/view/position/index.html @@ -10,11 +10,11 @@ {/block} @@ -25,6 +25,8 @@ -{include file="common/layui" base='base' extend="[]" callback="init" /} +{include file="common/layui" base='base' extend="['rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/home/view/position/view.html b/app/home/view/position/view.html index 7eda327..c011d28 100644 --- a/app/home/view/position/view.html +++ b/app/home/view/position/view.html @@ -2,7 +2,7 @@ {block name="body"}
-

岗位信息

+

岗位信息

@@ -34,7 +34,7 @@
岗位名称
-

岗位权限

+

岗位权限

@@ -105,9 +105,6 @@
权限配置
操作菜单可见
-
- -
{/block} diff --git a/app/home/view/rule/index.html b/app/home/view/rule/index.html index f2b5f7f..29b7616 100644 --- a/app/home/view/rule/index.html +++ b/app/home/view/rule/index.html @@ -27,7 +27,7 @@ var ptable = null, treeGrid = null,rightpage=null, layer = null, tableId = "treeTable"; function init(layui) { treeGrid = layui.treeGrid; - rightpage = layui.rightpage, + rightpage = layui.rightpage; layer = layui.layer; ptable = treeGrid.render({ id: tableId