diff --git a/app/home/common.php b/app/home/common.php index a88c2ff..bca906e 100644 --- a/app/home/common.php +++ b/app/home/common.php @@ -283,6 +283,12 @@ function add_log($type, $param_id = '', $param = []) break; case 'view': $action = '查看'; + break; + case 'save': + $action = '保存'; + break; + case 'send': + $action = '发送'; break; case 'delete': $action = '删除'; @@ -299,6 +305,18 @@ function add_log($type, $param_id = '', $param = []) case 'recovery': $action = '恢复'; break; + case 'apply': + $action = '申请'; + break; + case 'open': + $action = '开具'; + break; + case 'tovoid': + $action = '作废'; + break; + case 'back': + $action = '反到账'; + break; case 'reset': $action = '重新设置'; break; diff --git a/app/home/controller/Income.php b/app/home/controller/Income.php index 35e657f..d62d95c 100644 --- a/app/home/controller/Income.php +++ b/app/home/controller/Income.php @@ -137,7 +137,7 @@ class Income extends BaseController //发票部分到账 Db::name('Invoice')->where(['id'=>$inid])->update(['is_cash'=>1,'enter_amount'=>$incomeTotal,'enter_time'=>time()]); } - add_log('enter',$inid,$param); + add_log('add',$inid,$param); return to_assign(); } else{ @@ -163,7 +163,7 @@ class Income extends BaseController if($res!==false){ //设置发票全部到账 Db::name('Invoice')->where(['id'=>$inid])->update(['is_cash'=>2,'enter_amount'=>$invoiceAmount,'enter_time'=>time()]); - add_log('enter',$inid,$param); + add_log('add',$inid,$param); return to_assign(); } } @@ -173,7 +173,7 @@ class Income extends BaseController if($res!==false){ //设置发票全部没到账 Db::name('Invoice')->where(['id'=>$inid])->update(['is_cash'=>0,'enter_amount'=>0,'enter_time'=>0]); - add_log('del',$inid,$param); + add_log('tovoid',$inid,$param); return to_assign(); } } diff --git a/app/home/controller/Invoice.php b/app/home/controller/Invoice.php index a7ca513..5f99407 100644 --- a/app/home/controller/Invoice.php +++ b/app/home/controller/Invoice.php @@ -41,10 +41,18 @@ class Invoice extends BaseController // 验证失败 输出错误信息 return to_assign(1, $e->getError()); } - $data['update_time'] = time(); + $param['update_time'] = time(); $res = InvoiceSubject::strict(false)->field(true)->update($param); if ($res) { - add_log('edit', $param['id'], $param); + if($param['status'] == 0){ + add_log('disable', $param['id'], $param); + } + else if($param['status'] == 1){ + add_log('recovery', $param['id'], $param); + } + else{ + add_log('edit', $param['id'], $param); + } } return to_assign(); } else { @@ -158,6 +166,7 @@ class Invoice extends BaseController $param['update_time'] = time(); $res = InvoiceList::where('id', $param['id'])->strict(false)->field(true)->update($param); if ($res !== false) { + add_log('edit', $param['id'], $param); return to_assign(); } else { return to_assign(1, '操作失败'); @@ -175,6 +184,7 @@ class Invoice extends BaseController $param['create_time'] = time(); $exid = InvoiceList::strict(false)->field(true)->insertGetId($param); if ($exid) { + add_log('apply', $exid, $param); return to_assign(); } else { return to_assign(1, '操作失败'); @@ -230,12 +240,21 @@ class Invoice extends BaseController if (request()->isAjax()) { if ($param['invoice_status'] == 2 || $param['invoice_status'] == 0) { $param['check_time'] = time(); + add_log('check', $param['id'],$param); } if ($param['invoice_status'] == 3) { $param['open_time'] = time(); + add_log('open', $param['id'],$param); } if ($param['invoice_status'] == 10) { - $param['update_time'] = time(); + $count = Db::name('InvoiceIncome')->where(['inid'=>$param['id'],'status'=>1])->count(); + if($count>0){ + return to_assign(1, "发票已经新增有到账记录,请先反到账后再作废发票"); + } + else{ + $param['update_time'] = time(); + add_log('tovoid', $param['id'],$param); + } } $res = InvoiceList::where('id', $param['id'])->strict(false)->field(true)->update($param); if ($res !== false) { diff --git a/app/home/controller/Plan.php b/app/home/controller/Plan.php index acb1611..9d8f908 100644 --- a/app/home/controller/Plan.php +++ b/app/home/controller/Plan.php @@ -64,12 +64,26 @@ class Plan extends BaseController if (!empty($param['uid'])) { $uid = $param['uid']; } - $where = []; - $where[] = ['start_time', '>=', strtotime($param['start'])]; - $where[] = ['end_time', '<=', strtotime($param['end'])]; - $where[] = ['admin_id', '=', $uid]; - $where[] = ['status', '=', 1]; - $schedule = Db::name('Plan')->where($where)->field('id,title,type,start_time,end_time')->select()->toArray(); + $where1 = []; + $where2 = []; + + $where1[] = ['status', '=', 1]; + $where1[] = ['admin_id', '=', $uid]; + $where1[] = ['start_time', '>=', strtotime($param['start'])]; + + $where2[] = ['status', '=', 1]; + $where2[] = ['admin_id', '=', $uid]; + $where2[] = ['end_time', '<=', strtotime($param['end'])]; + + $schedule = Db::name('Plan') + ->where(function ($query) use ($where1) { + $query->where($where1); + }) + ->whereOr(function ($query) use ($where2) { + $query->where($where2); + }) + ->field('id,title,type,start_time,end_time') + ->select()->toArray(); $events = []; $color_array=['#393D49','#FF5722','#FFB800','#1E9FFF','#009688']; foreach ($schedule as $k => $v) { diff --git a/app/home/controller/Schedule.php b/app/home/controller/Schedule.php index 21c018d..4072169 100644 --- a/app/home/controller/Schedule.php +++ b/app/home/controller/Schedule.php @@ -142,8 +142,8 @@ class Schedule extends BaseController $events = []; $countEvents = []; foreach ($schedule as $k => $v) { - $v['backgroundColor'] = '#009688'; - $v['borderColor'] = '#009688'; + $v['backgroundColor'] = '#12bb37'; + $v['borderColor'] = '#12bb37'; $v['title'] = '[' . $v['labor_time'] . '工时] ' . $v['title']; $v['start'] = date('Y-m-d H:i', $v['start_time']); $v['end'] = date('Y-m-d H:i', $v['end_time']); diff --git a/app/home/controller/Search.php b/app/home/controller/Search.php deleted file mode 100644 index 9ae0eb4..0000000 --- a/app/home/controller/Search.php +++ /dev/null @@ -1,48 +0,0 @@ -isAjax()) { - $param = get_params(); - $where = array(); - if (!empty($param['keywords'])) { - $where[] = ['title', 'like', '%' . $param['keywords'] . '%']; - } - $rows = empty($param['limit']) ? get_config(app . page_size) : $param['limit']; - $content = Db::name('SearchKeywords') - ->order('id desc') - ->where($where) - ->paginate($rows, false, ['query' => $param]); - return table_assign(0, '', $content); - } else { - return view(); - } - } - - //删除 - public function delete() - { - $id = get_params("id"); - if (Db::name('SearchKeywords')->delete($id) !== false) { - add_log('delete', $id); - return to_assign(0, "删除成功!"); - } else { - return to_assign(1, "删除失败!"); - } - } -} diff --git a/app/home/model/User.php b/app/home/model/User.php deleted file mode 100644 index 7cf6dad..0000000 --- a/app/home/model/User.php +++ /dev/null @@ -1,15 +0,0 @@ - - @@ -92,13 +87,6 @@ ] }); - //表头工具栏事件 - table.on('toolbar(test)', function(obj){ - if (obj.event === 'add') { - rightpage.open("{:url('home/article/add')}"); - return; - } - }); //监听行工具事件 table.on('tool(test)', function(obj) { var data = obj.data; diff --git a/app/home/view/income/view.html b/app/home/view/income/view.html index aa2b6e0..9d12ec4 100644 --- a/app/home/view/income/view.html +++ b/app/home/view/income/view.html @@ -11,7 +11,7 @@

发票信息

- + @@ -113,9 +113,9 @@ 全部到账 {/if} - + - + diff --git a/app/home/view/invoice/index.html b/app/home/view/invoice/index.html index f1cb4da..b158667 100644 --- a/app/home/view/invoice/index.html +++ b/app/home/view/invoice/index.html @@ -136,12 +136,6 @@ else if(d.invoice_status==3){ html='已开具'; } - else if(d.invoice_status==4){ - html='部分到账'; - } - else if(d.invoice_status==5){ - html='全部到账'; - } else if(d.invoice_status==10){ html='已作废'; } diff --git a/app/home/view/invoice/subject.html b/app/home/view/invoice/subject.html index cbad5c0..76c8a92 100644 --- a/app/home/view/invoice/subject.html +++ b/app/home/view/invoice/subject.html @@ -69,7 +69,7 @@ data: { id: obj.data.id, status: 0, - title: obj.data.title, + title: obj.data.title }, success: function(e) { layer.msg(e.msg); @@ -89,7 +89,7 @@ data: { id: obj.data.id, status: 1, - title: obj.data.title, + title: obj.data.title }, success: function(e) { layer.msg(e.msg); diff --git a/app/home/view/invoice/view.html b/app/home/view/invoice/view.html index ba61ba9..7773554 100644 --- a/app/home/view/invoice/view.html +++ b/app/home/view/invoice/view.html @@ -11,7 +11,7 @@

发票详情

发票金额发票金额(元) {$detail.amount} 未到账金额未到账金额(元) {$detail.not_income}已到账金额已到账金额(元) {$detail.enter_amount}
- + diff --git a/app/home/view/mail/read.html b/app/home/view/mail/read.html index dfd7ecb..f6fd438 100644 --- a/app/home/view/mail/read.html +++ b/app/home/view/mail/read.html @@ -2,7 +2,7 @@ {block name="body"} -

消息详情

+

消息详情

开票金额开票金额(元) {$detail.amount}
diff --git a/app/home/view/mail/reply.html b/app/home/view/mail/reply.html index 09c1b5a..a62bf9c 100644 --- a/app/home/view/mail/reply.html +++ b/app/home/view/mail/reply.html @@ -6,7 +6,11 @@ {block name="body"} -

回复消息

+ {if condition="$type eq 1"} +

回复消息

+ {else/} +

转发消息

+ {/if}
信息主题
diff --git a/app/home/view/schedule/calendar.html b/app/home/view/schedule/calendar.html index 8dec3e1..671343f 100644 --- a/app/home/view/schedule/calendar.html +++ b/app/home/view/schedule/calendar.html @@ -242,7 +242,7 @@
接收人类型
\ \ \ - \ + \ \ \ \ diff --git a/app/home/view/schedule/index.html b/app/home/view/schedule/index.html index b105764..e790e71 100644 --- a/app/home/view/schedule/index.html +++ b/app/home/view/schedule/index.html @@ -282,7 +282,7 @@ \ \ \ - \ + \ \ \ \ @@ -355,7 +355,7 @@
工作内容'+detail.name+''+detail.title+'工作类别'+work_type+'
工作内容 *
工作详细描述
\ \ \ - \ + \ \ \ \ diff --git a/app/install/data/gouguoa.sql b/app/install/data/gouguoa.sql index 13770ea..1cacd8a 100644 --- a/app/install/data/gouguoa.sql +++ b/app/install/data/gouguoa.sql @@ -320,18 +320,18 @@ INSERT INTO `oa_admin_rule` VALUES (103, 8, 'home/expense/index', '报销管理' INSERT INTO `oa_admin_rule` VALUES (104, 103, 'home/expense/add', '新增/编辑报销','报销',1,0,0); INSERT INTO `oa_admin_rule` VALUES (105, 103, 'home/expense/delete', '删除报销','报销',1,0,0); INSERT INTO `oa_admin_rule` VALUES (106, 103, 'home/expense/view', '查看报销信息','报销',1,0,0); -INSERT INTO `oa_admin_rule` VALUES (107, 103, 'home/expense/check', '设置报销状态','报销状态',1,0,0); +INSERT INTO `oa_admin_rule` VALUES (107, 103, 'home/expense/check', '设置报销状态','报销',1,0,0); INSERT INTO `oa_admin_rule` VALUES (108, 8, 'home/invoice/index', '发票管理','发票',1,0,0); INSERT INTO `oa_admin_rule` VALUES (109, 108, 'home/invoice/add', '新增/编辑发票','发票',1,0,0); INSERT INTO `oa_admin_rule` VALUES (110, 108, 'home/invoice/delete', '删除发票','发票',1,0,0); INSERT INTO `oa_admin_rule` VALUES (111, 108, 'home/invoice/view', '查看发票信息','发票',1,0,0); -INSERT INTO `oa_admin_rule` VALUES (112, 108, 'home/invoice/check', '设置发票状态','发票状态',1,0,0); +INSERT INTO `oa_admin_rule` VALUES (112, 108, 'home/invoice/check', '设置发票状态','发票',1,0,0); -INSERT INTO `oa_admin_rule` VALUES (113, 8, 'home/income/index', '到账管理','到账',1,0,0); -INSERT INTO `oa_admin_rule` VALUES (114, 113, 'home/income/add', '新增到账记录','到账',1,0,0); -INSERT INTO `oa_admin_rule` VALUES (115, 113, 'home/income/view', '到账详情','到账',1,0,0); -INSERT INTO `oa_admin_rule` VALUES (116, 113, 'home/income/delete', '删除到账记录','反到账',1,0,0); +INSERT INTO `oa_admin_rule` VALUES (113, 8, 'home/income/index', '到账管理','到账记录',1,0,0); +INSERT INTO `oa_admin_rule` VALUES (114, 113, 'home/income/add', '新增到账记录','到账记录',1,0,0); +INSERT INTO `oa_admin_rule` VALUES (115, 113, 'home/income/view', '到账详情','到账记录',1,0,0); +INSERT INTO `oa_admin_rule` VALUES (116, 113, 'home/income/delete', '删除到账记录','到账记录',1,0,0); INSERT INTO `oa_admin_rule` VALUES (117, 9, 'home/analysis/index', '智能分析','智能分析',1,0,0); @@ -361,6 +361,12 @@ CREATE TABLE `oa_article` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '知识文章表'; +-- ---------------------------- +-- Records of oa_article +-- ---------------------------- +INSERT INTO `oa_article`(`id`, `title`, `article_cate_id`, `keywords`, `desc`, `thumb`, `uid`, `did`, `origin_url`, `content`, `read`, `type`, `is_share`, `status`, `sort`, `create_time`, `update_time`, `delete_time`) VALUES (1, '勾股办公是一款简单实用的开源免费的企业办公系统框架', 2, '', '勾股办公是一款基于ThinkPHP6+Layui+MySql打造的,简单实用的开源免费的企业办公系统框架。系统集成了系统设置、人事管理模块、消息管理模块、日常办公、财务管理等基础模块。系统简约,易于功...', 0, 1, 0, '', '

勾股办公是一款基于ThinkPHP6 + Layui + MySql打造的,简单实用的开源免费的企业办公系统框架。系统集成了系统设置、人事管理模块、消息管理模块、日常办公、财务管理等基础模块。系统简约,易于功能扩展,方便二次开发,让开发者更专注于业务深度需求的开发,帮助开发者简单高效降低二次开发成本,通过二次开发之后可以用来做CRM,ERP,业务管理等系统。

', 1, 2, 1, 1, 1, 1637985280, 1637985340, 0); + + -- ---------------------------- -- Table structure for oa_article_cate -- ---------------------------- @@ -376,6 +382,12 @@ CREATE TABLE `oa_article_cate` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '知识文章分类表'; +-- ---------------------------- +-- Records of oa_article_cate +-- ---------------------------- +INSERT INTO `oa_article_cate`(`id`, `pid`, `sort`, `title`, `desc`, `create_time`, `update_time`) VALUES (1, 0, 0, '办公技巧', '', 1637984651, 0); +INSERT INTO `oa_article_cate`(`id`, `pid`, `sort`, `title`, `desc`, `create_time`, `update_time`) VALUES (2, 0, 0, '行业技能', '', 1637984739, 0); + -- ---------------------------- -- Table structure for oa_article_keywords -- ---------------------------- @@ -548,6 +560,12 @@ CREATE TABLE `oa_expense_cate` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '报销类型'; +-- ---------------------------- +-- Records of oa_expense_cate +-- ---------------------------- +INSERT INTO `oa_expense_cate`(`id`, `title`, `status`, `create_time`, `update_time`) VALUES (1, '交通费', 1, 1637987189, 0); +INSERT INTO `oa_expense_cate`(`id`, `title`, `status`, `create_time`, `update_time`) VALUES (2, '住宿费', 1, 1637987199, 0); + -- ---------------------------- -- Table structure for oa_expense_file_interfix -- ---------------------------- @@ -744,7 +762,7 @@ CREATE TABLE `oa_note` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `cate_id` int(11) NOT NULL DEFAULT 0 COMMENT '关联分类ID', `title` varchar(225) NULL DEFAULT NULL COMMENT '标题', - `content` varchar(100) NULL DEFAULT NULL COMMENT '内容', + `content` text NOT NULL COMMENT '公告内容', `src` varchar(100) NULL DEFAULT NULL COMMENT '关联链接', `status` int(1) NOT NULL DEFAULT 1 COMMENT '1可用-1禁用', `sort` int(11) NOT NULL DEFAULT 0, @@ -755,6 +773,11 @@ CREATE TABLE `oa_note` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '公告'; +-- ---------------------------- +-- Records of oa_note +-- ---------------------------- +INSERT INTO `oa_note`(`id`, `cate_id`, `title`, `content`, `src`, `status`, `sort`, `start_time`, `end_time`, `create_time`, `update_time`) VALUES (1, 1, '欢迎使用勾股OA办公系统', '

欢迎使用勾股OA办公系统,勾股办公是一款基于ThinkPHP6 + Layui + MySql打造的,简单实用的开源免费的企业办公系统框架。系统集成了系统设置、人事管理模块、消息管理模块、日常办公、财务管理等基础模块。系统简约,易于功能扩展,方便二次开发,让开发者更专注于业务深度需求的开发,帮助开发者简单高效降低二次开发成本,通过二次开发之后可以用来做CRM,ERP,业务管理等系统。

', 'https://oa.gougucms.com', 1, 2, 1635696000, 1924876800, 1637984962, 1637984975); + -- ---------------------------- -- Table structure for oa_note_cate -- ---------------------------- @@ -769,6 +792,12 @@ CREATE TABLE `oa_note_cate` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '公告分类'; +-- ---------------------------- +-- Records of oa_note_cate +-- ---------------------------- +INSERT INTO `oa_note_cate`(`id`, `pid`, `sort`, `title`, `create_time`, `update_time`) VALUES (1, 0, 1, '普通公告', 1637984265, 1637984299); +INSERT INTO `oa_note_cate`(`id`, `pid`, `sort`, `title`, `create_time`, `update_time`) VALUES (2, 0, 2, '紧急公告', 1637984283, 1637984310); + -- ---------------------------- -- Table structure for oa_position -- ----------------------------
工作内容'+detail.name+''+detail.title+'工作类别'+work_type+'