- 文章内容* |
+ 文章内容* |
diff --git a/app/article/view/index/view.html b/app/article/view/index/view.html
index e6cf02d..b2a282b 100644
--- a/app/article/view/index/view.html
+++ b/app/article/view/index/view.html
@@ -28,7 +28,7 @@
{$detail.title}
- 发表于:{$detail.create_time | date='Y-m-d m:i:s'}
+ 发表于:{$detail.create_time | date='Y-m-d H:i:s'}
发布人:{$detail.user}
部门:{$detail.department}
阅读量:{$detail.read}
diff --git a/app/common.php b/app/common.php
index 369de6d..88752d0 100644
--- a/app/common.php
+++ b/app/common.php
@@ -313,6 +313,10 @@ function add_log($type, $param_id = '', $param = [])
$data['function'] = strtolower(app('request')->action());
$parameter = $data['module'] . '/' . $data['controller'] . '/' . $data['function'];
$rule_menu = Db::name('AdminRule')->where(array('src' => $parameter))->find();
+ if($type == 'upload'){
+ $data['title'] = $param['name'];
+ $data['subject'] = '文件';
+ }
if($rule_menu){
$data['title'] = $rule_menu['title'];
$data['subject'] = $rule_menu['name'];
@@ -338,11 +342,14 @@ function add_log($type, $param_id = '', $param = [])
*/
function sendMessage($user_id, $template, $data=[])
{
- $content = get_config('message.template')[$template]['template'];
+ $title = get_config('message.template')[$template]['title'];
+ $content = get_config('message.template')[$template]['content'];
foreach ($data as $key => $val) {
+ $title = str_replace('{' . $key . '}', $val, $title);
$content = str_replace('{' . $key . '}', $val, $content);
}
if(isSet($data['from_uid'])){
+ $title = str_replace('{from_user}', get_admin($data['from_uid'])['name'], $title);
$content = str_replace('{from_user}', get_admin($data['from_uid'])['name'], $content);
}
$content = str_replace('{date}', date('Y-m-d'), $content);
@@ -350,7 +357,7 @@ function sendMessage($user_id, $template, $data=[])
if (!$user_id) return false;
if (!$content) return false;
if (!is_array($user_id)) {
- $users[] = $user_id;
+ $users = explode(",", strval($user_id));
} else {
$users = $user_id;
}
@@ -361,7 +368,7 @@ function sendMessage($user_id, $template, $data=[])
$send_data[] = array(
'to_uid' => $value,//接收人
'action_id' => $data['action_id'],
- 'title' => $data['title'],
+ 'title' => $title,
'content' => $content,
'template' => $template,
'module_name' => strtolower(app('http')->getName()),
@@ -375,6 +382,15 @@ function sendMessage($user_id, $template, $data=[])
return $res;
}
+function getMessageLink($template,$action_id){
+ $content='';
+ if(isset(get_config('message.template')[$template]['link'])){
+ $link = get_config('message.template')[$template]['link'];
+ $content = str_replace('{action_id}', $action_id, $link);
+ }
+ return $content;
+}
+
/**
* 邮件发送
* @param $to 接收人
diff --git a/app/finance/controller/Expense.php b/app/finance/controller/Expense.php
index d98c458..f55f0d6 100644
--- a/app/finance/controller/Expense.php
+++ b/app/finance/controller/Expense.php
@@ -223,11 +223,23 @@ class Expense extends BaseController
if (!isset($param['check_admin_ids'])) {
if($flow[0]['flow_type'] == 1){
//部门负责人
- $param['check_admin_ids'] = get_department_leader($admin_id);
+ $leader = get_department_leader($this->uid);
+ if($leader == 0){
+ return to_assign(1,'审批流程设置有问题:当前部门负责人还未设置,请联系HR或者管理员');
+ }
+ else{
+ $param['check_admin_ids'] = $leader;
+ }
}
else if($flow[0]['flow_type'] == 2){
//上级部门负责人
- $param['check_admin_ids'] = get_department_leader($admin_id,1);
+ $leader = get_department_leader($this->uid,1);
+ if($leader == 0){
+ return to_assign(1,'审批流程设置有问题:上级部门负责人还未设置,请联系HR或者管理员');
+ }
+ else{
+ $param['check_admin_ids'] = $leader;
+ }
}
else{
$param['check_admin_ids'] = $flow[0]['flow_uids'];
@@ -282,6 +294,13 @@ class Expense extends BaseController
}
}
add_log('edit', $exid, $param);
+ //发送消息通知
+ $msg=[
+ 'from_uid'=>$this->uid,
+ 'action_id'=>$param['id']
+ ];
+ $users = $param['check_admin_ids'];
+ sendMessage($users,31,$msg);
Db::commit();
$dbRes = true;
} else {
@@ -306,11 +325,23 @@ class Expense extends BaseController
if (!isset($param['check_admin_ids'])) {
if($flow[0]['flow_type'] == 1){
//部门负责人
- $param['check_admin_ids'] = get_department_leader($admin_id);
+ $leader = get_department_leader($this->uid);
+ if($leader == 0){
+ return to_assign(1,'审批流程设置有问题:当前部门负责人还未设置,请联系HR或者管理员');
+ }
+ else{
+ $param['check_admin_ids'] = $leader;
+ }
}
else if($flow[0]['flow_type'] == 2){
//上级部门负责人
- $param['check_admin_ids'] = get_department_leader($admin_id,1);
+ $leader = get_department_leader($this->uid,1);
+ if($leader == 0){
+ return to_assign(1,'审批流程设置有问题:上级部门负责人还未设置,请联系HR或者管理员');
+ }
+ else{
+ $param['check_admin_ids'] = $leader;
+ }
}
else{
$param['check_admin_ids'] = $flow[0]['flow_uids'];
@@ -358,6 +389,13 @@ class Expense extends BaseController
}
}
add_log('add', $exid, $param);
+ //发送消息通知
+ $msg=[
+ 'from_uid'=>$this->uid,
+ 'action_id'=>$exid
+ ];
+ $users = $param['check_admin_ids'];
+ sendMessage($users,31,$msg);
Db::commit();
$dbRes = true;
} else {
@@ -378,6 +416,10 @@ class Expense extends BaseController
$id = isset($param['id']) ? $param['id'] : 0;
if ($id > 0) {
$expense = $this->detail($id);
+ if($expense['file_ids'] !=''){
+ $fileArray = Db::name('File')->where('id','in',$expense['file_ids'])->select();
+ $expense['fileArray'] = $fileArray;
+ }
View::assign('expense', $expense);
}
$department = get_login_admin('did');
@@ -415,6 +457,14 @@ class Expense extends BaseController
$detail['check_user'] = implode(',',$check_user);
}
}
+ if($detail['copy_uids'] !=''){
+ $copy_user = Db::name('Admin')->where('id','in',$detail['copy_uids'])->column('name');
+ $detail['copy_user'] = implode(',',$copy_user);
+ }
+ if($detail['file_ids'] !=''){
+ $fileArray = Db::name('File')->where('id','in',$detail['file_ids'])->select();
+ $detail['fileArray'] = $fileArray;
+ }
$is_check_admin = 0;
$is_create_admin = 0;
@@ -468,6 +518,10 @@ class Expense extends BaseController
{
$param = get_params();
$detail = Db::name('Expense')->where(['id' => $param['id']])->find();
+ $check_admin_ids = explode(",", strval($detail['check_admin_ids']));
+ if (!in_array($this->uid, $check_admin_ids)){
+ return to_assign(1,'您没权限审核该审批');
+ }
//当前审核节点详情
$step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>2,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find();
//审核通过
@@ -490,6 +544,9 @@ class Expense extends BaseController
$param['check_status'] = 2;
}
}
+ else{
+ $param['check_status'] = 1;
+ }
}
else if($step['flow_type'] == 0){
//自由人审批
@@ -556,6 +613,20 @@ class Expense extends BaseController
);
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
add_log('check', $param['id'], $param);
+ //发送消息通知
+ $msg=[
+ 'from_uid'=>$detail['admin_id'],
+ 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
+ 'action_id'=>$detail['id']
+ ];
+ if($param['check_status'] == 1){
+ $users = $param['check_admin_ids'];
+ sendMessage($users,31,$msg);
+ }
+ if($param['check_status'] == 2){
+ $users = $detail['admin_id'];
+ sendMessage($users,32,$msg);
+ }
return to_assign();
}
else{
@@ -582,6 +653,13 @@ class Expense extends BaseController
);
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
add_log('refue', $param['id'], $param);
+ //发送消息通知
+ $msg=[
+ 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
+ 'action_id'=>$detail['id']
+ ];
+ $users = $detail['admin_id'];
+ sendMessage($users,33,$msg);
return to_assign();
}
else{
@@ -628,6 +706,14 @@ class Expense extends BaseController
$param['pay_time'] = time();
$res = ExpenseList::where('id', $param['id'])->strict(false)->field(true)->update($param);
if ($res !== false) {
+ //发送消息通知
+ $detail = Db::name('Expense')->where(['id' => $param['id']])->find();
+ $msg=[
+ 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
+ 'action_id'=>$detail['id']
+ ];
+ $users = $detail['admin_id'];
+ sendMessage($users,34,$msg);
return to_assign();
} else {
return to_assign(1, "操作失败");
diff --git a/app/finance/controller/Invoice.php b/app/finance/controller/Invoice.php
index 31812cd..53bb407 100644
--- a/app/finance/controller/Invoice.php
+++ b/app/finance/controller/Invoice.php
@@ -201,7 +201,7 @@ class Invoice extends BaseController
return to_assign(1, '银行营业网点不能为空');
}
if (!$param['invoice_address']) {
- return to_assign(1, '银地址不能为空');
+ return to_assign(1, '银行地址不能为空');
}
}
if (!empty($param['id']) && $param['id'] > 0) {
@@ -263,6 +263,13 @@ class Invoice extends BaseController
$res = InvoiceList::where('id', $param['id'])->strict(false)->field(true)->update($param);
if ($res !== false) {
add_log('edit', $param['id'], $param);
+ //发送消息通知
+ $msg=[
+ 'from_uid'=>$this->uid,
+ 'action_id'=>$param['id']
+ ];
+ $users = $param['check_admin_ids'];
+ sendMessage($users,41,$msg);
return to_assign();
} else {
return to_assign(1, '操作失败');
@@ -323,11 +330,17 @@ class Invoice extends BaseController
);
//增加审核流程
Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step);
- }
-
+ }
if ($exid) {
add_log('apply', $exid, $param);
+ //发送消息通知
+ $msg=[
+ 'from_uid'=>$this->uid,
+ 'action_id'=>$exid
+ ];
+ $users = $param['check_admin_ids'];
+ sendMessage($users,41,$msg);
return to_assign();
} else {
return to_assign(1, '操作失败');
@@ -337,6 +350,10 @@ class Invoice extends BaseController
$id = isset($param['id']) ? $param['id'] : 0;
if ($id > 0) {
$detail = $this->detail($id);
+ if($detail['file_ids'] !=''){
+ $fileArray = Db::name('File')->where('id','in',$detail['file_ids'])->select();
+ $detail['fileArray'] = $fileArray;
+ }
View::assign('detail', $detail);
}
$department = get_login_admin('did');
@@ -373,6 +390,15 @@ class Invoice extends BaseController
}
}
+ if($detail['copy_uids'] !=''){
+ $copy_user = Db::name('Admin')->where('id','in',$detail['copy_uids'])->column('name');
+ $detail['copy_user'] = implode(',',$copy_user);
+ }
+ if($detail['file_ids'] !=''){
+ $fileArray = Db::name('File')->where('id','in',$detail['file_ids'])->select();
+ $detail['fileArray'] = $fileArray;
+ }
+
$is_check_admin = 0;
$is_create_admin = 0;
if($detail['admin_id'] == $this->uid){
@@ -424,6 +450,10 @@ class Invoice extends BaseController
{
$param = get_params();
$detail = Db::name('Invoice')->where(['id' => $param['id']])->find();
+ $check_admin_ids = explode(",", strval($detail['check_admin_ids']));
+ if (!in_array($this->uid, $check_admin_ids)){
+ return to_assign(1,'您没权限审核该审批');
+ }
//当前审核节点详情
$step = Db::name('FlowStep')->where(['action_id'=>$detail['id'],'type'=>3,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find();
//审核通过
@@ -446,6 +476,9 @@ class Invoice extends BaseController
$param['check_status'] = 2;
}
}
+ else{
+ $param['check_status'] = 1;
+ }
}
else if($step['flow_type'] == 0){
//自由人审批
@@ -512,6 +545,20 @@ class Invoice extends BaseController
);
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
add_log('check', $param['id'], $param);
+ //发送消息通知
+ $msg=[
+ 'from_uid'=>$detail['admin_id'],
+ 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
+ 'action_id'=>$detail['id']
+ ];
+ if($param['check_status'] == 1){
+ $users = $param['check_admin_ids'];
+ sendMessage($users,41,$msg);
+ }
+ if($param['check_status'] == 2){
+ $users = $detail['admin_id'];
+ sendMessage($users,42,$msg);
+ }
return to_assign();
}
else{
@@ -538,6 +585,13 @@ class Invoice extends BaseController
);
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
add_log('refue', $param['id'], $param);
+ //发送消息通知
+ $msg=[
+ 'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
+ 'action_id'=>$detail['id']
+ ];
+ $users = $detail['admin_id'];
+ sendMessage($users,43,$msg);
return to_assign();
}
else{
diff --git a/app/finance/view/expense/add.html b/app/finance/view/expense/add.html
index c0a71e9..675a02b 100644
--- a/app/finance/view/expense/add.html
+++ b/app/finance/view/expense/add.html
@@ -9,6 +9,21 @@
.select-1,.select-2{display:none;}
.layui-table-min th{font-size:13px; text-align:center; background-color:#f8f8f8;}
.layui-table-min td{font-size:13px; padding:6px;text-align:center;}
+.file-card {background: #fff;border: 1px solid #f1f1f1;border-radius: 2px; padding:8px 0; margin:4px 8px 4px 0;
+ -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:36px; color:#646464; margin-right: 4px;}
+.file-card .file-title {font-size: 12px; letter-spacing: 0; margin-right: 8px; line-height: 16px; 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 .layui-icon{font-size:22px; padding:2px; cursor:pointer;}
{/block}
@@ -28,21 +43,21 @@
|
- 报销选项* |
+ 报销选项* |
@@ -70,6 +85,14 @@
+
+ 附件 |
+
+
+
+
+ |
+
审批流程* |
@@ -87,6 +110,12 @@
|
+
+ 抄送人 |
+
+
+ |
+
{else/}
@@ -97,21 +126,21 @@
{$expense.department} |
- 报销凭证编号* |
+ 报销凭证编号* |
|
- 原始单据日期* |
+ 原始单据日期* |
|
- 入账月份* |
+ 入账月份* |
|
- 报销选项* |
+ 报销选项* |
@@ -141,6 +170,28 @@
+
+ 附件 |
+
+
+
+ {notempty name="$detail.file_ids"}
+ {volist name="$detail.fileArray" id="vo"}
+
+ {/volist}
+ {/notempty}
+
+ |
+
审批流程* |
@@ -158,6 +209,12 @@
|
+
+ 抄送人 |
+
+
+ |
+
{/if}
@@ -181,9 +238,76 @@
{block name="script"}
+{/block}
\ No newline at end of file
diff --git a/app/message/view/index/reply.html b/app/message/view/index/reply.html
index 18ec9f0..e965c92 100644
--- a/app/message/view/index/reply.html
+++ b/app/message/view/index/reply.html
@@ -19,7 +19,7 @@
|
{if condition="$type eq 1"}
- 收件人* |
+ 收件人* |
@@ -28,14 +28,14 @@
|
- 主题* |
+ 主题* |
|
{else/}
- 收件人* |
+ 收件人* |
@@ -44,14 +44,14 @@
|
- 主题* |
+ 主题* |
|
{/if}
- 内容* |
+ 内容* |
diff --git a/app/note/controller/Index.php b/app/note/controller/Index.php
index a66450d..d3c8444 100644
--- a/app/note/controller/Index.php
+++ b/app/note/controller/Index.php
@@ -77,7 +77,12 @@ class Index extends BaseController
if ($sid) {
add_log('add', $sid, $param);
$users= Db::name('Admin')->field('id as from_uid')->where(['status' => 1])->column('id');
- sendMessage($users,1,['title'=>$param['title'],'action_id'=>$sid]);
+ $msg=[
+ 'from_uid'=>$this->uid,
+ 'title' => $param['title'],
+ 'action_id'=>$sid
+ ];
+ sendMessage($users,1,$msg);
}
return to_assign();
diff --git a/app/note/view/index/add.html b/app/note/view/index/add.html
index 902dacf..8c34c84 100644
--- a/app/note/view/index/add.html
+++ b/app/note/view/index/add.html
@@ -14,7 +14,7 @@
|
- 公告分类* |
+ 公告分类* |
|
- 展示期间* |
+ 展示期间* |
@@ -41,7 +41,7 @@
|
- 状态* |
+ 状态* |
{if condition="$id eq 0"}
@@ -65,7 +65,7 @@
|
- 公告内容* |
+ 公告内容* |
|
diff --git a/app/note/view/index/view.html b/app/note/view/index/view.html
index bf0b244..f060a0a 100644
--- a/app/note/view/index/view.html
+++ b/app/note/view/index/view.html
@@ -28,7 +28,7 @@
- 开始时间 * |
+ 开始时间* |
|
@@ -59,7 +59,7 @@
- 结束时间 * |
+ 结束时间* |
|
@@ -116,6 +116,12 @@
+
+ 抄送人 |
+
+
+ |
+
{else/}
{/eq}
@@ -402,6 +414,13 @@ const moduleInit = ['tool','formSelects','employeepicker'];
return false;
});
+ //选择抄送人员
+ var copy_uids = $('#copy_uids').attr('xm-selected');
+ formSelects.data('selectcopy', 'server', {
+ url: '/api/index/get_employee_select',
+ keyword: copy_uids,
+ });
+
form.on('select(flowtype)', function(data){
var check_type = data.elem[data.elem.selectedIndex].title;
var formHtml=' 审核人* | \
@@ -420,23 +439,27 @@ const moduleInit = ['tool','formSelects','employeepicker'];
success: function (e) {
if (e.code == 0) {
var flowLi='';
- for(var a=0;a 当前部门负责人';
}
- else if(e.data[a].flow_type==2){
+ else if(flow_data[a].flow_type==2){
userList+= '上级部门负责人';
}
else{
- if(e.data[a].flow_type==3){
+ if(flow_data[a].flow_type==3){
sign_type= ' 或签'
}
- if(e.data[a].flow_type==4){
+ if(flow_data[a].flow_type==4){
sign_type= ' 会签'
}
- for(var b=0;b '+e.data[a].user_id_info[b].name+'';
+ for(var b=0;b '+flow_data[a].user_id_info[b].name+'';
}
}
flowLi+='\
@@ -446,8 +469,7 @@ const moduleInit = ['tool','formSelects','employeepicker'];
\
\
';
- }
-
+ }
formHtml = ' 审批流程 | \
\
\
@@ -457,7 +479,7 @@ const moduleInit = ['tool','formSelects','employeepicker'];
}
})
}
- });
+ });
}
{/block}
diff --git a/app/oa/view/approve/add_caigou.html b/app/oa/view/approve/add_caigou.html
index 9c9919c..0ba2fd8 100644
--- a/app/oa/view/approve/add_caigou.html
+++ b/app/oa/view/approve/add_caigou.html
@@ -11,7 +11,7 @@
|
物品名称* |
|
- 期望交互日期 * |
+ 期望交互日期* |
|
@@ -34,6 +34,14 @@
+
+ 附件 |
+
+
+
+
+ |
+
审批流程* |
@@ -51,13 +59,19 @@
|
+
+ 抄送人 |
+
+
+ |
+
|