dataLists(new OpurchaseclassLists()); } /** * @notes 添加采购订单 * @return \think\response\Json * @author likeadmin * @date 2024/04/27 11:26 */ public function add() { return $this->success('不能添加'); $params = (new OpurchaseclassValidate())->post()->goCheck('add'); $result = OpurchaseclassLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(OpurchaseclassLogic::getError()); } /** * @notes 编辑采购订单 * @return \think\response\Json * @author likeadmin * @date 2024/04/27 11:26 */ public function edit() { return $this->success('不能编辑'); $params = (new OpurchaseclassValidate())->post()->goCheck('edit'); $result = OpurchaseclassLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(OpurchaseclassLogic::getError()); } /** * @notes 删除采购订单 * @return \think\response\Json * @author likeadmin * @date 2024/04/27 11:26 */ public function delete() { return $this->success('不能删除'); $params = (new OpurchaseclassValidate())->post()->goCheck('delete'); OpurchaseclassLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取采购订单详情 * @return \think\response\Json * @author likeadmin * @date 2024/04/27 11:26 */ public function detail() { $params = (new OpurchaseclassValidate())->goCheck('detail'); $result = OpurchaseclassLogic::detail($params); return $this->data($result); } /** * @notes 采购订单列表 */ public function opurchaseinfo_list(){ $id=$this->request->get('id'); $page_no=$this->request->get('page_no',1); $res=Opurchaseinfo::where('pid',$id)->page($page_no,25)->select()->each(function ($item) { $find=Goods::where('id', $item['goods'])->with('unitName')->find(); $item['goods_name']=$find['name']; $item['unit_name']=$find['unit_name']; }); return $this->success('ok',$res?->toArray()); } /** * @notes 推送给供应商报价 * @return \think\response\Json * @author likeadmin * @date 2024/04/27 11:26 */ public function createSupplierGoods(){ return $this->success('禁止后台推送'); $params=$this->request->post(); $result = OpurchaseclassLogic::createSupplierGoods($params); if (true === $result) { return $this->success('推送成功', [], 1, 1); } return $this->fail(OpurchaseclassLogic::getError()); } /** * @notes 设置采纳商品 * @return \think\response\Json * @author likeadmin * @date 2024/04/27 11:26 */ public function goods_offer_update(){ $id=$this->request->post('id'); $result = OpurchaseclassLogic::goodsOfferUpdate($id); if ($result) { return $this->success('已采纳', [], 1, 1); } return $this->fail(OpurchaseclassLogic::getError()); } }