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