add($this->userId); HelpHander::success([],'操作成功'); } // 编辑 public function update(){ model('OfficeItems')->add($this->userId); HelpHander::success([],'操作成功'); } // 详情 public function detail(){ $id = input('id/d',0); $ret = model('OfficeItems')->info($id); HelpHander::success($ret); } // 列表 public function list(){ $page = input('page/d',1); $size = input('size/d',10); $title = input('title','','trim'); $cateId = input('cateId/d',0); $type = input('type/d',0); $ret = model('OfficeItems')->lists($page,$size,$title,$cateId,$this->orgId,$type); HelpHander::success($ret); } // 导出列表 public function export(){ $title = input('title','','trim'); $cateId = input('cateId/d',0); $type = input('type/d',0); $ret = model('OfficeItems')->export($title,$cateId,$this->orgId,$type); HelpHander::success($ret); } // 删除 public function del(){ $id = input('id/d',0); model('OfficeItems')->del($id); HelpHander::success([],'操作成功'); } // 申领物品列表 public function receive(){ $page = input('page/d',1); $size = input('size/d',10); $title = input('title','','trim'); $items = input('items','','trim'); $startTime = input('startTime','','trim'); $endTime = input('endTime','','trim'); $ret = model('OfficeReceive')->lists($page,$size,$title,$items,$startTime,$endTime,$this->orgId); HelpHander::success($ret); } // 修改物品数量 public function modifyNums(){ $id = input('id/d',0); $nums = input('nums/d',0); if($id <= 0||$nums <= 0){ HelpHander::error('参数错误'); } if($nums <= 0){ HelpHander::error('修改数量必须大于0'); } $reason = input('reason','','trim'); if(!$reason){ HelpHander::error('未填写原因'); } $type = input('type/d',0); if(!in_array($type,[0,1])){ HelpHander::error('类型错误'); } model('OfficeItems')->modifyNums($id,$nums,$reason,$type,$this->userId,$this->orgId); HelpHander::success([],'操作成功'); } // 物品入库 public function modifyNumsReceive(){ $id = input('id/d',0); $nums = input('nums/d',0); if($id <= 0||$nums <= 0){ HelpHander::error('参数错误'); } if($nums <= 0){ HelpHander::error('修改数量必须大于0'); } $remark = input('remark','','trim'); model('OfficeItems')->modifyNumsReceive($id,$nums,$remark,$this->userId,$this->orgId); HelpHander::success([],'操作成功'); } // 入库记录 public function inreceipt(){ $page = input('page/d',1); $size = input('size/d',10); $id = input('id/d',0); $ret = model('OfficeItems')->inreceipt($page,$size,$id); HelpHander::success($ret); } // 数量修改日志 public function numsLog(){ $page = input('page/d',1); $size = input('size/d',10); $title = input('title','','trim'); $name = input('name','','trim'); $ret = model('OfficeItems')->numsLog($page,$size,$title,$name,$this->orgId); HelpHander::success($ret); } // 物品入库月统计 public function tj(){ $page = input('page/d',1); $size = input('size/d',10); $title = input('title','','trim'); $month = input('month','','trim'); if(!$month){ HelpHander::error('请选择月份'); } $ret = model('OfficeItems')->numsTj($page,$size,$title,$month,$this->orgId); HelpHander::success($ret); } public function tjexport(){ $title = input('title','','trim'); $month = input('month','','trim'); if(!$month){ HelpHander::error('请选择月份'); } $ret = model('OfficeItems')->tjexport($title,$month,$this->orgId); HelpHander::success($ret); } }