dataLists(new ProcurementContractLists()); } /** * @notes 添加采购合同 * @return \think\response\Json * @author likeadmin * @date 2023/12/04 22:08 */ public function add() { $params = (new ProcurementContractValidate())->post()->goCheck('add'); $result = ProcurementContractLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(ProcurementContractLogic::getError()); } /** * @notes 编辑采购合同 * @return \think\response\Json * @author likeadmin * @date 2023/12/02 17:19 */ public function edit() { $params = (new ProcurementContractValidate())->post()->goCheck('edit'); $result = ProcurementContractLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(ProcurementContractLogic::getError()); } /** * @notes 获取采购合同详情 * @return \think\response\Json * @author likeadmin * @date 2023/12/04 22:08 */ public function detail() { $params = (new ProcurementContractValidate())->goCheck('detail'); $result = ProcurementContractLogic::detail($params); return $this->data($result); } public function flows(): \think\response\Json { $flow_type = FlowType::where('type',2)->where('name','cght')->findOrEmpty(); $data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select(); return $this->success('请求成功',$data->toArray()); } //添加审批 public function approve(): \think\response\Json { $params = (new ProcurementContractValidate())->post()->goCheck('approve'); $result = ProcurementContractLogic::approve($params,$this->adminId); if (true === $result) { return $this->success('提交审核信息成功', [], 1, 1); } return $this->fail(ProcurementContractLogic::getError()); } }