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 sub_orders() { $id = $this->request->get('id'); $page_no = $this->request->get('page_no', 1); $result = OpurchaseclassLogic::sub_detail($id, $page_no); 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']; }); $data['count'] = Opurchaseinfo::where('pid', $id)->count(); $data['lists'] = $res?->toArray(); $data['page_no'] = $page_no; $data['page_siz'] = 15; return $this->success('ok', $data); } /** * @notes 采购订单报价列表 */ public function goods_offer_list() { return $this->dataLists(new OpurchaseclassofferLists()); } /** * @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'); $type = $this->request->post('type'); $notes = $this->request->post('notes'); $nums = $this->request->post('nums'); $result = OpurchaseclassLogic::goodsOfferUpdate($id,$type,$notes,$nums); if ($result==true) { return $this->success('已设置', [], 1, 1); } return $this->fail(OpurchaseclassLogic::getError()); } }