更新layui到2.7.0版本,新增系统模块管理功能,新增独立的项目管理模块,优化审批流程,新增发票审核、报销审核的抄送列表功能。
This commit is contained in:
parent
557cf9b683
commit
b6224ed63e
app
api/controller
article
config
controller
validate
view
finance
controller
view
home
controller
validate
view
cate
conf
flow
index
keywords
login
module
install/data
message/view/index
oa
controller
view
approve
add.htmladd_caigou.htmladd_chuchai.htmladd_fukuan.htmladd_gongwen.htmladd_huiyishi.htmladd_huodong.htmladd_jiaban.htmladd_jiangli.htmladd_jiekuan.htmladd_lizhi.htmladd_qingjia.htmladd_ruzhi.htmladd_tongyong.htmladd_waichu.htmladd_weixiu.htmladd_yongche.htmladd_yongcheguihai.htmladd_yongzhang.htmladd_zhaopin.htmladd_zhuangang.htmladd_zhuanzheng.htmlview_script.html
schedule
work
project
@ -246,22 +246,53 @@ class Index extends BaseController
|
||||
$res['data'] = $list;
|
||||
return table_assign(0, '', $res);
|
||||
}
|
||||
|
||||
//首页文章
|
||||
|
||||
//首页文章
|
||||
public function get_article_list()
|
||||
{
|
||||
$list = Db::name('Article')
|
||||
->field('a.id,a.title,a.create_time,a.read,c.title as cate_title')
|
||||
->alias('a')
|
||||
->join('article_cate c', 'a.article_cate_id = c.id')
|
||||
->where(['a.status' => 1])
|
||||
->order('a.id desc')
|
||||
->limit(10)
|
||||
->select()->toArray();
|
||||
foreach ($list as $key => $val) {
|
||||
$list[$key]['create_time'] = date('Y-m-d :H:i', $val['create_time']);
|
||||
}
|
||||
$res['data'] = $list;
|
||||
$prefix = get_config('database.connections.mysql.prefix');//判断是否安装了文章模块
|
||||
$exist = Db::query('show tables like "'.$prefix.'article"');
|
||||
$res['data'] = [];
|
||||
if($exist){
|
||||
$list = Db::name('Article')
|
||||
->field('a.id,a.title,a.create_time,a.read,c.title as cate_title')
|
||||
->alias('a')
|
||||
->join('article_cate c', 'a.cate_id = c.id')
|
||||
->where(['a.delete_time' => 0])
|
||||
->order('a.id desc')
|
||||
->limit(10)
|
||||
->select()->toArray();
|
||||
foreach ($list as $key => $val) {
|
||||
$list[$key]['create_time'] = date('Y-m-d :H:i', $val['create_time']);
|
||||
}
|
||||
$res['data'] = $list;
|
||||
}
|
||||
return table_assign(0, '', $res);
|
||||
}
|
||||
|
||||
|
||||
//首页项目
|
||||
public function get_project_list()
|
||||
{
|
||||
$prefix = get_config('database.connections.mysql.prefix');//判断是否安装了项目模块
|
||||
$exist = Db::query('show tables like "'.$prefix.'project"');
|
||||
$res['data'] = [];
|
||||
if($exist){
|
||||
$list = Db::name('Project')
|
||||
->field('a.id,a.name,a.status,a.create_time,a.start_time,a.end_time,u.name as director_name')
|
||||
->alias('a')
|
||||
->join('Admin u', 'a.director_uid = u.id')
|
||||
->where([['a.delete_time','=',0]])
|
||||
->order('a.id desc')
|
||||
->limit(10)
|
||||
->select()->toArray();
|
||||
foreach ($list as $key => $val) {
|
||||
$list[$key]['create_time'] = date('Y-m-d :H:i', $val['create_time']);
|
||||
$list[$key]['plan_time'] = date('Y-m-d', $list[$key]['start_time']) . ' 至 ' . date('Y-m-d', $list[$key]['end_time']);
|
||||
$list[$key]['status_name'] = \app\project\model\Project::$Status[(int) $val['status']];
|
||||
}
|
||||
$res['data'] = $list;
|
||||
}
|
||||
return table_assign(0, '', $res);
|
||||
}
|
||||
|
||||
@ -361,6 +392,12 @@ class Index extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
//获取工作类型列表
|
||||
public function get_work_cate()
|
||||
{
|
||||
$cate = Db::name('WorkCate')->field('id,title')->where([['status', '=', 1]])->select();
|
||||
return to_assign(0, '', $cate);
|
||||
}
|
||||
|
||||
//获取审核类型
|
||||
public function get_flow_cate($type=0)
|
||||
|
1
app/article/config/install.gouguoa
Normal file
1
app/article/config/install.gouguoa
Normal file
@ -0,0 +1 @@
|
||||
勾股OA模块安装鉴定文件,请勿删除!!!!!此次模块标识为:article
|
78
app/article/config/install.sql
Normal file
78
app/article/config/install.sql
Normal file
@ -0,0 +1,78 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_article_cate
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_article_cate`;
|
||||
CREATE TABLE `oa_article_cate` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`pid` int(11) NOT NULL DEFAULT 0 COMMENT '父类ID',
|
||||
`sort` int(5) NOT NULL DEFAULT 0 COMMENT '排序',
|
||||
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '分类标题',
|
||||
`desc` varchar(1000) NULL DEFAULT '' COMMENT '描述',
|
||||
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间',
|
||||
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '知识文章分类表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of oa_article_cate
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_article_cate` VALUES (1, 0, 0, '办公技巧', '', 1637984651, 0);
|
||||
INSERT INTO `oa_article_cate` VALUES (2, 0, 0, '行业技能', '', 1637984739, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_article
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_article`;
|
||||
CREATE TABLE `oa_article` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '知识文章标题',
|
||||
`cate_id` int(11) NOT NULL DEFAULT 0 COMMENT '关联分类id',
|
||||
`keywords` varchar(255) NULL DEFAULT '' COMMENT '关键字',
|
||||
`desc` varchar(1000) NULL DEFAULT '' COMMENT '摘要',
|
||||
`thumb` int(11) NOT NULL DEFAULT 0 COMMENT '缩略图id',
|
||||
`uid` int(11) NOT NULL DEFAULT 0 COMMENT '作者',
|
||||
`did` int(11) NOT NULL DEFAULT 0 COMMENT '部门',
|
||||
`origin_url` varchar(255) NOT NULL DEFAULT '' COMMENT '来源地址',
|
||||
`content` text NOT NULL COMMENT '文章内容',
|
||||
`read` int(11) NOT NULL DEFAULT 0 COMMENT '阅读量',
|
||||
`type` tinyint(2) NOT NULL DEFAULT 0 COMMENT '属性:1精华 2热门 3推荐',
|
||||
`is_share` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否分享,0否,1是',
|
||||
`status` int(1) NOT NULL DEFAULT 1 COMMENT '状态:1正常-1下架',
|
||||
`sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
|
||||
`create_time` int(11) NOT NULL DEFAULT 0,
|
||||
`update_time` int(11) NOT NULL DEFAULT 0,
|
||||
`delete_time` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '知识文章表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of oa_article
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_article` VALUES (1, '勾股OA——简单实用的开源免费的企业办公系统框架', 2, '', '勾股办公是一款简单实用的开源免费的企业办公系统框架。系统集成了系统设置、人事管理模块、消息管理模块、日常办公、财务管理等基础模块。系统简约,易于功...', 1, 1, 1, '', '勾股办公是一款简单实用的开源免费的企业办公系统框架。系统集成了系统设置、人事管理模块、消息管理模块、日常办公、财务管理等基础模块。系统简约,易于功能扩展,方便二次开发,让开发者更专注于业务深度需求的开发,帮助开发者简单高效降低二次开发成本,通过二次开发之后可以用来做CRM,ERP,业务管理等系统。', 1, 2, 1, 1, 1, 1637985280, 1650817107, 0);
|
||||
INSERT INTO `oa_article` VALUES (2, '勾股CMS——轻量级、高性能极速后台开发框架', 2, '', '勾股CMS是一套轻量级、高性能极速后台开发框架。通用型的后台权限管理框架,极低门槛、操作简单、开箱即用。系统易于功能扩展,代码维护,方便二次开发,让...', 0, 1, 1, '', '勾股CMS是一套轻量级、高性能极速后台开发框架。通用型的后台权限管理框架,极低门槛、操作简单、开箱即用。系统易于功能扩展,代码维护,方便二次开发,让开发者更专注于业务深度需求的开发,帮助开发者简单高效降低二次开发成本。', 0, 0, 1, 1, 0, 1650817085, 0, 0);
|
||||
INSERT INTO `oa_article` VALUES (3, '勾股BLOG——简约,易用开源的个人博客系统', 2, '', '勾股BLOG是一款实用的开源免费的个人博客系统。集成了系统管理、基础数据、博客文章、博客动态、语雀知识库、用户管理、访问统计等功能。具有简约,易用,内存占用低等特点,可以用来做个人博客,工作室官网,自...', 0, 1, 1, '', '勾股BLOG是一款实用的开源免费的个人博客系统。集成了系统管理、基础数据、博客文章、博客动态、语雀知识库、用户管理、访问统计等功能。具有简约,易用,内存占用低等特点,可以用来做个人博客,工作室官网,自媒体官网等网站,二次开发之后也可以作为资讯、展品展示等网站。', 0, 0, 1, 1, 0, 1650817152, 0, 0);
|
||||
INSERT INTO `oa_article` VALUES (4, '勾股DEV——研发管理与团队协作的工具软件', 2, '', '勾股DEV是一款专为IT行业研发团队打造的智能化项目管理与团队协作的工具软件,可以在线管理团队的工作、项目和任务,覆盖从需求提出到研发完成上线整个过程的项目协作。', 0, 1, 1, '', '勾股DEV是一款专为IT行业研发团队打造的智能化项目管理与团队协作的工具软件,可以在线管理团队的工作、项目和任务,覆盖从需求提出到研发完成上线整个过程的项目协作。', 0, 0, 1, 1, 0, 1650817189, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_article_keywords
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_article_keywords`;
|
||||
CREATE TABLE `oa_article_keywords` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`aid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '知识文章ID',
|
||||
`keywords_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联关键字id',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
|
||||
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `aid`(`aid`) USING BTREE,
|
||||
INDEX `inid`(`keywords_id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '知识文章关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of oa_article_keywords
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_article_keywords` VALUES (1, 1, 1, 1, 1638093082);
|
||||
INSERT INTO `oa_article_keywords` VALUES (2, 2, 2, 1, 1638093082);
|
||||
INSERT INTO `oa_article_keywords` VALUES (3, 3, 3, 3, 1638093082);
|
||||
INSERT INTO `oa_article_keywords` VALUES (4, 4, 4, 4, 1638093082);
|
105
app/article/controller/Cate.php
Normal file
105
app/article/controller/Cate.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\article\controller;
|
||||
|
||||
use app\base\BaseController;
|
||||
use app\article\validate\ArticleCateCheck;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
|
||||
class Cate extends BaseController
|
||||
{
|
||||
//文章类别
|
||||
public function cate()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$cate = Db::name('ArticleCate')->order('create_time asc')->select();
|
||||
return to_assign(0, '', $cate);
|
||||
} else {
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//文章分类添加&编辑
|
||||
public function cate_add()
|
||||
{
|
||||
$param = get_params();
|
||||
if (request()->isAjax()) {
|
||||
if (!empty($param['id']) && $param['id'] > 0) {
|
||||
try {
|
||||
validate(ArticleCateCheck::class)->scene('edit')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
$note_array = admin_article_cate_son($param['id']);
|
||||
if (in_array($param['pid'], $note_array)) {
|
||||
return to_assign(1, '父级分类不能是该分类本身或其子分类');
|
||||
} else {
|
||||
$param['update_time'] = time();
|
||||
$res = Db::name('ArticleCate')->strict(false)->field(true)->update($param);
|
||||
if($res){
|
||||
add_log('edit', $param['id'], $param);
|
||||
return to_assign();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
validate(ArticleCateCheck::class)->scene('add')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
$param['create_time'] = time();
|
||||
$insertId = Db::name('ArticleCate')->strict(false)->field(true)->insertGetId($param);
|
||||
if ($insertId) {
|
||||
add_log('add', $insertId, $param);
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
} else {
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$pid = isset($param['pid']) ? $param['pid'] : 0;
|
||||
$cate = Db::name('ArticleCate')->order('id desc')->select()->toArray();
|
||||
$cates = set_recursion($cate);
|
||||
if ($id > 0) {
|
||||
$detail = Db::name('ArticleCate')->where(['id' => $id])->find();
|
||||
View::assign('detail', $detail);
|
||||
}
|
||||
View::assign('id', $id);
|
||||
View::assign('pid', $pid);
|
||||
View::assign('cates', $cates);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//删除文章分类
|
||||
public function cate_delete()
|
||||
{
|
||||
$id = get_params("id");
|
||||
$cate_count = Db::name('ArticleCate')->where(["pid" => $id])->count();
|
||||
if ($cate_count > 0) {
|
||||
return to_assign(1, "该分类下还有子分类,无法删除");
|
||||
}
|
||||
$content_count = Db::name('Article')->where(["article_cate_id" => $id])->count();
|
||||
if ($content_count > 0) {
|
||||
return to_assign(1, "该分类下还有文章,无法删除");
|
||||
}
|
||||
if (Db::name('ArticleCate')->delete($id) !== false) {
|
||||
add_log('delete', $id);
|
||||
return to_assign(0, "删除分类成功");
|
||||
} else {
|
||||
return to_assign(1, "删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -26,16 +26,16 @@ class Index extends BaseController
|
||||
if (!empty($param['keywords'])) {
|
||||
$where[] = ['a.id|a.title|a.keywords|a.desc|a.content|c.title', 'like', '%' . $param['keywords'] . '%'];
|
||||
}
|
||||
if (!empty($param['article_cate_id'])) {
|
||||
$where[] = ['a.article_cate_id', '=', $param['article_cate_id']];
|
||||
if (!empty($param['cate_id'])) {
|
||||
$where[] = ['a.cate_id', '=', $param['cate_id']];
|
||||
}
|
||||
$where[] = ['a.status', '>=', 0];
|
||||
$where[] = ['a.delete_time', '=', 0];
|
||||
$where[] = ['a.is_share', '=', 1];
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$content = ArticleList::where($where)
|
||||
->field('a.*,c.id as cate_id,a.id as id,c.title as cate_title,a.title as title,d.title as department,u.name as user')
|
||||
->field('a.*,a.id as id,c.title as cate_title,a.title as title,d.title as department,u.name as user')
|
||||
->alias('a')
|
||||
->join('article_cate c', 'a.article_cate_id = c.id')
|
||||
->join('article_cate c', 'a.cate_id = c.id')
|
||||
->join('admin u', 'a.uid = u.id','LEFT')
|
||||
->join('department d', 'a.did = d.id','LEFT')
|
||||
->order('a.create_time desc')
|
||||
@ -54,16 +54,16 @@ class Index extends BaseController
|
||||
if (!empty($param['keywords'])) {
|
||||
$where[] = ['a.id|a.title|a.keywords|a.desc|a.content|c.title', 'like', '%' . $param['keywords'] . '%'];
|
||||
}
|
||||
if (!empty($param['article_cate_id'])) {
|
||||
$where[] = ['a.article_cate_id', '=', $param['article_cate_id']];
|
||||
if (!empty($param['cate_id'])) {
|
||||
$where[] = ['a.cate_id', '=', $param['cate_id']];
|
||||
}
|
||||
$where[] = ['a.status', '>=', 0];
|
||||
$where[] = ['a.delete_time', '=', 0];
|
||||
$where[] = ['a.uid', '=', $this->uid];
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$content = ArticleList::where($where)
|
||||
->field('a.*,c.id as cate_id,a.id as id,c.title as cate_title,a.title as title')
|
||||
->field('a.*,a.id as id,c.title as cate_title,a.title as title')
|
||||
->alias('a')
|
||||
->join('article_cate c', 'a.article_cate_id = c.id')
|
||||
->join('article_cate c', 'a.cate_id = c.id')
|
||||
->order('a.create_time desc')
|
||||
->paginate($rows, false, ['query' => $param]);
|
||||
return table_assign(0, '', $content);
|
||||
@ -168,7 +168,7 @@ class Index extends BaseController
|
||||
{
|
||||
$id = get_params("id");
|
||||
$detail = (new ArticleList())->detail($id);
|
||||
$detail['cate_title'] = Db::name('ArticleCate')->where(['id' => $detail['article_cate_id']])->value('title');
|
||||
$detail['cate_title'] = Db::name('ArticleCate')->where(['id' => $detail['cate_id']])->value('title');
|
||||
// read 字段加 1
|
||||
Db::name('article')->where('id', $id)->inc('read')->update();
|
||||
View::assign('detail', $detail);
|
||||
@ -178,9 +178,8 @@ class Index extends BaseController
|
||||
public function delete()
|
||||
{
|
||||
$id = get_params("id");
|
||||
$data['status'] = '-1';
|
||||
$data['id'] = $id;
|
||||
$data['update_time'] = time();
|
||||
$data['delete_time'] = time();
|
||||
if (Db::name('Article')->update($data) !== false) {
|
||||
add_log('delete', $id);
|
||||
return to_assign(0, "删除成功");
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
namespace app\home\validate;
|
||||
namespace app\article\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
@ -15,20 +15,18 @@ class ArticleCheck extends Validate
|
||||
'title' => 'require|unique:article',
|
||||
'content' => 'require',
|
||||
'id' => 'require',
|
||||
'article_cate_id' => 'require',
|
||||
'status' => 'require',
|
||||
'cate_id' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'title.require' => '标题不能为空',
|
||||
'title.unique' => '同样的文章标题已经存在',
|
||||
'article_cate_id.require' => '所属分类为必选',
|
||||
'cate_id.require' => '所属分类为必选',
|
||||
'id.require' => '缺少更新条件',
|
||||
'status.require' => '状态为必选',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['title', 'article_cate_id', 'content', 'status'],
|
||||
'edit' => ['title', 'article_cate_id', 'content', 'id', 'status'],
|
||||
'add' => ['title', 'cate_id', 'content'],
|
||||
'edit' => ['title', 'cate_id', 'content', 'id'],
|
||||
];
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
id:'treeTable'
|
||||
,elem: '#treeTable'
|
||||
,idField:'id'
|
||||
,url: "/home/cate/article_cate"
|
||||
,url: "/article/cate/cate"
|
||||
,cellMinWidth: 100
|
||||
,treeId:'id'//树形id字段名称
|
||||
,treeUpId:'pid'//树形父id字段名称
|
||||
@ -48,18 +48,18 @@
|
||||
|
||||
//表头工具栏事件
|
||||
$('.add-menu').on('click', function(){
|
||||
tool.side("/home/cate/article_cate_add");
|
||||
tool.side("/article/cate/cate_add");
|
||||
return;
|
||||
});
|
||||
|
||||
//操作按钮
|
||||
treeGrid.on('tool(treeTable)', function (obj) {
|
||||
if (obj.event === 'add') {
|
||||
tool.side('/home/cate/article_cate_add?pid='+obj.data.id);
|
||||
tool.side('/article/cate/cate_add?pid='+obj.data.id);
|
||||
return;
|
||||
}
|
||||
if (obj.event === 'edit') {
|
||||
tool.side('/home/cate/article_cate_add?id='+obj.data.id);
|
||||
tool.side('/article/cate/cate_add?id='+obj.data.id);
|
||||
return;
|
||||
}
|
||||
if (obj.event === 'del') {
|
||||
@ -70,7 +70,7 @@
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete("/home/cate/article_cate_delete", { id: obj.data.id }, callback);
|
||||
tool.delete("/article/cate/cate_delete", { id: obj.data.id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
@ -81,7 +81,7 @@
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
tool.post("/home/cate/article_cate_add", data.field, callback);
|
||||
tool.post("/article/cate/cate_add", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
class="layui-input"></td>
|
||||
<td class="layui-td-gray">文章分类<font>*</font></td>
|
||||
<td>
|
||||
<select name="article_cate_id" lay-verify="required" lay-reqText="请选择分类">
|
||||
<select name="cate_id" lay-verify="required" lay-reqText="请选择分类">
|
||||
<option value="">请选择分类</option>
|
||||
{volist name=":set_recursion(article_cate())" id="v"}
|
||||
<option value="{$v.id}">{$v.title}</option>
|
||||
@ -109,13 +109,12 @@
|
||||
elem: '#test1'
|
||||
, url: "/api/index/upload"
|
||||
, done: function (res) {
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
return layer.msg('上传失败');
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
$('#demo1 input').attr('value', res.data.id);
|
||||
$('#demo1 img').attr('src', res.data.filepath);
|
||||
}
|
||||
//上传成功
|
||||
$('#demo1 input').attr('value', res.data.id);
|
||||
$('#demo1 img').attr('src', res.data.filepath);
|
||||
}
|
||||
});
|
||||
|
||||
|
81
app/article/view/index/cate.html
Normal file
81
app/article/view/index/cate.html
Normal file
@ -0,0 +1,81 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="p-3">
|
||||
<div class="gg-form-bar border-t border-x">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm add-menu">+ 添加分类</button>
|
||||
</div>
|
||||
<div>
|
||||
<table class="layui-hide" id="treeTable" lay-filter="treeTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/html" id="switchStatus">
|
||||
<input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="是|否" lay-filter="status" {{ d.status == 1 ? 'checked' : '' }}>
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool', 'treeGrid'];
|
||||
function gouguInit() {
|
||||
var treeGrid = layui.treeGrid,table = layui.table, tool = layui.tool;
|
||||
var pageTable = treeGrid.render({
|
||||
id:'treeTable'
|
||||
,elem: '#treeTable'
|
||||
,idField:'id'
|
||||
,url: "/article/cate/cate"
|
||||
,cellMinWidth: 100
|
||||
,treeId:'id'//树形id字段名称
|
||||
,treeUpId:'pid'//树形父id字段名称
|
||||
,treeShowName:'title'//以树形式显示的字段
|
||||
,cols: [[
|
||||
{field:'id',width:80, title: 'ID号', align:'center'}
|
||||
,{field: 'sort', title: '排序',align:'center', width:80}
|
||||
,{field:'title', edit:'text',width:240, title: '分类名称'}
|
||||
,{field:'pid', title: '父级ID', width:80, align:'center'}
|
||||
,{field:'desc', title: '描述', }
|
||||
,{width:160,title: '操作', align:'center',templet: function(d){
|
||||
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;
|
||||
}
|
||||
}
|
||||
]]
|
||||
,page:false
|
||||
//,skin:'line'
|
||||
});
|
||||
|
||||
//表头工具栏事件
|
||||
$('.add-menu').on('click', function(){
|
||||
tool.side("/article/cate/cate_add");
|
||||
return;
|
||||
});
|
||||
|
||||
//操作按钮
|
||||
treeGrid.on('tool(treeTable)', function (obj) {
|
||||
if (obj.event === 'add') {
|
||||
tool.side('/article/cate/cate_add?pid='+obj.data.id);
|
||||
return;
|
||||
}
|
||||
if (obj.event === 'edit') {
|
||||
tool.side('/article/cate/cate_add?id='+obj.data.id);
|
||||
return;
|
||||
}
|
||||
if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除吗?', { icon: 3, title: '提示' }, function (index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete("/article/cate/cate_delete", { id: obj.data.id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
@ -10,10 +10,10 @@
|
||||
class="layui-input" value="{$article.title}"></td>
|
||||
<td class="layui-td-gray">文章分类<font>*</font></td>
|
||||
<td>
|
||||
<select name="article_cate_id" lay-verify="required" lay-reqText="请选择分类">
|
||||
<select name="cate_id" lay-verify="required" lay-reqText="请选择分类">
|
||||
<option value="">请选择分类</option>
|
||||
{volist name=":set_recursion(article_cate())" id="v"}
|
||||
<option value="{$v.id}" {eq name="$article.article_cate_id" value="$v.id" }selected{/eq}>{$v.title}</option>
|
||||
<option value="{$v.id}" {eq name="$article.cate_id" value="$v.id" }selected{/eq}>{$v.title}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
@ -112,13 +112,12 @@ const moduleInit = ['tool','tagpicker','tinymce'];
|
||||
elem: '#test1',
|
||||
url: "/api/index/upload",
|
||||
done: function (res) {
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
return layer.msg('上传失败');
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
$('#demo1 input').attr('value', res.data.id);
|
||||
$('#demo1 img').attr('src', res.data.filepath);
|
||||
}
|
||||
//上传成功
|
||||
$('#demo1 input').attr('value', res.data.id);
|
||||
$('#demo1 img').attr('src', res.data.filepath);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-x border-t">
|
||||
<div class="layui-input-inline">
|
||||
<select name="article_cate_id">
|
||||
<select name="cate_id">
|
||||
<option value="">请选择知识文章分类</option>
|
||||
{volist name=":set_recursion(article_cate())" id="v"}
|
||||
<option value="{$v.id}">{$v.title}</option>
|
||||
@ -36,6 +36,7 @@
|
||||
title: '文章列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/article/index/index", //数据接口
|
||||
cellMinWidth: 360,
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
cols: [
|
||||
@ -57,7 +58,8 @@
|
||||
width: 120
|
||||
}, {
|
||||
field: 'title',
|
||||
title: '文章标题'
|
||||
title: '文章标题',
|
||||
templet: '<div><a data-href="/article/index/view/id/{{d.id}}.html" class="layui-table-link right-a" target="_blank">{{d.title}}</a></div>'
|
||||
},{
|
||||
field: 'read',
|
||||
title: '阅读量',
|
||||
@ -73,25 +75,10 @@
|
||||
title: '部门',
|
||||
align: 'center',
|
||||
width: 100
|
||||
}, {
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
width: 60,
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听行工具事件
|
||||
table.on('tool(test)', function(obj) {
|
||||
var data = obj.data;
|
||||
if(obj.event === 'view'){
|
||||
tool.side('/article/index/view?id='+data.id);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(webform)', function(data) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-x border-t">
|
||||
<div class="layui-input-inline">
|
||||
<select name="article_cate_id">
|
||||
<select name="cate_id">
|
||||
<option value="">请选择知识文章分类</option>
|
||||
{volist name=":set_recursion(article_cate())" id="v"}
|
||||
<option value="{$v.id}">{$v.title}</option>
|
||||
@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group"><span class="layui-btn layui-btn-normal layui-btn-xs" lay-event="view">查看</span><span class="layui-btn layui-btn-xs" lay-event="edit">编辑</span><span class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</span></div>
|
||||
<div class="layui-btn-group"><span class="layui-btn layui-btn-xs" lay-event="edit">编辑</span><span class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</span></div>
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
@ -47,6 +47,7 @@
|
||||
title: '文章列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/article/index/list", //数据接口
|
||||
cellMinWidth: 300,
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
cols: [
|
||||
@ -68,7 +69,8 @@
|
||||
width: 120
|
||||
}, {
|
||||
field: 'title',
|
||||
title: '文章标题'
|
||||
title: '文章标题',
|
||||
templet: '<div><a data-href="/article/index/view/id/{{d.id}}.html" class="layui-table-link right-a" target="_blank">{{d.title}}</a></div>'
|
||||
},{
|
||||
field: 'read',
|
||||
title: '阅读量',
|
||||
@ -90,7 +92,7 @@
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
width: 130,
|
||||
width: 100,
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
@ -107,10 +109,6 @@
|
||||
//监听行工具事件
|
||||
table.on('tool(test)', function(obj) {
|
||||
var data = obj.data;
|
||||
if(obj.event === 'view'){
|
||||
tool.side('/article/index/view?id='+data.id);
|
||||
return;
|
||||
}
|
||||
if(obj.event === 'edit'){
|
||||
tool.side('/article/index/add?id='+data.id);
|
||||
return;
|
||||
|
@ -1277,6 +1277,29 @@ function advancedDate($type)
|
||||
return [$start_time,$end_time];
|
||||
}
|
||||
|
||||
/**
|
||||
* 间隔时间段格式化
|
||||
* @param int $time 时间戳
|
||||
* @param string $format 格式 【d:显示到天 i显示到分钟 s显示到秒】
|
||||
* @return string
|
||||
*/
|
||||
function countDays($a, $b = 0)
|
||||
{
|
||||
if ($b == 0) {
|
||||
$b = date("Y-m-d");
|
||||
}
|
||||
$date_1 = $a;
|
||||
$date_2 = $b;
|
||||
$d1 = strtotime($date_1);
|
||||
$d2 = strtotime($date_2);
|
||||
$days = round(($d2 - $d1) / 3600 / 24);
|
||||
if ($days > 0) {
|
||||
return $days;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 间隔时间段格式化
|
||||
* @param int $time 时间戳
|
||||
@ -1567,9 +1590,13 @@ function curl_get($url)
|
||||
//设置获取的信息以文件流的形式返回,而不是直接输出。
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // https请求 不验证证书
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // https请求 不验证hosts
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // https请求 不验证hosts
|
||||
curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE);//添加这个获取请求头信息
|
||||
//执行命令
|
||||
$output = curl_exec($ch);
|
||||
$meta = curl_getinfo($ch,CURLINFO_HEADER_OUT);
|
||||
$accept = substr($meta,0,strpos($meta, 'Accept:'));
|
||||
$host = substr($accept,strpos($accept, 'Host:')+5);
|
||||
curl_close($ch); //释放curl句柄
|
||||
return $output;
|
||||
}
|
||||
@ -1581,10 +1608,11 @@ function curl_get($url)
|
||||
*/
|
||||
function curl_post($url = '', $post = array())
|
||||
{
|
||||
$post['host'] = $_SERVER['HTTP_HOST'];
|
||||
$curl = curl_init(); // 启动一个CURL会话
|
||||
curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1); // 从证书中检查SSL加密算法是否存在
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 从证书中检查SSL加密算法是否存在
|
||||
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器
|
||||
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转
|
||||
curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer
|
||||
|
@ -139,6 +139,28 @@ class Expense extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function copy()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
$user_id = $this->uid;
|
||||
//查询条件
|
||||
$map = [];
|
||||
//按时间检索
|
||||
$start_time = !empty($param['start_time']) ? strtotime(urldecode($param['start_time'])) : 0;
|
||||
$end_time = !empty($param['end_time']) ? strtotime(urldecode($param['end_time'])) : 0;
|
||||
if ($start_time > 0 && $end_time > 0) {
|
||||
$where[] = ['expense_time', 'between', [$start_time, $end_time]];
|
||||
}
|
||||
$map[] = ['check_status', '=', 2];
|
||||
$map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',copy_uids)")];
|
||||
$expense = $this->get_list($map, $param);
|
||||
return table_assign(0, '', $expense);
|
||||
} else {
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//报销打款
|
||||
public function checkedlist()
|
||||
{
|
||||
|
@ -153,6 +153,28 @@ class Invoice extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function copy()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
$user_id = $this->uid;
|
||||
//查询条件
|
||||
$map = [];
|
||||
//按时间检索
|
||||
$start_time = !empty($param['start_time']) ? strtotime(urldecode($param['start_time'])) : 0;
|
||||
$end_time = !empty($param['end_time']) ? strtotime(urldecode($param['end_time'])) : 0;
|
||||
if ($start_time > 0 && $end_time > 0) {
|
||||
$where[] = ['expense_time', 'between', [$start_time, $end_time]];
|
||||
}
|
||||
$map[] = ['check_status', '=', 2];
|
||||
$map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',copy_uids)")];
|
||||
$expense = $this->get_list($map, $param);
|
||||
return table_assign(0, '', $expense);
|
||||
} else {
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//发票开具
|
||||
public function checkedlist()
|
||||
{
|
||||
|
@ -174,9 +174,9 @@
|
||||
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
|
||||
<td colspan="5">
|
||||
<div class="layui-row" id="fileList">
|
||||
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
|
||||
{notempty name="$detail.file_ids"}
|
||||
{volist name="$detail.fileArray" id="vo"}
|
||||
<input type="hidden" name="file_ids" value="{$expense.file_ids}">
|
||||
{notempty name="$expense.file_ids"}
|
||||
{volist name="$expense.fileArray" id="vo"}
|
||||
<div class="layui-col-md3" id="uploadImg{$vo.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon iconfont icon-renwuguanli"></i>
|
||||
@ -272,29 +272,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -382,18 +380,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -428,53 +429,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
//添加报销信息表格
|
||||
$('#addInterfix').on('click',function(){
|
||||
var html = '';
|
||||
var selectTem=$('#selectTem').html();
|
||||
html += '<tr class="more_interfix">\
|
||||
<td><input type="text" name="amount[]" class="layui-input" lay-verify="required|number" lay-reqText="请完善报销金额"></td>\
|
||||
<td style="text-align:left">'+selectTem+'</td>\
|
||||
<td><input type="text" name="remarks[]" class="layui-input"><input type="hidden" name="expense_id[]" class="layui-input" value="0"></td>\
|
||||
<td><a class="layui-btn layui-btn-danger layui-btn-xs" data-id="0" lay-event="del">删除</a></td>\
|
||||
</tr>';
|
||||
$("#interfix").append(html).find('.tr-none').remove();
|
||||
form.render();
|
||||
});
|
||||
|
||||
$('#interfix').on('click', '[lay-event="del"]', function() {
|
||||
if($('.more_interfix').length<2){
|
||||
layer.msg('至少保留一个报销选项');
|
||||
return false;
|
||||
}
|
||||
var that=$(this);
|
||||
var _id = that.data('id');
|
||||
if(_id>0){
|
||||
layer.confirm('确定删除该报销数据项?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
$.ajax({
|
||||
url: "/api/index/del_expense_interfix",
|
||||
type:'post',
|
||||
data: {id: _id},
|
||||
success: function(res) {
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
that.parents(".more_interfix").remove();
|
||||
}
|
||||
}
|
||||
})
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
else{
|
||||
that.parents(".more_interfix").remove();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -54,7 +54,8 @@
|
||||
elem: '#test',
|
||||
title: '报销管理列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/finance/expense/checkedlist", //数据接口
|
||||
url: "/finance/expense/checkedlist", //数据接口
|
||||
cellMinWidth: 100,
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
cols: [
|
||||
|
146
app/finance/view/expense/copy.html
Normal file
146
app/finance/view/expense/copy.html
Normal file
@ -0,0 +1,146 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-x border-t">
|
||||
<div id="barDate" class="layui-input-inline">
|
||||
<div class="layui-input-inline" style="width:110px;">
|
||||
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
||||
</div>
|
||||
~
|
||||
<div class="layui-input-inline" style="width:110px;">
|
||||
<input type="text" class="layui-input" id="end_time" placeholder="选择时间区间" readonly name="end_time">
|
||||
</div>
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-danger" lay-submit="" lay-filter="webform">提交搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="test" lay-filter="test"></table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool','employeepicker'];
|
||||
function gouguInit() {
|
||||
var form = layui.form,table = layui.table,tool=layui.tool, laydate = layui.laydate;
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#barDate',
|
||||
range: ['#start_time', '#end_time']
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(webform)', function(data){
|
||||
let f=data.field;
|
||||
layui.pageTable.reload({where:{start_time:f.start_time,end_time:f.end_time},page:{curr:1}});
|
||||
return false;
|
||||
});
|
||||
|
||||
layui.pageTable = table.render({
|
||||
elem: '#test',
|
||||
title: '报销管理列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/finance/expense/copy", //数据接口
|
||||
page: true, //开启分页
|
||||
cellMinWidth: 100,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID号',
|
||||
align: 'center',
|
||||
width: 80
|
||||
}, {
|
||||
field: 'amount',
|
||||
title: '报销总金额(元)',
|
||||
align: 'right',
|
||||
style: 'color:#1E9FFF',
|
||||
width: 120,
|
||||
},{
|
||||
field: 'check_status',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
templet:function(d){
|
||||
var html='<span style="color:#FF5722">审批不通过</span>';
|
||||
if(d.check_status==1){
|
||||
html='<span style="color:#5FB878">审批中</span>';
|
||||
}
|
||||
else if(d.check_status==2){
|
||||
html='<span style="color:#1E9FFF">审批通过</span>';
|
||||
}
|
||||
else if(d.check_status==4){
|
||||
html='<span style="color:#FF5722">撤销</span>';
|
||||
}
|
||||
else if(d.check_status==5){
|
||||
html='<span style="color:#FFB800">已打款</span>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
},{
|
||||
field: 'admin_name',
|
||||
title: '报销人',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'department',
|
||||
title: '报销部门',
|
||||
align: 'center',
|
||||
width: 150
|
||||
},{
|
||||
field: 'code',
|
||||
title: '报销凭证编号'
|
||||
},{
|
||||
field: 'expense_time',
|
||||
title: '原始单据日期',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},{
|
||||
field: 'income_month',
|
||||
title: '入账月份',
|
||||
align: 'center',
|
||||
width: 90
|
||||
},{
|
||||
field: 'create_time',
|
||||
title: '录入时间',
|
||||
align: 'center',
|
||||
width: 150
|
||||
},{
|
||||
field: 'pay_name',
|
||||
title: '打款人',
|
||||
align: 'center',
|
||||
width: 90
|
||||
},{
|
||||
field: 'pay_time',
|
||||
title: '打款确认时间',
|
||||
align: 'center',
|
||||
width: 150
|
||||
}, {
|
||||
field: 'right',
|
||||
fixed: 'right',
|
||||
title: '操作',
|
||||
width: 80,
|
||||
align: 'center',
|
||||
templet:function(d){
|
||||
var html='<span class="layui-btn layui-btn-normal layui-btn-xs" lay-event="view">详情</span>';
|
||||
return html;
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
//监听行工具事件
|
||||
table.on('tool(test)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'view') {
|
||||
tool.side("/finance/expense/view?id="+data.id);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
@ -59,6 +59,7 @@
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/finance/expense/index", //数据接口
|
||||
page: true, //开启分页
|
||||
cellMinWidth: 100,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
|
@ -37,7 +37,8 @@
|
||||
elem: '#test',
|
||||
title: '报销管理列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/finance/expense/list", //数据接口
|
||||
url: "/finance/expense/list", //数据接口
|
||||
cellMinWidth: 100,
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
cols: [
|
||||
|
@ -50,7 +50,8 @@
|
||||
elem: '#test',
|
||||
title: '到账列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/finance/income/index", //数据接口
|
||||
url: "/finance/income/index", //数据接口
|
||||
cellMinWidth: 320,
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
cols: [
|
||||
@ -88,7 +89,6 @@
|
||||
}, {
|
||||
field: 'invoice_title',
|
||||
title: '发票抬头',
|
||||
minWidth: 300,
|
||||
templet:function(d){
|
||||
var html='';
|
||||
if(d.type==1){
|
||||
|
@ -192,7 +192,7 @@ const moduleInit = ['tool'];
|
||||
//获取审核信息
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_nodes",
|
||||
type:'post',
|
||||
type:'get',
|
||||
data:{id:$('[name="id"]').val(),type:3},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
|
@ -260,29 +260,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -340,18 +338,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -386,8 +387,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
@ -55,7 +55,8 @@
|
||||
elem: '#test',
|
||||
title: '发票列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/finance/invoice/checkedlist", //数据接口
|
||||
url: "/finance/invoice/checkedlist", //数据接口
|
||||
cellMinWidth: 320,
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
cols: [
|
||||
|
173
app/finance/view/invoice/copy.html
Normal file
173
app/finance/view/invoice/copy.html
Normal file
@ -0,0 +1,173 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-x border-t">
|
||||
<div id="barDate" class="layui-input-inline">
|
||||
<div class="layui-input-inline" style="width:110px;">
|
||||
<input type="text" class="layui-input" id="start_time" placeholder="选择时间区间" readonly name="start_time">
|
||||
</div>
|
||||
~
|
||||
<div class="layui-input-inline" style="width:110px;">
|
||||
<input type="text" class="layui-input" id="end_time" placeholder="选择时间区间" readonly name="end_time">
|
||||
</div>
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-danger" lay-submit="" lay-filter="webform">提交搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="test" lay-filter="test"></table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool','employeepicker'];
|
||||
function gouguInit() {
|
||||
var form = layui.form,table = layui.table,tool=layui.tool, laydate = layui.laydate;
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#barDate',
|
||||
range: ['#start_time', '#end_time']
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(webform)', function(data){
|
||||
let f=data.field;
|
||||
layui.pageTable.reload({where:{start_time:f.start_time,end_time:f.end_time},page:{curr:1}});
|
||||
return false;
|
||||
});
|
||||
|
||||
layui.pageTable = table.render({
|
||||
elem: '#test',
|
||||
title: '发票列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/finance/invoice/copy", //数据接口
|
||||
page: true, //开启分页
|
||||
cellMinWidth: 320,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID号',
|
||||
align: 'center',
|
||||
width: 80
|
||||
}, {
|
||||
field: 'invoice_title',
|
||||
title: '开票抬头',
|
||||
templet:function(d){
|
||||
var html='';
|
||||
if(d.type==1){
|
||||
html='<span class="layui-badge layui-bg-blue">企业</span> '+d.invoice_title;
|
||||
}
|
||||
else if(d.type==2){
|
||||
html='<span class="layui-badge layui-bg-green">个人</span> '+d.invoice_title;
|
||||
}
|
||||
return html;
|
||||
}
|
||||
},{
|
||||
field: 'amount',
|
||||
title: '开票金额(元)',
|
||||
align: 'right',
|
||||
style: 'color:#1E9FFF',
|
||||
width: 100,
|
||||
},{
|
||||
field: 'invoice_type',
|
||||
title: '开票类型',
|
||||
align: 'center',
|
||||
width: 90,
|
||||
templet:function(d){
|
||||
var html='-';
|
||||
if(d.invoice_type==1){
|
||||
html='<span style="color:#1E9FFF">专票</span>';
|
||||
}
|
||||
else if(d.invoice_type==2){
|
||||
html='<span style="color:#5FB878">普票</span>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
},{
|
||||
field: 'check_status',
|
||||
title: '发票状态',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
templet:function(d){
|
||||
var html='<span style="color:#FF5722">待审核</span>';
|
||||
if(d.check_status==1){
|
||||
html='<span style="color:#FFB800">审核中</span>';
|
||||
}
|
||||
else if(d.check_status==2){
|
||||
html='<span style="color:#5FB878">待开具</span>';
|
||||
}
|
||||
else if(d.check_status==3){
|
||||
html='<span style="color:#FF5722">审核不通过</span>';
|
||||
}
|
||||
else if(d.check_status==4){
|
||||
html='<span style="color:#FF5722">撤销</span>';
|
||||
}
|
||||
else if(d.check_status==5){
|
||||
html='<span style="color:#1E9FFF">已开具</span>';
|
||||
}
|
||||
else if(d.check_status==10){
|
||||
html='<span style="color:#FF5722">已作废</span>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
},{
|
||||
field: 'name',
|
||||
title: '申请人',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'department_name',
|
||||
title: '所属部门',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},{
|
||||
field: 'create_time',
|
||||
title: '申请时间',
|
||||
align: 'center',
|
||||
width: 150
|
||||
},{
|
||||
field: 'open_name',
|
||||
title: '开票人',
|
||||
align: 'center',
|
||||
width: 90
|
||||
},{
|
||||
field: 'open_time',
|
||||
title: '开票时间',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'code',
|
||||
title: '发票号码',
|
||||
align: 'center',
|
||||
width: 132
|
||||
}, {
|
||||
field: 'right',
|
||||
fixed: 'right',
|
||||
title: '操作',
|
||||
width: 80,
|
||||
align: 'center',
|
||||
templet:function(d){
|
||||
//0待审、1审批中、2通过、3失败、4撤销、5已开具、10已作废
|
||||
var html='<span class="layui-btn layui-btn-normal layui-btn-xs" lay-event="view">详情</span>';
|
||||
return html;
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
//监听行工具事件
|
||||
table.on('tool(test)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'view') {
|
||||
tool.side("/finance/invoice/view?id="+data.id);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
@ -60,6 +60,7 @@
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/finance/invoice/index", //数据接口
|
||||
page: true, //开启分页
|
||||
cellMinWidth: 320,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
@ -71,7 +72,6 @@
|
||||
}, {
|
||||
field: 'invoice_title',
|
||||
title: '开票抬头',
|
||||
width: 300,
|
||||
templet:function(d){
|
||||
var html='';
|
||||
if(d.type==1){
|
||||
|
@ -36,7 +36,8 @@
|
||||
elem: '#test',
|
||||
title: '发票列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/finance/invoice/list", //数据接口
|
||||
url: "/finance/invoice/list", //数据接口
|
||||
cellMinWidth: 320,
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
cols: [
|
||||
@ -49,7 +50,6 @@
|
||||
}, {
|
||||
field: 'invoice_title',
|
||||
title: '开票抬头',
|
||||
width: 320,
|
||||
templet:function(d){
|
||||
var html='';
|
||||
if(d.type==1){
|
||||
|
@ -245,7 +245,7 @@ const moduleInit = ['tool','employeepicker'];
|
||||
//获取审核信息
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_nodes",
|
||||
type:'post',
|
||||
type:'get',
|
||||
data:{id:$('[name="id"]').val(),type:3},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
|
@ -16,7 +16,8 @@ use app\home\validate\CostCateCheck;
|
||||
use app\home\validate\SealCateCheck;
|
||||
use app\home\validate\CarCateCheck;
|
||||
use app\home\validate\NoteCateCheck;
|
||||
use app\home\validate\ArticleCateCheck;
|
||||
use app\home\validate\WorkCateCheck;
|
||||
use app\home\validate\KeyworksCheck;
|
||||
use app\home\validate\InvoiceSubjectCheck;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
@ -503,6 +504,71 @@ class Cate extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//工作类别
|
||||
public function work_cate()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$cate = Db::name('WorkCate')->order('create_time asc')->select();
|
||||
return to_assign(0, '', $cate);
|
||||
} else {
|
||||
return view();
|
||||
}
|
||||
}
|
||||
//工作类别添加
|
||||
public function work_cate_add()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
if (!empty($param['id']) && $param['id'] > 0) {
|
||||
try {
|
||||
validate(WorkCateCheck::class)->scene('edit')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
$data['update_time'] = time();
|
||||
$res = Db::name('WorkCate')->strict(false)->field(true)->update($param);
|
||||
if ($res) {
|
||||
add_log('edit', $param['id'], $param);
|
||||
}
|
||||
return to_assign();
|
||||
} else {
|
||||
try {
|
||||
validate(WorkCateCheck::class)->scene('add')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
$param['create_time'] = time();
|
||||
$insertId = Db::name('WorkCate')->strict(false)->field(true)->insertGetId($param);
|
||||
if ($insertId) {
|
||||
add_log('add', $insertId, $param);
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//工作类别设置
|
||||
public function work_cate_check()
|
||||
{
|
||||
$param = get_params();
|
||||
$res = Db::name('WorkCate')->strict(false)->field('id,status')->update($param);
|
||||
if ($res) {
|
||||
if($param['status'] == 0){
|
||||
add_log('disable', $param['id'], $param);
|
||||
}
|
||||
else if($param['status'] == 1){
|
||||
add_log('recovery', $param['id'], $param);
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
else{
|
||||
return to_assign(0, '操作失败');
|
||||
}
|
||||
}
|
||||
|
||||
//文章类别
|
||||
public function article_cate()
|
||||
{
|
||||
|
@ -92,16 +92,48 @@ class Index extends BaseController
|
||||
if (file_exists(CMS_ROOT . 'app/install')) {
|
||||
$install = true;
|
||||
}
|
||||
$total=[];
|
||||
$adminCount = Db::name('Admin')->where('status', '1')->count();
|
||||
$articleCount = Db::name('Article')->where('status', '1')->count();
|
||||
$approveCount = Db::name('Approve')->count();
|
||||
$expenseCount = Db::name('Expense')->count();
|
||||
$invoiceCount = Db::name('Invoice')->count();
|
||||
View::assign('adminCount', $adminCount);
|
||||
View::assign('articleCount', $articleCount);
|
||||
View::assign('approveCount', $approveCount);
|
||||
View::assign('expenseCount', $expenseCount);
|
||||
View::assign('invoiceCount', $invoiceCount);
|
||||
$total[]=array(
|
||||
'name'=>'员工',
|
||||
'num'=>$adminCount,
|
||||
);
|
||||
$total[]=array(
|
||||
'name'=>'审批',
|
||||
'num'=>$approveCount,
|
||||
);
|
||||
$total[]=array(
|
||||
'name'=>'报销',
|
||||
'num'=>$expenseCount,
|
||||
);
|
||||
$total[]=array(
|
||||
'name'=>'发票',
|
||||
'num'=>$invoiceCount,
|
||||
);
|
||||
$module = Db::name('AdminModule')->column('name');
|
||||
if(in_array('project',$module)){
|
||||
$projectCount = Db::name('Project')->where([['delete_time','>',0]])->count();
|
||||
$taskCount = Db::name('ProjectTask')->where([['delete_time','>',0]])->count();
|
||||
$total[]=array(
|
||||
'name'=>'项目',
|
||||
'num'=>$projectCount,
|
||||
);
|
||||
$total[]=array(
|
||||
'name'=>'任务',
|
||||
'num'=>$taskCount,
|
||||
);
|
||||
}
|
||||
if(in_array('article',$module)){
|
||||
$articleCount = Db::name('Article')->where([['delete_time','>',0]])->count();
|
||||
$total[]=array(
|
||||
'name'=>'文章',
|
||||
'num'=>$articleCount,
|
||||
);
|
||||
}
|
||||
View::assign('total', $total);
|
||||
View::assign('install', $install);
|
||||
View::assign('TP_VERSION',\think\facade\App::version());
|
||||
return View();
|
||||
|
@ -23,73 +23,150 @@ class Module extends BaseController
|
||||
$module = Db::name('AdminModule')->select();
|
||||
return to_assign(0, '', $module);
|
||||
} else {
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//添加新增/编辑
|
||||
public function add()
|
||||
{
|
||||
$param = get_params();
|
||||
if (request()->isAjax()) {
|
||||
$param['name'] = preg_replace('# #','',$param['name']);
|
||||
if ($param['id'] > 0) {
|
||||
$module = Db::name('AdminModule')->where('id',$param['id'])->find();
|
||||
if($module['type'] == 1){
|
||||
return to_assign(1,'系统模块不能编辑');
|
||||
$data = curl_post('https://www.gougucms.com/home/get_module/get');
|
||||
//var_dump($data);exit;
|
||||
$module = json_decode($data, true);
|
||||
$oa_module = $module['data'];
|
||||
$sys_module = Db::name('AdminModule')->select()->toArray();
|
||||
foreach ($oa_module as $key => &$val) {
|
||||
$val['is_install'] = 0;
|
||||
$val['is_file'] = 0;
|
||||
if(file_exists(CMS_ROOT . '/app/'.$val["name"].'/config/install.gouguoa')){
|
||||
$val['is_file'] = 1;
|
||||
}
|
||||
try {
|
||||
validate(ModuleCheck::class)->scene('edit')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
$param['update_time'] = time();
|
||||
Db::name('AdminModule')->strict(false)->field(true)->update($param);
|
||||
add_log('edit', $param['id'], $param);
|
||||
} else {
|
||||
try {
|
||||
validate(ModuleCheck::class)->scene('add')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
$param['create_time'] = time();
|
||||
$mid = Db::name('AdminModule')->strict(false)->field(true)->insertGetId($param);
|
||||
add_log('add', $mid, $param);
|
||||
}
|
||||
return to_assign();
|
||||
} else {
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
if($id>0){
|
||||
$detail = Db::name('AdminModule')->where('id',$id)->find();
|
||||
View::assign('detail', $detail);
|
||||
}
|
||||
View::assign('id', $id);
|
||||
foreach ($sys_module as $sk => $sv) {
|
||||
if($val['name'] == $sv['name']){
|
||||
$val['is_install'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
View::assign('module', $oa_module);
|
||||
//var_dump($oa_module);exit;
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//禁用/启用
|
||||
public function disable()
|
||||
|
||||
//安装模块
|
||||
public function install()
|
||||
{
|
||||
$param = get_params();
|
||||
$module = Db::name('AdminModule')->where('id',$param['id'])->find();
|
||||
if($module['type'] == 1){
|
||||
return to_assign(1,'系统模块不能禁用');
|
||||
if($this->uid!=1){
|
||||
return to_assign(1,'只有系统超级管理员才有权限安装模块!');
|
||||
}
|
||||
$param['update_time']= time();
|
||||
$res = Db::name('AdminModule')->strict(false)->field('status,update_time')->update($param);
|
||||
$param = get_params();
|
||||
$name = $param['name'];
|
||||
$data = curl_post('https://www.gougucms.com/home/get_module/module',['name'=>$name]);
|
||||
$json_data = json_decode($data, true);
|
||||
if($json_data['code'] == 1){
|
||||
return to_assign(1,$json_data['msg']);
|
||||
}
|
||||
$detail = $json_data['data'];
|
||||
$rule = unserialize($detail['rule']);
|
||||
if(empty($rule)){
|
||||
return to_assign(1,'找不到该模块的信息');
|
||||
}
|
||||
$prefix = get_config('database.connections.mysql.prefix');
|
||||
|
||||
$insert = [];
|
||||
$insert['title'] = $detail['title'];
|
||||
$insert['name'] = $detail['name'];
|
||||
$insert['type'] = $detail['type'];
|
||||
$insert['sourse'] = $detail['sourse'];
|
||||
$insert['create_time'] = time();
|
||||
try {
|
||||
validate(ModuleCheck::class)->scene('add')->check($insert);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
//sql语句
|
||||
$sql_file = CMS_ROOT . '/app/'.$name.'/config/install.sql';
|
||||
$sql_array = [];
|
||||
if(file_exists($sql_file)){
|
||||
$sql = file_get_contents($sql_file);
|
||||
$sql_array = preg_split("/;[\r\n]+/", str_replace("oa_", $prefix, $sql));
|
||||
}
|
||||
//var_dump($sql_array);exit;
|
||||
Db::startTrans();
|
||||
try {
|
||||
// 导入sql数据并创建表
|
||||
if(!empty($sql_array)){
|
||||
foreach ($sql_array as $k => $v) {
|
||||
if (!empty($v)) {
|
||||
Db::execute($v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//如果安装过该模块,删除原来的菜单信息
|
||||
Db::name('AdminRule')->where('module',$name)->delete();
|
||||
$sort = Db::name('AdminRule')->where('pid',0)->max('sort');
|
||||
$this->add_rule($rule,0,$sort+1);
|
||||
$mid = Db::name('AdminModule')->strict(false)->field(true)->insertGetId($insert);
|
||||
|
||||
Db::commit();
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
//回滚事务
|
||||
Db::rollback();
|
||||
return to_assign(1,'捕获到异常'.$e->getMessage());
|
||||
}
|
||||
|
||||
//更新超级管理员的权限节点
|
||||
$rules = Db::name('AdminRule')->column('id');
|
||||
$admin_rules = implode(',',$rules);
|
||||
$res = Db::name('AdminGroup')->strict(false)->where('id',1)->update(['rules'=>$admin_rules,'update_time'=>time()]);
|
||||
if($res!==false){
|
||||
Db::name('AdminRule')->strict(false)->where('module',$module['name'])->field('status')->update(['status'=>$param['status']]);
|
||||
// 删除后台节点缓存
|
||||
clear_cache('adminRules');
|
||||
if($param['status'] == 0){
|
||||
add_log('disable', $param['id'], $param);
|
||||
}
|
||||
else if($param['status'] == 1){
|
||||
add_log('recovery', $param['id'], $param);
|
||||
add_log('install', $mid, $insert);
|
||||
return to_assign();
|
||||
}
|
||||
else{
|
||||
return to_assign(1,'操作失败');
|
||||
}
|
||||
}
|
||||
|
||||
//递归插入菜单数据
|
||||
protected function add_rule($data, $pid=0,$sort=0)
|
||||
{
|
||||
foreach($data as $k => $v)
|
||||
{
|
||||
$rule=[
|
||||
'title' => $v['title'],
|
||||
'name' => $v['name'],
|
||||
'src' => $v['src'],
|
||||
'module' => $v['module'],
|
||||
'menu' => $v['menu'],
|
||||
'icon' => $v['icon'],
|
||||
'pid' => $pid,
|
||||
'sort' => $sort,
|
||||
'create_time' => time()
|
||||
];
|
||||
$new_id = Db::name('AdminRule')->strict(false)->field(true)->insertGetId($rule);
|
||||
if(!empty($v['son'] && $new_id)){
|
||||
$this->add_rule($v['son'],$new_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//卸载
|
||||
public function uninstall()
|
||||
{
|
||||
if($this->uid!=1){
|
||||
return to_assign(1,'只有系统超级管理员才有权限卸载模块!');
|
||||
}
|
||||
$param = get_params();
|
||||
$module = Db::name('AdminModule')->where('name',$param['name'])->find();
|
||||
if($module['type'] == 1){
|
||||
return to_assign(1,'系统模块不能卸载');
|
||||
}
|
||||
$param['update_time']= time();
|
||||
$res = Db::name('AdminModule')->where('name',$param['name'])->delete();
|
||||
if($res!==false){
|
||||
Db::name('AdminRule')->strict(false)->where('module',$module['name'])->delete();
|
||||
// 删除后台节点缓存
|
||||
clear_cache('adminRules');
|
||||
add_log('uninstall', $module['id'], $param);
|
||||
return to_assign();
|
||||
}
|
||||
else{
|
||||
|
@ -13,7 +13,7 @@ class ModuleCheck extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'title' => 'require|unique:admin_module',
|
||||
'name' => 'require|upper|min:2|unique:admin_module',
|
||||
'name' => 'require|lower|min:2|unique:admin_module',
|
||||
'id' => 'require',
|
||||
];
|
||||
|
||||
@ -21,8 +21,8 @@ class ModuleCheck extends Validate
|
||||
'title.require' => '模块名称不能为空',
|
||||
'title.unique' => '同样的模块名称已经存在',
|
||||
'name.require' => '模块标识不能为空',
|
||||
'name.upper' => '模块标识只能是大写字符',
|
||||
'name.min' => '模块标识至少需要2个大写字符',
|
||||
'name.lower' => '模块标识只能是小写字母',
|
||||
'name.min' => '模块标识至少需要2个小写字母',
|
||||
'name.unique' => '同样的模块标识已经存在',
|
||||
'id.require' => '缺少更新条件',
|
||||
];
|
||||
|
29
app/home/validate/WorkCateCheck.php
Normal file
29
app/home/validate/WorkCateCheck.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
namespace app\home\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class WorkCateCheck extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'title' => 'require|unique:work_cate',
|
||||
'id' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'title.require' => '名称不能为空',
|
||||
'title.unique' => '同样的名称已经存在',
|
||||
'id.require' => '缺少更新条件',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['title'],
|
||||
'edit' => ['id', 'title'],
|
||||
];
|
||||
}
|
@ -36,6 +36,11 @@
|
||||
如:icon-jichupeizhi<a href="{__GOUGU__}/icon/index.html" target="_blank" style="margin-left:10px; color:#007AFF">[查看图标]</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<span style="color: red; font-size: 12px;">注意:新增审批类型以后,需要对应新增模板文件,模板文件名称需与标识名称一致,建议复制现有的审批类型模板文件,然后根据需求修改对应的表单即可。</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{else/}
|
||||
<table class="layui-table">
|
||||
|
121
app/home/view/cate/work_cate.html
Normal file
121
app/home/view/cate/work_cate.html
Normal file
@ -0,0 +1,121 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="p-3">
|
||||
<table class="layui-hide" id="test" lay-filter="test"></table>
|
||||
</div>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm addNew" type="button">+ 添加工作类型</button>
|
||||
</div>
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table, tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#test'
|
||||
,toolbar: '#toolbarDemo'
|
||||
,title:'工作类型列表'
|
||||
,url: "/home/cate/work_cate"
|
||||
,page: true //开启分页
|
||||
,limit: 20
|
||||
,cellMinWidth: 80
|
||||
,cols: [[
|
||||
{field:'id',width:80, title: 'ID号', align:'center'}
|
||||
,{field:'title',title: '类别名称'}
|
||||
,{field:'status', title: '状态',width:80,align:'center',templet: function(d){
|
||||
var html1='<span>正常</span>';
|
||||
var html2='<span style="color:#FF5722">禁用</span>';
|
||||
if(d.status==1){
|
||||
return html1;
|
||||
}
|
||||
else{
|
||||
return html2;
|
||||
}
|
||||
}}
|
||||
,{width:100,title: '操作', align:'center',templet: function(d){
|
||||
var html='';
|
||||
var btn='<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>';
|
||||
var btn1='<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="disable">禁用</a>';
|
||||
var btn2='<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="open">启用</a>';
|
||||
if(d.status==1){
|
||||
html = '<div class="layui-btn-group">'+btn+btn1+'</div>';
|
||||
}
|
||||
else{
|
||||
html = '<div class="layui-btn-group">'+btn+btn2+'</div>';
|
||||
}
|
||||
return html;
|
||||
}}
|
||||
]]
|
||||
});
|
||||
|
||||
table.on('tool(test)',function (obj) {
|
||||
if(obj.event === 'edit'){
|
||||
addExpense(obj.data.id,obj.data.title);
|
||||
}
|
||||
if(obj.event === 'disable'){
|
||||
layer.confirm('确定要禁用该类别吗?', {icon: 3, title:'提示'}, function(index){
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
layui.pageTable.reload();
|
||||
}
|
||||
}
|
||||
tool.post("/home/cate/work_cate_check", { id: obj.data.id,status: 0,title: obj.data.title}, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
if(obj.event === 'open'){
|
||||
layer.confirm('确定要启用该类别吗?', {icon: 3, title:'提示'}, function(index){
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
layui.pageTable.reload();
|
||||
}
|
||||
}
|
||||
tool.post("/home/cate/work_cate_check", { id: obj.data.id,status: 1,title: obj.data.title}, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('body').on('click','.addNew',function(){
|
||||
addExpense(0,'');
|
||||
});
|
||||
|
||||
function addExpense(id,val){
|
||||
var title = '新增类别';
|
||||
if(id>0){
|
||||
title = '编辑类别';
|
||||
}
|
||||
layer.prompt({
|
||||
title: title,
|
||||
value: val,
|
||||
yes: function(index, layero) {
|
||||
// 获取文本框输入的值
|
||||
var value = layero.find(".layui-layer-input").val();
|
||||
if (value) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
layui.pageTable.reload();
|
||||
}
|
||||
}
|
||||
tool.post("/home/cate/work_cate_add", {id: id,title: value}, callback);
|
||||
layer.close(index);
|
||||
} else {
|
||||
layer.msg('请填写类别标题');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
@ -27,6 +27,7 @@
|
||||
title: '配置列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: "/home/conf/index",
|
||||
cellMinWidth: 300,
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
cols: [
|
||||
|
@ -124,11 +124,10 @@
|
||||
elem: '#uploadBtn',
|
||||
url: "/api/index/upload",
|
||||
done: function (res) {
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败');
|
||||
} else {
|
||||
layer.msg('上传成功');
|
||||
$('#demo1 input').attr('value', res.data.filepath);
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
$('#demo1 input').attr('value', res.data.id);
|
||||
$('#demo1 img').attr('src', res.data.filepath);
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +166,7 @@
|
||||
<select name="flowType[]" lay-filter="flowtype">
|
||||
<option value="1" {eq name="$vo.flow_type" value="1"}selected=""{/eq}>当前部门负责人</option>
|
||||
<option value="2" {eq name="$vo.flow_type" value="2"}selected=""{/eq}>上一级部门负责人</option>
|
||||
<option value="3" {eq name="$vo.flow_type" value="3"}selected=""{/eq}>指定人员(任意一人)</option>
|
||||
<option value="3" {eq name="$vo.flow_type" value="3"}selected=""{/eq}>指定人员(多人或签)</option>
|
||||
<option value="4" {eq name="$vo.flow_type" value="4"}selected=""{/eq}>指定人员(多人会签)</option>
|
||||
</select>
|
||||
</div>
|
||||
@ -305,7 +305,7 @@
|
||||
<select name="flowType[]" lay-filter="flowtype">\
|
||||
<option value="1">当前部门负责人</option>\
|
||||
<option value="2">上一级部门负责人</option>\
|
||||
<option value="3">指定人员(任意一人)</option>\
|
||||
<option value="3">指定人员(多人或签)</option>\
|
||||
<option value="4">指定人员(多人会签)</option>\
|
||||
</select>\
|
||||
</div>\
|
||||
|
@ -3,7 +3,7 @@
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.panel-num table {width: 100%;}
|
||||
.panel-num td {text-align: center; padding: 16px 0; width: 20%;border-left: 1px solid #f1f1f1; position: relative;}
|
||||
.panel-num td {text-align: center; padding: 16px 0; border-left: 1px solid #f1f1f1; position: relative;}
|
||||
.panel-num td:nth-child(1) { border-left: none}
|
||||
.panel-num .num-title { padding-bottom: 10px; color: #999;}
|
||||
.panel-num .blue {font-size: 20px; font-weight: 300;}
|
||||
@ -27,26 +27,12 @@
|
||||
<div class="layui-card panel-num">
|
||||
<table>
|
||||
<tr>
|
||||
{volist name="$total" id="vo"}
|
||||
<td>
|
||||
<div class="num-title">员工</div>
|
||||
<div class="blue">{$adminCount}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="num-title">知识</div>
|
||||
<div class="blue">{$articleCount}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="num-title">审批</div>
|
||||
<div class="blue">{$approveCount}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="num-title">报销</div>
|
||||
<div class="blue">{$expenseCount}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="num-title">发票</div>
|
||||
<div class="blue">{$invoiceCount}</div>
|
||||
<div class="num-title">{$vo.name}</div>
|
||||
<div class="blue">{$vo.num}</div>
|
||||
</td>
|
||||
{/volist}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@ -56,6 +42,12 @@
|
||||
<table id="Note" lay-filter="Note" class="layui-hide" style="margin-top:0"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-title">项目列表</div>
|
||||
<div style="padding: 12px;">
|
||||
<table id="Project" lay-filter="Project" class="layui-hide" style="margin-top:0"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-title">知识列表</div>
|
||||
<div style="padding: 12px;">
|
||||
@ -169,6 +161,26 @@
|
||||
{ field: 'create_time', title: '发布时间', align: 'center','width': 136}
|
||||
]]
|
||||
});
|
||||
//项目
|
||||
table.render({
|
||||
elem: '#Project'
|
||||
, url: "/api/index/get_project_list" //数据接口
|
||||
, page: false //开启分页
|
||||
, cols: [[ //表头
|
||||
{ field: 'id', title: '项目编号', align: 'center','width': 90, templet: function (d) {
|
||||
return 'P' + d.id;
|
||||
}
|
||||
},
|
||||
{field: 'status', title: '状态', align: 'center', width: 80, templet: function (d) {
|
||||
var html = '<span class="layui-btn layui-btn-xs bg-status-' + d.status + '">' + d.status_name + '</span>';
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{ field: 'title', title: '项目名称',templet: '<div><a data-href="/project/index/view/id/{{d.id}}.html" class="layui-table-link right-a" target="_blank">{{d.name}}</a></div>'},
|
||||
{ field: 'director_name', title: '负责人', align: 'center', width: 80},
|
||||
{ field: 'plan_time', title: '项目周期', align: 'center', width: 190},
|
||||
]]
|
||||
});
|
||||
$('body').on('click','[data-event="pay"]',function(){
|
||||
var src=$(this).attr('src');
|
||||
layer.open({
|
||||
@ -186,7 +198,7 @@
|
||||
function get_logs() {
|
||||
$.ajax({
|
||||
url: "/api/index/log_list",
|
||||
type: 'post',
|
||||
type: 'get',
|
||||
data: {
|
||||
page: 1,
|
||||
limit: 20
|
||||
@ -221,7 +233,7 @@
|
||||
function get_view_data() {
|
||||
$.ajax({
|
||||
url: "/api/index/get_view_data",
|
||||
type: 'post',
|
||||
type: 'get',
|
||||
data: {},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
|
@ -1,11 +1,11 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form page-content">
|
||||
<h3 class="h3-title">知识关键字</h3>
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">知识关键字</h3>
|
||||
<table class="layui-table">
|
||||
<tr>
|
||||
<td class="layui-td-gray">关键字名称<font>*</font></td>
|
||||
<td class="layui-td-gray-2">关键字名称<font>*</font></td>
|
||||
<td>
|
||||
<input type="text" name="title" lay-verify="required" lay-reqText="请输入关键字名称" autocomplete="off" placeholder="请输入关键字名称" class="layui-input" {notempty name="$keywords.title"} value="{$keywords.title}" {/notempty}>
|
||||
</td>
|
||||
@ -40,10 +40,9 @@
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
function init(layui) {
|
||||
var form = layui.form
|
||||
, layer = layui.layer;
|
||||
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table, tool = layui.tool, form = layui.form;
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
$.ajax({
|
||||
@ -53,10 +52,8 @@
|
||||
success: function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
parent.tableIns.reload();
|
||||
setTimeout(function(){
|
||||
parent.layui.rightpage.close();
|
||||
},1000);
|
||||
layer.msg(e.msg);
|
||||
parent.layui.tool.close(1000);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -1,22 +1,21 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="body-table">
|
||||
<form class="layui-form layui-form-bar">
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-x border-t">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="关键字名称" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">提交搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="test" lay-filter="test"></table>
|
||||
<table class="layui-hide" id="test" lay-filter="test"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="status">
|
||||
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" lay-event="add">+ 添加关键字</button>
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" lay-event="add">+ 添加关键字</button>
|
||||
</div>
|
||||
</script>
|
||||
{/block}
|
||||
@ -24,11 +23,10 @@
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,form = layui.form;
|
||||
|
||||
var table = layui.table, tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#test',
|
||||
title: '关键字列表',
|
||||
|
@ -67,8 +67,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="foot">
|
||||
{:get_system_config('web','copyright')} <a id="beian" href="//www.beian.miit.gov.cn" target="_blank"
|
||||
rel="nofollow" style="margin-left: 12px;color:#458BF3;">{:get_system_config('web','icp')}</a>,Powered by GouguCMS
|
||||
{:get_system_config('web','copyright')} ,Powered by GouguCMS
|
||||
</div>
|
||||
</div>
|
||||
<script src="{__GOUGU__}/layui/layui.js?v={:get_system_config('web','version')}"></script>
|
||||
|
@ -2,13 +2,64 @@
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="p-3">
|
||||
<table class="layui-hide" id="list" lay-filter="list"></table>
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<th style="text-align: center; background-color:#FAFAFA">模块名称</th>
|
||||
<th style="text-align: center; background-color:#FAFAFA">模块所在目录</th>
|
||||
<th style="text-align: center; background-color:#FAFAFA">功能描述</th>
|
||||
<th style="text-align: center; background-color:#FAFAFA">类型</th>
|
||||
<th style="text-align: center; background-color:#FAFAFA">作者</th>
|
||||
<th style="text-align: center; background-color:#FAFAFA">状态</th>
|
||||
<th style="text-align: center; background-color:#FAFAFA; width:90px">操作</th>
|
||||
</tr>
|
||||
{empty name="module"}
|
||||
<tr>
|
||||
<td colspan="7" align="center">暂无数据</td>
|
||||
</tr>
|
||||
{/empty}
|
||||
{volist name="module" id="vo" key="k"}
|
||||
<tr>
|
||||
<td align="center">{$vo.title}</td>
|
||||
<td>app/{$vo.name}</td>
|
||||
<td>{$vo.desc}</td>
|
||||
<td align="center">
|
||||
{eq name="$vo.type" value="1"}系统模块{/eq}
|
||||
{eq name="$vo.type" value="2"}普通模块{/eq}
|
||||
</td>
|
||||
<td align="center">
|
||||
{eq name="$vo.sourse" value="1"}官方{/eq}
|
||||
{eq name="$vo.sourse" value="2"}第三方{/eq}
|
||||
</td>
|
||||
{eq name="$vo.is_install" value="0"}
|
||||
<td align="center">
|
||||
<span class="green">未安装</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<div class="layui-btn-group">
|
||||
{eq name = "$vo.is_file" value="0"}
|
||||
<a class="layui-btn layui-btn-xs down" href="https://www.gougucms.com/home/pages/detail/s/gouguoa.html" target="_blank">下载</a>
|
||||
{/eq}
|
||||
{eq name = "$vo.is_file" value="1"}
|
||||
<a class="layui-btn layui-btn-xs install" data-name="{$vo.name}">安装</a>
|
||||
{/eq}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs view" href="https://www.gougucms.com/home/pages/detail/s/gouguoa.html" target="_blank">演示</a>
|
||||
</div>
|
||||
</td>
|
||||
{/eq}
|
||||
{eq name="$vo.is_install" value="1"}
|
||||
<td align="center">
|
||||
<span class="red">已安装</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<div class="layui-btn-group">
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs delete" data-name="{$vo.name}">卸载</a>
|
||||
</div>
|
||||
</td>
|
||||
{/eq}
|
||||
</tr>
|
||||
{/volist}
|
||||
</table>
|
||||
</div>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div>
|
||||
<span class="red">模块功能即将推出,该列表目前只是预设数据,不影响开发者基于该版本进行二次开发。</span>
|
||||
</div>
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
@ -17,155 +68,39 @@
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var tool = layui.tool, table = layui.table;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#list'
|
||||
, toolbar: '#toolbarDemo'
|
||||
, title: '功能模块列表'
|
||||
, url: "/home/module/index"
|
||||
, page: false //开启分页
|
||||
, cellMinWidth: 80
|
||||
, cols: [[
|
||||
{ field: 'id', width: 80, title: 'ID号', align: 'center' }
|
||||
, { field: 'title', title: '模块名称' }
|
||||
, {
|
||||
field: 'name', title: '模块所在目录', templet: function (d) {
|
||||
var html = 'app/' + d.name;
|
||||
return html;
|
||||
}
|
||||
}
|
||||
, {
|
||||
field: 'status', title: '状态', width: 80, align: 'center', templet: function (d) {
|
||||
var html1 = '<span>正常</span>';
|
||||
var html2 = '<span style="color:#FF5722">禁用</span>';
|
||||
if (d.status == 1) {
|
||||
return html1;
|
||||
}
|
||||
else {
|
||||
return html2;
|
||||
}
|
||||
}
|
||||
}
|
||||
, {
|
||||
field: 'type', title: '类型', width: 120, align: 'center', templet: function (d) {
|
||||
var html1 = '<span>系统模块</span>';
|
||||
var html2 = '<span style="color:#FF5722">普通模块</span>';
|
||||
if (d.type == 1) {
|
||||
return html1;
|
||||
}
|
||||
else {
|
||||
return html2;
|
||||
}
|
||||
}
|
||||
}
|
||||
, {
|
||||
field: 'sourse', title: '来源', width: 120, align: 'center', templet: function (d) {
|
||||
var html1 = '<span>官方平台</span>';
|
||||
var html2 = '<span style="color:#FF5722">第三方</span>';
|
||||
if (d.sourse == 1) {
|
||||
return html1;
|
||||
}
|
||||
else {
|
||||
return html2;
|
||||
}
|
||||
}
|
||||
}
|
||||
, {
|
||||
width: 100, title: '操作', align: 'center', templet: function (d) {
|
||||
var html = '';
|
||||
var btn = '<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>';
|
||||
var btn1 = '<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="disable">禁用</a>';
|
||||
var btn2 = '<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="open">启用</a>';
|
||||
if (d.status == 1) {
|
||||
html = '<div class="layui-btn-group">' + btn + btn1 + '</div>';
|
||||
}
|
||||
else {
|
||||
html = '<div class="layui-btn-group">' + btn + btn2 + '</div>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
}
|
||||
]]
|
||||
});
|
||||
var tool = layui.tool;
|
||||
|
||||
table.on('tool(list)', function (obj) {
|
||||
if (obj.event === 'edit') {
|
||||
addExpense(obj.data.id, obj.data.title, obj.data.name);
|
||||
}
|
||||
if (obj.event === 'disable') {
|
||||
layer.confirm('确定要禁用该模块吗?', { icon: 3, title: '提示' }, function (index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
layer.close(index);
|
||||
layui.pageTable.reload()
|
||||
}
|
||||
$('body').on('click', '.install', function () {
|
||||
let name = $(this).data('name');
|
||||
layer.confirm('确定要安装该模块吗?', { icon: 3, title: '提示' }, function (index) {
|
||||
//layer.msg('该功能内测中...');
|
||||
//return false;
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
layer.close(index);
|
||||
location.reload();
|
||||
}
|
||||
tool.post("/home/module/disable", { id: obj.data.id, status: 0 }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
if (obj.event === 'open') {
|
||||
layer.confirm('确定要启用该模块吗?', { icon: 3, title: '提示' }, function (index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
layer.close(index);
|
||||
layui.pageTable.reload()
|
||||
}
|
||||
}
|
||||
tool.post("/home/module/disable", { id: obj.data.id, status: 1 }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('body').on('click', '.addNew', function () {
|
||||
addExpense(0, '', '');
|
||||
});
|
||||
|
||||
function addExpense(id, title, name) {
|
||||
layer.open({
|
||||
type: 1
|
||||
, title: id > 0 ? '新增模块' : '编辑模块'
|
||||
, area: '398px;'
|
||||
, id: 'GG_module' //设定一个id,防止重复弹出
|
||||
, btn: ['确定', '取消']
|
||||
, btnAlign: 'c'
|
||||
, content: `<div style="padding-top:16px;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">模块名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="hidden" name="id" value="${id}">
|
||||
<input type="text" name="title" autocomplete="off" value="${title}" placeholder="请输入模块名称" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">所在目录</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" autocomplete="off" value="${name}" placeholder="请输入至少2个小写字符" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding:8px 0;text-align:center;color:red">目录如:"app/admin",只需要填写"admin"就可以了。</div>
|
||||
</div>`
|
||||
, yes: function (index) {
|
||||
let id = $('#GG_module').find('[name="id"]').val();
|
||||
let title = $('#GG_module').find('[name="title"]').val();
|
||||
let name = $('#GG_module').find('[name="name"]').val();
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
layer.close(index);
|
||||
layui.pageTable.reload();
|
||||
}
|
||||
}
|
||||
tool.post("/home/module/add", { id: id, title: title, name: name }, callback);
|
||||
}
|
||||
, btn2: function () {
|
||||
layer.closeAll();
|
||||
}
|
||||
tool.post("/home/module/install", {name: name}, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
});
|
||||
$('body').on('click', '.delete', function () {
|
||||
let name = $(this).data('name');
|
||||
layer.confirm('确定要卸载该模块吗?', { icon: 3, title: '提示' }, function (index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
layer.close(index);
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
tool.post("/home/module/uninstall",{name: name}, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
@ -48,29 +48,6 @@ CREATE TABLE `oa_admin` (
|
||||
UNIQUE INDEX `id`(`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '员工表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_admin_group
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_admin_group`;
|
||||
CREATE TABLE `oa_admin_group` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) NOT NULL DEFAULT '',
|
||||
`status` int(1) NOT NULL DEFAULT 1,
|
||||
`rules` varchar(1000) NULL DEFAULT '' COMMENT '用户组拥有的规则id, 多个规则\",\"隔开',
|
||||
`desc` text NULL COMMENT '备注',
|
||||
`create_time` int(11) NOT NULL DEFAULT 0,
|
||||
`update_time` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `id`(`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '员工权限分组表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of cms_admin_group
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_admin_group` VALUES (1, '超级员工权限', 1, '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142', '超级员工权限,拥有系统的最高权限,不可修改', 0, 0);
|
||||
INSERT INTO `oa_admin_group` VALUES (2, '人事总监权限', 1, '2,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,3,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,4,78,79,80,81,82,83,84,85,86,87,5,88,89,90,91,6,92,93,94,95,96,7,97,100,101,102,98,99,8,103,105,106,107,104,108,110,111,112,113,109,114,115,116,117,118,9,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,10,142', '人力资源部门领导的最高管理权限', 0, 0);
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_admin_log
|
||||
-- ----------------------------
|
||||
@ -96,7 +73,6 @@ CREATE TABLE `oa_admin_log` (
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '员工操作日志表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_admin_module
|
||||
-- ----------------------------
|
||||
@ -105,10 +81,8 @@ CREATE TABLE `oa_admin_module` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '模块名称',
|
||||
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '模块目录,唯一,字母',
|
||||
`icon` varchar(255) NOT NULL DEFAULT '' COMMENT '图标',
|
||||
`status` int(1) NOT NULL DEFAULT 1 COMMENT '状态,0禁用,1正常',
|
||||
`type` int(1) NOT NULL DEFAULT 2 COMMENT '模块类型,1系统模块,2普通模块',
|
||||
`sourse` int(1) NOT NULL DEFAULT 1 COMMENT '来源,1官方平台,2第三方',
|
||||
`type` int(2) NOT NULL DEFAULT 1 COMMENT '状态::1系统模块,2普通模块',
|
||||
`sourse` int(2) NOT NULL DEFAULT 1 COMMENT '来源:1官方,2第三方',
|
||||
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
@ -117,15 +91,14 @@ CREATE TABLE `oa_admin_module` (
|
||||
-- ----------------------------
|
||||
-- Records of oa_admin_module
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_admin_module` VALUES (1, '系统模块', 'home', '', 1, 1,1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (2, '用户模块', 'user', '', 1, 1,1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (3, '消息模块', 'message', '', 1,1, 1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (4, '公告模块', 'note', '', 1, 1,1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (5, '知识模块', 'article', '', 1,1, 1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (6, 'OA模块', 'oa', '', 1, 1,1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (7, '财务模块', 'finance', '', 1,1, 1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (8, '统计模块', 'business', '', 1,1, 1, 1639562910, 0);
|
||||
|
||||
INSERT INTO `oa_admin_module` VALUES (1, '系统模块', 'home', 1, 1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (2, '用户模块', 'user', 1, 1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (3, '消息模块', 'message', 1, 1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (4, '公告模块', 'note', 1, 1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (5, 'OA模块', 'oa', 1, 1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (6, '财务模块', 'finance', 1, 1, 1639562910, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (7, '项目模块', 'project', 2, 1, 1656142368, 0);
|
||||
INSERT INTO `oa_admin_module` VALUES (8, '知识模块', 'article', 2, 1, 1656143065, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_admin_rule
|
||||
@ -151,262 +124,231 @@ CREATE TABLE `oa_admin_rule` (
|
||||
-- ----------------------------
|
||||
-- Records of oa_admin_rule
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_admin_rule` VALUES (1, 0, '', '系统管理', '系统管理', 'HOME', 'icon-jichupeizhi', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (2, 0, '', '基础数据', '基础数据', 'HOME', 'icon-hetongshezhi', 1, 2, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (3, 0, '', '员工管理', '员工管理', 'USER', 'icon-renshishezhi', 1, 3, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (4, 0, '', '消息通知', '消息通知', 'MSG', 'icon-xiaoxishezhi', 1, 4, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (5, 0, '', '企业公告', '企业公告', 'NOTE', 'icon-zhaoshengbaobiao', 1, 5, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (6, 0, '', '知识文章', '知识文章', 'KQ', 'icon-kecheng', 1, 6, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (7, 0, '', '办公审批', '办公审批', 'OA', 'icon-shenpishezhi', 1, 7, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (8, 0, '', '日常办公', '日常办公', 'OA', 'icon-kaoshijihua', 1, 8, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (9, 0, '', '财务管理', '财务管理', 'CF', 'icon-yuangongtidian', 1, 9, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (10, 0, '', '商业智能', '商业智能', 'BI', 'icon-jiaoxuetongji', 1, 10, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (1, 0, '', '系统管理', '系统管理', 'home', 'icon-jichupeizhi', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (2, 0, '', '基础数据', '基础数据', 'home', 'icon-hetongshezhi', 1, 2, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (3, 0, '', '员工管理', '员工管理', 'user', 'icon-renshishezhi', 1, 3, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (4, 0, '', '消息通知', '消息通知', 'message', 'icon-xiaoxishezhi', 1, 4, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (5, 0, '', '企业公告', '企业公告', 'note', 'icon-zhaoshengbaobiao', 1, 5, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (6, 0, '', '办公审批', '办公审批', 'oa', 'icon-shenpishezhi', 1, 6, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (7, 0, '', '日常办公', '日常办公', 'oa', 'icon-kaoshijihua', 1, 7, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (8, 0, '', '财务管理', '财务管理', 'finance', 'icon-yuangongtidian', 1, 8, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (11, 1, 'home/conf/index', '系统配置', '系统配置', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (12, 11, 'home/conf/add', '新建/编辑', '配置项', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (13, 11, 'home/conf/delete', '删除', '配置项', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (14, 11, 'home/conf/edit', '编辑', '配置详情', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (9, 1, 'home/conf/index', '系统配置', '系统配置', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (10, 9, 'home/conf/add', '新建/编辑', '配置项', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (11, 9, 'home/conf/delete', '删除', '配置项', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (12, 9, 'home/conf/edit', '编辑', '配置详情', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (15, 1, 'home/module/index', '功能模块', '功能模块', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (16, 15, 'home/module/add', '新建/编辑', '功能模块', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (17, 15, 'home/module/disable', '禁用/启用', '功能模块', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (13, 1, 'home/module/index', '功能模块', '功能模块', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (14, 13, 'home/module/install', '安装', '功能模块', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (15, 13, 'home/module/upgrade', '升级', '功能模块', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (16, 13, 'home/module/uninstall', '卸载', '功能模块', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (18, 1, 'home/rule/index', '功能节点', '功能节点', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (19, 18, 'home/rule/add', '新建/编辑', '功能节点', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (20, 18, 'home/rule/delete', '删除', '功能节点', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (17, 1, 'home/rule/index', '功能节点', '功能节点', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (18, 17, 'home/rule/add', '新建/编辑', '功能节点', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (19, 17, 'home/rule/delete', '删除', '功能节点', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (21, 1, 'home/role/index', '权限角色', '权限角色', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (22, 21, 'home/role/add', '新建/编辑', '权限角色', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (23, 21, 'home/role/delete', '删除', '权限角色', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (20, 1, 'home/role/index', '权限角色', '权限角色', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (21, 20, 'home/role/add', '新建/编辑', '权限角色', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (22, 20, 'home/role/delete', '删除', '权限角色', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (24, 1, 'home/log/index', '操作日志', '操作日志', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (23, 1, 'home/log/index', '操作日志', '操作日志', 'home', '', 1, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (25, 1, 'home/database/database', '备份数据', '数据备份', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (26, 25, 'home/database/backup', '备份数据表', '数据', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (27, 25, 'home/database/optimize', '优化数据表', '数据表', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (28, 25, 'home/database/repair', '修复数据表', '数据表', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (24, 1, 'home/database/database', '备份数据', '数据备份', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (25, 24, 'home/database/backup', '备份数据表', '数据', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (26, 24, 'home/database/optimize', '优化数据表', '数据表', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (27, 24, 'home/database/repair', '修复数据表', '数据表', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (29, 1, 'home/database/backuplist', '还原数据', '数据还原', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (30, 29, 'home/database/import', '还原数据表', '数据', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (31, 29, 'home/database/downfile', '下载备份数据', '备份数据', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (32, 29, 'home/database/del', '删除备份数据', '备份数据', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (28, 1, 'home/database/backuplist', '还原数据', '数据还原', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (29, 28, 'home/database/import', '还原数据表', '数据', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (30, 28, 'home/database/downfile', '下载备份数据', '备份数据', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (31, 28, 'home/database/del', '删除备份数据', '备份数据', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (33, 2, 'home/cate/flow_type', '审批类型', '审批类型', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (34, 33, 'home/cate/flow_type_add', '新建/编辑', '审批类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (35, 33, 'home/cate/flow_type_check', '设置', '审批类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (32, 2, 'home/cate/flow_type', '审批类型', '审批类型', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (33, 32, 'home/cate/flow_type_add', '新建/编辑', '审批类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (34, 32, 'home/cate/flow_type_check', '设置', '审批类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (36, 2, 'home/flow/index', '审批流程', '审批流程', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (37, 36, 'home/flow/add', '新建/编辑', '审批流程', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (38, 36, 'home/flow/delete', '删除', '审批流程', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (39, 36, 'home/flow/check', '设置', '审批流程', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (35, 2, 'home/flow/index', '审批流程', '审批流程', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (36, 35, 'home/flow/add', '新建/编辑', '审批流程', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (37, 35, 'home/flow/delete', '删除', '审批流程', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (38, 35, 'home/flow/check', '设置', '审批流程', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (40, 2, 'home/cate/expense_cate', '报销类型', '报销类型', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (41, 40, 'home/cate/expense_cate_add', '新建/编辑', '报销类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (42, 40, 'home/cate/expense_cate_check', '设置', '报销类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (39, 2, 'home/cate/expense_cate', '报销类型', '报销类型', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (40, 39, 'home/cate/expense_cate_add', '新建/编辑', '报销类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (41, 39, 'home/cate/expense_cate_check', '设置', '报销类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (43, 2, 'home/cate/cost_cate', '费用类型', '费用类型', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (44, 43, 'home/cate/cost_cate_add', '新建/编辑', '费用类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (45, 43, 'home/cate/cost_cate_check', '设置', '费用类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (42, 2, 'home/cate/cost_cate', '费用类型', '费用类型', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (43, 42, 'home/cate/cost_cate_add', '新建/编辑', '费用类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (44, 42, 'home/cate/cost_cate_check', '设置', '费用类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (46, 2, 'home/cate/seal_cate', '印章类型', '印章类型', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (47, 46, 'home/cate/seal_cate_add', '新建/编辑', '印章类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (48, 46, 'home/cate/seal_cate_check', '设置', '印章类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (45, 2, 'home/cate/seal_cate', '印章类型', '印章类型', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (46, 45, 'home/cate/seal_cate_add', '新建/编辑', '印章类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (47, 45, 'home/cate/seal_cate_check', '设置', '印章类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (49, 2, 'home/cate/car_cate', '车辆类型', '车辆类型', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (50, 49, 'home/cate/car_cate_add', '新建/编辑', '车辆类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (51, 49, 'home/cate/car_cate_check', '设置', '车辆类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (48, 2, 'home/cate/car_cate', '车辆类型', '车辆类型', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (49, 48, 'home/cate/car_cate_add', '新建/编辑', '车辆类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (50, 48, 'home/cate/car_cate_check', '设置', '车辆类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (52, 2, 'home/cate/subject', '发票主体', '发票主体', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (53, 52, 'home/cate/subject_add', '新建/编辑', '发票主体', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (54, 52, 'home/cate/subject_check', '设置', '发票主体', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (51, 2, 'home/cate/subject', '发票主体', '发票主体', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (52, 51, 'home/cate/subject_add', '新建/编辑', '发票主体', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (53, 51, 'home/cate/subject_check', '设置', '发票主体', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (55, 2, 'home/cate/note_cate', '公告类型', '公告类型', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (56, 55, 'home/cate/note_cate_add', '新建/编辑', '公告类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (57, 55, 'home/cate/note_cate_delete', '删除', '公告类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (54, 2, 'home/cate/note_cate', '公告类型', '公告类型', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (55, 54, 'home/cate/note_cate_add', '新建/编辑', '公告类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (56, 54, 'home/cate/note_cate_delete', '删除', '公告类型', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (58, 2, 'home/cate/article_cate', '知识类型', '知识类型', 'HOME', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (59, 58, 'home/cate/article_cate_add', '新建/编辑', '知识类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (60, 58, 'home/cate/article_cate_delete', '删除', '知识类型', 'HOME', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (57, 2, 'home/cate/work_cate', '工作类别', '工作类别', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (58, 57, 'home/cate/work_cate_add', '新建/编辑', '工作类别', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (59, 57, 'home/cate/work_cate_check', '设置', '工作类别', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (60, 2, 'home/keywords/index', '关 键 字','关键字', 'home', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (61, 60, 'home/keywords/add', '新建/编辑','关键字', 'home', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (62, 60, 'home/keywords/delete', '删除','关键字', 'home', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (63, 3, 'user/department/index', '部门架构', '部门', 'user', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (64, 63, 'user/department/add', '新建/编辑', '部门', 'user', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (65, 63, 'user/department/delete', '删除', '部门', 'user', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (66, 3, 'user/position/index', '岗位职称', '岗位职称', 'user', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (67, 66, 'user/position/add', '新建/编辑', '岗位职称', 'user', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (68, 66, 'user/position/delete', '删除', '岗位职称', 'user', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (69, 66, 'user/position/view', '查看', '岗位职称', 'user', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (70, 3, 'user/user/index', '企业员工', '员工', 'user', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (71, 70, 'user/user/add', '新建/编辑', '员工', 'user', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (72, 70, 'user/user/view', '查看', '员工信息', 'user', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (73, 70, 'user/user/set', '设置', '员工状态', 'user', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (74, 70, 'user/user/reset_psw', '重设密码', '员工密码', 'user', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (75, 3, 'user/personal/change', '人事调动', '人事调动', 'user', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (76, 75, 'user/personal/change_add', '新建/编辑', '人事调动', 'user', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (77, 3, 'user/personal/leave', '离职档案', '离职档案', 'user', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (78, 77, 'user/personal/leave_add', '新建/编辑', '离职档案', 'user', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (79, 77, 'user/personal/leave_delete', '删除', '离职档案', 'user', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (80, 4, 'message/index/inbox', '收件箱', '收件箱', 'message', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (81, 80, 'message/index/add', '新建/编辑', '消息', 'message', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (82, 80, 'message/index/send', '发送', '消息', 'message', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (83, 80, 'message/index/save', '保存', '消息到草稿', 'message', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (84, 80, 'message/index/reply', '回复', '消息', 'message', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (85, 80, 'message/index/read', '查看', '消息', 'message', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (86, 80, 'message/index/check', '设置', '消息状态', 'message', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (87, 4, 'message/index/sendbox', '发件箱', '发件箱', 'message', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (88, 4, 'message/index/draft', '草稿箱', '草稿箱', 'message', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (89, 4, 'message/index/rubbish', '垃圾箱', '垃圾箱', 'message', '', 1, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (90, 5, 'note/index/index', '公告列表', '公告', 'note', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (91, 90, 'note/index/add', '新建/编辑', '公告', 'note', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (92, 90, 'note/index/delete', '删除', '公告', 'note', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (93, 90, 'note/index/view', '查看', '公告', 'note', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (94, 6, 'oa/approve/index', '我发起的', '办公审批', 'oa', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (95, 94, 'oa/approve/add', '新建/编辑', '办公审批', 'oa', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (96, 94, 'oa/approve/view', '查看', '办公审批', 'oa', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (97, 94, 'oa/approve/check', '审核', '办公审批', 'oa', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (98, 6, 'oa/approve/list', '我处理的', '办公审批', 'oa', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (99, 6, 'oa/approve/copy', '抄送给我的', '办公审批', 'oa', '', 1, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (100, 7, 'oa/plan/index', '日程安排', '日程安排', 'oa', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (101, 100, 'oa/plan/add', '新建/编辑', '日程安排', 'oa', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (102, 100, 'oa/plan/delete', '删除', '日程安排', 'oa', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (103, 100, 'oa/plan/detail', '查看', '日程安排', 'oa', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (104, 7, 'oa/plan/calendar', '日程日历', '日程安排', 'oa', '', 1, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (105, 7, 'oa/schedule/index', '工作记录', '工作记录', 'oa', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (106, 105, 'oa/schedule/add', '新建/编辑', '工作记录', 'oa', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (107, 105, 'oa/schedule/delete', '删除', '工作记录', 'oa', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (108, 105, 'oa/schedule/detail', '查看', '工作记录', 'oa', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (109, 105, 'oa/schedule/update_labor_time', '更改工时', '工时', 'oa', '', 0, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (110, 7, 'oa/schedule/calendar', '工作日历', '工作日历', 'oa', '', 1, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (111, 7, 'oa/work/index', '工作汇报', '工作汇报', 'oa', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (112, 111, 'oa/work/add', '新建/编辑', '工作汇报', 'oa', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (113, 111, 'oa/work/send', '发送', '工作汇报', 'oa', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (114, 111, 'oa/work/read', '查看', '工作汇报', 'oa', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (115, 111, 'oa/work/delete', '删除', '工作汇报', 'oa', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (116, 8, '', '报销管理', '报销', 'finance', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (117, 116, 'finance/expense/index', '我申请的', '报销', 'finance', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (118, 116, 'finance/expense/list', '我处理的', '报销', 'finance', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (119, 116, 'finance/expense/copy', '抄送给我的', '报销', 'finance', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (120, 116, 'finance/expense/checkedlist', '报销打款', '报销', 'finance', '', 1, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (121, 116, 'finance/expense/add', '新建/编辑', '报销', 'finance', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (122, 116, 'finance/expense/delete', '删除', '报销', 'finance', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (123, 116, 'finance/expense/view', '查看', '报销', 'finance', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (124, 116, 'finance/expense/check', '审核', '报销', 'finance', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (125, 116, 'finance/expense/topay', '打款', '报销', 'finance', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (126, 8, '', '发票管理', '发票', 'finance', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (127, 126, 'finance/invoice/index', '我申请的', '发票', 'finance', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (128, 126, 'finance/invoice/list', '我处理的', '发票', 'finance', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (129, 126, 'finance/invoice/copy', '抄送给我的', '发票', 'finance', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (130, 126, 'finance/invoice/checkedlist', '发票开具', '发票', 'finance', '', 1, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (131, 126, 'finance/invoice/add', '新建/编辑', '发票', 'finance', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (132, 126, 'finance/invoice/delete', '删除', '发票', 'finance', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (133, 126, 'finance/invoice/view', '查看', '发票', 'finance', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (134, 126, 'finance/invoice/check', '审核', '发票', 'finance', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (135, 126, 'finance/invoice/open', '开具', '发票', 'finance', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (136, 126, 'finance/invoice/tovoid', '作废', '发票', 'finance', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (137, 8, 'finance/income/index', '到账管理', '到账记录', 'finance', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (138, 137, 'finance/income/add', '新建/编辑', '到账记录', 'finance', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (139, 137, 'finance/income/view', '查看', '到账记录', 'finance', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (140, 137, 'finance/income/delete', '删除', '到账记录', 'finance', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (141, 0, '', '项目任务', '项目任务', 'project', 'icon-xiangmuguanli', 1, 9, 1, 1656142368, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (142, 141, 'project/index/index', '项目列表', '项目', 'project', '', 1, 0, 1, 1656142368, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (143, 142, 'project/index/add', '新建', '项目', 'project', '', 2, 0, 1, 1656142368, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (144, 142, 'project/index/edit', '编辑', '项目', 'project', '', 2, 0, 1, 1656142368, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (145, 142, 'project/index/view', '查看', '项目', 'project', '', 2, 0, 1, 1656142368, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (146, 142, 'project/index/delete', '删除', '项目', 'project', '', 2, 0, 1, 1656142368, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (147, 141, 'project/task/index', '任务列表', '任务', 'project', '', 1, 0, 1, 1656142368, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (148, 147, 'project/task/add', '新建', '任务', 'project', '', 2, 0, 1, 1656142368, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (149, 147, 'project/task/edit', '编辑', '任务', 'project', '', 2, 0, 1, 1656142368, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (150, 147, 'project/task/view', '查看', '任务', 'project', '', 2, 0, 1, 1656142368, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (151, 147, 'project/task/delete', '删除', '任务', 'project', '', 2, 0, 1, 1656142368, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (152, 0, '', '知识文章', '知识文章', 'article', 'icon-kecheng', 1, 10, 1, 1656143065, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (153, 152, 'article/cate/cate', '知识类型', '知识类型', 'article', '', 1, 0, 1, 1656143065, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (154, 153, 'article/cate/cate_add', '新建/编辑', '知识类型', 'article', '', 2, 0, 1, 1656143065, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (155, 153, 'article/cate/cate_delete', '删除', '知识类型', 'article', '', 2, 0, 1, 1656143065, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (156, 152, 'article/index/index', '共享知识', '知识文章', 'article', '', 1, 0, 1, 1656143065, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (157, 152, 'article/index/list', '个人知识', '知识文章', 'article', '', 1, 0, 1, 1656143065, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (158, 157, 'article/index/add', '新建/编辑', '知识文章', 'article', '', 2, 0, 1, 1656143065, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (159, 157, 'article/index/view', '查看', '知识文章', 'article', '', 2, 0, 1, 1656143065, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (160, 157, 'article/index/delete', '删除', '知识文章', 'article', '', 2, 0, 1, 1656143065, 0);
|
||||
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (61, 3, 'user/department/index', '部门架构', '部门', 'USER', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (62, 61, 'user/department/add', '新建/编辑', '部门', 'USER', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (63, 61, 'user/department/delete', '删除', '部门', 'USER', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (64, 3, 'user/position/index', '岗位职称', '岗位职称', 'USER', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (65, 64, 'user/position/add', '新建/编辑', '岗位职称', 'USER', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (66, 64, 'user/position/delete', '删除', '岗位职称', 'USER', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (67, 64, 'user/position/view', '查看', '岗位职称', 'USER', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (68, 3, 'user/user/index', '企业员工', '员工', 'USER', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (69, 68, 'user/user/add', '新建/编辑', '员工', 'USER', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (70, 68, 'user/user/view', '查看', '员工信息', 'USER', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (71, 68, 'user/user/set', '设置', '员工状态', 'USER', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (72, 68, 'user/user/reset_psw', '重设密码', '员工密码', 'USER', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (73, 3, 'user/personal/change', '人事调动', '人事调动', 'USER', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (74, 73, 'user/personal/change_add', '新建/编辑', '人事调动', 'USER', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (75, 3, 'user/personal/leave', '离职档案', '离职档案', 'USER', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (76, 75, 'user/personal/leave_add', '新建/编辑', '离职档案', 'USER', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (77, 75, 'user/personal/leave_delete', '删除', '离职档案', 'USER', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (78, 4, 'message/index/inbox', '收件箱', '收件箱', 'MSG', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (79, 78, 'message/index/add', '新建/编辑', '消息', 'MSG', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (80, 78, 'message/index/send', '发送', '消息', 'MSG', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (81, 78, 'message/index/save', '保存', '消息到草稿', 'MSG', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (82, 78, 'message/index/reply', '回复', '消息', 'MSG', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (83, 78, 'message/index/read', '查看', '消息', 'MSG', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (84, 78, 'message/index/check', '设置', '消息状态', 'MSG', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (85, 4, 'message/index/sendbox', '发件箱', '发件箱', 'MSG', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (86, 4, 'message/index/draft', '草稿箱', '草稿箱', 'MSG', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (87, 4, 'message/index/rubbish', '垃圾箱', '垃圾箱', 'MSG', '', 1, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (88, 5, 'note/index/index', '公告列表', '公告', 'NOTE', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (89, 88, 'note/index/add', '新建/编辑', '公告', 'NOTE', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (90, 88, 'note/index/delete', '删除', '公告', 'NOTE', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (91, 88, 'note/index/view', '查看', '公告', 'NOTE', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (92, 6, 'article/index/index', '共享知识', '知识文章', 'KQ', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (93, 6, 'article/index/list', '个人知识', '知识文章', 'KQ', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (94, 93, 'article/index/add', '新建/编辑', '知识文章', 'KQ', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (95, 93, 'article/index/delete', '删除', '知识文章', 'KQ', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (96, 93, 'article/index/view', '查看', '知识文章', 'KQ', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (97, 7, 'oa/approve/index', '我发起的', '办公审批', 'OA', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (98, 7, 'oa/approve/list', '我处理的', '办公审批', 'OA', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (99, 7, 'oa/approve/copy', '抄送给我的', '办公审批', 'OA', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (100, 97, 'oa/approve/add', '新建/编辑', '办公审批', 'OA', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (101, 97, 'oa/approve/view', '查看', '办公审批', 'OA', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (102, 97, 'oa/approve/check', '审核', '办公审批', 'OA', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (103, 8, 'oa/plan/calendar', '日程日历', '日程安排', 'OA', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (104, 8, 'oa/plan/index', '日程安排', '日程安排', 'OA', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (105, 103, 'oa/plan/add', '新建/编辑', '日程安排', 'OA', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (106, 103, 'oa/plan/delete', '删除', '日程安排', 'OA', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (107, 103, 'oa/plan/detail', '查看', '日程安排', 'OA', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (108, 8, 'oa/schedule/calendar', '工作日历', '工作日历', 'OA', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (109, 8, 'oa/schedule/index', '工作记录', '工作记录', 'OA', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (110, 108, 'oa/schedule/add', '新建/编辑', '工作记录', 'OA', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (111, 108, 'oa/schedule/delete', '删除', '工作记录', 'OA', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (112, 108, 'oa/schedule/detail', '查看', '工作记录', 'OA', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (113, 108, 'oa/schedule/update_labor_time', '更改工时', '工时', 'OA', '', 0, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (114, 8, 'oa/work/index', '工作汇报', '工作汇报', 'OA', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (115, 114, 'oa/work/add', '新建/编辑', '工作汇报', 'OA', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (116, 114, 'oa/work/send', '发送', '工作汇报', 'OA', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (117, 114, 'oa/work/read', '查看', '工作汇报', 'OA', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (118, 114, 'oa/work/delete', '删除', '工作汇报', 'OA', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (119, 9, '', '报销管理', '报销', 'CF', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (120, 119, 'finance/expense/index', '我申请的', '报销', 'CF', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (121, 119, 'finance/expense/list', '我处理的', '报销', 'CF', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (122, 119, 'finance/expense/checkedlist', '报销打款', '报销', 'CF', '', 1, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (123, 119, 'finance/expense/add', '新建/编辑', '报销', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (124, 119, 'finance/expense/delete', '删除', '报销', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (125, 119, 'finance/expense/view', '查看', '报销', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (126, 119, 'finance/expense/check', '审核', '报销', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (127, 119, 'finance/expense/topay', '打款', '报销', 'CF', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (128, 9, '', '发票管理', '发票', 'CF', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (129, 128, 'finance/invoice/index', '我申请的', '发票', 'CF', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (130, 128, 'finance/invoice/list', '我处理的', '发票', 'CF', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (131, 128, 'finance/invoice/checkedlist', '发票开具', '发票', 'CF', '', 1, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (132, 128, 'finance/invoice/add', '新建/编辑', '发票', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (133, 128, 'finance/invoice/delete', '删除', '发票', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (134, 128, 'finance/invoice/view', '查看', '发票', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (135, 128, 'finance/invoice/check', '审核', '发票', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (136, 128, 'finance/invoice/open', '开具', '发票', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (137, 128, 'finance/invoice/tovoid', '作废', '发票', 'CF', '', 2, 1, 1, 0, 0);
|
||||
|
||||
INSERT INTO `oa_admin_rule` VALUES (138, 9, 'finance/income/index', '到账管理', '到账记录', 'CF', '', 1, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (139, 138, 'finance/income/add', '新建/编辑', '到账记录', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (140, 138, 'finance/income/view', '查看', '到账记录', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (141, 138, 'finance/income/delete', '删除', '到账记录', 'CF', '', 2, 1, 1, 0, 0);
|
||||
INSERT INTO `oa_admin_rule` VALUES (142, 10, 'business/analysis/index', '智能分析', '智能分析', 'BI', '', 1, 1, 1, 0, 0);
|
||||
|
||||
---------------------------------
|
||||
-- Table structure for oa_article
|
||||
---------------------------------
|
||||
DROP TABLE IF EXISTS `oa_article`;
|
||||
CREATE TABLE `oa_article` (
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_admin_group
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_admin_group`;
|
||||
CREATE TABLE `oa_admin_group` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '知识文章标题',
|
||||
`article_cate_id` int(11) NOT NULL DEFAULT 0 COMMENT '关联分类id',
|
||||
`keywords` varchar(255) NULL DEFAULT '' COMMENT '关键字',
|
||||
`desc` varchar(1000) NULL DEFAULT '' COMMENT '摘要',
|
||||
`thumb` int(11) NOT NULL DEFAULT 0 COMMENT '缩略图id',
|
||||
`uid` int(11) NOT NULL DEFAULT 0 COMMENT '作者',
|
||||
`did` int(11) NOT NULL DEFAULT 0 COMMENT '部门',
|
||||
`origin_url` varchar(255) NOT NULL DEFAULT '' COMMENT '来源地址',
|
||||
`content` text NOT NULL COMMENT '文章内容',
|
||||
`read` int(11) NOT NULL DEFAULT 0 COMMENT '阅读量',
|
||||
`type` tinyint(2) NOT NULL DEFAULT 0 COMMENT '属性:1精华 2热门 3推荐',
|
||||
`is_share` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否分享,0否,1是',
|
||||
`status` int(1) NOT NULL DEFAULT 1 COMMENT '状态:1正常-1下架',
|
||||
`sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
|
||||
`title` varchar(255) NOT NULL DEFAULT '',
|
||||
`status` int(1) NOT NULL DEFAULT 1,
|
||||
`rules` varchar(1000) NULL DEFAULT '' COMMENT '用户组拥有的规则id, 多个规则\",\"隔开',
|
||||
`desc` text NULL COMMENT '备注',
|
||||
`create_time` int(11) NOT NULL DEFAULT 0,
|
||||
`update_time` int(11) NOT NULL DEFAULT 0,
|
||||
`delete_time` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '知识文章表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of oa_article
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_article` VALUES (1, '勾股OA——简单实用的开源免费的企业办公系统框架', 2, '', '勾股办公是一款基于ThinkPHP6+Layui+MySql打造的,简单实用的开源免费的企业办公系统框架。系统集成了系统设置、人事管理模块、消息管理模块、日常办公、财务管理等基础模块。系统简约,易于功...', 1, 1, 0, '', '<p>勾股办公是一款基于ThinkPHP6 + Layui + MySql打造的,简单实用的开源免费的企业办公系统框架。系统集成了系统设置、人事管理模块、消息管理模块、日常办公、财务管理等基础模块。系统简约,易于功能扩展,方便二次开发,让开发者更专注于业务深度需求的开发,帮助开发者简单高效降低二次开发成本,通过二次开发之后可以用来做CRM,ERP,业务管理等系统。</p>', 1, 2, 1, 1, 1, 1637985280, 1650817107, 0);
|
||||
INSERT INTO `oa_article` VALUES (2, '勾股CMS——轻量级、高性能极速后台开发框架', 2, '', '勾股CMS是一套基于ThinkPHP6+Layui+MySql打造的轻量级、高性能极速后台开发框架。通用型的后台权限管理框架,极低门槛、操作简单、开箱即用。系统易于功能扩展,代码维护,方便二次开发,让...', 0, 1, 1, '', '<p>勾股CMS是一套基于ThinkPHP6 + Layui + MySql打造的轻量级、高性能极速后台开发框架。通用型的后台权限管理框架,极低门槛、操作简单、开箱即用。系统易于功能扩展,代码维护,方便二次开发,让开发者更专注于业务深度需求的开发,帮助开发者简单高效降低二次开发成本。</p>', 0, 0, 1, 1, 0, 1650817085, 0, 0);
|
||||
INSERT INTO `oa_article` VALUES (3, '勾股BLOG——简约,易用开源的个人博客系统', 2, '', '勾股BLOG是一款实用的开源免费的个人博客系统。集成了系统管理、基础数据、博客文章、博客动态、语雀知识库、用户管理、访问统计等功能。具有简约,易用,内存占用低等特点,可以用来做个人博客,工作室官网,自...', 0, 1, 1, '', '<p>勾股BLOG是一款实用的开源免费的个人博客系统。集成了系统管理、基础数据、博客文章、博客动态、语雀知识库、用户管理、访问统计等功能。具有简约,易用,内存占用低等特点,可以用来做个人博客,工作室官网,自媒体官网等网站,二次开发之后也可以作为资讯、展品展示等网站。</p>', 0, 0, 1, 1, 0, 1650817152, 0, 0);
|
||||
INSERT INTO `oa_article` VALUES (4, '勾股DEV——研发管理与团队协作的工具软件', 2, '', '勾股DEV是一款专为IT行业研发团队打造的智能化项目管理与团队协作的工具软件,可以在线管理团队的工作、项目和任务,覆盖从需求提出到研发完成上线整个过程的项目协作。', 0, 1, 1, '', '<p>勾股DEV是一款专为IT行业研发团队打造的智能化项目管理与团队协作的工具软件,可以在线管理团队的工作、项目和任务,覆盖从需求提出到研发完成上线整个过程的项目协作。</p>', 0, 0, 1, 1, 0, 1650817189, 0, 0);
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_article_cate
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_article_cate`;
|
||||
CREATE TABLE `oa_article_cate` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`pid` int(11) NOT NULL DEFAULT 0 COMMENT '父类ID',
|
||||
`sort` int(5) NOT NULL DEFAULT 0 COMMENT '排序',
|
||||
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '分类标题',
|
||||
`desc` varchar(1000) NULL DEFAULT '' COMMENT '描述',
|
||||
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间',
|
||||
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '知识文章分类表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of oa_article_cate
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_article_cate` VALUES (1, 0, 0, '办公技巧', '', 1637984651, 0);
|
||||
INSERT INTO `oa_article_cate` VALUES (2, 0, 0, '行业技能', '', 1637984739, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_article_keywords
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_article_keywords`;
|
||||
CREATE TABLE `oa_article_keywords` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`aid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '知识文章ID',
|
||||
`keywords_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联关键字id',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
|
||||
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `aid`(`aid`) USING BTREE,
|
||||
INDEX `inid`(`keywords_id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '知识文章关联表';
|
||||
UNIQUE INDEX `id`(`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '员工权限分组表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of oa_article_keywords
|
||||
-- Records of cms_admin_group
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_article_keywords` VALUES (1, 1, 1, 1, 1638093082);
|
||||
INSERT INTO `oa_article_keywords` VALUES (2, 2, 2, 1, 1638093082);
|
||||
INSERT INTO `oa_article_keywords` VALUES (3, 3, 3, 3, 1638093082);
|
||||
INSERT INTO `oa_article_keywords` VALUES (4, 4, 4, 4, 1638093082);
|
||||
INSERT INTO `oa_admin_group` VALUES (1, '超级员工权限', 1, '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160', '超级员工权限,拥有系统的最高权限,不可修改。', 0, 0);
|
||||
INSERT INTO `oa_admin_group` VALUES (2, '总经理权限', 1, '2,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,3,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,4,80,81,82,83,84,85,86,87,88,89,5,90,91,92,93,6,94,95,96,97,98,99,7,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,8,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160', '总经理的管理权限,可根据公司的具体需求调整。', 0, 0);
|
||||
INSERT INTO `oa_admin_group` VALUES (3, '普通员工权限', 1, '4,80,81,82,83,84,85,86,87,88,89,5,90,93,6,94,95,96,97,98,99,7,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,8,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,156,157,158,159,160', '普通员工管理权限,可根据公司的具体需求调整。', 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_config
|
||||
@ -1021,7 +963,7 @@ CREATE TABLE `oa_plan` (
|
||||
`remind_type` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提醒类型',
|
||||
`remind_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提醒时间',
|
||||
`remark` text NOT NULL COMMENT '描述',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
@ -1034,10 +976,10 @@ DROP TABLE IF EXISTS `oa_schedule`;
|
||||
CREATE TABLE `oa_schedule` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '工作记录主题',
|
||||
`cid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预设字段:关联工作内容类型ID',
|
||||
`cid` int(11) UNSIGNED NOT NULL DEFAULT 1 COMMENT '预设字段:关联工作内容类型ID',
|
||||
`cmid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预设字段:关联客户ID',
|
||||
`ptid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预设字段:关联项目ID',
|
||||
`taid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预设字段:关联任务ID',
|
||||
`tid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预设字段:关联任务ID',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联创建员工ID',
|
||||
`did` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '所属部门',
|
||||
`start_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '开始时间',
|
||||
@ -1045,7 +987,7 @@ CREATE TABLE `oa_schedule` (
|
||||
`labor_time` decimal(15, 2) NOT NULL DEFAULT 0.00 COMMENT '工时',
|
||||
`labor_type` int(1) NOT NULL DEFAULT 0 COMMENT '工作类型:1案头2外勤',
|
||||
`remark` text NOT NULL COMMENT '描述',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
@ -1139,6 +1081,31 @@ CREATE TABLE `oa_flow_record` (
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '审批记录表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_work_cate
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_work_cate`;
|
||||
CREATE TABLE `oa_work_cate` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '工作类型名称',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '工作类型';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of oa_work_cate
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_work_cate` VALUES (1, '其他', 1, 1637987189, 0);
|
||||
INSERT INTO `oa_work_cate` VALUES (2, '方案策划', 1, 1637987199, 0);
|
||||
INSERT INTO `oa_work_cate` VALUES (3, '撰写文档', 1, 1637987199, 0);
|
||||
INSERT INTO `oa_work_cate` VALUES (4, '需求调研', 1, 1637987199, 0);
|
||||
INSERT INTO `oa_work_cate` VALUES (5, '需求沟通', 1, 1637987199, 0);
|
||||
INSERT INTO `oa_work_cate` VALUES (6, '参加会议', 1, 1637987199, 0);
|
||||
INSERT INTO `oa_work_cate` VALUES (7, '拜访客户', 1, 1637987199, 0);
|
||||
INSERT INTO `oa_work_cate` VALUES (8, '接待客户', 1, 1637987199, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_work
|
||||
-- ----------------------------
|
||||
@ -1183,4 +1150,199 @@ CREATE TABLE `oa_work_record` (
|
||||
`read_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '阅读时间',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '汇报工作发送记录表';
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '汇报工作发送记录表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project`;
|
||||
CREATE TABLE `oa_project` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '项目名称',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
|
||||
`director_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目负责人',
|
||||
`start_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目开始时间',
|
||||
`end_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目结束时间',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:状态:0未设置,1未开始,2进行中,3已完成,4已关闭',
|
||||
`content` text NULL COMMENT '项目描述',
|
||||
`md_content` text NULL COMMENT 'markdown项目描述',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
|
||||
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '项目表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project_user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project_user`;
|
||||
CREATE TABLE `oa_project_user` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`uid` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目成员id',
|
||||
`project_id` int(11) UNSIGNED NOT NULL COMMENT '关联项目id',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '移除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '项目成员表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project_task
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project_task`;
|
||||
CREATE TABLE `oa_project_task` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '主题',
|
||||
`project_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联项目id',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
|
||||
`plan_hours` decimal(10, 1) NOT NULL DEFAULT 0.00 COMMENT '预估工时',
|
||||
`end_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预计结束时间',
|
||||
`over_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '实际结束时间',
|
||||
`director_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '指派给(负责人)',
|
||||
`assist_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '协助人员,如:1,2,3',
|
||||
`cate` tinyint(1) NOT NULL DEFAULT 1 COMMENT '所属工作类型',
|
||||
`priority` tinyint(1) NOT NULL DEFAULT 1 COMMENT '优先级:1低,2中,3高,4紧急',
|
||||
`flow_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '流转状态:1待办的,2进行中,3已完成,4已拒绝,5已关闭',
|
||||
`done_ratio` int(2) NOT NULL DEFAULT 0 COMMENT '完成进度:0,20,40,50,60,80,100',
|
||||
`content` text NULL COMMENT '任务描述',
|
||||
`md_content` text NULL COMMENT 'markdown任务描述',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
|
||||
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '任务表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project_file
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project_file`;
|
||||
CREATE TABLE `oa_project_file` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块',
|
||||
`topic_id` int(11) UNSIGNED NOT NULL COMMENT '关联主题id',
|
||||
`file_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '相关联附件id',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '项目任务附件关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project_comment
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project_comment`;
|
||||
CREATE TABLE `oa_project_comment` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块',
|
||||
`topic_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联主题id',
|
||||
`pid` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '回复内容id',
|
||||
`padmin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '回复内容用户id',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
|
||||
`content` text NULL COMMENT '评论内容',
|
||||
`md_content` text NULL COMMENT 'markdown评论内容',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
|
||||
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '项目任务评论表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project_log`;
|
||||
CREATE TABLE `oa_project_log` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块',
|
||||
`action` varchar(100) NOT NULL DEFAULT 'edit' COMMENT '动作:add,edit,del,upload',
|
||||
`field` varchar(100) NOT NULL DEFAULT '' COMMENT '字段',
|
||||
`project_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联项目id',
|
||||
`task_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联任务id',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作人',
|
||||
`old_content` text NULL COMMENT '修改前的内容',
|
||||
`new_content` text NULL COMMENT '修改后的内容',
|
||||
`remark` text NULL COMMENT '补充备注',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '项目任务操作记录表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_article_cate
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_article_cate`;
|
||||
CREATE TABLE `oa_article_cate` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`pid` int(11) NOT NULL DEFAULT 0 COMMENT '父类ID',
|
||||
`sort` int(5) NOT NULL DEFAULT 0 COMMENT '排序',
|
||||
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '分类标题',
|
||||
`desc` varchar(1000) NULL DEFAULT '' COMMENT '描述',
|
||||
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '添加时间',
|
||||
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '知识文章分类表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of oa_article_cate
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_article_cate` VALUES (1, 0, 0, '办公技巧', '', 1637984651, 0);
|
||||
INSERT INTO `oa_article_cate` VALUES (2, 0, 0, '行业技能', '', 1637984739, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_article
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_article`;
|
||||
CREATE TABLE `oa_article` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '知识文章标题',
|
||||
`cate_id` int(11) NOT NULL DEFAULT 0 COMMENT '关联分类id',
|
||||
`keywords` varchar(255) NULL DEFAULT '' COMMENT '关键字',
|
||||
`desc` varchar(1000) NULL DEFAULT '' COMMENT '摘要',
|
||||
`thumb` int(11) NOT NULL DEFAULT 0 COMMENT '缩略图id',
|
||||
`uid` int(11) NOT NULL DEFAULT 0 COMMENT '作者',
|
||||
`did` int(11) NOT NULL DEFAULT 0 COMMENT '部门',
|
||||
`origin_url` varchar(255) NOT NULL DEFAULT '' COMMENT '来源地址',
|
||||
`content` text NOT NULL COMMENT '文章内容',
|
||||
`read` int(11) NOT NULL DEFAULT 0 COMMENT '阅读量',
|
||||
`type` tinyint(2) NOT NULL DEFAULT 0 COMMENT '属性:1精华 2热门 3推荐',
|
||||
`is_share` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否分享,0否,1是',
|
||||
`status` int(1) NOT NULL DEFAULT 1 COMMENT '状态:1正常-1下架',
|
||||
`sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
|
||||
`create_time` int(11) NOT NULL DEFAULT 0,
|
||||
`update_time` int(11) NOT NULL DEFAULT 0,
|
||||
`delete_time` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '知识文章表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of oa_article
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_article` VALUES (1, '勾股OA——简单实用的开源免费的企业办公系统框架', 2, '', '勾股办公是一款简单实用的开源免费的企业办公系统框架。系统集成了系统设置、人事管理模块、消息管理模块、日常办公、财务管理等基础模块。系统简约,易于功...', 1, 1, 1, '', '勾股办公是一款简单实用的开源免费的企业办公系统框架。系统集成了系统设置、人事管理模块、消息管理模块、日常办公、财务管理等基础模块。系统简约,易于功能扩展,方便二次开发,让开发者更专注于业务深度需求的开发,帮助开发者简单高效降低二次开发成本,通过二次开发之后可以用来做CRM,ERP,业务管理等系统。', 1, 2, 1, 1, 1, 1637985280, 1650817107, 0);
|
||||
INSERT INTO `oa_article` VALUES (2, '勾股CMS——轻量级、高性能极速后台开发框架', 2, '', '勾股CMS是一套轻量级、高性能极速后台开发框架。通用型的后台权限管理框架,极低门槛、操作简单、开箱即用。系统易于功能扩展,代码维护,方便二次开发,让...', 0, 1, 1, '', '勾股CMS是一套轻量级、高性能极速后台开发框架。通用型的后台权限管理框架,极低门槛、操作简单、开箱即用。系统易于功能扩展,代码维护,方便二次开发,让开发者更专注于业务深度需求的开发,帮助开发者简单高效降低二次开发成本。', 0, 0, 1, 1, 0, 1650817085, 0, 0);
|
||||
INSERT INTO `oa_article` VALUES (3, '勾股BLOG——简约,易用开源的个人博客系统', 2, '', '勾股BLOG是一款实用的开源免费的个人博客系统。集成了系统管理、基础数据、博客文章、博客动态、语雀知识库、用户管理、访问统计等功能。具有简约,易用,内存占用低等特点,可以用来做个人博客,工作室官网,自...', 0, 1, 1, '', '勾股BLOG是一款实用的开源免费的个人博客系统。集成了系统管理、基础数据、博客文章、博客动态、语雀知识库、用户管理、访问统计等功能。具有简约,易用,内存占用低等特点,可以用来做个人博客,工作室官网,自媒体官网等网站,二次开发之后也可以作为资讯、展品展示等网站。', 0, 0, 1, 1, 0, 1650817152, 0, 0);
|
||||
INSERT INTO `oa_article` VALUES (4, '勾股DEV——研发管理与团队协作的工具软件', 2, '', '勾股DEV是一款专为IT行业研发团队打造的智能化项目管理与团队协作的工具软件,可以在线管理团队的工作、项目和任务,覆盖从需求提出到研发完成上线整个过程的项目协作。', 0, 1, 1, '', '勾股DEV是一款专为IT行业研发团队打造的智能化项目管理与团队协作的工具软件,可以在线管理团队的工作、项目和任务,覆盖从需求提出到研发完成上线整个过程的项目协作。', 0, 0, 1, 1, 0, 1650817189, 0, 0);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_article_keywords
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_article_keywords`;
|
||||
CREATE TABLE `oa_article_keywords` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`aid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '知识文章ID',
|
||||
`keywords_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联关键字id',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用',
|
||||
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `aid`(`aid`) USING BTREE,
|
||||
INDEX `inid`(`keywords_id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '知识文章关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of oa_article_keywords
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_article_keywords` VALUES (1, 1, 1, 1, 1638093082);
|
||||
INSERT INTO `oa_article_keywords` VALUES (2, 2, 2, 1, 1638093082);
|
||||
INSERT INTO `oa_article_keywords` VALUES (3, 3, 3, 3, 1638093082);
|
||||
INSERT INTO `oa_article_keywords` VALUES (4, 4, 4, 4, 1638093082);
|
@ -244,17 +244,19 @@
|
||||
layer.msg('上传中...',{time: 3600000});
|
||||
}
|
||||
,done: function(res, index, upload){
|
||||
layer.msg('上传成功');
|
||||
var timestamp=new Date().getTime();
|
||||
var tr = '<tr data-id="'+res.data.id+'" id="tr_'+timestamp+'">\
|
||||
<td>'+ res.data.name +'</td>\
|
||||
<td align="center">'+ (res.data.filesize/(1024*1024)).toFixed(2) +'MB</td>\
|
||||
<td align="center">\
|
||||
<span class="layui-btn layui-btn-xs layui-btn-danger demo-delete" data-id="'+timestamp+'">删除</span>\
|
||||
</td>\
|
||||
</tr>';
|
||||
$('.layui-upload-list').show();
|
||||
$('#demoList').append(tr);
|
||||
layer.msg(res.msg);
|
||||
if(res.code==0){
|
||||
var timestamp=new Date().getTime();
|
||||
var tr = '<tr data-id="'+res.data.id+'" id="tr_'+timestamp+'">\
|
||||
<td>'+ res.data.name +'</td>\
|
||||
<td align="center">'+ (res.data.filesize/(1024*1024)).toFixed(2) +'MB</td>\
|
||||
<td align="center">\
|
||||
<span class="layui-btn layui-btn-xs layui-btn-danger demo-delete" data-id="'+timestamp+'">删除</span>\
|
||||
</td>\
|
||||
</tr>';
|
||||
$('.layui-upload-list').show();
|
||||
$('#demoList').append(tr);
|
||||
}
|
||||
}
|
||||
,error: function(index, upload){
|
||||
layer.msg('上传失败');
|
||||
|
@ -197,17 +197,19 @@
|
||||
layer.msg('上传中...',{time: 3600000});
|
||||
}
|
||||
,done: function(res, index, upload){
|
||||
layer.msg('上传成功');
|
||||
var timestamp=new Date().getTime();
|
||||
var tr = '<tr data-id="'+res.data.id+'" id="tr_'+timestamp+'">\
|
||||
<td>'+ res.data.name +'</td>\
|
||||
<td align="center">'+ (res.data.filesize/(1024*1024)).toFixed(2) +'MB</td>\
|
||||
<td align="center">\
|
||||
<span class="layui-btn layui-btn-xs layui-btn-danger demo-delete" data-id="'+timestamp+'">删除</span>\
|
||||
</td>\
|
||||
</tr>';
|
||||
$('.layui-upload-list').show();
|
||||
$('#demoList').append(tr);
|
||||
layer.msg(res.msg);
|
||||
if(res.code==0){
|
||||
var timestamp=new Date().getTime();
|
||||
var tr = '<tr data-id="'+res.data.id+'" id="tr_'+timestamp+'">\
|
||||
<td>'+ res.data.name +'</td>\
|
||||
<td align="center">'+ (res.data.filesize/(1024*1024)).toFixed(2) +'MB</td>\
|
||||
<td align="center">\
|
||||
<span class="layui-btn layui-btn-xs layui-btn-danger demo-delete" data-id="'+timestamp+'">删除</span>\
|
||||
</td>\
|
||||
</tr>';
|
||||
$('.layui-upload-list').show();
|
||||
$('#demoList').append(tr);
|
||||
}
|
||||
}
|
||||
,error: function(index, upload){
|
||||
layer.msg('上传失败');
|
||||
|
@ -35,7 +35,7 @@ class Plan extends BaseController
|
||||
} else {
|
||||
$where[] = ['a.admin_id', '=', $this->uid];
|
||||
}
|
||||
$where[] = ['a.status', '=', 1];
|
||||
$where[] = ['a.delete_time', '=', 0];
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$plan = PlanList::where($where)
|
||||
->field('a.*,u.name as create_admin')
|
||||
@ -67,11 +67,11 @@ class Plan extends BaseController
|
||||
$where1 = [];
|
||||
$where2 = [];
|
||||
|
||||
$where1[] = ['status', '=', 1];
|
||||
$where1[] = ['delete_time', '=', 1];
|
||||
$where1[] = ['admin_id', '=', $uid];
|
||||
$where1[] = ['start_time', '>=', strtotime($param['start'])];
|
||||
|
||||
$where2[] = ['status', '=', 1];
|
||||
$where2[] = ['delete_time', '=', 1];
|
||||
$where2[] = ['admin_id', '=', $uid];
|
||||
$where2[] = ['end_time', '<=', strtotime($param['end'])];
|
||||
|
||||
@ -184,9 +184,8 @@ class Plan extends BaseController
|
||||
public function delete()
|
||||
{
|
||||
$id = get_params("id");
|
||||
$data['status'] = '-1';
|
||||
$data['id'] = $id;
|
||||
$data['update_time'] = time();
|
||||
$data['delete_time'] = time();
|
||||
if (Db::name('Plan')->update($data) !== false) {
|
||||
add_log('delete', $data['id'], $data);
|
||||
return to_assign(0, "删除成功");
|
||||
|
@ -26,6 +26,12 @@ class Schedule extends BaseController
|
||||
$where = [];
|
||||
if ($start_time > 0 && $end_time > 0) {
|
||||
$where[] = ['a.start_time', 'between', [$start_time, $end_time]];
|
||||
}
|
||||
if (!empty($param['tid']) && $param['tid']>0) {
|
||||
$task_ids = Db::name('ProjectTask')->where(['delete_time' => 0, 'project_id' => $param['tid']])->column('id');
|
||||
if (!empty($task_ids)) {
|
||||
$where[] = ['a.tid', 'in', $task_ids];
|
||||
}
|
||||
}
|
||||
if (!empty($param['keywords'])) {
|
||||
$where[] = ['a.title', 'like', '%' . trim($param['keywords']) . '%'];
|
||||
@ -35,15 +41,30 @@ class Schedule extends BaseController
|
||||
} else {
|
||||
$where[] = ['a.admin_id', '=', $this->uid];
|
||||
}
|
||||
$where[] = ['a.status', '=', 1];
|
||||
$where[] = ['a.delete_time', '=', 0];
|
||||
$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')
|
||||
->field('a.*,u.name,d.title as department,w.title as cate')
|
||||
->alias('a')
|
||||
->join('Admin u', 'a.admin_id = u.id', 'LEFT')
|
||||
->join('Department d', 'u.did = d.id', 'LEFT')
|
||||
->join('WorkCate w', 'w.id = a.cid', 'LEFT')
|
||||
->order('a.end_time desc')
|
||||
->paginate($rows, false)
|
||||
->each(function ($item, $key) {
|
||||
$item->labor_type_string = '案头工作';
|
||||
if($item->labor_type == 2){
|
||||
$item->labor_type_string = '外勤工作';
|
||||
}
|
||||
if($item->tid > 0){
|
||||
$task = Db::name('ProjectTask')->where(['id' => $item->tid])->find();
|
||||
$item->task = $task['title'];
|
||||
$item->project = Db::name('Project')->where(['id' => $task['project_id']])->value('name');
|
||||
}
|
||||
$item->start_time_a = empty($item->start_time) ? '' : date('Y-m-d', $item->start_time);
|
||||
$item->start_time_b = empty($item->start_time) ? '' : date('H:i', $item->start_time);
|
||||
$item->end_time_a = empty($item->end_time) ? '' : date('Y-m-d', $item->end_time);
|
||||
$item->end_time_b = empty($item->end_time) ? '' : date('H:i', $item->end_time);
|
||||
$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);
|
||||
@ -67,7 +88,7 @@ class Schedule extends BaseController
|
||||
$where[] = ['start_time', '>=', strtotime($param['start'])];
|
||||
$where[] = ['end_time', '<=', strtotime($param['end'])];
|
||||
$where[] = ['admin_id', '=', $uid];
|
||||
$where[] = ['status', '=', 1];
|
||||
$where[] = ['delete_time', '=', 0];
|
||||
$schedule = Db::name('Schedule')->where($where)->field('id,title,labor_time,start_time,end_time')->select()->toArray();
|
||||
$events = [];
|
||||
$countEvents = [];
|
||||
@ -139,16 +160,16 @@ class Schedule extends BaseController
|
||||
if ($param['end_time'] <= $param['start_time']) {
|
||||
return to_assign(1, "结束时间需要大于开始时间");
|
||||
}
|
||||
$where1[] = ['status', '=', 1];
|
||||
$where1[] = ['delete_time', '=', 0];
|
||||
$where1[] = ['admin_id', '=', $admin_id];
|
||||
$where1[] = ['start_time', 'between', [$param['start_time'], $param['end_time'] - 1]];
|
||||
|
||||
$where2[] = ['status', '=', 1];
|
||||
$where2[] = ['delete_time', '=', 0];
|
||||
$where2[] = ['admin_id', '=', $admin_id];
|
||||
$where2[] = ['start_time', '<=', $param['start_time']];
|
||||
$where2[] = ['start_time', '>=', $param['end_time']];
|
||||
|
||||
$where3[] = ['status', '=', 1];
|
||||
$where3[] = ['delete_time', '=', 0];
|
||||
$where3[] = ['admin_id', '=', $admin_id];
|
||||
$where3[] = ['end_time', 'between', [$param['start_time'] + 1, $param['end_time']]];
|
||||
|
||||
@ -205,18 +226,18 @@ class Schedule extends BaseController
|
||||
if ($param['end_time'] <= $param['start_time']) {
|
||||
return to_assign(1, "结束时间需要大于开始时间");
|
||||
}
|
||||
$where1[] = ['status', '=', 1];
|
||||
$where1[] = ['delete_time', '=', 0];
|
||||
$where1[] = ['id', '<>', $param['id']];
|
||||
$where1[] = ['admin_id', '=', $param['admin_id']];
|
||||
$where1[] = ['start_time', 'between', [$param['start_time'], $param['end_time'] - 1]];
|
||||
|
||||
$where2[] = ['status', '=', 1];
|
||||
$where2[] = ['delete_time', '=', 0];
|
||||
$where2[] = ['id', '<>', $param['id']];
|
||||
$where2[] = ['admin_id', '=', $param['admin_id']];
|
||||
$where2[] = ['start_time', '<=', $param['start_time']];
|
||||
$where2[] = ['start_time', '>=', $param['end_time']];
|
||||
|
||||
$where3[] = ['status', '=', 1];
|
||||
$where3[] = ['delete_time', '=', 0];
|
||||
$where3[] = ['id', '<>', $param['id']];
|
||||
$where3[] = ['admin_id', '=', $param['admin_id']];
|
||||
$where3[] = ['end_time', 'between', [$param['start_time'] + 1, $param['end_time']]];
|
||||
@ -249,9 +270,8 @@ class Schedule extends BaseController
|
||||
public function delete()
|
||||
{
|
||||
$id = get_params("id");
|
||||
$data['status'] = '-1';
|
||||
$data['id'] = $id;
|
||||
$data['update_time'] = time();
|
||||
$data['delete_time'] = time();
|
||||
if (Db::name('schedule')->update($data) !== false) {
|
||||
add_log('delete', $data['id'], $data);
|
||||
return to_assign(0, "删除成功");
|
||||
@ -270,7 +290,18 @@ class Schedule extends BaseController
|
||||
$schedule['start_time'] = date('Y-m-d', $schedule['start_time']);
|
||||
$schedule['end_time'] = date('Y-m-d', $schedule['end_time']);
|
||||
$schedule['create_time'] = date('Y-m-d H:i:s', $schedule['create_time']);
|
||||
$schedule['user'] = Db::name('Admin')->where(['id' => $schedule['admin_id']])->value('name');
|
||||
$schedule['name'] = Db::name('Admin')->where(['id' => $schedule['admin_id']])->value('name');
|
||||
$schedule['labor_type_string'] = '案头工作';
|
||||
if($schedule['labor_type'] == 2){
|
||||
$schedule['labor_type_string'] = '外勤工作';
|
||||
}
|
||||
$schedule['department'] = get_admin($schedule['admin_id'])['department'];
|
||||
$schedule['work_cate'] = Db::name('WorkCate')->where(['id' => $schedule['cid']])->value('title');
|
||||
if($schedule['tid']>0){
|
||||
$task = Db::name('ProjectTask')->where(['id' => $schedule['tid']])->find();
|
||||
$schedule['task'] = $task['title'];
|
||||
$schedule['project'] = Db::name('Project')->where(['id' => $task['project_id']])->value('name');
|
||||
}
|
||||
}
|
||||
if (request()->isAjax()) {
|
||||
return to_assign(0, "", $schedule);
|
||||
|
@ -428,18 +428,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -474,8 +477,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -188,29 +188,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -283,18 +281,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -329,8 +330,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -304,29 +304,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -390,18 +388,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -436,8 +437,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -222,29 +222,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -318,18 +316,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -364,9 +365,9 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
@ -197,18 +197,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -243,9 +246,9 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
@ -296,18 +296,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -342,8 +345,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -306,29 +306,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -410,18 +408,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -456,9 +457,9 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
@ -445,18 +445,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -491,9 +494,9 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
@ -176,29 +176,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -271,18 +269,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -317,9 +318,9 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
@ -214,18 +214,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -260,8 +263,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -220,29 +220,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -313,18 +311,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -359,8 +360,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -390,29 +390,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -516,18 +514,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -562,9 +563,9 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
@ -220,18 +220,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -266,8 +269,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -174,29 +174,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -259,18 +257,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -305,8 +306,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -403,29 +403,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -489,18 +487,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -535,8 +536,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -197,29 +197,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -283,18 +281,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -329,8 +330,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -469,18 +469,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -515,8 +518,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -188,18 +188,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -234,8 +237,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -229,29 +229,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -314,18 +312,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -360,8 +361,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -220,29 +220,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -314,18 +312,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -360,8 +361,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -260,29 +260,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -353,18 +351,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -399,8 +400,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -212,29 +212,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
,accept: 'file' //普通文件
|
||||
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
|
||||
,done: function(res){
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败')
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
layer.msg(res.msg);
|
||||
if (res.code == 0) {
|
||||
//上传成功
|
||||
var idsStr = $('#fileList input').val(),idsArray = [];
|
||||
if (idsStr != '') {
|
||||
idsArray = idsStr.split(",");
|
||||
}
|
||||
idsArray.push(res.data.id);
|
||||
$('#fileList input').attr('value', idsArray.join(','));
|
||||
let temp = `<div class="layui-col-md3" id="uploadImg${res.data.id}">
|
||||
<div class="file-card">
|
||||
<i class="file-icon layui-icon layui-icon-file"></i>
|
||||
<div class="file-title">${res.data.name}</div>
|
||||
<div class="file-tool">
|
||||
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
|
||||
<i class="btn-delete layui-icon layui-icon-delete" data-id="${res.data.id}" style="color: #FF5722;" title="删除"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
</div>`;
|
||||
$('#fileList').append(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
@ -298,18 +296,21 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
form.render();
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'post',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(data.value==''){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_users",
|
||||
type:'get',
|
||||
data:{id:data.value},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
var flowLi='';
|
||||
var flow_data = e.data.flow_data;
|
||||
if(e.data.copy_uids && e.data.copy_uids !=''){
|
||||
formSelects.value('selectcopy', e.data.copy_uids.split(','));
|
||||
}
|
||||
if(check_type == 1){
|
||||
for(var a=0;a<flow_data.length;a++){
|
||||
var userList='',sign_type = '';
|
||||
if(flow_data[a].flow_type==1){
|
||||
@ -344,8 +345,8 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
$('#flow_tr').html(formHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -5,7 +5,7 @@ const moduleInit = ['tool','employeepicker'];
|
||||
//获取审核信息
|
||||
$.ajax({
|
||||
url: "/api/index/get_flow_nodes",
|
||||
type:'post',
|
||||
type:'get',
|
||||
data:{id:$('[name="id"]').val()},
|
||||
success: function (e) {
|
||||
if (e.code == 0) {
|
||||
|
@ -66,9 +66,9 @@ user-select: none;}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
const moduleInit = ['tool','employeepicker'];
|
||||
const moduleInit = ['tool','employeepicker','oaSchedule'];
|
||||
function gouguInit() {
|
||||
var form = layui.form,tool=layui.tool, employeepicker = layui.employeepicker,laydate = layui.laydate,dropdown = layui.dropdown;
|
||||
var form = layui.form,tool=layui.tool, employeepicker = layui.employeepicker,laydate = layui.laydate,work = layui.oaSchedule;
|
||||
|
||||
// 选择员工
|
||||
$('body').on('click','[data-event="select"]',function(){
|
||||
@ -89,191 +89,6 @@ user-select: none;}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
function addEvent(detail){
|
||||
var content='<form class="layui-form" style="width:868px">\
|
||||
<table class="layui-table" style="margin:15px 15px 0;">\
|
||||
<tr>\
|
||||
<td class="layui-td-gray-2">工作时间范围<font>*</font></td>\
|
||||
<td>\
|
||||
<input id="start_time_a" name="start_time_a" value="'+detail.start_time_a+'" style="width:100px; display:inline-block;" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" lay-reqText="请选择"><div style="display: inline-block; margin-left:3px; width: 80px;"><select lay-filter="start_time_b" id="start_time_b"></select></div> 至 <input id="end_time_a" name="end_time_a" value="'+detail.end_time_a+'" style="width:100px; display:inline-block;" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" lay-reqText="请选择"><div style="display: inline-block; margin-left:3px; width: 80px;"><select lay-filter="end_time_b" id="end_time_b"></select></div>\
|
||||
</td>\
|
||||
<td class="layui-td-gray">工作类型<font>*</font></td>\
|
||||
<td>\
|
||||
<input type="radio" name="labor_type" lay-filter="labor_type" value="1" title="案头工作"><input type="radio" name="labor_type" value="2" lay-filter="labor_type" title="外勤工作">\
|
||||
</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="layui-td-gray">工作内容<font>*</font></td>\
|
||||
<td colspan="3"><input name="title" class="layui-input" value="" lay-verify="required" lay-reqText="请完成工作内容"></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="layui-td-gray-2">工作详细描述</td>\
|
||||
<td colspan="3">\
|
||||
<textarea name="remark" form-input="remark" class="layui-textarea" style="min-height:120px;"></textarea>\
|
||||
</td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
</form>';
|
||||
layer.open({
|
||||
type:1,
|
||||
title:'添加工作记录',
|
||||
area:['900px','390px'],
|
||||
content:content,
|
||||
success:function(){
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time_a',
|
||||
type: 'date',
|
||||
min: -7,
|
||||
max:0,
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(a,b,c){
|
||||
$('#end_time_a').val(a);
|
||||
detail.start_time_a=a;
|
||||
detail.end_time_a=a;
|
||||
}
|
||||
});
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#end_time_a',
|
||||
type: 'date',
|
||||
min: -7,
|
||||
max:0,
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(a,b,c){
|
||||
$('#start_time_a').val(a);
|
||||
detail.start_time_a=a;
|
||||
detail.end_time_a=a;
|
||||
}
|
||||
});
|
||||
$('#start_time_b,#end_time_b').empty();
|
||||
|
||||
var hourArray=[];
|
||||
for(var h=0;h<24;h++){
|
||||
var t=h<10?'0'+h:h
|
||||
var t_1=t+':00',t_2=t+':15',t_3=t+':30',t_4=t+':45';
|
||||
hourArray.push(t_1,t_2,t_3,t_4);
|
||||
}
|
||||
|
||||
var html_1='', html_2='',def_h1='08:30',def_h2='09:00';
|
||||
for(var s=0;s<hourArray.length;s++){
|
||||
var check_1='',check_2='';
|
||||
if(hourArray[s]==def_h1){
|
||||
check_1='selected';
|
||||
}
|
||||
if(hourArray[s]==def_h2){
|
||||
check_2='selected';
|
||||
}
|
||||
html_1 += '<option value="'+hourArray[s]+'" '+check_1+'>'+hourArray[s]+'</option>';
|
||||
html_2 += '<option value="'+hourArray[s]+'" '+check_2+'>'+hourArray[s]+'</option>';
|
||||
}
|
||||
|
||||
$('#start_time_b').append(html_1);
|
||||
$('#end_time_b').append(html_2);
|
||||
form.render();
|
||||
|
||||
$('[name="title"]').on('input',function(){
|
||||
var _val=$(this).val();
|
||||
detail.title=_val;
|
||||
});
|
||||
form.on('select(start_time_b)', function(data){
|
||||
detail.start_time_b=data.value;
|
||||
console.log(data);
|
||||
});
|
||||
form.on('select(end_time_b)', function(data){
|
||||
detail.end_time_b=data.value;
|
||||
});
|
||||
$('[form-input="remark"]').on('input',function(){
|
||||
var _val=$(this).val();
|
||||
detail.remark=_val;
|
||||
});
|
||||
form.on('radio(labor_type)', function(data){
|
||||
detail.labor_type=data.value;
|
||||
});
|
||||
},
|
||||
btn: ['确定提交'],
|
||||
btnAlign:'c',
|
||||
yes: function(idx){
|
||||
if(detail.start_time=='' || detail.end_time==''){
|
||||
layer.msg('请选择工作时间范围');
|
||||
return;
|
||||
}
|
||||
if(detail.labor_type==0){
|
||||
layer.msg('请选择工作类型');
|
||||
return;
|
||||
}
|
||||
if(detail.title==''){
|
||||
layer.msg('请填写工作内容');
|
||||
return;
|
||||
}
|
||||
console.log(detail);
|
||||
$.ajax({
|
||||
url: "/oa/schedule/add",
|
||||
type:'post',
|
||||
data:detail,
|
||||
success:function(e){
|
||||
layer.msg(e.msg);
|
||||
if(e.code==0){
|
||||
layer.close(idx);
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1000)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//查看工作记录
|
||||
function viewEvent(){
|
||||
var work_type='-';
|
||||
if(detail.labor_type==2){
|
||||
work_type='外勤工作';
|
||||
}
|
||||
else if(detail.labor_type==1){
|
||||
work_type='案头工作';
|
||||
}
|
||||
var content='<form class="layui-form" style="width:770px">\
|
||||
<table class="layui-table" style="margin:12px 15px 0;">\
|
||||
<tr>\
|
||||
<td class="layui-td-gray">工作内容</td>\
|
||||
<td>'+detail.title+'</td>\
|
||||
<td class="layui-td-gray">工作类别</td>\
|
||||
<td>'+work_type+'</td>\
|
||||
</tr>\
|
||||
<tr id="tr_date_range">\
|
||||
<td class="layui-td-gray-2">工作时间范围</td>\
|
||||
<td>'+detail.start_time+' '+detail.start_time_1+' 至 '+detail.end_time_1+',共'+detail.labor_time+'工时</td>\
|
||||
<td class="layui-td-gray">执行人</td>\
|
||||
<td>'+detail.user+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="layui-td-gray">工作描述</td>\
|
||||
<td colspan="3">'+detail.remark+'</td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
</form>';
|
||||
layer.open({
|
||||
type:1,
|
||||
title:'查看工作记录',
|
||||
area:['800px','336px'],
|
||||
content:content,
|
||||
success:function(){
|
||||
|
||||
},
|
||||
btn: ['关闭'],
|
||||
btnAlign: 'c',
|
||||
yes: function(idx){
|
||||
layer.close(idx);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//请求事件api数据
|
||||
function eventApi(id){
|
||||
@ -286,7 +101,7 @@ user-select: none;}
|
||||
data:{id:id},
|
||||
success:function(res){
|
||||
detail=res.data;
|
||||
viewEvent();
|
||||
work.view(detail);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -349,13 +164,13 @@ user-select: none;}
|
||||
detail['labor_type']=0;
|
||||
detail['start_time_a']=dateStr;
|
||||
detail['end_time_a']=dateStr;
|
||||
detail['start_time_b']='08:30';
|
||||
detail['end_time_b']='09:00';
|
||||
detail['start_time_b']='09:00';
|
||||
detail['end_time_b']='09:30';
|
||||
detail['remark']='';
|
||||
detail['type']=0;
|
||||
detail['remind_type']=0;
|
||||
//console.log(detail);
|
||||
addEvent(detail);
|
||||
work.add(0, detail);
|
||||
},
|
||||
nowIndicator: true,
|
||||
weekNumbers: true,// 是否开启周数
|
||||
|
@ -41,9 +41,9 @@
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool','employeepicker'];
|
||||
const moduleInit = ['tool','employeepicker','oaSchedule'];
|
||||
function gouguInit() {
|
||||
var form = layui.form,table = layui.table,tool=layui.tool, employeepicker = layui.employeepicker,laydate = layui.laydate,dropdown = layui.dropdown;
|
||||
var form = layui.form,table = layui.table,tool=layui.tool, employeepicker = layui.employeepicker,laydate = layui.laydate,work = layui.oaSchedule;
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#barDate',
|
||||
@ -77,11 +77,11 @@
|
||||
//监听搜索提交
|
||||
form.on('submit(webform)', function(data){
|
||||
let f=data.field;
|
||||
layui.pageTable.reload({where:{keywords:f.keywords,start_time:f.start_time,end_time:f.end_time,uid:f.uid},page:{curr:1}});
|
||||
layui.scheduleTable.reload({where:{keywords:f.keywords,start_time:f.start_time,end_time:f.end_time,uid:f.uid},page:{curr:1}});
|
||||
return false;
|
||||
});
|
||||
|
||||
layui.pageTable = table.render({
|
||||
layui.scheduleTable = table.render({
|
||||
elem: '#test'
|
||||
,toolbar: '#toolbarDemo'
|
||||
,title:'工作记录列表'
|
||||
@ -91,19 +91,20 @@
|
||||
,cellMinWidth: 80
|
||||
,cols: [[ //表头
|
||||
{field: 'id', title: '序号',fixed: 'left', width:80, align:'center'}
|
||||
,{field: 'labor_type', title: '工作类别', align:'center',width:90,templet:function(d){
|
||||
,{field: 'labor_type_string', title: '工作类型', align:'center',width:90,templet:function(d){
|
||||
var html='';
|
||||
if(d.labor_type==0){
|
||||
html='<span class="span-color-'+d.labor_type+'">-</span>';
|
||||
html='<span class="layui-color-'+d.labor_type+'">-</span>';
|
||||
}
|
||||
else if(d.labor_type == 1){
|
||||
html='<span class="span-color-'+d.labor_type+'">案头工作</span>';
|
||||
html='<span class="layui-color-'+d.labor_type+'">案头工作</span>';
|
||||
}
|
||||
else if(d.labor_type == 2){
|
||||
html='<span class="span-color-'+d.labor_type+'">外勤工作</span>';
|
||||
html='<span class="layui-color-'+d.labor_type+'">外勤工作</span>';
|
||||
}
|
||||
return html;
|
||||
}}
|
||||
,{field: 'cate', title: '工作类别', align:'center',width:80}
|
||||
,{field: 'start_time', title: '工作时间范围', align:'center',width:186,templet:function(d){
|
||||
var html=d.start_time+'至'+d.end_time;
|
||||
return html;
|
||||
@ -132,7 +133,7 @@
|
||||
<tr>\
|
||||
<td class="layui-td-gray-2">工作时间范围<font>*</font></td>\
|
||||
<td>\
|
||||
<input id="start_time_a" name="start_time_a" style="width:110px; display:inline-block;" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" lay-reqText="请选择"><div style="display: inline-block; margin-left:5px; width: 80px;"><select lay-filter="start_time_b" id="start_time_b"></select></div> 至 <input id="end_time_a" name="end_time_a" style="width:110px; display:inline-block;" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" lay-reqText="请选择"><div style="display: inline-block; margin-left:5px; width: 80px;"><select lay-filter="end_time_b" id="end_time_b"></select></div>\
|
||||
<input id="start_time_a" name="start_time_a" style="width:120px; display:inline-block;" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" lay-reqText="请选择"><div style="display: inline-block; margin-left:5px; width: 80px;"><select lay-filter="start_time_b" id="start_time_b"></select></div> 至 <input id="end_time_a" name="end_time_a" style="width:120px; display:inline-block;" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" lay-reqText="请选择"><div style="display: inline-block; margin-left:5px; width: 80px;"><select lay-filter="end_time_b" id="end_time_b"></select></div>\
|
||||
</td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
@ -219,7 +220,7 @@
|
||||
layer.msg(e.msg);
|
||||
if(e.code==0){
|
||||
layer.close(idx);
|
||||
layui.pageTable.reload();
|
||||
layui.scheduleTable.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -227,301 +228,16 @@
|
||||
})
|
||||
}
|
||||
else if(obj.event === 'edit'){
|
||||
$.ajax({
|
||||
url: "/oa/schedule/detail",
|
||||
type:'get',
|
||||
data:{id:data.id},
|
||||
success:function(e){
|
||||
if(e.code==0){
|
||||
editEvent(e.data);
|
||||
}
|
||||
}
|
||||
})
|
||||
work.add(0, obj.data);
|
||||
}
|
||||
else if(obj.event === 'view'){
|
||||
$.ajax({
|
||||
url: "/oa/schedule/detail",
|
||||
type:'get',
|
||||
data:{id:data.id},
|
||||
success:function(e){
|
||||
if(e.code==0){
|
||||
viewEvent(e.data);
|
||||
}
|
||||
}
|
||||
})
|
||||
work.view(obj.data);
|
||||
}
|
||||
});
|
||||
|
||||
//编辑
|
||||
function editEvent(data){
|
||||
var detail={};
|
||||
detail['id']=data.id;
|
||||
detail['title']=data.title;
|
||||
detail['remark']=data.remark;
|
||||
detail['labor_type']=data.labor_type;
|
||||
var content='<form class="layui-form" style="width:868px">\
|
||||
<table class="layui-table" style="margin:15px 15px 0;">\
|
||||
<tr>\
|
||||
<td class="layui-td-gray-2">工作时间范围<font>*</font></td>\
|
||||
<td>'+data.start_time+' '+data.start_time_1+' 至 '+data.end_time_1+'</td>\
|
||||
<td class="layui-td-gray">工作类型<font>*</font></td>\
|
||||
<td>\
|
||||
<input type="radio" name="labor_type" lay-filter="labor_type" value="1" title="案头工作"><input type="radio" name="labor_type" value="2" lay-filter="labor_type" title="外勤工作">\
|
||||
</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="layui-td-gray">工作内容<font>*</font></td>\
|
||||
<td colspan="3"><input name="title" class="layui-input" value="'+data.title+'" lay-verify="required" lay-reqText="请完成工作内容"></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="layui-td-gray-2">工作详细描述</td>\
|
||||
<td colspan="3">\
|
||||
<textarea name="remark" form-input="remark" class="layui-textarea" style="min-height:120px;">'+data.remark+'</textarea>\
|
||||
</td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
</form>';
|
||||
layer.open({
|
||||
type:1,
|
||||
title:'编辑工作记录',
|
||||
area:['900px','390px'],
|
||||
content:content,
|
||||
success:function(){
|
||||
$("input[name=labor_type][value="+data.labor_type+"]").prop("checked","true");
|
||||
form.render();
|
||||
$('[name="title"]').on('input',function(){
|
||||
var _val=$(this).val();
|
||||
detail.title=_val;
|
||||
});
|
||||
$('[form-input="remark"]').on('input',function(){
|
||||
var _val=$(this).val();
|
||||
detail.remark=_val;
|
||||
});
|
||||
form.on('radio(labor_type)', function(data){
|
||||
detail.labor_type=data.value;
|
||||
});
|
||||
},
|
||||
btn: ['确定提交'],
|
||||
btnAlign:'c',
|
||||
yes: function(idx){
|
||||
if(detail.labor_type==0){
|
||||
layer.msg('请选择工作类型');
|
||||
return;
|
||||
}
|
||||
if(detail.title==''){
|
||||
layer.msg('请填写工作内容');
|
||||
return;
|
||||
}
|
||||
console.log(detail);
|
||||
$.ajax({
|
||||
url: "/oa/schedule/add",
|
||||
type:'post',
|
||||
data:detail,
|
||||
success:function(e){
|
||||
layer.msg(e.msg);
|
||||
if(e.code==0){
|
||||
layer.close(idx);
|
||||
layui.pageTable.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//查看工作记录
|
||||
function viewEvent(detail){
|
||||
var work_type='-';
|
||||
if(detail.labor_type==2){
|
||||
work_type='外勤工作';
|
||||
}
|
||||
else if(detail.labor_type==1){
|
||||
work_type='案头工作';
|
||||
}
|
||||
var content='<form class="layui-form" style="width:770px">\
|
||||
<table class="layui-table" style="margin:12px 15px 0;">\
|
||||
<tr>\
|
||||
<td class="layui-td-gray">工作内容</td>\
|
||||
<td>'+detail.title+'</td>\
|
||||
<td class="layui-td-gray">工作类别</td>\
|
||||
<td>'+work_type+'</td>\
|
||||
</tr>\
|
||||
<tr id="tr_date_range">\
|
||||
<td class="layui-td-gray-2">工作时间范围</td>\
|
||||
<td>'+detail.start_time+' '+detail.start_time_1+' 至 '+detail.end_time_1+',共'+detail.labor_time+'工时</td>\
|
||||
<td class="layui-td-gray">执行人</td>\
|
||||
<td>'+detail.user+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="layui-td-gray">工作描述</td>\
|
||||
<td colspan="3">'+detail.remark+'</td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
</form>';
|
||||
layer.open({
|
||||
type:1,
|
||||
title:'工作记录',
|
||||
area:['800px','336px'],
|
||||
content:content,
|
||||
success:function(){
|
||||
|
||||
},
|
||||
btn: ['关闭'],
|
||||
btnAlign: 'c',
|
||||
yes: function(idx){
|
||||
layer.close(idx);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$('body').on('click','.addLoan',function(){
|
||||
addEvent();
|
||||
});
|
||||
|
||||
function addEvent(){
|
||||
var detail={};
|
||||
detail['id']=0;
|
||||
detail['title']='';
|
||||
detail['start_time_a']='';
|
||||
detail['end_time_a']='';
|
||||
detail['start_time_b']='09:00';
|
||||
detail['end_time_b']='09:30';
|
||||
detail['remark']='';
|
||||
detail['labor_type']=0;
|
||||
var content='<form class="layui-form" style="width:868px">\
|
||||
<table class="layui-table" style="margin:15px 15px 0;">\
|
||||
<tr>\
|
||||
<td class="layui-td-gray-2">工作时间范围<font>*</font></td>\
|
||||
<td>\
|
||||
<input id="start_time_a" name="start_time_a" style="width:100px; display:inline-block;" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" lay-reqText="请选择"><div style="display: inline-block; margin-left:3px; width: 80px;"><select lay-filter="start_time_b" id="start_time_b"></select></div> 至 <input id="end_time_a" name="end_time_a" style="width:100px; display:inline-block;" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" lay-reqText="请选择"><div style="display: inline-block; margin-left:3px; width: 80px;"><select lay-filter="end_time_b" id="end_time_b"></select></div>\
|
||||
</td>\
|
||||
<td class="layui-td-gray">工作类型<font>*</font></td>\
|
||||
<td>\
|
||||
<input type="radio" name="labor_type" lay-filter="labor_type" value="1" title="案头工作"><input type="radio" name="labor_type" value="2" lay-filter="labor_type" title="外勤工作">\
|
||||
</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="layui-td-gray">工作内容<font>*</font></td>\
|
||||
<td colspan="3"><input name="title" class="layui-input" value="" lay-verify="required" lay-reqText="请完成工作内容"></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="layui-td-gray-2">工作详细描述</td>\
|
||||
<td colspan="3">\
|
||||
<textarea name="remark" form-input="remark" class="layui-textarea" style="min-height:120px;"></textarea>\
|
||||
</td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
</form>';
|
||||
layer.open({
|
||||
type:1,
|
||||
title:'添加工作记录',
|
||||
area:['900px','390px'],
|
||||
content:content,
|
||||
success:function(){
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#start_time_a',
|
||||
type: 'date',
|
||||
min: -7,
|
||||
max:0,
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(a,b,c){
|
||||
$('#end_time_a').val(a);
|
||||
detail.start_time_a=a;
|
||||
detail.end_time_a=a;
|
||||
}
|
||||
});
|
||||
|
||||
//日期时间范围
|
||||
laydate.render({
|
||||
elem: '#end_time_a',
|
||||
type: 'date',
|
||||
min: -7,
|
||||
max:0,
|
||||
format: 'yyyy-MM-dd',
|
||||
showBottom: false,
|
||||
done:function(a,b,c){
|
||||
$('#start_time_a').val(a);
|
||||
detail.start_time_a=a;
|
||||
detail.end_time_a=a;
|
||||
}
|
||||
});
|
||||
$('#start_time_b,#end_time_b').empty();
|
||||
|
||||
var hourArray=[];
|
||||
for(var h=0;h<24;h++){
|
||||
var t=h<10?'0'+h:h
|
||||
var t_1=t+':00',t_2=t+':15',t_3=t+':30',t_4=t+':45';
|
||||
hourArray.push(t_1,t_2,t_3,t_4);
|
||||
}
|
||||
|
||||
var html_1='', html_2='',def_h1='09:00',def_h2='09:30';
|
||||
for(var s=0;s<hourArray.length;s++){
|
||||
var check_1='',check_2='';
|
||||
if(hourArray[s]==def_h1){
|
||||
check_1='selected';
|
||||
}
|
||||
if(hourArray[s]==def_h2){
|
||||
check_2='selected';
|
||||
}
|
||||
html_1 += '<option value="'+hourArray[s]+'" '+check_1+'>'+hourArray[s]+'</option>';
|
||||
html_2 += '<option value="'+hourArray[s]+'" '+check_2+'>'+hourArray[s]+'</option>';
|
||||
}
|
||||
|
||||
$('#start_time_b').append(html_1);
|
||||
$('#end_time_b').append(html_2);
|
||||
form.render();
|
||||
|
||||
$('[name="title"]').on('input',function(){
|
||||
var _val=$(this).val();
|
||||
detail.title=_val;
|
||||
});
|
||||
form.on('select(start_time_b)', function(data){
|
||||
detail.start_time_b=data.value;
|
||||
console.log(data);
|
||||
});
|
||||
form.on('select(end_time_b)', function(data){
|
||||
detail.end_time_b=data.value;
|
||||
});
|
||||
$('[form-input="remark"]').on('input',function(){
|
||||
var _val=$(this).val();
|
||||
detail.remark=_val;
|
||||
});
|
||||
form.on('radio(labor_type)', function(data){
|
||||
detail.labor_type=data.value;
|
||||
});
|
||||
},
|
||||
btn: ['确定提交'],
|
||||
btnAlign:'c',
|
||||
yes: function(idx){
|
||||
if(detail.start_time_a=='' || detail.end_time_a==''){
|
||||
layer.msg('请选择工作时间范围');
|
||||
return;
|
||||
}
|
||||
if(detail.labor_type==0){
|
||||
layer.msg('请选择工作类型');
|
||||
return;
|
||||
}
|
||||
if(detail.title==''){
|
||||
layer.msg('请填写工作内容');
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: "/oa/schedule/add",
|
||||
type:'post',
|
||||
data:detail,
|
||||
success:function(e){
|
||||
layer.msg(e.msg);
|
||||
if(e.code==0){
|
||||
layer.close(idx);
|
||||
layui.pageTable.reload();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
work.add(0,{'id':0});
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -258,17 +258,19 @@ const moduleInit = ['tool','formSelects','employeepicker'];
|
||||
layer.msg('上传中...',{time: 3600000});
|
||||
}
|
||||
,done: function(res, index, upload){
|
||||
layer.msg('上传成功');
|
||||
var timestamp=new Date().getTime();
|
||||
var tr = '<tr data-id="'+res.data.id+'" id="tr_'+timestamp+'">\
|
||||
layer.msg(res.msg);
|
||||
if(res.code==0){
|
||||
var timestamp=new Date().getTime();
|
||||
var tr = '<tr data-id="'+res.data.id+'" id="tr_'+timestamp+'">\
|
||||
<td>'+ res.data.name +'</td>\
|
||||
<td align="center">'+ (res.data.filesize/(1024*1024)).toFixed(2) +'MB</td>\
|
||||
<td align="center">\
|
||||
<span class="layui-btn layui-btn-xs layui-btn-danger demo-delete" data-id="'+timestamp+'">删除</span>\
|
||||
</td>\
|
||||
</tr>';
|
||||
$('.layui-upload-list').show();
|
||||
$('#demoList').append(tr);
|
||||
$('.layui-upload-list').show();
|
||||
$('#demoList').append(tr);
|
||||
}
|
||||
}
|
||||
,error: function(index, upload){
|
||||
layer.msg('上传失败');
|
||||
|
97
app/project/common.php
Normal file
97
app/project/common.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2022 勾股工作室
|
||||
* @license https://opensource.org/licenses/GPL-3.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
/**
|
||||
======================
|
||||
*模块数据获取公共文件
|
||||
======================
|
||||
*/
|
||||
use think\facade\Db;
|
||||
//写入日志
|
||||
function add_project_log($uid,$module,$param,$old)
|
||||
{
|
||||
$log_data = [];
|
||||
$key_array = ['id', 'create_time', 'update_time', 'delete_time', 'over_time', 'md_content'];
|
||||
foreach ($param as $key => $value) {
|
||||
if (!in_array($key, $key_array)) {
|
||||
$log_data[] = array(
|
||||
'module' => $module,
|
||||
'field' => $key,
|
||||
$module . '_id' => $param['id'],
|
||||
'admin_id' => $uid,
|
||||
'old_content' => $old[$key],
|
||||
'new_content' => $value,
|
||||
'create_time' => time(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Db::name('ProjectLog')->strict(false)->field(true)->insertAll($log_data);
|
||||
}
|
||||
//读取项目
|
||||
function get_project($uid = 0)
|
||||
{
|
||||
$map = [];
|
||||
$map[] = ['delete_time', '=', 0];
|
||||
if ($uid > 0) {
|
||||
$project_ids = Db::name('ProjectUser')->where(['uid' => $uid, 'delete_time' => 0])->column('project_id');
|
||||
$map[] = ['id', 'in', $project_ids];
|
||||
}
|
||||
$project = Db::name('Project')->where($map)->select()->toArray();
|
||||
return $project;
|
||||
}
|
||||
//读取工作分类列表
|
||||
function work_cate()
|
||||
{
|
||||
$cate = Db::name('WorkCate')->order('id desc')->select()->toArray();
|
||||
return $cate;
|
||||
}
|
||||
|
||||
|
||||
//任务分配情况统计
|
||||
function plan_count($arrData)
|
||||
{
|
||||
$documents = array();
|
||||
foreach ($arrData as $index => $value) {
|
||||
$planTime = date("Y-m-d", $value['end_time']);
|
||||
if (empty($documents[$planTime])) {
|
||||
$documents[$planTime] = 1;
|
||||
} else {
|
||||
$documents[$planTime] += 1;
|
||||
}
|
||||
}
|
||||
return $documents;
|
||||
}
|
||||
|
||||
//工时登记情况统计
|
||||
function hour_count($arrData)
|
||||
{
|
||||
$documents = array();
|
||||
foreach ($arrData as $index => $value) {
|
||||
$hourTime = date("Y-m-d", $value['start_time']);
|
||||
if (empty($documents[$hourTime])) {
|
||||
$documents[$hourTime] = $value['labor_time'] + 0;
|
||||
} else {
|
||||
$documents[$hourTime] += $value['labor_time'];
|
||||
}
|
||||
$documents[$hourTime] = round($documents[$hourTime], 2);
|
||||
}
|
||||
return $documents;
|
||||
}
|
||||
|
||||
//燃尽图统计
|
||||
function cross_count($arrData)
|
||||
{
|
||||
$documents = array();
|
||||
foreach ($arrData as $index => $value) {
|
||||
$planTime = date("Y-m-d", $value['end_time']);
|
||||
if (empty($documents[$planTime])) {
|
||||
$documents[$planTime] = 1;
|
||||
} else {
|
||||
$documents[$planTime] += 1;
|
||||
}
|
||||
}
|
||||
return $documents;
|
||||
}
|
1
app/project/config/install.gouguoa
Normal file
1
app/project/config/install.gouguoa
Normal file
@ -0,0 +1 @@
|
||||
勾股OA模块安装鉴定文件,请勿删除!!!!!此次模块标识为:project
|
114
app/project/config/install.sql
Normal file
114
app/project/config/install.sql
Normal file
@ -0,0 +1,114 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project`;
|
||||
CREATE TABLE `oa_project` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '项目名称',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
|
||||
`director_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目负责人',
|
||||
`start_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目开始时间',
|
||||
`end_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目结束时间',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:状态:0未设置,1未开始,2进行中,3已完成,4已关闭',
|
||||
`content` text NULL COMMENT '项目描述',
|
||||
`md_content` text NULL COMMENT 'markdown项目描述',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
|
||||
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '项目表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project_user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project_user`;
|
||||
CREATE TABLE `oa_project_user` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`uid` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '项目成员id',
|
||||
`project_id` int(11) UNSIGNED NOT NULL COMMENT '关联项目id',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '移除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '项目成员表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project_task
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project_task`;
|
||||
CREATE TABLE `oa_project_task` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '主题',
|
||||
`project_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联项目id',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
|
||||
`plan_hours` decimal(10, 1) NOT NULL DEFAULT 0.00 COMMENT '预估工时',
|
||||
`end_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预计结束时间',
|
||||
`over_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '实际结束时间',
|
||||
`director_uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '指派给(负责人)',
|
||||
`assist_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '协助人员,如:1,2,3',
|
||||
`cate` tinyint(1) NOT NULL DEFAULT 1 COMMENT '所属工作类型',
|
||||
`priority` tinyint(1) NOT NULL DEFAULT 1 COMMENT '优先级:1低,2中,3高,4紧急',
|
||||
`flow_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '流转状态:1待办的,2进行中,3已完成,4已拒绝,5已关闭',
|
||||
`done_ratio` int(2) NOT NULL DEFAULT 0 COMMENT '完成进度:0,20,40,50,60,80,100',
|
||||
`content` text NULL COMMENT '任务描述',
|
||||
`md_content` text NULL COMMENT 'markdown任务描述',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
|
||||
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '任务表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project_file
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project_file`;
|
||||
CREATE TABLE `oa_project_file` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块',
|
||||
`topic_id` int(11) UNSIGNED NOT NULL COMMENT '关联主题id',
|
||||
`file_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '相关联附件id',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '项目任务附件关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project_comment
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project_comment`;
|
||||
CREATE TABLE `oa_project_comment` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块',
|
||||
`topic_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联主题id',
|
||||
`pid` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '回复内容id',
|
||||
`padmin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '回复内容用户id',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
|
||||
`content` text NULL COMMENT '评论内容',
|
||||
`md_content` text NULL COMMENT 'markdown评论内容',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
|
||||
`update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||
`delete_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '删除时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1000 CHARACTER SET = utf8mb4 COMMENT = '项目任务评论表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oa_project_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `oa_project_log`;
|
||||
CREATE TABLE `oa_project_log` (
|
||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`module` varchar(100) NOT NULL DEFAULT '' COMMENT '模块',
|
||||
`action` varchar(100) NOT NULL DEFAULT 'edit' COMMENT '动作:add,edit,del,upload',
|
||||
`field` varchar(100) NOT NULL DEFAULT '' COMMENT '字段',
|
||||
`project_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联项目id',
|
||||
`task_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联任务id',
|
||||
`admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作人',
|
||||
`old_content` text NULL COMMENT '修改前的内容',
|
||||
`new_content` text NULL COMMENT '修改后的内容',
|
||||
`remark` text NULL COMMENT '补充备注',
|
||||
`create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '项目任务操作记录表';
|
461
app/project/controller/Api.php
Normal file
461
app/project/controller/Api.php
Normal file
@ -0,0 +1,461 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2022 勾股工作室
|
||||
* @license https://opensource.org/licenses/GPL-3.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
declare (strict_types = 1);
|
||||
namespace app\project\controller;
|
||||
|
||||
use app\api\BaseController;
|
||||
use app\oa\model\Schedule as ScheduleList;
|
||||
use app\project\model\ProjectLog;
|
||||
use app\project\model\ProjectComment;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
|
||||
class Api extends BaseController
|
||||
{
|
||||
//获取项目概况数据
|
||||
public function get_chart_data()
|
||||
{
|
||||
$param = get_params();
|
||||
$tasks = Db::name('ProjectTask')->field('id,plan_hours,end_time,flow_status,over_time')->order('end_time asc')->where([['project_id', '=', $param['project_id']], ['delete_time', '=', 0]])->select()->toArray();
|
||||
|
||||
$task_count = count($tasks);
|
||||
$task_count_ok = Db::name('ProjectTask')->where([['project_id', '=', $param['project_id']], ['delete_time', '=', 0],['flow_status', '>', 2]])->count();
|
||||
$task_delay = 0;
|
||||
if ($task_count > 0) {
|
||||
foreach ($tasks as $k => $v) {
|
||||
if (($v['flow_status'] < 3) && ($v['end_time'] < time() - 86400)) {
|
||||
$task_delay++;
|
||||
}
|
||||
if (($v['flow_status'] == 3) && ($v['end_time'] < $v['over_time'] - 86400)) {
|
||||
$task_delay++;
|
||||
}
|
||||
}
|
||||
}
|
||||
$task_pie = [
|
||||
'count' => $task_count,
|
||||
'count_ok' => $task_count_ok,
|
||||
'delay' => $task_delay,
|
||||
'ok_lv' => $task_count == 0 ? 100 : round($task_count_ok * 100 / $task_count, 2),
|
||||
'delay_lv' => $task_count == 0 ? 100 : round($task_delay * 100 / $task_count, 2),
|
||||
];
|
||||
|
||||
$date_tasks = [];
|
||||
if ($tasks) {
|
||||
$date_tasks = plan_count($tasks);
|
||||
}
|
||||
|
||||
$tasks_ok = Db::name('ProjectTask')->field('id,over_time as end_time')->order('over_time asc')->where([['over_time', '>', 0], ['delete_time', '=', 0], ['project_id', '=', $param['project_id']]])->select()->toArray();
|
||||
$date_tasks_ok = [];
|
||||
if ($tasks_ok) {
|
||||
$date_tasks_ok = plan_count($tasks_ok);
|
||||
}
|
||||
$tids = Db::name('ProjectTask')->where(['delete_time' => 0, 'project_id' => $param['project_id']])->column('id');
|
||||
$schedules = Db::name('Schedule')->where([['tid', 'in', $tids], ['delete_time', '=', 0]])->select()->toArray();
|
||||
$date_schedules = [];
|
||||
if ($schedules) {
|
||||
$date_schedules = hour_count($schedules);
|
||||
}
|
||||
|
||||
$res['task_pie'] = $task_pie;
|
||||
$res['date_tasks'] = $date_tasks;
|
||||
$res['date_tasks_ok'] = $date_tasks_ok;
|
||||
$res['date_schedules'] = $date_schedules;
|
||||
to_assign(0, '', $res);
|
||||
}
|
||||
|
||||
//添加附件
|
||||
public function add_file()
|
||||
{
|
||||
$param = get_params();
|
||||
$param['create_time'] = time();
|
||||
$param['admin_id'] = $this->uid;
|
||||
$fid = Db::name('ProjectFile')->strict(false)->field(true)->insertGetId($param);
|
||||
if ($fid) {
|
||||
$log_data = array(
|
||||
'module' => $param['module'],
|
||||
'field' => 'file',
|
||||
'action' => 'upload',
|
||||
$param['module'] . '_id' => $param['topic_id'],
|
||||
'admin_id' => $this->uid,
|
||||
'old_content' => '',
|
||||
'new_content' => $param['file_name'],
|
||||
'create_time' => time(),
|
||||
);
|
||||
Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data);
|
||||
return to_assign(0, '', $fid);
|
||||
}
|
||||
}
|
||||
|
||||
//删除
|
||||
public function delete_file()
|
||||
{
|
||||
if (request()->isDelete()) {
|
||||
$id = get_params("id");
|
||||
$detail = Db::name('ProjectFile')->where('id', $id)->find();
|
||||
if (Db::name('ProjectFile')->where('id', $id)->delete() !== false) {
|
||||
$file_name = Db::name('File')->where('id', $detail['file_id'])->value('name');
|
||||
$log_data = array(
|
||||
'module' => $detail['module'],
|
||||
'field' => 'file',
|
||||
'action' => 'delete',
|
||||
$detail['module'] . '_id' => $detail['topic_id'],
|
||||
'admin_id' => $this->uid,
|
||||
'new_content' => $file_name,
|
||||
'create_time' => time(),
|
||||
);
|
||||
Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data);
|
||||
return to_assign(0, "删除成功");
|
||||
} else {
|
||||
return to_assign(0, "删除失败");
|
||||
}
|
||||
} else {
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
|
||||
//工作记录列表
|
||||
public function schedule()
|
||||
{
|
||||
$param = get_params();
|
||||
$task_ids = Db::name('ProjectTask')->where(['delete_time' => 0, 'project_id' => $param['tid']])->column('id');
|
||||
$where = array();
|
||||
if (!empty($param['keywords'])) {
|
||||
$where[] = ['a.title', 'like', '%' . $param['keywords'] . '%'];
|
||||
}
|
||||
if (!empty($param['uid'])) {
|
||||
$where[] = ['a.admin_id', '=', $param['uid']];
|
||||
}
|
||||
if (!empty($task_ids)) {
|
||||
$where[] = ['a.tid', 'in', $task_ids];
|
||||
}
|
||||
$where[] = ['a.delete_time', '=', 0];
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$list = ScheduleList::where($where)
|
||||
->field('a.*,u.name,d.title as department,t.title as task,p.name as project,w.title as work_cate')
|
||||
->alias('a')
|
||||
->join('Admin u', 'a.admin_id = u.id', 'LEFT')
|
||||
->join('Department d', 'u.did = d.id', 'LEFT')
|
||||
->join('ProjectTask t', 'a.tid = t.id', 'LEFT')
|
||||
->join('WorkCate w', 'w.id = t.cate', 'LEFT')
|
||||
->join('Project p', 't.project_id = p.id', 'LEFT')
|
||||
->order('a.end_time desc')
|
||||
->paginate($rows, false, ['query' => $param])
|
||||
->each(function ($item, $key) {
|
||||
$item->start_time_a = empty($item->start_time) ? '' : date('Y-m-d', $item->start_time);
|
||||
$item->start_time_b = empty($item->start_time) ? '' : date('H:i', $item->start_time);
|
||||
$item->end_time_a = empty($item->end_time) ? '' : date('Y-m-d', $item->end_time);
|
||||
$item->end_time_b = empty($item->end_time) ? '' : date('H:i', $item->end_time);
|
||||
|
||||
$item->start_time = empty($item->start_time) ? '' : date('Y-m-d H:i', $item->start_time);
|
||||
$item->end_time = empty($item->end_time) ? '' : date('H:i', $item->end_time);
|
||||
});
|
||||
return table_assign(0, '', $list);
|
||||
}
|
||||
|
||||
//查看工作记录详情
|
||||
public function schedule_detail($id)
|
||||
{
|
||||
$id = get_params('id');
|
||||
$schedule = ScheduleList::where(['id' => $id])->find();
|
||||
if (!empty($schedule)) {
|
||||
$schedule['start_time_1'] = date('H:i', $schedule['start_time']);
|
||||
$schedule['end_time_1'] = date('H:i', $schedule['end_time']);
|
||||
$schedule['start_time'] = date('Y-m-d', $schedule['start_time']);
|
||||
$schedule['end_time'] = date('Y-m-d', $schedule['end_time']);
|
||||
// $schedule['create_time'] = date('Y-m-d H:i:s', $schedule['create_time']);
|
||||
$schedule['user'] = Db::name('Admin')->where(['id' => $schedule['admin_id']])->value('name');
|
||||
$schedule['department'] = Db::name('Department')->where(['id' => $schedule['did']])->value('title');
|
||||
}
|
||||
if (request()->isAjax()) {
|
||||
return to_assign(0, "", $schedule);
|
||||
} else {
|
||||
return $schedule;
|
||||
}
|
||||
}
|
||||
|
||||
//任务的工作记录列表
|
||||
public function task_schedule()
|
||||
{
|
||||
$param = get_params();
|
||||
$where = array();
|
||||
$where['a.tid'] = $param['tid'];
|
||||
$where['a.delete_time'] = 0;
|
||||
$list = Db::name('Schedule')
|
||||
->field('a.*,u.name')
|
||||
->alias('a')
|
||||
->join('Admin u', 'u.id = a.admin_id')
|
||||
->order('a.create_time desc')
|
||||
->where($where)
|
||||
->select()->toArray();
|
||||
foreach ($list as $k => $v) {
|
||||
$list[$k]['start_time'] = empty($v['start_time']) ? '' : date('Y-m-d H:i', $v['start_time']);
|
||||
$list[$k]['end_time'] = empty($v['end_time']) ? '' : date('H:i', $v['end_time']);
|
||||
}
|
||||
return to_assign(0, '', $list);
|
||||
}
|
||||
|
||||
|
||||
public function project_user()
|
||||
{
|
||||
$param = get_params();
|
||||
$project = Db::name('Project')->where(['id' => $param['tid']])->find();
|
||||
$users = Db::name('ProjectUser')
|
||||
->field('pu.*,a.name,a.mobile,p.title as position,d.title as department')
|
||||
->alias('pu')
|
||||
->join('Admin a', 'pu.uid = a.id', 'LEFT')
|
||||
->join('Department d', 'a.did = d.id', 'LEFT')
|
||||
->join('Position p', 'a.position_id = p.id', 'LEFT')
|
||||
->order('pu.id asc')
|
||||
->where(['pu.project_id' => $param['tid']])
|
||||
->select()->toArray();
|
||||
if(!empty($users)){
|
||||
foreach ($users as $k => &$v) {
|
||||
$v['role'] = 0; //普通项目成员
|
||||
if ($v['uid'] == $project['admin_id']) {
|
||||
$v['role'] = 1; //项目创建人
|
||||
}
|
||||
if ($v['uid'] == $project['director_uid']) {
|
||||
$v['role'] = 2; //项目负责人
|
||||
}
|
||||
|
||||
$v['create_time'] = date('Y-m-d', (int) $v['create_time']);
|
||||
if($v['delete_time'] > 0){
|
||||
$v['delete_time'] = date('Y-m-d', (int) $v['delete_time']);
|
||||
}
|
||||
else{
|
||||
$v['delete_time'] = '-';
|
||||
}
|
||||
|
||||
$tids = Db::name('ProjectTask')->where([['project_id','=',$param['tid']],['delete_time','=',0]])->column('id');
|
||||
$schedule_map = [];
|
||||
$schedule_map[] = ['tid','in',$tids];
|
||||
$schedule_map[] = ['delete_time','=',0];
|
||||
$schedule_map[] = ['admin_id','=',$v['uid']];
|
||||
$v['schedules'] = Db::name('Schedule')->where($schedule_map)->count();
|
||||
$v['labor_times'] = Db::name('Schedule')->where($schedule_map)->sum('labor_time');
|
||||
|
||||
$task_map = [];
|
||||
$task_map[] = ['project_id','=',$param['tid']];
|
||||
$task_map[] = ['delete_time', '=', 0];
|
||||
|
||||
$task_map1 = [
|
||||
['admin_id', '=', $v['uid']],
|
||||
];
|
||||
$task_map2 = [
|
||||
['director_uid', '=', $v['uid']],
|
||||
];
|
||||
$task_map3 = [
|
||||
['', 'exp', Db::raw("FIND_IN_SET('{$v['uid']}',assist_admin_ids)")],
|
||||
];
|
||||
|
||||
//任务总数
|
||||
$v['tasks_total'] = Db::name('ProjectTask')
|
||||
->where(function ($query) use ($task_map1, $task_map2, $task_map3) {
|
||||
$query->where($task_map1)->whereor($task_map2)->whereor($task_map3);
|
||||
})
|
||||
->where($task_map)->count();
|
||||
//已完成任务
|
||||
$task_map[] = ['flow_status', '>', 2]; //已完成
|
||||
$v['tasks_finish'] = Db::name('ProjectTask')->where(function ($query) use ($task_map1, $task_map2, $task_map3) {
|
||||
$query->where($task_map1)->whereor($task_map2)->whereor($task_map3);
|
||||
})
|
||||
->where($task_map)->count();
|
||||
//未完成任务
|
||||
$v['tasks_unfinish'] = $v['tasks_total'] - $v['tasks_finish'];
|
||||
$v['tasks_pensent'] = "100%";
|
||||
if ($v['tasks_total'] > 0) {
|
||||
$v['tasks_pensent'] = round($v['tasks_finish'] / $v['tasks_total'] * 100, 2) . "%";
|
||||
}
|
||||
}
|
||||
}
|
||||
to_assign(0, '', $users);
|
||||
}
|
||||
|
||||
//新增项目成员
|
||||
public function add_user()
|
||||
{
|
||||
$param = get_params();
|
||||
if (request()->isPost()) {
|
||||
$has = Db::name('ProjectUser')->where(['uid' => $param['uid'],'project_id'=>$param['project_id']])->find();
|
||||
if(!empty($has)){
|
||||
to_assign(1, '该员工已经是项目成员');
|
||||
}
|
||||
$project = Db::name('Project')->where(['id' => $param['project_id']])->find();
|
||||
if($this->uid == $project['admin_id'] || $this->uid == $project['director_uid']){
|
||||
$param['admin_id'] = $this->uid;
|
||||
$param['create_time'] = time();
|
||||
$res = Db::name('ProjectUser')->strict(false)->field(true)->insert($param);
|
||||
if ($res) {
|
||||
$log_data = array(
|
||||
'module' => 'project',
|
||||
'field' => 'user',
|
||||
'action' => 'add',
|
||||
'project_id' => $param['project_id'],
|
||||
'admin_id' => $this->uid,
|
||||
'new_content' => $param['uid'],
|
||||
'create_time' => time(),
|
||||
);
|
||||
Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data);
|
||||
to_assign();
|
||||
}
|
||||
}else{
|
||||
to_assign(1, '只有项目创建者和负责人才有权限新增项目成员');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//移除项目成员
|
||||
public function remove_user()
|
||||
{
|
||||
$param = get_params();
|
||||
if (request()->isDelete()) {
|
||||
$detail = Db::name('ProjectUser')->where(['id' => $param['id']])->find();
|
||||
$project = Db::name('Project')->where(['id' => $detail['project_id']])->find();
|
||||
if($this->uid == $project['admin_id'] || $this->uid == $project['director_uid']){
|
||||
if($detail['uid'] == $project['admin_id']){
|
||||
to_assign(1, '该项目成员是项目的创建者,不能移除');
|
||||
}
|
||||
if($detail['uid'] == $project['director_uid']){
|
||||
to_assign(1, '该项目成员是项目的负责人,需要去除负责人权限才能移除');
|
||||
}
|
||||
$param['delete_time'] = time();
|
||||
if (Db::name('ProjectUser')->update($param) !== false) {
|
||||
$log_data = array(
|
||||
'module' => 'project',
|
||||
'field' => 'user',
|
||||
'action' => 'remove',
|
||||
'project_id' => $detail['project_id'],
|
||||
'admin_id' => $this->uid,
|
||||
'new_content' => $detail['uid'],
|
||||
'create_time' => time(),
|
||||
);
|
||||
Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data);
|
||||
return to_assign(0, "移除成功");
|
||||
} else {
|
||||
return to_assign(1, "移除失败");
|
||||
}
|
||||
}else{
|
||||
to_assign(1, '只有项目创建者和负责人才有权限移除项目成员');
|
||||
}
|
||||
}else{
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
//恢复项目成员
|
||||
public function recover_user()
|
||||
{
|
||||
$param = get_params();
|
||||
if (request()->isPost()) {
|
||||
$detail = Db::name('ProjectUser')->where(['id' => $param['id']])->find();
|
||||
$project = Db::name('Project')->where(['id' => $detail['project_id']])->find();
|
||||
if($this->uid == $project['admin_id'] || $this->uid == $project['director_uid']){
|
||||
$param['delete_time'] = 0;
|
||||
if (Db::name('ProjectUser')->update($param) !== false) {
|
||||
$log_data = array(
|
||||
'module' => 'project',
|
||||
'field' => 'user',
|
||||
'action' => 'recover',
|
||||
'project_id' => $detail['project_id'],
|
||||
'admin_id' => $this->uid,
|
||||
'new_content' => $detail['uid'],
|
||||
'create_time' => time(),
|
||||
);
|
||||
Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data);
|
||||
return to_assign(0, "恢复成功");
|
||||
} else {
|
||||
return to_assign(1, "恢复失败");
|
||||
}
|
||||
}else{
|
||||
to_assign(1, '只有项目创建者和负责人才有权限恢复项目成员');
|
||||
}
|
||||
}else{
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//项目日志列表
|
||||
public function project_log()
|
||||
{
|
||||
$param = get_params();
|
||||
$list = new ProjectLog();
|
||||
$content = $list->project_log($param);
|
||||
return to_assign(0, '', $content);
|
||||
}
|
||||
|
||||
//任务日志列表
|
||||
public function task_log()
|
||||
{
|
||||
$param = get_params();
|
||||
$list = new ProjectLog();
|
||||
$content = $list->get_list($param);
|
||||
return to_assign(0, '', $content);
|
||||
}
|
||||
|
||||
|
||||
//获取评论列表
|
||||
public function project_comment()
|
||||
{
|
||||
$param = get_params();
|
||||
$list = new ProjectComment();
|
||||
$content = $list->get_list($param);
|
||||
return to_assign(0, '', $content);
|
||||
}
|
||||
|
||||
//添加修改评论内容
|
||||
public function add_comment()
|
||||
{
|
||||
$param = get_params();
|
||||
if (!empty($param['id']) && $param['id'] > 0) {
|
||||
$param['update_time'] = time();
|
||||
unset($param['pid']);
|
||||
unset($param['padmin_id']);
|
||||
$res = ProjectComment::where(['admin_id' => $this->uid,'id'=>$param['id']])->strict(false)->field(true)->update($param);
|
||||
if ($res) {
|
||||
add_log('edit', $param['id'], $param);
|
||||
return to_assign();
|
||||
}
|
||||
} else {
|
||||
$param['create_time'] = time();
|
||||
$param['admin_id'] = $this->uid;
|
||||
$cid = ProjectComment::strict(false)->field(true)->insertGetId($param);
|
||||
if ($cid) {
|
||||
add_log('add', $cid, $param);
|
||||
return to_assign();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//删除评论内容
|
||||
public function delete_comment()
|
||||
{
|
||||
if (request()->isDelete()) {
|
||||
$id = get_params("id");
|
||||
$res = ProjectComment::where('id',$id)->strict(false)->field(true)->update(['delete_time'=>time()]);
|
||||
if ($res) {
|
||||
add_log('delete', $id);
|
||||
return to_assign(0, "删除成功");
|
||||
} else {
|
||||
return to_assign(1, "删除失败");
|
||||
}
|
||||
}else{
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
|
||||
//获取项目列表
|
||||
public function get_project($pid = 0)
|
||||
{
|
||||
$where = [];
|
||||
$where[] = ['delete_time', '=', 0];
|
||||
if ($pid > 0) {
|
||||
$where[] = ['product_id', '=', $pid];
|
||||
}
|
||||
$project = Db::name('Project')->field('id,name as title')->where($where)->select();
|
||||
return to_assign(0, '', $project);
|
||||
}
|
||||
}
|
270
app/project/controller/Index.php
Normal file
270
app/project/controller/Index.php
Normal file
@ -0,0 +1,270 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2022 勾股工作室
|
||||
* @license https://opensource.org/licenses/GPL-3.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\project\controller;
|
||||
|
||||
use app\base\BaseController;
|
||||
use app\project\model\Project as ProjectList;
|
||||
use app\project\validate\ProjectCheck;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
$project_ids = Db::name('ProjectUser')->where(['uid' => $this->uid, 'delete_time' => 0])->column('project_id');
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$list = ProjectList::withoutField('content,md_content')
|
||||
->where([['delete_time', '=', 0], ['id', 'in', $project_ids]])
|
||||
->order('id desc')
|
||||
->paginate($rows, false, ['query' => $param])
|
||||
->each(function ($item, $key) {
|
||||
$item->director_name = Db::name('Admin')->where(['id' => $item->director_uid])->value('name');
|
||||
$item->plan_time = date('Y-m-d', $item->start_time) . ' 至 ' . date('Y-m-d', $item->end_time);
|
||||
$item->status_name = ProjectList::$Status[(int) $item->status];
|
||||
|
||||
$task_map = [];
|
||||
$task_map[] = ['project_id', '=', $item->id];
|
||||
$task_map[] = ['delete_time', '=', 0];
|
||||
//任务总数
|
||||
$item->tasks_total = Db::name('ProjectTask')->where($task_map)->count();
|
||||
//已完成任务
|
||||
$task_map[] = ['flow_status', '>', 2]; //已完成
|
||||
$item->tasks_finish = Db::name('ProjectTask')->where($task_map)->count();
|
||||
//未完成任务
|
||||
$item->tasks_unfinish = $item->tasks_total - $item->tasks_finish;
|
||||
if ($item->tasks_total > 0) {
|
||||
$item->tasks_pensent = round($item->tasks_finish / $item->tasks_total * 100, 2) . "%";
|
||||
} else {
|
||||
$item->tasks_pensent = "100%";
|
||||
}
|
||||
});
|
||||
return table_assign(0, '', $list);
|
||||
} else {
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add()
|
||||
{
|
||||
$param = get_params();
|
||||
if (request()->isPost()) {
|
||||
if (isset($param['start_time'])) {
|
||||
$param['start_time'] = strtotime(urldecode($param['start_time']));
|
||||
}
|
||||
if (isset($param['end_time'])) {
|
||||
$param['end_time'] = strtotime(urldecode($param['end_time']));
|
||||
}
|
||||
if (!empty($param['id']) && $param['id'] > 0) {
|
||||
$project = (new ProjectList())->detail($param['id']);
|
||||
if ($this->uid == $project['admin_id'] || $this->uid == $project['director_uid']) {
|
||||
if (isset($param['start_time'])) {
|
||||
if ($param['start_time'] >= $project['end_time']) {
|
||||
return to_assign(1, '开始时间不能大于计划结束时间');
|
||||
}
|
||||
}
|
||||
if (isset($param['end_time'])) {
|
||||
if ($param['end_time'] <= $project['start_time']) {
|
||||
return to_assign(1, '计划结束时间不能小于开始时间');
|
||||
}
|
||||
}
|
||||
if (isset($param['flow_status'])) {
|
||||
if ($param['flow_status'] > 2) {
|
||||
$param['over_time'] = time();
|
||||
} else {
|
||||
$param['over_time'] = 0;
|
||||
}
|
||||
}
|
||||
try {
|
||||
validate(ProjectCheck::class)->scene('edit')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
//add_project_log('edit', $param['id'], $param, $project);
|
||||
$param['update_time'] = time();
|
||||
$res = ProjectList::where('id', $param['id'])->strict(false)->field(true)->update($param);
|
||||
if ($res) {
|
||||
add_log('edit', $param['id'], $param);
|
||||
add_project_log($this->uid,'project',$param, $project);
|
||||
}
|
||||
return to_assign();
|
||||
} else {
|
||||
return to_assign(1, '只有创建人或者负责人才有权限编辑');
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
validate(ProjectCheck::class)->scene('add')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
$param['create_time'] = time();
|
||||
$param['admin_id'] = $this->uid;
|
||||
$sid = ProjectList::strict(false)->field(true)->insertGetId($param);
|
||||
if ($sid) {
|
||||
$project_users = $this->uid;
|
||||
if (!empty($param['director_uid'])){
|
||||
$project_users.=",".$param['director_uid'];
|
||||
}
|
||||
if (!empty($param['team_admin_ids'])){
|
||||
$project_users.=",".$param['team_admin_ids'];
|
||||
}
|
||||
$project_array = explode(",",(string)$project_users);
|
||||
$project_array = array_unique($project_array);
|
||||
$project_user_array=[];
|
||||
foreach ($project_array as $k => $v) {
|
||||
if (is_numeric($v)) {
|
||||
$project_user_array[]=array(
|
||||
'uid'=>$v,
|
||||
'admin_id'=>$this->uid,
|
||||
'project_id'=>$sid,
|
||||
'create_time'=>time(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Db::name('ProjectUser')->strict(false)->field(true)->insertAll($project_user_array);
|
||||
add_log('add', $sid, $param);
|
||||
$log_data = array(
|
||||
'module' => 'project',
|
||||
'project_id' => $sid,
|
||||
'new_content' => $param['name'],
|
||||
'field' => 'new',
|
||||
'action' => 'add',
|
||||
'admin_id' => $this->uid,
|
||||
'old_content' => '',
|
||||
'create_time' => time(),
|
||||
);
|
||||
Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data);
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
} else {
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
if ($id > 0) {
|
||||
$detail = (new ProjectList())->detail($id);
|
||||
if (empty($detail)) {
|
||||
return to_assign(1, '项目不存在');
|
||||
}
|
||||
View::assign('detail', $detail);
|
||||
}
|
||||
View::assign('id', $id);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//编辑
|
||||
public function edit()
|
||||
{
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = (new ProjectList())->detail($id);
|
||||
if (empty($detail)) {
|
||||
return to_assign(1, '项目不存在');
|
||||
} else {
|
||||
$file_array = Db::name('FileInterfix')
|
||||
->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,a.name as admin_name')
|
||||
->alias('mf')
|
||||
->join('File f', 'mf.file_id = f.id', 'LEFT')
|
||||
->join('Admin a', 'mf.admin_id = a.id', 'LEFT')
|
||||
->order('mf.create_time desc')
|
||||
->where(array('mf.topic_id' => $id, 'mf.module' => 'project'))
|
||||
->select()->toArray();
|
||||
View::assign('file_array', $file_array);
|
||||
View::assign('detail', $detail);
|
||||
View::assign('id', $id);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//查看
|
||||
public function view()
|
||||
{
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = (new ProjectList())->detail($id);
|
||||
if (empty($detail)) {
|
||||
return to_assign(1, '项目不存在');
|
||||
} else {
|
||||
$tids = Db::name('ProjectTask')->where([['project_id', '=', $detail['id']], ['delete_time', '=', 0]])->column('id');
|
||||
$detail['schedules'] = Db::name('Schedule')->where([['tid', 'in', $tids], ['delete_time', '=', 0]])->count();
|
||||
$detail['hours'] = Db::name('Schedule')->where([['tid', 'in', $tids], ['delete_time', '=', 0]])->sum('labor_time');
|
||||
$detail['plan_hours'] = Db::name('ProjectTask')->where([['project_id', '=', $detail['id']], ['delete_time', '=', 0]])->sum('plan_hours');
|
||||
$detail['tasks'] = Db::name('ProjectTask')->where([['project_id', '=', $detail['id']], ['delete_time', '=', 0]])->count();
|
||||
$detail['tasks_finish'] = Db::name('ProjectTask')->where([['project_id', '=', $detail['id']], ['flow_status', '>', 2], ['delete_time', '=', 0]])->count();
|
||||
$detail['tasks_unfinish'] = $detail['tasks'] - $detail['tasks_finish'];
|
||||
|
||||
$task_map = [];
|
||||
$task_map[] = ['project_id', '=', $detail['id']];
|
||||
$task_map[] = ['delete_time', '=', 0];
|
||||
//判断是否是创建者或者负责人
|
||||
$role = 0;
|
||||
if ($detail['director_uid'] == $this->uid) {
|
||||
$role = 1; //负责人
|
||||
}
|
||||
if ($detail['admin_id'] == $this->uid) {
|
||||
$role = 2; //创建人
|
||||
}
|
||||
|
||||
$file_array = Db::name('ProjectFile')
|
||||
->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,a.name as admin_name')
|
||||
->alias('mf')
|
||||
->join('File f', 'mf.file_id = f.id', 'LEFT')
|
||||
->join('Admin a', 'mf.admin_id = a.id', 'LEFT')
|
||||
->order('mf.create_time desc')
|
||||
->where(array('mf.topic_id' => $id, 'mf.module' => 'project'))
|
||||
->select()->toArray();
|
||||
|
||||
View::assign('file_array', $file_array);
|
||||
View::assign('detail', $detail);
|
||||
View::assign('role', $role);
|
||||
View::assign('id', $id);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//删除
|
||||
public function delete()
|
||||
{
|
||||
if (request()->isDelete()) {
|
||||
$id = get_params("id");
|
||||
$count_task = Db::name('ProjectTask')->where([['project_id', '=', $id], ['delete_time', '=', 0]])->count();
|
||||
if ($count_task > 0) {
|
||||
return to_assign(1, "该项目下有关联的任务,无法删除");
|
||||
}
|
||||
$detail = Db::name('Project')->where('id', $id)->find();
|
||||
if ($detail['admin_id'] != $this->uid) {
|
||||
return to_assign(1, "你不是该项目的创建人,无权限删除");
|
||||
}
|
||||
if (Db::name('Project')->where('id', $id)->update(['delete_time' => time()]) !== false) {
|
||||
$log_data = array(
|
||||
'module' => 'project',
|
||||
'field' => 'delete',
|
||||
'action' => 'delete',
|
||||
'project_id' => $detail['id'],
|
||||
'admin_id' => $this->uid,
|
||||
'old_content' => '',
|
||||
'new_content' => $detail['name'],
|
||||
'create_time' => time(),
|
||||
);
|
||||
Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data);
|
||||
return to_assign(0, "删除成功");
|
||||
} else {
|
||||
return to_assign(0, "删除失败");
|
||||
}
|
||||
} else {
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
}
|
167
app/project/controller/Task.php
Normal file
167
app/project/controller/Task.php
Normal file
@ -0,0 +1,167 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2022 勾股工作室
|
||||
* @license https://opensource.org/licenses/GPL-3.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\project\controller;
|
||||
|
||||
use app\base\BaseController;
|
||||
use app\project\model\ProjectTask as TaskList;
|
||||
use app\project\validate\TaskCheck;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
|
||||
class Task extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
$param['uid'] = $this->uid;
|
||||
$list = (new TaskList())->list($param);
|
||||
return table_assign(0, '', $list);
|
||||
} else {
|
||||
View::assign('cate', work_cate());
|
||||
View::assign('project', get_project($this->uid));
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//添加
|
||||
public function add()
|
||||
{
|
||||
$param = get_params();
|
||||
if (request()->isPost()) {
|
||||
if (isset($param['end_time'])) {
|
||||
$param['end_time'] = strtotime(urldecode($param['end_time']));
|
||||
}if (isset($param['flow_status'])) {
|
||||
if ($param['flow_status'] == 3) {
|
||||
$param['over_time'] = time();
|
||||
} else {
|
||||
$param['over_time'] = 0;
|
||||
}
|
||||
}
|
||||
if (!empty($param['id']) && $param['id'] > 0) {
|
||||
$task = (new TaskList())->detail($param['id']);
|
||||
try {
|
||||
validate(TaskCheck::class)->scene('edit')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
$param['update_time'] = time();
|
||||
$res = TaskList::where('id', $param['id'])->strict(false)->field(true)->update($param);
|
||||
if ($res) {
|
||||
add_log('edit', $param['id'], $param);
|
||||
add_project_log($this->uid,'task',$param, $task);
|
||||
}
|
||||
return to_assign();
|
||||
} else {
|
||||
try {
|
||||
validate(TaskCheck::class)->scene('add')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
$param['create_time'] = time();
|
||||
$param['admin_id'] = $this->uid;
|
||||
$sid = TaskList::strict(false)->field(true)->insertGetId($param);
|
||||
if ($sid) {
|
||||
add_log('add', $sid, $param);
|
||||
$log_data = array(
|
||||
'module' => 'task',
|
||||
'task_id' => $sid,
|
||||
'new_content' => $param['title'],
|
||||
'field' => 'new',
|
||||
'action' => 'add',
|
||||
'admin_id' => $this->uid,
|
||||
'create_time' => time(),
|
||||
);
|
||||
Db::name('ProjectLog')->strict(false)->field(true)->insert($log_data);
|
||||
//发消息
|
||||
//$users = $param['director_uid'];
|
||||
//sendMessage($users, 21, ['title' => $param['title'],'from_uid' => $this->uid, 'create_time'=>date('Y-m-d H:i:s',time()), 'action_id' => $sid]);
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
} else {
|
||||
if (isset($param['project_id'])) {
|
||||
View::assign('project_id', $param['project_id']);
|
||||
}
|
||||
View::assign('cate', work_cate());
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
//查看
|
||||
public function view()
|
||||
{
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = (new TaskList())->detail($id);
|
||||
if (empty($detail)) {
|
||||
return to_assign(1, '任务不存在');
|
||||
} else {
|
||||
$role_uid = [$detail['admin_id'], $detail['director_uid']];
|
||||
$role_edit = 'view';
|
||||
if (in_array($this->uid, $role_uid)) {
|
||||
$role_edit = 'edit';
|
||||
}
|
||||
$project_ids = Db::name('ProjectUser')->where(['uid' => $this->uid, 'delete_time' => 0])->column('project_id');
|
||||
if (in_array($detail['project_id'], $project_ids) || in_array($this->uid, $role_uid) || in_array($this->uid, explode(",",$detail['assist_admin_ids']))) {
|
||||
$file_array = Db::name('ProjectFile')
|
||||
->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,a.name as admin_name')
|
||||
->alias('mf')
|
||||
->join('File f', 'mf.file_id = f.id', 'LEFT')
|
||||
->join('Admin a', 'mf.admin_id = a.id', 'LEFT')
|
||||
->order('mf.create_time desc')
|
||||
->where(array('mf.topic_id' => $id, 'mf.module' => 'task'))
|
||||
->select()->toArray();
|
||||
|
||||
View::assign('detail', $detail);
|
||||
View::assign('file_array', $file_array);
|
||||
View::assign('role_edit', $role_edit);
|
||||
View::assign('id', $id);
|
||||
return view();
|
||||
}
|
||||
else{
|
||||
return to_assign(1, '您没权限查看该任务');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//删除
|
||||
public function delete()
|
||||
{
|
||||
if (request()->isDelete()) {
|
||||
$id = get_params("id");
|
||||
$detail = Db::name('Task')->where('id', $id)->find();
|
||||
if ($detail['admin_id'] != $this->uid) {
|
||||
return to_assign(1, "你不是该任务的创建人,无权限删除");
|
||||
}
|
||||
if (Db::name('Task')->where('id', $id)->update(['delete_time' => time()]) !== false) {
|
||||
$log_data = array(
|
||||
'module' => 'task',
|
||||
'field' => 'delete',
|
||||
'action' => 'delete',
|
||||
'task_id' => $detail['id'],
|
||||
'admin_id' => $this->uid,
|
||||
'old_content' => '',
|
||||
'new_content' => $detail['title'],
|
||||
'create_time' => time(),
|
||||
);
|
||||
Db::name('Log')->strict(false)->field(true)->insert($log_data);
|
||||
return to_assign(0, "删除成功");
|
||||
} else {
|
||||
return to_assign(0, "删除失败");
|
||||
}
|
||||
} else {
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
}
|
5
app/project/event.php
Normal file
5
app/project/event.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
// 这是系统自动生成的event定义文件
|
||||
return [
|
||||
|
||||
];
|
14
app/project/middleware.php
Normal file
14
app/project/middleware.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2022 勾股工作室
|
||||
* @license https://opensource.org/licenses/GPL-3.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
// 这是系统自动生成的middleware定义文件
|
||||
return [
|
||||
//开启session中间件
|
||||
//'think\middleware\SessionInit',
|
||||
//验证勾股OA是否完成安装
|
||||
\app\home\middleware\Install::class,
|
||||
];
|
42
app/project/model/Project.php
Normal file
42
app/project/model/Project.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
namespace app\project\model;
|
||||
|
||||
use think\facade\Db;
|
||||
use think\Model;
|
||||
|
||||
class Project extends Model
|
||||
{
|
||||
const ZERO = 0;
|
||||
const ONE = 1;
|
||||
const TWO = 2;
|
||||
const THREE = 3;
|
||||
const FORE = 4;
|
||||
|
||||
public static $Status = [
|
||||
self::ZERO => '未设置',
|
||||
self::ONE => '未开始',
|
||||
self::TWO => '进行中',
|
||||
self::THREE => '已完成',
|
||||
self::FORE => '已关闭',
|
||||
];
|
||||
//详情
|
||||
public function detail($id)
|
||||
{
|
||||
$detail = Db::name('Project')->where(['id' => $id])->find();
|
||||
if (!empty($detail)) {
|
||||
$detail['admin_name'] = Db::name('Admin')->where(['id' => $detail['admin_id']])->value('name');
|
||||
$detail['director_name'] = Db::name('Admin')->where(['id' => $detail['director_uid']])->value('name');
|
||||
$team_admin_ids = Db::name('ProjectUser')->where(['delete_time' => 0,'project_id'=>$id])->column('uid');
|
||||
$team_admin_names = Db::name('Admin')->where('id', 'in', $team_admin_ids)->column('name');
|
||||
$detail['team_admin_names'] = implode(',', $team_admin_names);
|
||||
$detail['status_name'] = self::$Status[(int) $detail['status']];
|
||||
$detail['times'] = time_trans($detail['create_time']);
|
||||
$detail['start_time'] = date('Y-m-d', $detail['start_time']);
|
||||
$detail['end_time'] = date('Y-m-d', $detail['end_time']);
|
||||
$detail['users'] = Db::name('ProjectUser')->where(['delete_time' => 0,'project_id'=>$id])->count();
|
||||
$detail['comments'] = Db::name('ProjectComment')->where([['module','=','project'],['topic_id','=',$detail['id']],['delete_time','=',0]])->count();
|
||||
$detail['logs'] = Db::name('ProjectLog')->where(['module' => 'project', 'project_id' => $detail['id']])->count();
|
||||
}
|
||||
return $detail;
|
||||
}
|
||||
}
|
41
app/project/model/ProjectComment.php
Normal file
41
app/project/model/ProjectComment.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2022 勾股工作室
|
||||
* @license https://opensource.org/licenses/GPL-3.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
namespace app\Project\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProjectComment extends Model
|
||||
{
|
||||
public function get_list($param = [])
|
||||
{
|
||||
$where = array();
|
||||
$where['a.module'] = $param['m'];
|
||||
$where['a.topic_id'] = $param['tid'];
|
||||
$where['a.delete_time'] = 0;
|
||||
$content = \think\facade\Db::name('ProjectComment')
|
||||
->field('a.*,u.name,u.thumb,pu.name as pname')
|
||||
->alias('a')
|
||||
->join('Admin u', 'u.id = a.admin_id')
|
||||
->leftjoin('Admin pu', 'pu.id = a.padmin_id')
|
||||
->order('a.create_time desc')
|
||||
->where($where)
|
||||
->select()->toArray();
|
||||
foreach ($content as $k => &$v) {
|
||||
$v['times'] = time_trans($v['create_time']);
|
||||
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
if($v['update_time']>0){
|
||||
$v['update_time'] = ',最后编辑时间:'.time_trans($v['update_time']);
|
||||
}
|
||||
else{
|
||||
$v['update_time'] = '';
|
||||
}
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
216
app/project/model/ProjectLog.php
Normal file
216
app/project/model/ProjectLog.php
Normal file
@ -0,0 +1,216 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2022 勾股工作室
|
||||
* @license https://opensource.org/licenses/GPL-3.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
namespace app\project\model;
|
||||
|
||||
use think\facade\Db;
|
||||
use think\Model;
|
||||
|
||||
class ProjectLog extends Model
|
||||
{
|
||||
public static $Sourse = [
|
||||
'project' => [
|
||||
'status' => ['未开始', '进行中', '已完成', '已关闭'],
|
||||
'field_array' => [
|
||||
'director_uid' => array('icon' => 'icon-xueshengzhuce', 'title' => '负责人'),
|
||||
'start_time' => array('icon' => 'icon-kaoshijihua', 'title' => '预计开始时间'),
|
||||
'end_time' => array('icon' => 'icon-kaoshijihua', 'title' => '预计结束时间'),
|
||||
'name' => array('icon' => 'icon-wodedianping', 'title' => '标题'),
|
||||
'status' => array('icon' => 'icon-wodedianping', 'title' => '状态'),
|
||||
'content' => array('icon' => 'icon-wodedianping', 'title' => '项目描述'),
|
||||
'file' => array('icon' => 'icon-sucaiziyuan', 'title' => '项目文件'),
|
||||
'user' => array('icon' => 'icon-xueshengzhuce', 'title' => '项目成员'),
|
||||
'new' => array('icon' => 'icon-zidingyishezhi', 'title' => '项目'),
|
||||
'delete' => array('icon' => 'icon-shanchu', 'title' => '项目'),
|
||||
]],
|
||||
'task' => [
|
||||
'priority' => ['', '低', '中', '高', '紧急'],
|
||||
'flow_status' => ['', '未开始', '进行中', '已完成', '已拒绝', '已关闭'],
|
||||
'field_array' => [
|
||||
'director_uid' => array('icon' => 'icon-xueshengzhuce', 'title' => '负责人'),
|
||||
'assist_admin_ids' => array('icon' => 'icon-xueshengbaoming', 'title' => '协作人'),
|
||||
'end_time' => array('icon' => 'icon-kaoshijihua', 'title' => '预计结束时间'),
|
||||
'title' => array('icon' => 'icon-wodedianping', 'title' => '标题'),
|
||||
'flow_status' => array('icon' => 'icon-wodedianping', 'title' => '任务状态'),
|
||||
'plan_hours' => array('icon' => 'icon-wodedianping', 'title' => '工时'),
|
||||
'priority' => array('icon' => 'icon-wodedianping', 'title' => '等级'),
|
||||
'type' => array('icon' => 'icon-wodedianping', 'title' => '任务类型'),
|
||||
'cate' => array('icon' => 'icon-wodedianping', 'title' => '任务类别'),
|
||||
'is_bug' => array('icon' => 'icon-wodedianping', 'title' => '任务性质'),
|
||||
'done_ratio' => array('icon' => 'icon-wodedianping', 'title' => '完成进度'),
|
||||
'project_id' => array('icon' => 'icon-wodedianping', 'title' => '关联项目'),
|
||||
'content' => array('icon' => 'icon-wodedianping', 'title' => '描述'),
|
||||
'file' => array('icon' => 'icon-sucaiziyuan', 'title' => '文件'),
|
||||
'new' => array('icon' => 'icon-zidingyishezhi', 'title' => '任务'),
|
||||
'delete' => array('icon' => 'icon-shanchu', 'title' => '任务'),
|
||||
]]
|
||||
];
|
||||
|
||||
public function get_list($param = [])
|
||||
{
|
||||
$where = array();
|
||||
$where['a.module'] = $param['m'];
|
||||
$where['a.' . $param['m'] . '_id'] = $param['tid'];
|
||||
$content = Db::name('ProjectLog')
|
||||
->field('a.*,u.name')
|
||||
->alias('a')
|
||||
->join('Admin u', 'u.id = a.admin_id')
|
||||
->order('a.create_time desc')
|
||||
->where($where)
|
||||
->select()->toArray();
|
||||
$sourse = self::$Sourse[$param['m']];
|
||||
$action = get_config('log.type_action');
|
||||
$field_array = $sourse['field_array'];
|
||||
$data = [];
|
||||
foreach ($content as $k => $v) {
|
||||
if (isset($sourse[$v['field']])) {
|
||||
$v['old_content'] = $sourse[$v['field']][$v['old_content']];
|
||||
$v['new_content'] = $sourse[$v['field']][$v['new_content']];
|
||||
}
|
||||
if (strpos($v['field'], '_time') !== false) {
|
||||
if ($v['old_content'] == '') {
|
||||
$v['old_content'] = '未设置';
|
||||
}
|
||||
$v['new_content'] = date('Y-m-d', (int) $v['new_content']);
|
||||
}
|
||||
if (strpos($v['field'], '_uid') !== false) {
|
||||
$v['old_content'] = Db::name('Admin')->where(['id' => $v['old_content']])->value('name');
|
||||
$v['new_content'] = Db::name('Admin')->where(['id' => $v['new_content']])->value('name');
|
||||
}
|
||||
if ($v['field'] == 'user') {
|
||||
$v['new_content'] = Db::name('Admin')->where(['id' => $v['new_content']])->value('name');
|
||||
}
|
||||
if ($v['field'] == 'project_id') {
|
||||
$v['old_content'] = Db::name('Project')->where(['id' => $v['old_content']])->value('name');
|
||||
$v['new_content'] = Db::name('Project')->where(['id' => $v['new_content']])->value('name');
|
||||
}
|
||||
if ($v['field'] == 'cate') {
|
||||
$v['old_content'] = Db::name('WorkCate')->where(['id' => $v['old_content']])->value('title');
|
||||
$v['new_content'] = Db::name('WorkCate')->where(['id' => $v['new_content']])->value('title');
|
||||
}
|
||||
if ($v['field'] == 'done_ratio') {
|
||||
$v['old_content'] = $v['old_content'] . '%';
|
||||
$v['new_content'] = $v['new_content'] . '%';
|
||||
}
|
||||
if (strpos($v['field'], '_ids') !== false) {
|
||||
$old_ids = Db::name('Admin')->where('id', 'in', $v['old_content'])->column('name');
|
||||
$v['old_content'] = implode(',', $old_ids);
|
||||
$new_ids = Db::name('Admin')->where('id', 'in', $v['new_content'])->column('name');
|
||||
$v['new_content'] = implode(',', $new_ids);
|
||||
}
|
||||
if ($v['old_content'] == '' || $v['old_content'] == null) {
|
||||
$v['old_content'] = '未设置';
|
||||
}
|
||||
if ($v['new_content'] == '' || $v['new_content'] == null) {
|
||||
$v['new_content'] = '未设置';
|
||||
}
|
||||
$v['action'] = $action[$v['action']];
|
||||
$v['icon'] = $field_array[$v['field']]['icon'];
|
||||
$v['title'] = $field_array[$v['field']]['title'];
|
||||
$v['times'] = time_trans($v['create_time']);
|
||||
$v['create_time'] = date('Y-m-d H:i:s', $v['create_time']);
|
||||
$data[] = $v;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function project_log($param = [])
|
||||
{
|
||||
$task_ids = Db::name('ProjectTask')->where(['project_id' => $param['topic_id'], 'delete_time' => 0])->column('id');
|
||||
|
||||
$where1 = [];
|
||||
$where2 = [];
|
||||
$where3 = [];
|
||||
|
||||
$where1[] = ['a.module', '=', 'project'];
|
||||
$where1[] = ['a.project_id', '=', $param['topic_id']];
|
||||
|
||||
$where2[] = ['a.module', '=', 'task'];
|
||||
$where2[] = ['a.task_id', 'in', $task_ids];
|
||||
$page = intval($param['page']);
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$content = Db::name('ProjectLog')
|
||||
->field('a.*,u.name,u.thumb')
|
||||
->alias('a')
|
||||
->join('Admin u', 'u.id = a.admin_id')
|
||||
->order('a.create_time desc')
|
||||
->whereOr([$where1, $where2])
|
||||
->page($page, $rows)
|
||||
->select()->toArray();
|
||||
|
||||
$module = [
|
||||
'project' => '',
|
||||
'task' => '任务',
|
||||
];
|
||||
$action = get_config('log.type_action');
|
||||
$data = [];
|
||||
foreach ($content as $k => $v) {
|
||||
$sourse = self::$Sourse[$v['module']];
|
||||
$field_array = $sourse['field_array'];
|
||||
if (isset($sourse[$v['field']])) {
|
||||
$v['old_content'] = $sourse[$v['field']][$v['old_content']];
|
||||
$v['new_content'] = $sourse[$v['field']][$v['new_content']];
|
||||
}
|
||||
if (strpos($v['field'], '_time') !== false) {
|
||||
if ($v['old_content'] == '') {
|
||||
$v['old_content'] = '未设置';
|
||||
}
|
||||
$v['new_content'] = date('Y-m-d', (int) $v['new_content']);
|
||||
}
|
||||
if (strpos($v['field'], '_uid') !== false) {
|
||||
$v['old_content'] = Db::name('Admin')->where(['id' => $v['old_content']])->value('name');
|
||||
$v['new_content'] = Db::name('Admin')->where(['id' => $v['new_content']])->value('name');
|
||||
}
|
||||
if ($v['field'] == 'user') {
|
||||
$v['new_content'] = Db::name('Admin')->where(['id' => $v['new_content']])->value('name');
|
||||
}
|
||||
if ($v['field'] == 'project_id') {
|
||||
$v['old_content'] = Db::name('Project')->where(['id' => $v['old_content']])->value('name');
|
||||
$v['new_content'] = Db::name('Project')->where(['id' => $v['new_content']])->value('name');
|
||||
}
|
||||
if ($v['field'] == 'cate') {
|
||||
$v['old_content'] = Db::name('WorkCate')->where(['id' => $v['old_content']])->value('title');
|
||||
$v['new_content'] = Db::name('WorkCate')->where(['id' => $v['new_content']])->value('title');
|
||||
}
|
||||
if ($v['field'] == 'done_ratio') {
|
||||
$v['old_content'] = $v['old_content'] . '%';
|
||||
$v['new_content'] = $v['new_content'] . '%';
|
||||
}
|
||||
if (strpos($v['field'], '_ids') !== false) {
|
||||
$old_ids = Db::name('Admin')->where('id', 'in', $v['old_content'])->column('name');
|
||||
$v['old_content'] = implode(',', $old_ids);
|
||||
$new_ids = Db::name('Admin')->where('id', 'in', $v['new_content'])->column('name');
|
||||
$v['new_content'] = implode(',', $new_ids);
|
||||
}
|
||||
if ($v['old_content'] == '' || $v['old_content'] == null) {
|
||||
$v['old_content'] = '未设置';
|
||||
}
|
||||
if ($v['new_content'] == '' || $v['new_content'] == null) {
|
||||
$v['new_content'] = '未设置';
|
||||
}
|
||||
$v['module_name'] = $module[$v['module']];
|
||||
|
||||
$v['topic'] = '';
|
||||
$v['topic_title'] = '';
|
||||
$v['url'] = '';
|
||||
if ($v['module'] == 'task') {
|
||||
$v['topic'] = 'T' . $v['task_id'];
|
||||
$v['topic_title'] = Db::name('ProjectTask')->where('id', $v['task_id'])->value('title');
|
||||
$v['url'] = '/project/task/view/id/' . $v['task_id'];
|
||||
}
|
||||
|
||||
$v['action'] = $action[$v['action']];
|
||||
$v['icon'] = $field_array[$v['field']]['icon'];
|
||||
$v['title'] = $field_array[$v['field']]['title'];
|
||||
$v['times'] = time_trans($v['create_time']);
|
||||
$v['create_time'] = date('Y-m-d', $v['create_time']);
|
||||
$data[] = $v;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
138
app/project/model/ProjectTask.php
Normal file
138
app/project/model/ProjectTask.php
Normal file
@ -0,0 +1,138 @@
|
||||
<?php
|
||||
namespace app\project\model;
|
||||
|
||||
use think\facade\Db;
|
||||
use think\Model;
|
||||
|
||||
class ProjectTask extends Model
|
||||
{
|
||||
const ZERO = 0; //#648A8D
|
||||
const ONE = 1; //#4AC8BE
|
||||
const TWO = 2; //#409CDE
|
||||
const THREE = 3; //#C0DB38
|
||||
const FOUR = 4; //#4DCE58
|
||||
const FIVE = 5; //#FEC939
|
||||
const SIX = 6; //#8838DA
|
||||
const SEVEN = 7; //#FD6206
|
||||
const EIGHT = 8; //#F03347
|
||||
const NINE = 9; //#A38B82
|
||||
|
||||
public static $Priority = [
|
||||
self::ZERO => '未设置',
|
||||
self::ONE => '低',
|
||||
self::TWO => '中',
|
||||
self::THREE => '高',
|
||||
self::FOUR => '紧急',
|
||||
];
|
||||
public static $FlowStatus = [
|
||||
self::ZERO => '未设置',
|
||||
self::ONE => '未开始',
|
||||
self::TWO => '进行中',
|
||||
self::THREE => '已完成',
|
||||
self::FOUR => '已拒绝',
|
||||
self::FIVE => '已关闭',
|
||||
];
|
||||
|
||||
//列表
|
||||
function list($param) {
|
||||
$where = array();
|
||||
$map1 = [];
|
||||
$map2 = [];
|
||||
$map3 = [];
|
||||
$map4 = [];
|
||||
if (!empty($param['project_id'])) {
|
||||
$where[] = ['project_id', '=', $param['project_id']];
|
||||
} else {
|
||||
$project_ids = Db::name('ProjectUser')->where(['uid' => $param['uid'], 'delete_time' => 0])->column('project_id');
|
||||
$map1[] = ['admin_id', '=', $param['uid']];
|
||||
$map2[] = ['director_uid', '=', $param['uid']];
|
||||
$map3[] = ['', 'exp', Db::raw("FIND_IN_SET({$param['uid']},assist_admin_ids)")];
|
||||
$map4[] = ['project_id', 'in', $project_ids];
|
||||
}
|
||||
if (!empty($param['type'])) {
|
||||
$where[] = ['type', '=', $param['type']];
|
||||
}
|
||||
if (!empty($param['flow_status'])) {
|
||||
$where[] = ['flow_status', '=', $param['flow_status']];
|
||||
}
|
||||
if (!empty($param['priority'])) {
|
||||
$where[] = ['priority', '=', $param['priority']];
|
||||
}
|
||||
if (!empty($param['cate'])) {
|
||||
$where[] = ['cate', '=', $param['cate']];
|
||||
}
|
||||
if (!empty($param['director_uid'])) {
|
||||
$where[] = ['director_uid', 'in', $param['director_uid']];
|
||||
}
|
||||
if (!empty($param['keywords'])) {
|
||||
$where[] = ['title|content', 'like', '%' . $param['keywords'] . '%'];
|
||||
}
|
||||
$where[] = ['delete_time', '=', 0];
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$list = Db::name('ProjectTask')->where(function ($query) use ($map1, $map2, $map3, $map4) {
|
||||
$query->where($map1)->whereor($map2)->whereor($map3)->whereor($map4);
|
||||
})->where($where)
|
||||
->withoutField('content,md_content')
|
||||
->order('flow_status asc')
|
||||
->order('id desc')
|
||||
->paginate($rows, false, ['query' => $param])
|
||||
->each(function ($item, $key) {
|
||||
$item['director_name'] = Db::name('Admin')->where(['id' => $item['director_uid']])->value('name');
|
||||
$assist_admin_names = Db::name('Admin')->where([['id', 'in', $item['assist_admin_ids']]])->column('name');
|
||||
$item['cate_name'] = Db::name('WorkCate')->where(['id' => $item['cate']])->value('title');
|
||||
if (empty($assist_admin_names)) {
|
||||
$item['assist_admin_names'] = '-';
|
||||
} else {
|
||||
$item['assist_admin_names'] = implode(',', $assist_admin_names);
|
||||
}
|
||||
$item['end_time'] = date('Y-m-d', $item['end_time']);
|
||||
$item['delay'] = 0;
|
||||
if ($item['over_time'] > 0 && $item['flow_status'] < 4) {
|
||||
$item['delay'] = countDays($item['end_time'], date('Y-m-d', $item['over_time']));
|
||||
}
|
||||
if ($item['over_time'] == 0 && $item['flow_status'] < 4) {
|
||||
$item['delay'] = countDays($item['end_time']);
|
||||
}
|
||||
$item['priority_name'] = self::$Priority[(int) $item['priority']];
|
||||
$item['flow_name'] = self::$FlowStatus[(int) $item['flow_status']];
|
||||
return $item;
|
||||
});
|
||||
return $list;
|
||||
}
|
||||
//详情
|
||||
public function detail($id)
|
||||
{
|
||||
$detail = Db::name('ProjectTask')->where(['id' => $id])->find();
|
||||
if (!empty($detail)) {
|
||||
$detail['product_name'] = '';
|
||||
$detail['project_name'] = '';
|
||||
if ($detail['project_id'] > 0) {
|
||||
$detail['project_name'] = Db::name('Project')->where(['id' => $detail['project_id']])->value('name');
|
||||
}
|
||||
$detail['admin_name'] = Db::name('Admin')->where(['id' => $detail['admin_id']])->value('name');
|
||||
$detail['director_name'] = Db::name('Admin')->where(['id' => $detail['director_uid']])->value('name');
|
||||
$detail['work_hours'] = Db::name('Schedule')->where(['delete_time' => 0, 'tid' => $detail['id']])->sum('labor_time');
|
||||
$detail['cate_name'] = Db::name('WorkCate')->where(['id' => $detail['cate']])->value('title');
|
||||
$detail['director_name'] = Db::name('Admin')->where(['id' => $detail['director_uid']])->value('name');
|
||||
$detail['logs'] = Db::name('ProjectLog')->where(['module' => 'task', 'task_id' => $detail['id']])->count();
|
||||
$detail['comments'] = Db::name('ProjectComment')->where(['module' => 4, 'delete_time' => 0, 'topic_id' => $detail['id']])->count();
|
||||
$detail['assist_admin_names'] = '';
|
||||
if (!empty($detail['assist_admin_ids'])) {
|
||||
$assist_admin_names = Db::name('Admin')->where('id', 'in', $detail['assist_admin_ids'])->column('name');
|
||||
$detail['assist_admin_names'] = implode(',', $assist_admin_names);
|
||||
}
|
||||
$detail['priority_name'] = self::$Priority[(int) $detail['priority']];
|
||||
$detail['flow_name'] = self::$FlowStatus[(int) $detail['flow_status']];
|
||||
$detail['times'] = time_trans($detail['create_time']);
|
||||
$detail['end_time'] = date('Y-m-d', $detail['end_time']);
|
||||
$detail['delay'] = 0;
|
||||
if ($detail['over_time'] > 0 && $detail['flow_status'] < 4) {
|
||||
$detail['delay'] = countDays($detail['end_time'], date('Y-m-d', $detail['over_time']));
|
||||
}
|
||||
if ($detail['over_time'] == 0 && $detail['flow_status'] < 4) {
|
||||
$detail['delay'] = countDays($detail['end_time']);
|
||||
}
|
||||
}
|
||||
return $detail;
|
||||
}
|
||||
}
|
26
app/project/validate/ProjectCheck.php
Normal file
26
app/project/validate/ProjectCheck.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace app\project\validate;
|
||||
use think\Validate;
|
||||
|
||||
class ProjectCheck extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'name' => 'require|unique:project',
|
||||
'code' => 'alphaNum|length:5,10|unique:project',
|
||||
'id' => 'require'
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'name.require' => '项目名称不能为空',
|
||||
'name.unique' => '同样的项目名称已经存在',
|
||||
'code.alphaNum' => '项目代码只能为5至10为字母和数字',
|
||||
'code.length' => '项目代码只能为5至10为字母和数字',
|
||||
'code.unique' => '同样的项目代码已经存在',
|
||||
'id.require' => '缺少更新条件',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['name','code'],
|
||||
'edit' => ['id']
|
||||
];
|
||||
}
|
26
app/project/validate/TaskCheck.php
Normal file
26
app/project/validate/TaskCheck.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace app\project\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class TaskCheck extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'title' => 'require',
|
||||
'plan_hours' => 'require|regex:/^[0-9]+(.[0-9]{1,1})?$/',
|
||||
'id' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'title.require' => '任务主题不能为空',
|
||||
'plan_hours.require' => '预估工时不能为空',
|
||||
'plan_hours.regex' => '预估工时只能是整数或者1位小数的数字',
|
||||
'id.require' => '缺少更新条件',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['title'],
|
||||
'hours' => ['plan_hours'],
|
||||
'edit' => ['id'],
|
||||
];
|
||||
}
|
115
app/project/view/index/add.html
Normal file
115
app/project/view/index/add.html
Normal file
@ -0,0 +1,115 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-3">
|
||||
<h3 class="pb-3">新建项目</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">项目名称<font>*</font></td>
|
||||
<td>
|
||||
<input type="text" name="name" lay-verify="required" lay-reqText="请输入项目名称" placeholder="请输入项目名称" class="layui-input" value="">
|
||||
</td>
|
||||
<td class="layui-td-gray-2">计划完成周期<span style="color: red">*</span></td>
|
||||
<td id="date">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="start_time" name="start_time" readonly lay-verify="required" lay-reqText="请选择开始时间" placeholder="请选择" class="layui-input" value="">
|
||||
</div>
|
||||
-
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="end_time" name="end_time" readonly lay-verify="required" lay-reqText="请选择结束时间" placeholder="请选择" class="layui-input" value="">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">负责人<font>*</font></td>
|
||||
<td>
|
||||
<input type="hidden" name="director_uid" lay-verify="required" readonly lay-reqText="请选择项目负责人" value="">
|
||||
<input type="text" name="director_name" placeholder="请选择项目负责人" readonly class="layui-input" value="">
|
||||
</td>
|
||||
<td class="layui-td-gray">项目成员<span style="color: red">*</span></td>
|
||||
<td colspan="3">
|
||||
<input type="hidden" id="team_admin_ids" name="team_admin_ids" class="layui-input" value="">
|
||||
<input type="text" id="team_admin_names" name="team_admin_names" placeholder="请选择项目成员" readonly class="layui-input" value="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">项目简介<span style="color: red">*</span></td>
|
||||
<td colspan="3">
|
||||
<textarea name="content" class="layui-textarea" lay-verify="required" lay-reqText="请完善项目简介"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="padding: 10px 0">
|
||||
<input type="hidden" name="id" value="0" />
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool','employeepicker'];
|
||||
function gouguInit() {
|
||||
var form = layui.form,tool = layui.tool,laydate = layui.laydate,employeepicker = layui.employeepicker;
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#date',
|
||||
range: ['#start_time', '#end_time']
|
||||
});
|
||||
|
||||
//选择产品负责人弹窗
|
||||
$('body').on('click','[name="director_name"]',function () {
|
||||
var ids=$('[name="director_uid"]').val(),names=$('[name="director_name"]').val();
|
||||
employeepicker.init({
|
||||
ids:ids,
|
||||
names:names,
|
||||
type:0,
|
||||
department_url: "/api/index/get_department_tree",
|
||||
employee_url: "/api/index/get_employee",
|
||||
callback:function(ids,names,dids,departments){
|
||||
$('[name="director_uid"]').val(ids);
|
||||
$('[name="director_name"]').val(names);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//选择项目成员弹窗
|
||||
$('body').on('click','#team_admin_names',function () {
|
||||
var ids=$('#team_admin_ids').val(),names=$(this).val(),team_admin_id_array=[],team_admin_name_array=[];
|
||||
if(ids.length>0){
|
||||
team_admin_id_array=ids.split(',');
|
||||
team_admin_name_array=names.split(',');
|
||||
}
|
||||
employeepicker.init({
|
||||
ids:team_admin_id_array,
|
||||
names:team_admin_name_array,
|
||||
type:1,
|
||||
department_url: "/api/index/get_department_tree",
|
||||
employee_url: "/api/index/get_employee",
|
||||
callback:function(ids,names,dids,departments){
|
||||
$('#team_admin_ids').val(ids);
|
||||
$('#team_admin_names').val(names);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
layer.msg(e.msg);
|
||||
parent.layui.tool.close(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/project/index/add",data.field,callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
{/block}
|
60
app/project/view/index/index.html
Normal file
60
app/project/view/index/index.html
Normal file
@ -0,0 +1,60 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="p-3">
|
||||
<div class="gg-form-bar border-t border-x">
|
||||
<button class="layui-btn layui-btn-sm add-project">+ 新建项目</button>
|
||||
</div>
|
||||
<table class="layui-hide" id="projectList" lay-filter="project"></table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table, form = layui.form, tool = layui.tool;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#projectList',
|
||||
title: '项目列表',
|
||||
cellMinWidth: 300,
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
url: "/project/index/index", //数据接口
|
||||
cols: [[
|
||||
{
|
||||
field: 'id', title: '项目编号', width: 80, align: 'center', fixed: 'left', rowspan: 2, templet: function (d) {
|
||||
return 'P' + d.id;
|
||||
}
|
||||
}
|
||||
, {
|
||||
field: 'status', title: '状态', align: 'center', width: 70, rowspan: 2, templet: function (d) {
|
||||
var html = '<span class="layui-btn layui-btn-xs bg-status-' + d.status + '">' + d.status_name + '</span>';
|
||||
return html;
|
||||
}
|
||||
}
|
||||
, {
|
||||
field: 'name', title: '项目名称', rowspan: 2, templet: function (d) {
|
||||
var html = '<a class="right-a" data-href="/project/index/view/id/' + d.id + '">' + d.name + '</a>';
|
||||
return html;
|
||||
}
|
||||
}
|
||||
, { field: 'director_name', title: '负责人', align: 'center', width: 80, rowspan: 2 }
|
||||
, { field: 'plan_time', title: '项目周期', align: 'center', width: 190, rowspan: 2 }
|
||||
, { align: 'center', title: '关联任务', colspan: 3 }
|
||||
], [
|
||||
{ field: 'tasks_unfinish', align: 'center', style: 'color: #91CC75;', width: 72, 'title': '进行中' }
|
||||
, { field: 'tasks_finish', align: 'center', style: 'color: #FAC858;', width: 70, 'title': '已完成' }
|
||||
, { field: 'tasks_pensent', align: 'center', style: 'color: #EE6666;', width: 72, 'title': '完成率' }
|
||||
]]
|
||||
});
|
||||
|
||||
$('.gg-form-bar').on('click','.add-project', function () {
|
||||
tool.side('/project/index/add');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
524
app/project/view/index/view.html
Normal file
524
app/project/view/index/view.html
Normal file
@ -0,0 +1,524 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
{block name="style"}
|
||||
<style>
|
||||
.hover-view i,.hover-edit i{margin-left:4px; font-weight:800; cursor:pointer; opacity:0}
|
||||
.hover-edit.hover-on i{opacity:1}
|
||||
.layui-tab-title .layui-this{background-color:#fff;}
|
||||
.layui-tab-card,.layui-card{box-shadow:0 0 0 0 rgb(0 0 0 / 10%); border-radius:0;}
|
||||
.layui-card-tips {color: #969696;}
|
||||
.layui-card-value {padding: 4px 0 16px;font-size: 18px;color: #1E9FFF;}
|
||||
|
||||
.file-card {background: #fff;border: 1px solid #f1f1f1;border-radius: 2px; padding: 8px; margin:8px;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
.file-card .file-icon{font-size:42px; color:#999; margin-right: 8px;}
|
||||
.file-card .file-title {font-size: 14px; color: #409eff; letter-spacing: 0; margin-right: 8px; line-height: 18px; cursor: pointer; word-break: break-all; overflow: hidden; text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;width: calc(100% - 110px);
|
||||
}
|
||||
.file-card .file-tool .iconfont{font-size:16px; padding:4px; cursor:pointer;}
|
||||
|
||||
.log-timeline{ position: relative; min-height:600px; padding-left: 48px; background-color:#fff;}
|
||||
.log-timeline:after {content: ""; position: absolute; top: 0; left: 24px; width: 1px; height: 100%; background: #e3e9ed;}
|
||||
.log-timeline dl{padding-bottom: 8px; position: relative;}
|
||||
.log-timeline dt{font-size: 16px; line-height: 2.4; color: #323232; font-weight:600}
|
||||
.log-timeline dd{font-size: 14px; line-height: 1.6; padding:5px 0}
|
||||
.log-timeline .date-second-point{width: 10px; height: 10px; display: block; border-radius: 50%; border: 3px solid #FBBC05; background: #fff; position: absolute; z-index: 99; left:-32px; top:9px}
|
||||
.log-timeline .log-thumb{width: 24px; height: 24px; border-radius: 50%; margin-right:4px;}
|
||||
.log-timeline .open-a{margin:0 4px;}
|
||||
.log-item i{font-weight:800; color:#323232}
|
||||
.log-content strong{margin:0 4px; color:#323232}
|
||||
|
||||
.comment-input .comment-image{width:40px; height:40px; border-radius:50%}
|
||||
.comment-item .comment-avatar{width:50px; float:left}
|
||||
.comment-item .comment-image{width:36px; height:36px; border-radius:50%}
|
||||
.comment-item .comment-body{margin-left:50px;}
|
||||
.comment-item .comment-content blockquote{border-left:3px solid #f1f1f1; padding:4px 8px;}
|
||||
.comment-item .comment-actions a{color:#8c95a8; cursor:pointer; font-size:12px;}
|
||||
.comment-item .comment-actions a:hover{color:#3582fb;}
|
||||
.comment-meta span{font-size:12px;}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="p-3">
|
||||
<h2 class="pb-3 hover-edit">
|
||||
<span class="font20" id="name_{$detail.id}" data-val="">{$detail.name}</span>
|
||||
<i class="iconfont icon-wodedianping" title="编辑" data-id="{$detail.id}" data-name="name"></i>
|
||||
</h2>
|
||||
<div>
|
||||
<span class="layui-badge layui-bg-gray">#T{$detail.id}</span>
|
||||
<span class="mx-2">{$detail.admin_name}</span>
|
||||
<span class="gray">创建于{$detail.times}<span id="editTips">{gt name="$detail.update_time"
|
||||
value="0"},最近更新于 {:time_trans($detail.update_time)}{/gt}</span></span>
|
||||
{eq name="$detail.admin_id" value="$login_user"}
|
||||
<span class="layui-btn layui-btn-xs layui-btn-danger ml-4" id="delProject"><i
|
||||
class="layui-icon"></i>删除</span>
|
||||
{/eq}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-tab layui-tab-card" style="margin:0;" lay-filter="project" id="projectTab">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this" data-load="true">项目概览</li>
|
||||
<li data-load="">项目任务</li>
|
||||
<li data-load="">工作记录</li>
|
||||
<li data-load="">项目人员</li>
|
||||
<li data-load="">项目动态</li>
|
||||
<li data-load="">项目评论</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="padding:0">
|
||||
<div class="layui-tab-item layui-show">
|
||||
{include file="/index/view_overview" /}
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
{include file="/index/view_task" /}
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
{include file="/index/view_schedule" /}
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
{include file="/index/view_user" /}
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
{include file="/index/view_log" /}
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
{include file="/index/view_comment" /}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="https://cdn.staticfile.org/echarts/5.3.0/echarts.min.js"></script>
|
||||
<script>
|
||||
var project_id = '{$detail.id}';
|
||||
var project_start_time = '{$detail.start_time| date="Y-m-d"}';
|
||||
const opsData = {
|
||||
status: [
|
||||
{ 'id': 1, 'title': '未开始' },
|
||||
{ 'id': 2, 'title': '进行中' },
|
||||
{ 'id': 3, 'title': '已完成' },
|
||||
{ 'id': 4, 'title': '已关闭' }
|
||||
]
|
||||
}
|
||||
|
||||
var chartProgress = document.getElementById('progress');
|
||||
var progressChart = echarts.init(chartProgress);
|
||||
var optionA;
|
||||
optionA = {
|
||||
backgroundColor: "#ffffff",
|
||||
title: {
|
||||
text: '67.45%',//主标题文本
|
||||
subtext: '任务完成率',//副标题文本
|
||||
x: 'center',
|
||||
y: '39%',
|
||||
textStyle: {
|
||||
fontWeight: 'normal',
|
||||
fontSize: 18,
|
||||
color: '#FF974C',
|
||||
align: 'center'
|
||||
},
|
||||
subtextStyle: {
|
||||
fontSize: 12,
|
||||
color: '#6c7a89',
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "item",
|
||||
formatter: '{b}:<br/><strong>{c}</strong>',
|
||||
show: true,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['60%', '80%'],
|
||||
center: ['50%', '50%'],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
data: [
|
||||
{ value: 1048, name: '待处理' },
|
||||
{ value: 735, name: '已完成' }
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var chartDelay = document.getElementById('delay');
|
||||
var delayChart = echarts.init(chartDelay);
|
||||
var optionB;
|
||||
optionB = {
|
||||
backgroundColor: "#ffffff",
|
||||
title: {
|
||||
text: '40.25%',//主标题文本
|
||||
subtext: '任务延迟率',//副标题文本
|
||||
x: 'center',
|
||||
y: '39%',
|
||||
textStyle: {
|
||||
fontWeight: 'normal',
|
||||
fontSize: 18,
|
||||
color: '#FF974C',
|
||||
align: 'center',
|
||||
marginLeft: '-10px'
|
||||
},
|
||||
subtextStyle: {
|
||||
fontSize: 12,
|
||||
color: '#6c7a89',
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "item",
|
||||
formatter: '{b}:<br/><strong>{c}</strong>',
|
||||
show: true,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['60%', '80%'],
|
||||
center: ['50%', '50%'],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
data: [{
|
||||
value: 1048,
|
||||
name: '延误',
|
||||
itemStyle: {
|
||||
color: "#ED6666",
|
||||
}
|
||||
},
|
||||
{
|
||||
value: 735,
|
||||
name: '按时完成',
|
||||
itemStyle: {
|
||||
color: "#91CC75",
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var chartCross = document.getElementById('cross');
|
||||
var crossChart = echarts.init(chartCross);
|
||||
var optionD;
|
||||
optionD = {
|
||||
backgroundColor: "#ffffff",
|
||||
color: ['#8C92A4', '#2C7EF8'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['任务计划剩余', '任务实际剩余']
|
||||
},
|
||||
grid: {
|
||||
top: 36,
|
||||
left: 8,
|
||||
right: 36,
|
||||
bottom: 0,
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [{
|
||||
axisLine: {
|
||||
show: true
|
||||
},
|
||||
boundaryGap: false,
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
},
|
||||
type: 'value'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
var chartPlan = document.getElementById('plan');
|
||||
var planChart = echarts.init(chartPlan);
|
||||
var optionE;
|
||||
|
||||
optionE = {
|
||||
backgroundColor: "#ffffff",
|
||||
title: {
|
||||
top: 0,
|
||||
left: 0,
|
||||
text: ''
|
||||
},
|
||||
tooltip: {
|
||||
padding: 6,
|
||||
formatter: function (obj) {
|
||||
var value = obj.value;
|
||||
var tips = '<div style="font-size: 12px;">' + value[0] + '<br>';
|
||||
tips += '共 ' + value[1] + ' 个工作任务';
|
||||
tips += '</div>';
|
||||
return tips;
|
||||
}
|
||||
},
|
||||
visualMap: {
|
||||
min: 0,
|
||||
max: 10,
|
||||
show: false,
|
||||
inRange: {
|
||||
color: ['#fafafa', '#20BF3F']
|
||||
}
|
||||
},
|
||||
calendar: {
|
||||
top: 24,
|
||||
left: 36,
|
||||
right: 4,
|
||||
cellSize: ['auto', 16],
|
||||
range: ['2022-03-01', '2022-08-01'],
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#333',
|
||||
type: 'dashed',
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
borderWidth: 0.5
|
||||
},
|
||||
yearLabel: { show: false },
|
||||
monthLabel: {
|
||||
nameMap: 'cn',
|
||||
fontSize: 12
|
||||
},
|
||||
dayLabel: {
|
||||
show: true,
|
||||
formatter: '{start} 1st',
|
||||
fontWeight: 'lighter',
|
||||
nameMap: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
|
||||
fontSize: 12
|
||||
}
|
||||
},
|
||||
series: {
|
||||
type: 'heatmap',
|
||||
coordinateSystem: 'calendar',
|
||||
data: []
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var chartWork = document.getElementById('work');
|
||||
var workChart = echarts.init(chartWork);
|
||||
var optionF;
|
||||
|
||||
optionF = {
|
||||
backgroundColor: "#ffffff",
|
||||
title: {
|
||||
top: 0,
|
||||
left: 0,
|
||||
text: ''
|
||||
},
|
||||
tooltip: {
|
||||
padding: 6,
|
||||
formatter: function (obj) {
|
||||
var value = obj.value;
|
||||
var tips = '<div style="font-size: 12px;">' + value[0] + '<br>';
|
||||
tips += '共 ' + value[1] + ' 个工时';
|
||||
tips += '</div>';
|
||||
return tips;
|
||||
}
|
||||
},
|
||||
visualMap: {
|
||||
min: 0,
|
||||
max: 10,
|
||||
show: false,
|
||||
inRange: {
|
||||
color: ['#fafafa', '#359AEF']
|
||||
}
|
||||
},
|
||||
calendar: {
|
||||
top: 24,
|
||||
left: 36,
|
||||
right: 4,
|
||||
cellSize: ['auto', 16],
|
||||
range: ['2022-03-01', '2022-08-01'],
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#333',
|
||||
type: 'dashed',
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
borderWidth: 0.5
|
||||
},
|
||||
yearLabel: { show: false },
|
||||
monthLabel: {
|
||||
nameMap: 'cn',
|
||||
fontSize: 12
|
||||
},
|
||||
dayLabel: {
|
||||
show: true,
|
||||
formatter: '{start} 1st',
|
||||
fontWeight: 'lighter',
|
||||
nameMap: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
|
||||
fontSize: 12
|
||||
}
|
||||
},
|
||||
series: {
|
||||
type: 'heatmap',
|
||||
coordinateSystem: 'calendar',
|
||||
data: []
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function getCalendarData(arr) {
|
||||
var rangeArray = [];
|
||||
for (var property in arr) {
|
||||
rangeArray.push(property);
|
||||
}
|
||||
var rangeArray = [rangeArray[0], rangeArray[rangeArray.length - 1]];
|
||||
var start = +echarts.number.parseDate(rangeArray[0]);
|
||||
var end = +echarts.number.parseDate(rangeArray[1]);
|
||||
if (start + 7776000000 > end) {
|
||||
end = start + 8640000000;
|
||||
rangeArray[1] = echarts.format.formatTime('yyyy-MM-dd', end);
|
||||
}
|
||||
var dayTime = 3600 * 24 * 1000;
|
||||
var data = [];
|
||||
for (var time = start; time < end; time += dayTime) {
|
||||
var this_date = echarts.format.formatTime('yyyy-MM-dd', time);
|
||||
if (arr[this_date]) {
|
||||
data.push([this_date, arr[this_date]]);
|
||||
} else {
|
||||
data.push([this_date, 0]);
|
||||
}
|
||||
}
|
||||
var res = { 'range': rangeArray, 'data': data };
|
||||
return res;
|
||||
}
|
||||
|
||||
//燃尽图统计
|
||||
function cross_count(arr, arr2) {
|
||||
var planArray = [], doArray = [];
|
||||
var today = new Date();
|
||||
var todayStr = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate();
|
||||
for (var a in arr) {
|
||||
planArray.push(a);
|
||||
}
|
||||
var rangeArray = [planArray[0], planArray[planArray.length - 1]];
|
||||
if (arr2 instanceof Array == false) {
|
||||
for (var b in arr2) {
|
||||
doArray.push(b);
|
||||
}
|
||||
if ((+echarts.number.parseDate(doArray[doArray.length - 1])) < (+echarts.number.parseDate(todayStr))) {
|
||||
doArray.push(todayStr);
|
||||
}
|
||||
if ((+echarts.number.parseDate(planArray[planArray.length - 1])) < (+echarts.number.parseDate(doArray[doArray.length - 1]))) {
|
||||
rangeArray[1] = doArray[doArray.length - 1];
|
||||
}
|
||||
}
|
||||
var start = +echarts.number.parseDate(rangeArray[0]);
|
||||
var end = +echarts.number.parseDate(rangeArray[1]);
|
||||
var todayInt = +echarts.number.parseDate(todayStr);
|
||||
var dayTime = 3600 * 24 * 1000;
|
||||
var xArray = [], yArray = [], yArray2 = [], done = 0, doneArray = [];
|
||||
for (var time = start; time <= end; time += dayTime) {
|
||||
var this_date = echarts.format.formatTime('yyyy-MM-dd', time);
|
||||
xArray.push(this_date);
|
||||
var plan = cross_recursion(time, end, arr);
|
||||
yArray.push(plan);
|
||||
|
||||
if (arr2[this_date]) {
|
||||
done += arr2[this_date];
|
||||
}
|
||||
if (time <= todayInt) {
|
||||
doneArray.push(done);
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < doneArray.length; i++) {
|
||||
yArray2.push(yArray[0] - doneArray[i]);
|
||||
}
|
||||
var start_time = +echarts.number.parseDate(project_start_time), tem_x_array = [], tem_y_array = [];
|
||||
if (start_time < start) {
|
||||
for (var tem_time = start_time; tem_time < start; tem_time += dayTime) {
|
||||
var this_date = echarts.format.formatTime('yyyy-MM-dd', tem_time);
|
||||
tem_x_array.push(this_date);
|
||||
tem_y_array.push(yArray[0]);
|
||||
}
|
||||
xArray = tem_x_array.concat(xArray);
|
||||
yArray = tem_y_array.concat(yArray);
|
||||
yArray2 = tem_y_array.concat(yArray2);
|
||||
}
|
||||
return { 'x': xArray, 'y': yArray, 'y2': yArray2 };
|
||||
}
|
||||
|
||||
function cross_recursion(start, end, arr) {
|
||||
var count = 0;
|
||||
var dayTime = 3600 * 24 * 1000;
|
||||
for (var time = start; time <= end; time += dayTime) {
|
||||
var this_date = echarts.format.formatTime('yyyy-MM-dd', time);
|
||||
if (arr[this_date]) {
|
||||
count += arr[this_date];
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
const moduleInit = ['tool','oaEdit','oaSchedule','oaComment'];
|
||||
|
||||
function gouguInit() {
|
||||
var element = layui.element;
|
||||
overview(layui);
|
||||
element.on('tab(project)', function(data){
|
||||
let index = data.index;
|
||||
console.log(index);
|
||||
if(index == 1){
|
||||
task(layui);
|
||||
}
|
||||
else if(index == 2){
|
||||
schedule(layui);
|
||||
}
|
||||
else if(index == 3){
|
||||
user(layui);
|
||||
}
|
||||
else if(index == 4){
|
||||
log(layui);
|
||||
}
|
||||
else if(index == 5){
|
||||
comment(layui);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
41
app/project/view/index/view_comment.html
Normal file
41
app/project/view/index/view_comment.html
Normal file
@ -0,0 +1,41 @@
|
||||
<div class="pt-3 px-3 bg-white">
|
||||
<div class="comment-input">
|
||||
<input type="text" id="commentInput" readonly placeholder="发表一下你的看法" class="layui-input" value="">
|
||||
</div>
|
||||
<div id="comment_project_{$detail.id}" class="pt-3"></div>
|
||||
</div>
|
||||
<script>
|
||||
function comment(){
|
||||
if($('#projectTab').find('li').eq(5).data('load') =='true'){
|
||||
return false;
|
||||
}
|
||||
$('#projectTab').find('li').eq(5).data('load','true');
|
||||
|
||||
let tool = layui.tool, comment = layui.oaComment;
|
||||
|
||||
//评论
|
||||
comment.load(project_id,'project');
|
||||
$('#commentInput').on('click', function () {
|
||||
comment.textarea(0,project_id,0,0,'project','');
|
||||
})
|
||||
//回复
|
||||
$('#comment_project_' + project_id).on('click', '[data-event="replay"]', function () {
|
||||
let pid = $(this).data('id');
|
||||
let padmin_id = $(this).data('uid');
|
||||
comment.textarea(0, project_id, pid, padmin_id, 'project', '');
|
||||
})
|
||||
//编辑
|
||||
$('#comment_project_' + project_id).on('click', '[data-event="edit"]', function () {
|
||||
let id = $(this).data('id');
|
||||
let content = $('#comment_' + id).data('content');
|
||||
comment.textarea(id, project_id, 0, 0, 'project', content);
|
||||
})
|
||||
|
||||
//删除
|
||||
$('#comment_project_' + project_id).on('click', '[data-event="del"]', function () {
|
||||
let id = $(this).data('id');
|
||||
comment.del(id, project_id, 'project');
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
94
app/project/view/index/view_log.html
Normal file
94
app/project/view/index/view_log.html
Normal file
@ -0,0 +1,94 @@
|
||||
<div class="bg-white">
|
||||
<div id="logList" class="log-timeline p-3"></div>
|
||||
</div>
|
||||
<script>
|
||||
function log(){
|
||||
if($('#projectTab').find('li').eq(4).data('load') =='true'){
|
||||
return false;
|
||||
}
|
||||
$('#projectTab').find('li').eq(4).data('load','true');
|
||||
let tool = layui.tool;
|
||||
|
||||
//日志
|
||||
let callback = function(res){
|
||||
$('.log-more').remove();
|
||||
if(res.code==0 && res.data.length>0){
|
||||
let itemLog = '',log_time='';
|
||||
$.each(res.data, function (index, item) {
|
||||
let link="",detail = "";
|
||||
if(log_time != item.create_time){
|
||||
if(log_time==''){
|
||||
itemLog+='<dl><dt><span class="date-second-point"></span>'+item.create_time+'</dt>'
|
||||
}
|
||||
else{
|
||||
itemLog+='</dl><dl><dt><span class="date-second-point"></span>'+item.create_time+'</dt>'
|
||||
}
|
||||
log_time = item.create_time;
|
||||
}
|
||||
|
||||
if(item.topic_title != ''){
|
||||
link='<a class="'+item.module+' open-a" data-url="'+item.url+'">'+item.topic+' '+item.topic_title+'</a>';
|
||||
}
|
||||
if(item.field =='new' || item.field =='delete'){
|
||||
detail= `
|
||||
<span class="log-content gray">${item.action}了项目${item.module_name}${link}</strong><span class="ml-4 gray" title="${item.create_time}">${item.times}</span>
|
||||
`;
|
||||
}
|
||||
else if(item.field =='content'){
|
||||
detail= `
|
||||
<span class="log-content gray">${item.action}了<strong>${item.title}</strong><i title="对比查看" class="iconfont icon-yuejuan" style="color:#1E9FFF; cursor: pointer;"></i> <span class="ml-4 gray" title="${item.create_time}">${item.times}</span></span>
|
||||
`;
|
||||
}
|
||||
else if(item.field =='file'|| item.field =='link' || item.field =='user'){
|
||||
detail= `
|
||||
<span class="log-content gray">${item.action}了${item.title}<strong>${item.new_content}</strong><span class="ml-4 gray" title="${item.create_time}">${item.times}</span></span>
|
||||
`;
|
||||
}
|
||||
else if(item.field =='document'){
|
||||
if(item.action =='修改'){
|
||||
detail= `
|
||||
<span class="log-content gray">项目${item.module_name}${link}${item.action}了${item.title}<strong>${item.remark}</strong><i title="对比查看" class="iconfont icon-yuejuan" style="color:#1E9FFF; cursor: pointer;"></i> <span class="ml-4 font-gray" title="${item.create_time}">${item.times}</span></span>
|
||||
`;
|
||||
}
|
||||
else{
|
||||
detail= `
|
||||
<span class="log-content gray">项目${item.module_name}${link}${item.action}了${item.title}<strong>${item.remark}</strong><span class="ml-4 gray" title="${item.create_time}">${item.times}</span></span>
|
||||
`;
|
||||
}
|
||||
}
|
||||
else{
|
||||
detail= `
|
||||
<span class="log-content gray">将项目${item.module_name}${link}<strong>${item.title}</strong>从 ${item.old_content} ${item.action}为<strong>${item.new_content}</strong><span class="ml-4 gray" title="${item.create_time}">${item.times}</span></span>
|
||||
`;
|
||||
}
|
||||
itemLog+= `
|
||||
<dd><img src="${item.thumb}" class="log-thumb" /><span class="log-name">${item.name}</span>${detail}</dd>
|
||||
`;
|
||||
});
|
||||
|
||||
itemLog+='</dl>';
|
||||
if(res.data.length>19){
|
||||
itemLog+='<div class="py-3 log-more"><button class="layui-btn layui-btn-normal layui-btn-sm" type="button">查看更多项目动态</button></div>';
|
||||
}
|
||||
$("#logList").append(itemLog);
|
||||
}
|
||||
else{
|
||||
if(project_page ==1){
|
||||
$("#logList").html('<div class="layui-data-none">暂无动态</div>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let project_page=1;
|
||||
tool.get("/project/api/project_log",{topic_id:project_id,page:project_page},callback);
|
||||
$('#logList').on('click','.log-more',function(){
|
||||
project_page++;
|
||||
tool.get("/project/api/project_log",{topic_id:project_id,page:project_page},callback);
|
||||
});
|
||||
|
||||
$('#logList').on('click','.open-a',function(){
|
||||
let url = $(this).data('url');
|
||||
parent.layui.tool.side(url);
|
||||
});
|
||||
}
|
||||
</script>
|
422
app/project/view/index/view_overview.html
Normal file
422
app/project/view/index/view_overview.html
Normal file
@ -0,0 +1,422 @@
|
||||
<div class="layui-card border-b">
|
||||
<div class='layui-card-body {$role=="0"?"hover-view":"hover-edit"}'>
|
||||
<div class="py-1">
|
||||
<span class="gray">项目状态:</span>
|
||||
<span class="layui-color-{$detail.status}" id="status_{$detail.id}"
|
||||
data-val="{$detail.status}">{$detail.status_name}</span><i
|
||||
class="iconfont icon-wodedianping" title="编辑" data-name="status"></i>
|
||||
<span class="gray" style="margin-left:32px">负责人:</span>
|
||||
<span id="director_uid_{$detail.id}" data-val="{$detail.director_uid}">{$detail.director_name}</span>
|
||||
<i class="iconfont icon-wodedianping" title="编辑" data-id="{$detail.id}" data-name="director_uid"></i>
|
||||
<span class="gray" style="margin-left:32px">项目成员:</span>{$detail.team_admin_names}
|
||||
</div>
|
||||
<div class="py-1">
|
||||
<span class="gray">计划完成周期:</span>
|
||||
<span id="start_time_{$detail.id}" data-val="">{$detail.start_time}</span>
|
||||
<i class="iconfont icon-wodedianping" title="修改计划开始日期" data-name="start_time"></i> 至 <span id="end_time_{$detail.id}"
|
||||
data-val="">{$detail.end_time}</span><i class="iconfont icon-wodedianping"
|
||||
title="修改计划结束日期" data-name="end_time"></i>
|
||||
</div>
|
||||
<div class="py-1">
|
||||
<span class="gray">项目简介:</span>
|
||||
<span id="content_{$detail.id}" data-val="{$detail.content}">{$detail.content}</span>
|
||||
<i class="iconfont icon-wodedianping" title="编辑" data-id="{$detail.id}" data-name="content"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card border-y">
|
||||
<div class="layui-card-header" style="height:45px;">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6">
|
||||
<h5>项目附件</h5>
|
||||
</div>
|
||||
<div class="layui-col-md6" style="text-align:right">
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="fileBtn">上传附件</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row p-2" id="fileList">
|
||||
{volist name="file_array" id="vo"}
|
||||
<div class="layui-col-md4">
|
||||
<div class="file-card">
|
||||
<i class="file-icon iconfont icon-ziyuan"></i>
|
||||
<div class="file-title" title="上传人:{$vo.admin_name}">
|
||||
{$vo.name}
|
||||
</div>
|
||||
<div class="file-tool">
|
||||
<a href="{$vo.filepath}" download="{$vo.name}" data-id="{$vo.id}" target="_blank" title="大小:{$vo.filesize/1048576|round=2}MB">
|
||||
<i class="iconfont icon-shujudaoru" style="color: #12bb37;"></i>
|
||||
</a>
|
||||
<i class="btn-delete iconfont icon-shanchu" data-id="{$vo.id}" style="color: #FF5722;"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
{empty name="$file_array" }
|
||||
<div class="layui-data-none">暂无附件</div>
|
||||
{/empty}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row mb-3 border-y">
|
||||
<div class="layui-col-xs6 layui-col-md4">
|
||||
<div class="layui-card border-l">
|
||||
<div class="layui-card-header">
|
||||
<h5>项目概况</h5>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div style="width:100%; height:200px;">
|
||||
<dl>
|
||||
<dt>任务 <span class="gray">(已完成/总任务)</span></dt>
|
||||
<dd class="layui-card-value" title="已完成/总任务">{$detail.tasks_finish} / {$detail.tasks}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>项目工时 <span class="gray">(实际工时/计划工时)</span></dt>
|
||||
<dd class="layui-card-value" title="实际工时/计划工时">{$detail.hours} / {$detail.plan_hours}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>工作记录</dt>
|
||||
<dd class="layui-card-value" title="工作记录数">{$detail.schedules}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs6 layui-col-md8">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<h5>项目进度</h5>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6">
|
||||
<div id="progress" class="gougu-data-none" style="width:100%; height:200px;"></div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div id="delay" class="gougu-data-none" style="width:100%; height:200px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-card border-y">
|
||||
<div class="layui-card-header">
|
||||
<h5>项目燃尽图</h5>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div id="cross" class="gougu-data-none" style="width:100%; height:360px;"
|
||||
data-tips="任务数:{$detail.tasks},已完成:{$detail.tasks_finish},未完成:{$detail.tasks_unfinish}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row border-y">
|
||||
<div class="layui-col-xs6 layui-col-md6">
|
||||
<div class="layui-card border-r">
|
||||
<div class="layui-card-header">
|
||||
<h5>任务分配情况</h5>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div id="plan" class="gougu-data-none" style="width:100%; height:150px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs6 layui-col-md6">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
<h5>工时登记情况</h5>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div id="work" class="gougu-data-none" style="width:100%; height:150px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function overview(){
|
||||
let form = layui.form,tool = layui.tool, edit = layui.oaEdit,upload = layui.upload;
|
||||
$('.hover-edit').hover(function () {
|
||||
$(this).addClass('hover-on');
|
||||
}, function () {
|
||||
$(this).removeClass('hover-on');
|
||||
})
|
||||
|
||||
$('.hover-edit').on('click', 'i', function () {
|
||||
let name = $(this).data('name');
|
||||
let show_txt = $('#' + name + '_' + project_id).text().replace(/[\r\n\t]/g, "");
|
||||
let real_txt = $('#' + name + '_' + project_id).data('val');
|
||||
if (real_txt === '') {
|
||||
real_txt = show_txt;
|
||||
}
|
||||
editShow(project_id, name, show_txt, real_txt);
|
||||
})
|
||||
|
||||
let loading = false;
|
||||
let editPost = function (id, name, show_val, real_val) {
|
||||
let callback = function (e) {
|
||||
layer.closeAll();
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
setTimeout(function () {
|
||||
location.reload();
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
let postData = { id: id };
|
||||
postData[name] = real_val;
|
||||
tool.post("/project/index/add", postData, callback);
|
||||
}
|
||||
|
||||
function editShow(id, name, show_txt, real_txt) {
|
||||
if (loading == true) {
|
||||
return false;
|
||||
}
|
||||
if (name == "name") {
|
||||
edit.text(id, name, real_txt, editPost);
|
||||
}
|
||||
if (name == "start_time" || name == "end_time") {
|
||||
edit.date(id, name, real_txt, editPost);
|
||||
}
|
||||
if (name == "director_uid") {
|
||||
edit.employee_one(id, name, show_txt, real_txt, editPost);
|
||||
}
|
||||
if (name == "status") {
|
||||
edit.dropdown(id, name, real_txt, opsData[name], editPost);
|
||||
}
|
||||
if (name == "product_id") {
|
||||
loading = true;
|
||||
gougu.get("/api/index/get_product", {}, function (res) {
|
||||
let data = res.data;
|
||||
loading = false;
|
||||
edit.dropdown(id, name, real_txt, data, editPost, 1);
|
||||
});
|
||||
}
|
||||
if (name == "content") {
|
||||
edit.textarea(id, name, real_txt, editPost);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$('#delProject').on('click', function () {
|
||||
layer.confirm('确定要删除该项目吗?请慎重', { icon: 3, title: '提示' }, function (index) {
|
||||
let callback = function (e) {
|
||||
layer.closeAll();
|
||||
layer.msg(e.msg);
|
||||
if(e.code==0){
|
||||
setTimeout(function () {
|
||||
location.href='/project/index/index';
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
let postData = { "id": project_id };
|
||||
tool.delete("/project/index/delete", postData, callback);
|
||||
});
|
||||
})
|
||||
|
||||
upload.render({
|
||||
elem: '#fileBtn'
|
||||
, url: '/api/index/upload'
|
||||
, accept: 'file' //普通文件
|
||||
, exts: 'jpeg|jpg|png|gif|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件
|
||||
, before: function (obj) {
|
||||
layer.msg('上传中...', { time: 3600000 });
|
||||
}
|
||||
, done: function (res, index, upload) {
|
||||
let callback = function (e) {
|
||||
layer.msg('上传成功');
|
||||
setTimeout(function(){
|
||||
location.reload();
|
||||
},2000)
|
||||
}
|
||||
let postData = { 'topic_id': project_id, 'file_id': res.data.id, 'file_name': res.data.name, 'module': 'project' };
|
||||
if(res.code>0){
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
else{
|
||||
tool.post("/project/api/add_file", postData, callback);
|
||||
}
|
||||
}
|
||||
, error: function (index, upload) {
|
||||
layer.msg('上传失败');
|
||||
}
|
||||
});
|
||||
|
||||
$('#fileList').on('click', '.btn-delete', function () {
|
||||
let id = $(this).data('id');
|
||||
layer.confirm('确定要删除该附件吗?', { icon: 3, title: '提示' }, function (index) {
|
||||
let callback = function (e) {
|
||||
layer.closeAll();
|
||||
layer.msg(e.msg);
|
||||
setTimeout(function(){
|
||||
location.reload();
|
||||
},2000)
|
||||
}
|
||||
let postData = { "id": id };
|
||||
tool.delete("/project/api/delete_file", postData, callback);
|
||||
});
|
||||
})
|
||||
|
||||
$('#linkBtn').on('click', function () {
|
||||
comment.addLink(0, project_id, 'project', '', '');
|
||||
})
|
||||
$('#linkList').on('click', '.link-edit', function () {
|
||||
let id = $(this).data('id');
|
||||
let url = $(this).data('url');
|
||||
let desc = $(this).data('desc');
|
||||
comment.addLink(id, project_id, 'project', url, desc);
|
||||
})
|
||||
$('#linkList').on('click', '.link-delete', function () {
|
||||
let id = $(this).data('id');
|
||||
layer.confirm('确定要删除该链接吗?', { icon: 3, title: '提示' }, function (index) {
|
||||
let callback = function (e) {
|
||||
layer.closeAll();
|
||||
layer.msg(e.msg);
|
||||
setTimeout(function(){
|
||||
location.reload();
|
||||
},2000)
|
||||
}
|
||||
let postData = { "id": id };
|
||||
tool.delete("/api/appendix/delete_link", postData, callback);
|
||||
});
|
||||
})
|
||||
|
||||
let callback = function (res) {
|
||||
if (res.data.date_tasks instanceof Array == false) {
|
||||
optionA.title.text = res.data.task_pie.ok_lv + '%';
|
||||
optionA.series = [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['60%', '80%'],
|
||||
center: ['50%', '50%'],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
data: [
|
||||
{ value: res.data.task_pie.count - res.data.task_pie.count_ok, name: '待处理' },
|
||||
{ value: res.data.task_pie.count_ok, name: '已完成' }
|
||||
]
|
||||
}
|
||||
];
|
||||
optionA && progressChart.setOption(optionA);
|
||||
|
||||
optionB.title.text = res.data.task_pie.delay_lv + '%';
|
||||
optionB.series = [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['60%', '80%'],
|
||||
center: ['50%', '50%'],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
data: [{
|
||||
value: res.data.task_pie.delay,
|
||||
name: '延误',
|
||||
itemStyle: {
|
||||
color: "#ED6666",
|
||||
}
|
||||
},
|
||||
{
|
||||
value: res.data.task_pie.count - res.data.task_pie.delay,
|
||||
name: '按时完成',
|
||||
itemStyle: {
|
||||
color: "#91CC75",
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
optionB && delayChart.setOption(optionB);
|
||||
|
||||
var dataD = cross_count(res.data.date_tasks, res.data.date_tasks_ok);
|
||||
var tips = $('#cross').data('tips');
|
||||
optionD.title = {
|
||||
text: '',
|
||||
subtext: tips,
|
||||
top: -10,
|
||||
},
|
||||
optionD.xAxis = {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'dashed'
|
||||
}
|
||||
},
|
||||
data: dataD.x,
|
||||
axisLabel: {
|
||||
rotate: 30,
|
||||
formatter: function (value, index) {
|
||||
return value.slice(5);
|
||||
}
|
||||
}
|
||||
};
|
||||
optionD.series = [
|
||||
{
|
||||
name: '任务计划剩余',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
markLine: {
|
||||
data: [{ type: 'average', name: 'Avg' }],
|
||||
},
|
||||
lineStyle: {
|
||||
width: 2
|
||||
},
|
||||
data: dataD.y
|
||||
},
|
||||
{
|
||||
name: '任务实际剩余',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
areaStyle: {
|
||||
opacity: 0.1
|
||||
},
|
||||
markLine: {
|
||||
data: [{ type: 'average', name: 'Avg' }],
|
||||
},
|
||||
lineStyle: {
|
||||
width: 2
|
||||
},
|
||||
data: dataD.y2
|
||||
}
|
||||
]
|
||||
optionD && crossChart.setOption(optionD)
|
||||
|
||||
var dataE = getCalendarData(res.data.date_tasks);
|
||||
optionE.calendar.range = dataE.range,
|
||||
optionE.series = {
|
||||
type: 'heatmap',
|
||||
coordinateSystem: 'calendar',
|
||||
data: dataE.data
|
||||
}
|
||||
optionE && planChart.setOption(optionE);
|
||||
|
||||
if (res.data.date_schedules instanceof Array == false) {
|
||||
var dataF = getCalendarData(res.data.date_schedules);
|
||||
optionF.calendar.range = dataF.range,
|
||||
optionF.series = {
|
||||
type: 'heatmap',
|
||||
coordinateSystem: 'calendar',
|
||||
data: dataE.data
|
||||
}
|
||||
optionF && workChart.setOption(optionF);
|
||||
}
|
||||
}
|
||||
}
|
||||
tool.get('/project/api/get_chart_data', { 'project_id': project_id }, callback);
|
||||
|
||||
window.onresize = function () {
|
||||
progressChart.resize();
|
||||
delayChart.resize();
|
||||
crossChart.resize();
|
||||
planChart.resize();
|
||||
workChart.resize();
|
||||
}
|
||||
}
|
||||
</script>
|
94
app/project/view/index/view_schedule.html
Normal file
94
app/project/view/index/view_schedule.html
Normal file
@ -0,0 +1,94 @@
|
||||
<div class="gg-form-bar border-x p-3">
|
||||
<form class="layui-form">
|
||||
<div class="layui-input-inline" style="width:120px;">
|
||||
<input type="text" name="username" placeholder="请选择员工" class="layui-input" readonly data-event="select" />
|
||||
<input type="text" name="uid" value="" style="display:none" />
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width:220px;">
|
||||
<input type="text" name="keywords" placeholder="输入工作内容" class="layui-input" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">提交搜索</button><button type="reset" class="layui-btn-reset" lay-filter="clear">清空</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="px-3 pb-3 bg-white">
|
||||
<table class="layui-hide" id="scheduleApi" lay-filter="schedule"></table>
|
||||
</div>
|
||||
<script>
|
||||
function schedule(){
|
||||
if($('#projectTab').find('li').eq(2).data('load') =='true'){
|
||||
return false;
|
||||
}
|
||||
$('#projectTab').find('li').eq(2).data('load','true');
|
||||
let form = layui.form,tool = layui.tool,table = layui.table,work = layui.oaSchedule,employeepicker=layui.employeepicker;
|
||||
//项目工作记录
|
||||
layui.scheduleTable = table.render({
|
||||
elem: '#scheduleApi',
|
||||
title: '工作记录列表',
|
||||
cellMinWidth: 200,
|
||||
url: "/oa/schedule/index", //数据接口
|
||||
where: { 'tid': project_id },
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
cols: [[ //表头
|
||||
{ field: 'id', title: '序号', width: 80, align: 'center' }
|
||||
, {
|
||||
field: 'start_time', title: '工作时间范围', align: 'center', width: 186, templet: function (d) {
|
||||
var html = d.start_time + '至' + d.end_time;
|
||||
return html;
|
||||
}
|
||||
}
|
||||
, { field: 'labor_time', title: '工时', style: 'color: #91CC75;', align: 'center', width: 60 }
|
||||
, { field: 'labor_type_string', title: '工作类型', align: 'center', width: 90 }
|
||||
, { field: 'work_cate', title: '工作类别', align: 'center', width: 100 }
|
||||
, { field: 'title', title: '工作内容' }
|
||||
, { field: 'name', title: '执行员工', align: 'center', width: 80 }
|
||||
, { field: 'department', title: '所在部门', align: 'center', width: 100 }
|
||||
, { field: 'create_time', title: '记录时间', align: 'center', width: 150 }
|
||||
, {title: '操作',fixed:'right', align: 'center', width: 100, templet: function (d) {
|
||||
return '<div class="layui-btn-group"><span class="layui-btn layui-btn-xs" lay-event="edit">修改</span><span class="layui-btn layui-btn-normal layui-btn-xs" lay-event="view">详细</span></div>';
|
||||
}
|
||||
}
|
||||
]]
|
||||
});
|
||||
|
||||
// 选择员工
|
||||
$('.gg-form-bar').on('click', '[data-event="select"]', function () {
|
||||
var that = $(this);
|
||||
var names = that.val(), ids = $('[name="uid"]').val();
|
||||
employeepicker.init({
|
||||
ids: ids,
|
||||
names: names,
|
||||
type: 0,
|
||||
department_url: "/api/index/get_department_tree",
|
||||
employee_url: "/api/index/get_employee",
|
||||
callback: function (ids, names, dids, departments) {
|
||||
$('[name="uid"]').val(ids);
|
||||
that.val(names);
|
||||
$('[lay-filter="webform"]').click();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
let f = data.field;
|
||||
layui.scheduleTable.reload({ where: { keywords: f.keywords, uid: f.uid, tid: project_id }, page: { curr: 1 } });
|
||||
return false;
|
||||
});
|
||||
$('body').on('click', '[lay-filter="clear"]', function () {
|
||||
setTimeout(function () {
|
||||
$('[lay-filter="webform"]').click();
|
||||
}, 10)
|
||||
})
|
||||
//监听行工具事件
|
||||
table.on('tool(schedule)', function (obj) {
|
||||
if (obj.event === 'edit') {
|
||||
work.add(0, obj.data);
|
||||
}
|
||||
if (obj.event === 'view') {
|
||||
work.view(obj.data);
|
||||
}
|
||||
return false;
|
||||
})
|
||||
}
|
||||
</script>
|
63
app/project/view/index/view_task.html
Normal file
63
app/project/view/index/view_task.html
Normal file
@ -0,0 +1,63 @@
|
||||
<div class="gg-form-bar border-x p-3">
|
||||
<button class="layui-btn layui-btn-sm add-new">+ 新建任务</button>
|
||||
</div>
|
||||
<div class="px-3 pb-3 bg-white">
|
||||
<table class="layui-hide" id="task" lay-filter="task"></table>
|
||||
</div>
|
||||
<script>
|
||||
function task(){
|
||||
if($('#projectTab').find('li').eq(1).data('load') =='true'){
|
||||
return false;
|
||||
}
|
||||
$('#projectTab').find('li').eq(1).data('load','true');
|
||||
let tool = layui.tool, table = layui.table;
|
||||
//项目任务
|
||||
parent.layui.taskTable = table.render({
|
||||
elem: '#task',
|
||||
title: '任务列表',
|
||||
cellMinWidth:200,
|
||||
url: "/project/task/index",
|
||||
where:{'project_id':project_id},
|
||||
page: true, //开启分页
|
||||
limit: 20,
|
||||
cols: [[
|
||||
{field: 'id', title: '任务编号', width: 80, align: 'center', fixed: 'left', templet: function (d) {
|
||||
return 'T' + d.id;
|
||||
}
|
||||
}
|
||||
,{field:'flow_name',title: '状态',align:'center',width: 80,templet:function(d){
|
||||
var html = '<span class="layui-badge layui-bg-'+d.flow_status+'">'+d.flow_name+'</span>';
|
||||
return html;
|
||||
}}
|
||||
, { field: 'cate_name', title: '工作类型', width: 90, align: 'center' }
|
||||
,{field:'title',title: '任务主题',rowspan: 2,templet:function(d){
|
||||
var html = '<span class="layui-badge layui-bg-'+d.priority+'">'+d.priority_name+'</span> <a class="right-a" lay-event="detail">'+d.title+'</a>';
|
||||
return html;
|
||||
}}
|
||||
,{field:'director_name',title: '负责人', align:'center',width: 80}
|
||||
,{field:'assist_admin_names',title: '协作人',width: 160}
|
||||
,{field:'plan_hours',title: '预估工时', align:'center',width: 80}
|
||||
,{field:'end_time',title: '预计结束日期', width: 150,templet:function(d){
|
||||
var html = d.end_time;
|
||||
if(d.delay>0){
|
||||
html+= '<span class="red ml-1" style="font-size:12px;">逾期'+d.delay+'天</span>';
|
||||
}
|
||||
return html;
|
||||
}}
|
||||
]]
|
||||
});
|
||||
$('.add-new').on('click',function(){
|
||||
parent.layui.tool.side('/project/task/add?project_id='+project_id);
|
||||
});
|
||||
|
||||
table.on('tool(task)', function(obj){
|
||||
var data = obj.data; //获得当前行数据
|
||||
var layEvent = obj.event;
|
||||
|
||||
if(layEvent === 'detail'){ //查看
|
||||
let url = '/project/task/view/id/'+data.id;
|
||||
parent.layui.tool.side(url);
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
105
app/project/view/index/view_user.html
Normal file
105
app/project/view/index/view_user.html
Normal file
@ -0,0 +1,105 @@
|
||||
<div class="gg-form-bar border-x p-3">
|
||||
<button class="layui-btn layui-btn-sm add-user">+ 新增项目成员</button>
|
||||
</div>
|
||||
<div class="px-3 pb-3 bg-white">
|
||||
<table class="layui-hide" id="user" lay-filter="user"></table>
|
||||
</div>
|
||||
<script>
|
||||
function user(){
|
||||
if($('#projectTab').find('li').eq(3).data('load') =='true'){
|
||||
return false;
|
||||
}
|
||||
$('#projectTab').find('li').eq(3).data('load','true');
|
||||
let tool = layui.tool, table = layui.table,employeepicker=layui.employeepicker;
|
||||
//项目成员
|
||||
layui.userTable = table.render({
|
||||
elem: '#user',
|
||||
title: '项目成员列表',
|
||||
cellMinWidth: 120,
|
||||
url: "/project/api/project_user", //数据接口
|
||||
where: { 'tid': project_id },
|
||||
page: false, //开启分页
|
||||
limit: 20,
|
||||
cols: [[ //表头
|
||||
{ field: 'name', fixed: 'left', title: '成员姓名', width: 90, rowspan: 2 }
|
||||
, { field: 'create_time', title: '进入项目日期', width: 110, align: 'center', rowspan: 2 }
|
||||
, { field: 'role', title: '角色', align: 'center', width: 90, rowspan: 2, templet: function (d) {
|
||||
var html='<span style="color: #4285F4;">普通成员</span>';
|
||||
if(d.role==1){
|
||||
html='<span style="color: #EE6666;">项目创建人</span>';
|
||||
}
|
||||
if(d.role==2){
|
||||
html='<span style="color: #91CC75;">项目负责人</span>';
|
||||
}
|
||||
return html;
|
||||
}}
|
||||
, { field: 'position', title: '职位', align: 'center', width: 100, rowspan: 2 }
|
||||
, { field: 'department', title: '所在部门', align: 'center', width: 120, rowspan: 2 }
|
||||
, { field: 'mobile', title: '手机号码', align: 'center', width: 110, rowspan: 2 }
|
||||
, { field: 'email', title: '电子邮箱', align: 'center', rowspan: 2 }
|
||||
, { align: 'center', title: '工作记录', colspan: 2 }
|
||||
, { align: 'center', title: '项目任务', colspan: 3 }
|
||||
, { field: 'delete_time', title: '移除日期', align: 'center', width: 110, rowspan: 2 }
|
||||
, { field: 'status',fixed: 'right', title: '状态', align: 'center', width: 60, rowspan: 2, templet: function (d) {
|
||||
var html = '<span style="color:#EE6666">✘</span>';
|
||||
if(d.delete_time == '-')
|
||||
html = '<span style="color:#91CC75">✔</span>';
|
||||
return html;
|
||||
}}
|
||||
, {title: '操作',fixed: 'right', align: 'center', width: 60, rowspan: 2, templet: function (d) {
|
||||
var html = '<span class="layui-btn layui-btn-xs" lay-event="recover">恢复</span>';
|
||||
if(d.delete_time == '-')
|
||||
html = '<span class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</span>';
|
||||
return html;
|
||||
}
|
||||
}
|
||||
], [
|
||||
{ field: 'schedules', align: 'center', style: 'color: #91CC75;', width: 72, 'title': '记录' }
|
||||
, { field: 'labor_times', align: 'center', style: 'color: #4285F4;', width: 70, 'title': '工时' }
|
||||
, { field: 'tasks_unfinish', align: 'center', style: 'color: #91CC75;', width: 72, 'title': '进行中' }
|
||||
, { field: 'tasks_finish', align: 'center', style: 'color: #FAC858;', width: 70, 'title': '已完成' }
|
||||
, { field: 'tasks_pensent', align: 'center', style: 'color: #EE6666;', width: 72, 'title': '完成率' }
|
||||
]]
|
||||
});
|
||||
// 选择员工
|
||||
$('body').on('click', '.add-user', function () {
|
||||
employeepicker.init({
|
||||
type: 0,
|
||||
department_url: "/api/index/get_department_tree",
|
||||
employee_url: "/api/index/get_employee",
|
||||
callback: function (ids, names, dids, departments) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if(e.code == 0){
|
||||
layui.userTable.reload();
|
||||
}
|
||||
}
|
||||
tool.post("/project/api/add_user", {uid: ids,project_id: project_id}, callback);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
//监听行工具事件
|
||||
table.on('tool(user)', function (obj) {
|
||||
let postData = { "id": obj.data.id };
|
||||
let callback = function (e) {
|
||||
layer.closeAll();
|
||||
layer.msg(e.msg);
|
||||
if(e.code == 0){
|
||||
layui.userTable.reload();
|
||||
}
|
||||
}
|
||||
if (obj.event === 'remove') {
|
||||
layer.confirm('确定要移除该项目成员吗?', { icon: 3, title: '提示' }, function (index) {
|
||||
tool.delete("/project/api/remove_user", postData, callback);
|
||||
});
|
||||
}
|
||||
if (obj.event === 'recover') {
|
||||
layer.confirm('确定要恢复该项目成员吗?', { icon: 3, title: '提示' }, function (index) {
|
||||
tool.post("/project/api/recover_user", postData, callback);
|
||||
});
|
||||
}
|
||||
return;
|
||||
});
|
||||
}
|
||||
</script>
|
166
app/project/view/task/add.html
Normal file
166
app/project/view/task/add.html
Normal file
@ -0,0 +1,166 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">新建任务</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">任务主题<font>*</font></td>
|
||||
<td colspan="3">
|
||||
<input type="text" name="title" lay-verify="required" lay-reqText="请输入任务主题" placeholder="请输入任务主题" class="layui-input" value="">
|
||||
</td>
|
||||
<td class="layui-td-gray">优先级<span style="color: red">*</span></td>
|
||||
<td>
|
||||
<select name="priority" lay-verify="required" lay-reqText="请选择优先级">
|
||||
<option value="1" selected>低</option>
|
||||
<option value="2">中</option>
|
||||
<option value="3">高</option>
|
||||
<option value="4">紧急</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">工作类型<span style="color: red">*</span></td>
|
||||
<td>
|
||||
<select name="cate" lay-verify="required" lay-reqText="请选择工作类型">
|
||||
<option value="">请选择</option>
|
||||
{volist name="cate" id="vo"}
|
||||
<option value="{$vo.id}">{$vo.title}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
<td class="layui-td-gray-2">预计结束日期<span style="color: red">*</span></td>
|
||||
<td>
|
||||
<input type="text" id="end_time" name="end_time" readonly lay-verify="required" lay-reqText="请选择结束时间"
|
||||
placeholder="请选择时间" class="layui-input" value="">
|
||||
</td>
|
||||
<td class="layui-td-gray">预估工时<span style="color: red">*</span></td>
|
||||
<td>
|
||||
<input type="text" name="plan_hours" lay-verify="required" lay-reqText="请填写预估工时" placeholder="请填写预估工时"
|
||||
class="layui-input" value="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">负责人</td>
|
||||
<td>
|
||||
<input type="hidden" name="director_uid" readonly value="">
|
||||
<input type="text" name="director_name" placeholder="请选择" readonly class="layui-input" value="">
|
||||
</td>
|
||||
{empty name="$project_id"}
|
||||
<td class="layui-td-gray">协作人</td>
|
||||
<td>
|
||||
<input type="hidden" name="assist_admin_ids" readonly value="">
|
||||
<input type="text" name="assist_admin_names" placeholder="请选择" readonly class="layui-input" value="">
|
||||
</td>
|
||||
<td class="layui-td-gray">关联项目</td>
|
||||
<td>
|
||||
<select id="projectId" name="project_id" lay-filter="project_id">
|
||||
<option value="">请选择关联项目</option>
|
||||
{volist name=":get_project()" id="v"}
|
||||
<option value="{$v.id}">{$v.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
{else/}
|
||||
<td class="layui-td-gray">协作人</td>
|
||||
<td colspan="3">
|
||||
<input type="hidden" name="project_id" readonly value="{$project_id}">
|
||||
<input type="hidden" name="assist_admin_ids" readonly value="">
|
||||
<input type="text" name="assist_admin_names" placeholder="请选择" readonly class="layui-input" value="">
|
||||
</td>
|
||||
{/empty}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">详细描述<font>*</font></td>
|
||||
<td colspan="5">
|
||||
<textarea name="content" placeholder="请输入内容" class="layui-textarea" id="container" style="border:0;padding:0"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="padding: 10px 0">
|
||||
<input type="hidden" name="id" value="0" />
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool','tinymce','employeepicker'];
|
||||
function gouguInit() {
|
||||
var form = layui.form,tool=layui.tool, laydate = layui.laydate, employeepicker = layui.employeepicker;
|
||||
|
||||
//编辑器初始化
|
||||
var editor = layui.tinymce;
|
||||
var edit = editor.render({
|
||||
selector: "#container",
|
||||
images_upload_url: '/api/index/upload/sourse/tinymce',//图片上传接口
|
||||
height: 500
|
||||
});
|
||||
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#end_time'
|
||||
});
|
||||
|
||||
//选择负责人弹窗
|
||||
$('body').on('click', '[name="director_name"]', function () {
|
||||
var ids = $('[name="director_uid"]').val(), names = $('[name="director_name"]').val();
|
||||
employeepicker.init({
|
||||
ids: ids,
|
||||
names: names,
|
||||
type: 0,
|
||||
department_url: "/api/index/get_department_tree",
|
||||
employee_url: "/api/index/get_employee",
|
||||
callback: function (ids, names, dids, departments) {
|
||||
$('[name="director_uid"]').val(ids);
|
||||
$('[name="director_name"]').val(names);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//选择协作人人弹窗
|
||||
$('body').on('click', '[name="assist_admin_names"]', function () {
|
||||
var ids = $('[name="assist_admin_ids"]').val(), names = $('[name="assist_admin_names"]').val(), assist_admin_id_array = [], assist_admin_name_array = [];
|
||||
if (ids.length > 0) {
|
||||
assist_admin_id_array = ids.split(',');
|
||||
assist_admin_name_array = names.split(',');
|
||||
}
|
||||
employeepicker.init({
|
||||
ids: assist_admin_id_array,
|
||||
names: assist_admin_name_array,
|
||||
department_url: "/api/index/get_department_tree",
|
||||
employee_url: "/api/index/get_employee",
|
||||
type: 1,
|
||||
callback: function (ids, names, dids, departments) {
|
||||
$('[name="assist_admin_ids"]').val(ids);
|
||||
$('[name="assist_admin_names"]').val(names);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
data.field.content = tinyMCE.editors['container'].getContent();
|
||||
if (data.field.content == '') {
|
||||
layer.msg('请先完善任务描述内容');
|
||||
return false;
|
||||
}
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
parent.layui.taskTable.reload();
|
||||
if (e.code == 0) {
|
||||
parent.layui.tool.close(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/project/task/add", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
{/block}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user