|
@@ -10,13 +10,17 @@ use app\common\model\ApproveFlow;
|
|
|
use app\common\model\EvectionInfo;
|
|
|
use app\common\service\ApproveFlowService;
|
|
|
use app\common\service\ApproveService;
|
|
|
+use app\common\service\EvectionInfoService;
|
|
|
use think\App;
|
|
|
use think\Db;
|
|
|
use app\common\model\User;
|
|
|
use hg\apidoc\annotation as Apidoc;
|
|
|
+use think\Request;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
- * @Apidoc\Title("员工出差管理")
|
|
|
+ * @Apidoc\Title("员工出差")
|
|
|
* @Apidoc\Group("api")
|
|
|
*/
|
|
|
class Evection extends Base
|
|
@@ -56,14 +60,28 @@ class Evection extends Base
|
|
|
* @Apidoc\Query("images", type="string", desc="图片(多个用英文逗号隔开)")
|
|
|
* @Apidoc\Query("type", type="integer",desc="出差类型:1=市内,2=市外")
|
|
|
* @Apidoc\Query("is_who", type="integer",desc="是否跨关内关外:0=否,1=是")
|
|
|
- * @Apidoc\Query("desc", type="string", desc="备注")
|
|
|
- * @Apidoc\Query("peer_user", type="string", desc="同行员工id(多个用英文逗号隔开)")
|
|
|
+ * @Apidoc\Query("remark", type="string", desc="备注")
|
|
|
+ * @Apidoc\Query("peer_user", type="string", desc="同行员工数据")
|
|
|
* @Apidoc\Query("approve_user", type="string", desc="审批人id(多个用英文逗号隔开)")
|
|
|
* @Apidoc\Query("copy_user", type="string", desc="抄送人id(多个用英文逗号隔开)")
|
|
|
*/
|
|
|
- public function applyEvection()
|
|
|
+ public function create()
|
|
|
{
|
|
|
- $request_param = input('post.');
|
|
|
+ $reason = input('reason');
|
|
|
+ $start_time = input('start_time');
|
|
|
+ $end_time = input('end_time');
|
|
|
+ $document = input('document');
|
|
|
+ $images = input('images');
|
|
|
+ $type = input('type');
|
|
|
+ $is_who = input('is_who');
|
|
|
+ $remark = input('remark');
|
|
|
+ $peer_user = input('peer_user');
|
|
|
+ $approve_user = input('approve_user');
|
|
|
+ $copy_user = input('copy_user');
|
|
|
+ $params = compact("reason", "start_time", "end_time", "document", "images", "type", "is_who", "remark", "peer_user", "approve_user", "copy_user");
|
|
|
+ EvectionInfoService::create($params,$this->user);
|
|
|
+ $this->success('申请已提交,请等待审核');
|
|
|
+
|
|
|
if (empty($request_param['start_time']) || empty($request_param['end_time'])) $this->error('请选择出差时间');
|
|
|
if (empty($request_param['type'])) $this->error('请选择出差类型');
|
|
|
if (empty($request_param['user_id'])) $request_param['user_id'] = $this->user_id;
|
|
@@ -83,7 +101,7 @@ class Evection extends Base
|
|
|
} else {
|
|
|
EvectionInfo::where('id', $flow_info->id)->update(['status' => 2]);
|
|
|
}
|
|
|
- $this->success('出差已提交,请等待审核', ['detail' => $flow_info->toArray()]);
|
|
|
+ $this->success('出差已提交,请等待审核', ['detail' => -$flow_info>toArray()]);
|
|
|
}
|
|
|
|
|
|
|