dataLists(new MaterialPurchaseRequestLists()); } /** * @notes 添加材料采购申请 * @return \think\response\Json * @author likeadmin * @date 2024/01/09 13:47 */ public function add() { $params = (new MaterialPurchaseRequestValidate())->post()->goCheck('add'); $result = MaterialPurchaseRequestLogic::add($params,$this->adminId); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(MaterialPurchaseRequestLogic::getError()); } /** * @notes 获取材料采购申请详情 * @return \think\response\Json * @author likeadmin * @date 2024/01/09 13:47 */ public function detail() { $params = (new MaterialPurchaseRequestValidate())->goCheck('detail'); $result = MaterialPurchaseRequestLogic::detail($params); return $this->data($result); } public function flows(): \think\response\Json { $flow_type = FlowType::where('type',5)->where('name','cgsq')->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 MaterialPurchaseRequestValidate())->post()->goCheck('approve'); $result = MaterialPurchaseRequestLogic::approve($params,$this->adminId); if (true === $result) { return $this->success('提交审核信息成功', [], 1, 1); } return $this->fail(MaterialPurchaseRequestLogic::getError()); } }