From 82006fe5e222db515e8d10b2e09e5790841730f1 Mon Sep 17 00:00:00 2001 From: hdm Date: Thu, 18 Nov 2021 15:48:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=A5=E5=B8=B8=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/home/controller/Schedule.php | 78 ++-- app/home/view/schedule/calendar.html | 349 +++++++++++++++++ app/home/view/schedule/index.html | 524 +++++++++++++++++-------- app/home/view/schedule/list.html | 549 --------------------------- app/install/data/gouguoa.sql | 10 +- 5 files changed, 755 insertions(+), 755 deletions(-) create mode 100644 app/home/view/schedule/calendar.html delete mode 100644 app/home/view/schedule/list.html diff --git a/app/home/controller/Schedule.php b/app/home/controller/Schedule.php index 4510592..682da18 100644 --- a/app/home/controller/Schedule.php +++ b/app/home/controller/Schedule.php @@ -87,8 +87,45 @@ class Schedule extends BaseController } } + function index() { + if (request()->isAjax()) { + $param = get_params(); + //按时间检索 + $start_time = isset($param['start_time']) ? strtotime($param['start_time']) : 0; + $end_time = isset($param['end_time']) ? strtotime($param['end_time']) : 0; + $where = []; + if ($start_time > 0 && $end_time > 0) { + $where[] = ['a.start_time', 'between', [$start_time, $end_time]]; + } + if (!empty($param['keywords'])) { + $where[] = ['a.name', 'like', '%' . trim($param['keywords']) . '%']; + } + if (!empty($param['uid'])) { + $where[] = ['a.admin_id', '=', $param['uid']]; + } else { + $where[] = ['a.admin_id', '=', $this->uid]; + } + $where[] = ['a.status', '=', 1]; + $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; + $schedule = ScheduleList::where($where) + ->field('a.*,u.name as create_admin') + ->alias('a') + ->join('admin u', 'u.id = a.admin_id', 'LEFT') + ->order('a.id desc') + ->paginate($rows, false) + ->each(function ($item, $key) { + $item->start_time = empty($item->start_time) ? '' : date('Y-m-d H:i', $item->start_time); + //$item->end_time = empty($item->end_time) ? '': date('Y-m-d H:i', $item->end_time); + $item->end_time = empty($item->end_time) ? '' : date('H:i', $item->end_time); + }); + return table_assign(0, '', $schedule); + } else { + return view(); + } + } + //工作记录 - public function index() + public function calendar() { if (request()->isAjax()) { $param = get_params(); @@ -155,45 +192,8 @@ class Schedule extends BaseController } } - function list() { - if (request()->isAjax()) { - $param = get_params(); - //按时间检索 - $start_time = isset($param['start_time']) ? strtotime($param['start_time']) : 0; - $end_time = isset($param['end_time']) ? strtotime($param['end_time']) : 0; - $where = []; - if ($start_time > 0 && $end_time > 0) { - $where[] = ['a.start_time', 'between', [$start_time, $end_time]]; - } - if (!empty($param['keywords'])) { - $where[] = ['a.name', 'like', '%' . trim($param['keywords']) . '%']; - } - if (!empty($param['uid'])) { - $where[] = ['a.admin_id', '=', $param['uid']]; - } else { - $where[] = ['a.admin_id', '=', $this->uid]; - } - $where[] = ['a.status', '=', 1]; - $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; - $schedule = ScheduleList::where($where) - ->field('a.*,u.name as create_admin') - ->alias('a') - ->join('admin u', 'u.id = a.admin_id', 'LEFT') - ->order('a.id desc') - ->paginate($rows, false) - ->each(function ($item, $key) { - $item->start_time = empty($item->start_time) ? '' : date('Y-m-d H:i', $item->start_time); - //$item->end_time = empty($item->end_time) ? '': date('Y-m-d H:i', $item->end_time); - $item->end_time = empty($item->end_time) ? '' : date('H:i', $item->end_time); - }); - return table_assign(0, '', $schedule); - } else { - return view(); - } - } - //保存日志数据 - public function save() + public function add() { $param = get_params(); $admin_id = $this->uid; diff --git a/app/home/view/schedule/calendar.html b/app/home/view/schedule/calendar.html new file mode 100644 index 0000000..3753119 --- /dev/null +++ b/app/home/view/schedule/calendar.html @@ -0,0 +1,349 @@ +{extend name="common/base"/} +{block name="style"} + + + + + + + +{/block} + +{block name="body"} + + + + + + +
+
+
+ +
+
+
+ +
+
+ +{/block} + +{block name="script"} + + {include file="common/layui" base='base' extend="['employeepicker','dtree']" callback="init" /} +{/block} + \ No newline at end of file diff --git a/app/home/view/schedule/index.html b/app/home/view/schedule/index.html index 3753119..dc64717 100644 --- a/app/home/view/schedule/index.html +++ b/app/home/view/schedule/index.html @@ -1,51 +1,67 @@ {extend name="common/base"/} {block name="style"} - - - - {/block} {block name="body"} - - - - - -
-
-
- -
-
-
- +
+
+
+ +
+ ~ +
+ +
+
+
+ + +
+
+ +
+ +
+
+
- + {/block} + + {block name="script"} - - {include file="common/layui" base='base' extend="['employeepicker','dtree']" callback="init" /} + {include file="common/layui" base='base' extend="['dtree','employeepicker']" use="[]" callback="init" /} {/block} \ No newline at end of file diff --git a/app/home/view/schedule/list.html b/app/home/view/schedule/list.html deleted file mode 100644 index 99124e5..0000000 --- a/app/home/view/schedule/list.html +++ /dev/null @@ -1,549 +0,0 @@ -{extend name="common/base"/} -{block name="style"} - - - -{/block} - -{block name="body"} -
-
-
-
- -
- ~ -
- -
-
-
- - -
-
- -
- -
-
-
-
-
- -{/block} - - - -{block name="script"} - - {include file="common/layui" base='base' extend="['dtree','employeepicker']" use="[]" callback="init" /} -{/block} - \ No newline at end of file diff --git a/app/install/data/gouguoa.sql b/app/install/data/gouguoa.sql index bd7ce24..2d578c4 100644 --- a/app/install/data/gouguoa.sql +++ b/app/install/data/gouguoa.sql @@ -139,7 +139,7 @@ INSERT INTO `oa_admin_menu` VALUES (21, 2, '发票主体设置', 'home/invoice/s INSERT INTO `oa_admin_menu` VALUES (22, 3, '部门架构', 'home/department/index', '', 1, 0, 0); INSERT INTO `oa_admin_menu` VALUES (23, 3, '岗位职称', 'home/position/index', '', 1, 0, 0); INSERT INTO `oa_admin_menu` VALUES (24, 3, '企业员工', 'home/admin/index', '', 1, 0, 0); -INSERT INTO `oa_admin_menu` VALUES (25, 3, '人事调动', 'home/personnel/chage', '', 1, 0, 0); +INSERT INTO `oa_admin_menu` VALUES (25, 3, '人事调动', 'home/personnel/change', '', 1, 0, 0); INSERT INTO `oa_admin_menu` VALUES (26, 3, '离职档案', 'home/personnel/leave', '', 1, 0, 0); INSERT INTO `oa_admin_menu` VALUES (27, 4, '收件箱', 'home/mail/inbox', '', 1, 0, 0); @@ -154,10 +154,10 @@ INSERT INTO `oa_admin_menu` VALUES (33, 6, '知识类别', 'home/article/cate', INSERT INTO `oa_admin_menu` VALUES (34, 6, '共享知识', 'home/article/index', '', 1, 0, 0); INSERT INTO `oa_admin_menu` VALUES (35, 6, '个人知识', 'home/article/list', '', 1, 0, 0); -INSERT INTO `oa_admin_menu` VALUES (36, 7, '工作计划', 'home/plan/list', '', 1, 0, 0); -INSERT INTO `oa_admin_menu` VALUES (37, 7, '计划日历', 'home/plan/index', '', 1, 0, 0); -INSERT INTO `oa_admin_menu` VALUES (38, 7, '工作记录', 'home/schedule/list', '', 1, 0, 0); -INSERT INTO `oa_admin_menu` VALUES (39, 7, '工作日历', 'home/schedule/index', '', 1, 0, 0); +INSERT INTO `oa_admin_menu` VALUES (36, 7, '工作计划', 'home/plan/index', '', 1, 0, 0); +INSERT INTO `oa_admin_menu` VALUES (37, 7, '计划日历', 'home/plan/calendar', '', 1, 0, 0); +INSERT INTO `oa_admin_menu` VALUES (38, 7, '工作记录', 'home/schedule/index', '', 1, 0, 0); +INSERT INTO `oa_admin_menu` VALUES (39, 7, '工作日历', 'home/schedule/calendar', '', 1, 0, 0); INSERT INTO `oa_admin_menu` VALUES (40, 8, '报销管理', 'home/expense/index', '', 1, 0, 0); INSERT INTO `oa_admin_menu` VALUES (41, 8, '发票管理', 'home/invoice/index', '', 1, 0, 0);