123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- class ImportantRecord extends Base
- {
- // 新增/编辑
- public function save(){
- model('ImportantRecord')->add();
- HelpHander::success([],'操作成功');
- }
- // 详情
- public function detail(){
- $id = input('id/d',0);
- $ret = model('ImportantRecord')->info($id);
- HelpHander::success($ret);
- }
- // 列表
- public function list(){
- $ret = model('ImportantRecord')->lists($this->orgId,$this->userId);
- HelpHander::success($ret);
- }
- // 获取下级节点
- public function getNextList(){
- $pid = input('pid/d',0);
- $importantId = input('importantId/d',0);
- $ret = model('ImportantRecord')->getNextList($importantId,$pid);
- HelpHander::success($ret);
- }
- // 获取所有下级
- public function getNextAll(){
- $pid = input('pid/d',0);
- $importantId = input('importantId/d',0);
- $ret = model('ImportantRecord')->getNextAll($importantId,$pid);
- HelpHander::success($ret);
- }
- // 办结
- public function finish(){
- model('ImportantRecord')->finish();
- HelpHander::success([],'操作成功');
- }
- // 撤销
- public function backout(){
- $id = input('id/d',0);
- model('ImportantRecord')->backout($id);
- HelpHander::success([],'操作成功');
- }
- // 同意/拒绝办结
- public function deal(){
- $id = input('id/d',0);
- $type = input('type/d',1);
- model('ImportantRecord')->deal($id,$type,$this->userId);
- HelpHander::success([],'操作成功');
- }
- // 接受/退回
- public function confirm(){
- $id = input('id/d',0);
- $status = input('status/d',1);
- if(!in_array($status,[1,3])){
- HelpHander::error('参数错误');
- }
- model('ImportantRecord')->confirm($id,$status);
- HelpHander::success([],'操作成功');
- }
- // 操作成功
- public function tranfer(){
- $id = input('id/d',0);
- $toUserId = input('toUserId/d',0);
- if($toUserId <= 0){
- HelpHander::error('未选择转交人员');
- }
- if($toUserId == $this->userId){
- HelpHander::error('不能转交给自己');
- }
- model('ImportantRecord')->tranfer($id,$this->userId,$toUserId);
- HelpHander::success([],'操作成功');
- }
- // 修改进度
- public function progress(){
- $id = input('id/d',0);
- $progress = input('progress/d',0);
- model('ImportantRecord')->progress($id,$progress);
- HelpHander::success([],'操作成功');
- }
- public function unapply(){
- $ret = model('ImportantRecord')->unapply($this->userId);
- HelpHander::success($ret);
- }
- }
|