|
@@ -17,8 +17,6 @@ namespace app\approve\controller;
|
|
|
|
|
|
use app\common\constant\CommonConstant;
|
|
|
use app\common\constant\MaintainConstant;
|
|
|
-use app\common\model\Department;
|
|
|
-use app\common\service\UserService;
|
|
|
use library\Controller;
|
|
|
|
|
|
/**
|
|
@@ -66,75 +64,6 @@ class ApproveMaintainUser extends Controller
|
|
|
*/
|
|
|
protected function _index_page_filter(&$data)
|
|
|
{
|
|
|
- if($data){
|
|
|
-// $this->user_list = UserService::get_list(1);
|
|
|
-// $user_object = array_column($this->user_list->toArray(),null,'userid');
|
|
|
-// $department_list = Department::column('dept_id,name');
|
|
|
-// foreach ($data as &$value) {
|
|
|
-// // 所属部门
|
|
|
-// $department_ids = explode(',',$value['department']);
|
|
|
-// $department_text = '';
|
|
|
-// foreach ($department_ids as $val){
|
|
|
-// if(array_key_exists($val,$department_list)){
|
|
|
-// $department_text .= $department_list[$val].',';
|
|
|
-// }
|
|
|
-// }
|
|
|
-// $value['department_text'] = $department_text;
|
|
|
-// // 员工的直属主管
|
|
|
-// $manager_text = !empty($value['manager_userid']) && array_key_exists($value['manager_userid'],$user_object) ? $user_object[$value['manager_userid']]['name'] : '';
|
|
|
-// $value['manager_text'] = $manager_text;
|
|
|
-// }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 编辑
|
|
|
- * @auth true
|
|
|
- * @throws \think\Exception
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException
|
|
|
- * @throws \think\exception\DbException
|
|
|
- * @throws \think\exception\PDOException
|
|
|
- */
|
|
|
- public function edit()
|
|
|
- {
|
|
|
- $this->title = '编辑';
|
|
|
- $this->_form($this->table, 'form');
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 表单处理
|
|
|
- * @param array $data
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException
|
|
|
- * @throws \think\exception\DbException
|
|
|
- */
|
|
|
- protected function _form_filter(&$data)
|
|
|
- {
|
|
|
- // 编辑
|
|
|
- if($data['id'] > 0){
|
|
|
- if($this->request->isGet()) {
|
|
|
- $department_list = Department::column('dept_id,name');
|
|
|
- // 所属部门
|
|
|
- $department_ids = explode(',',$data['department']);
|
|
|
- $department_text = '';
|
|
|
- foreach ($department_ids as $val){
|
|
|
- if(array_key_exists($val,$department_list)){
|
|
|
- $department_text .= $department_list[$val].',';
|
|
|
- }
|
|
|
- }
|
|
|
- $data['department_text'] = $department_text;
|
|
|
- $this->user_list = UserService::get_list(1);
|
|
|
- }
|
|
|
- if($this->request->isPost()){
|
|
|
- if (isset_full($data, 'signature_status')) {
|
|
|
- if(!in_array($data['signature_status'],[CommonConstant::SIGNATURE_STATUS_3,CommonConstant::SIGNATURE_STATUS_4])){
|
|
|
- unset($data['signature_status']);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
|