ApproveFlow.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkAdmin
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://demo.thinkadmin.top
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // +----------------------------------------------------------------------
  11. // | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
  12. // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
  13. // +----------------------------------------------------------------------
  14. namespace app\approve\controller;
  15. use app\common\constant\CommonConstant;
  16. use app\common\constant\EvectionConstant;
  17. use app\common\constant\LeaveConstant;
  18. use app\common\constant\MaintainConstant;
  19. use library\Controller;
  20. /**
  21. * 审批流程设置
  22. */
  23. class ApproveFlow extends Controller
  24. {
  25. /**
  26. * 绑定数据表
  27. * @var string
  28. */
  29. protected $table = 'ApproveFlow';
  30. /**
  31. * 列表
  32. * @auth true
  33. * @menu true
  34. * @throws \think\Exception
  35. * @throws \think\db\exception\DataNotFoundException
  36. * @throws \think\db\exception\ModelNotFoundException
  37. * @throws \think\exception\DbException
  38. */
  39. public function index()
  40. {
  41. $module = input('module');
  42. $get_item_list = [];
  43. switch ($module){
  44. case CommonConstant::MODULE_5:
  45. $get_item_list = EvectionConstant::get_type_list();
  46. break;
  47. case CommonConstant::MODULE_6:
  48. $get_item_list = LeaveConstant::get_time_list();
  49. break;
  50. case CommonConstant::MODULE_8:
  51. $get_item_list = MaintainConstant::get_type_list();
  52. break;
  53. }
  54. $this->get_item_list = $get_item_list;
  55. $this->get_type_list = CommonConstant::get_type_list();
  56. $this->get_module_list = CommonConstant::get_module_list();
  57. $this->title = $this->get_module_list[$module].'审批流程';
  58. $query = $this->_query($this->table)
  59. ->where('module',$module);
  60. $query->page(false);
  61. }
  62. /**
  63. * 列表数据处理
  64. * @param array $data
  65. * @throws \Exception
  66. */
  67. protected function _index_page_filter(&$data)
  68. {
  69. foreach ($data as &$value) {
  70. }
  71. }
  72. /**
  73. * 编辑
  74. * @auth true
  75. */
  76. public function edit()
  77. {
  78. $this->title = '编辑';
  79. $this->_form($this->table, 'form');
  80. }
  81. /**
  82. * 数据处理
  83. * @auth true
  84. * @menu true
  85. * @param array $data
  86. * @throws \think\db\exception\DataNotFoundException
  87. * @throws \think\db\exception\ModelNotFoundException
  88. * @throws \think\exception\DbException
  89. */
  90. protected function _form_filter(&$data)
  91. {
  92. if($this->request->isGet()) {
  93. // $this->all_user = User::where('is_deleted',0)->column('name','id');
  94. }
  95. }
  96. /**
  97. * 列表
  98. */
  99. public function flow()
  100. {
  101. $this->title = '审批流';
  102. $list = CommonConstant::get_module_list();
  103. return $this->fetch('', compact("list"));
  104. }
  105. }