AssetCheck.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\Db;
  6. class AssetCheck extends Base
  7. {
  8. // 新增
  9. public function save(){
  10. model('AssetCheck')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 详情
  14. public function detail(){
  15. $id = input('id/d',0);
  16. $ret = model('AssetCheck')->info($id);
  17. HelpHander::success($ret);
  18. }
  19. // 列表
  20. public function list(){
  21. $page = input('page/d',1);
  22. $size = input('size/d',10);
  23. $status = input('status/d',-1);
  24. $ret = model('AssetCheck')->lists($page,$size,$status,$this->orgId);
  25. HelpHander::success($ret);
  26. }
  27. // 删除
  28. public function del(){
  29. $id = input('id/d',0);
  30. model('AssetCheck')->del($id);
  31. HelpHander::success([],'操作成功');
  32. }
  33. // 完成盘点
  34. public function finish(){
  35. $id = input('id/d',0);
  36. model('AssetCheck')->finish($id);
  37. HelpHander::success([],'操作成功');
  38. }
  39. // 盘库物品列表
  40. public function items(){
  41. $page = input('page/d',1);
  42. $size = input('size/d',10);
  43. $status = input('status/d',-1);
  44. $title = input('title','','trim');
  45. $checkId = input('checkId/d',0);
  46. $ret = model('AssetCheck')->items($page,$size,$checkId,$status,$title);
  47. HelpHander::success($ret);
  48. }
  49. // 所有盘库物品列表
  50. public function allItems(){
  51. $checkId = input('checkId/d',0);
  52. $ret = model('AssetCheck')->allItems($checkId);
  53. HelpHander::success($ret);
  54. }
  55. // 删除资产
  56. public function delItems(){
  57. $id = input('id/d',0);
  58. model('AssetCheck')->delItems($id);
  59. HelpHander::success([],'操作成功');
  60. }
  61. // 收到盘点
  62. public function finishItems(){
  63. $id = input('id/d',0);
  64. model('AssetCheck')->finishItems($id);
  65. HelpHander::success([],'操作成功');
  66. }
  67. }