diff --git a/app/contract/controller/Api.php b/app/contract/controller/Api.php index 0a8a0ef..580e8e6 100644 --- a/app/contract/controller/Api.php +++ b/app/contract/controller/Api.php @@ -19,15 +19,30 @@ class Api extends BaseController { $param = get_params(); $where = array(); + $whereOr = array(); if (!empty($param['keywords'])) { $where[] = ['id|name', 'like', '%' . $param['keywords'] . '%']; } $where[] = ['delete_time', '=', 0]; + $where[] = ['check_status', '=', 2]; + $uid = $this->uid; + $auth = isAuth($uid,'contract'); + if($auth==0){ + $whereOr[] =['admin_id|prepared_uid|sign_uid|keeper_uid', '=', $uid]; + $whereOr[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',share_ids)")]; + $dids = get_department_role($this->uid); + if(!empty($dids)){ + $whereOr[] =['sign_did', 'in', $dids]; + } + } $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit']; $list = Db::name('Contract') ->field('id,name,sign_uid,sign_time') ->order('end_time asc') ->where($where) + ->where(function ($query) use($whereOr) { + $query->whereOr($whereOr); + }) ->paginate($rows, false)->each(function($item, $key){ $item['sign_name'] = Db::name('Admin')->where('id',$item['sign_uid'])->value('name'); $item['sign_time'] = date('Y-m-d', $item['sign_time']); diff --git a/app/finance/model/Invoice.php b/app/finance/model/Invoice.php index dfd1aff..0a6d3a9 100644 --- a/app/finance/model/Invoice.php +++ b/app/finance/model/Invoice.php @@ -93,6 +93,12 @@ class Invoice extends Model $detail['open_time'] = '-'; $detail['open_admin'] = '-'; } + if ($detail['contract_id'] > 0) { + $detail['contract_name'] = Db::name('Contract')->where(['id' => $detail['contract_id']])->value('name'); + } + else{ + $detail['contract_name'] = ''; + } } return $detail; } diff --git a/app/finance/view/expense/add.html b/app/finance/view/expense/add.html index 54964c7..e5084f7 100644 --- a/app/finance/view/expense/add.html +++ b/app/finance/view/expense/add.html @@ -345,6 +345,11 @@ const moduleInit = ['tool','employeepicker']; , { field: 'title', title: '项目名称' } ]] }); + //项目搜索提交 + form.on('submit(search_form)', function (data) { + projectTable.reload({ where: { keywords: data.field.keywords }, page: { curr: 1 } }); + return false; + }); }, btn: ['确定'], yes: function () { @@ -362,11 +367,6 @@ const moduleInit = ['tool','employeepicker']; } }) } - //项目搜索提交 - form.on('submit(search_form)', function (data) { - projectTable.reload({ where: { keywords: data.field.keywords }, page: { curr: 1 } }); - return false; - }); //监听提交 form.on('submit(webform)', function(data){ diff --git a/app/finance/view/invoice/add.html b/app/finance/view/invoice/add.html index 7f9f358..46223ce 100644 --- a/app/finance/view/invoice/add.html +++ b/app/finance/view/invoice/add.html @@ -62,6 +62,13 @@