purchaseApplyManage.js 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /**
  2. 入驻小区
  3. **/
  4. (function(vc){
  5. var DEFAULT_PAGE = 1;
  6. var DEFAULT_ROWS = 10;
  7. vc.extends({
  8. data:{
  9. purchaseApplyManageInfo:{
  10. purchaseApplys:[],
  11. total:0,
  12. records:1,
  13. moreCondition:false,
  14. applyOrderId:'',
  15. conditions:{
  16. state:'',
  17. applyOrderId:'',
  18. }
  19. }
  20. },
  21. _initMethod:function(){
  22. vc.component._listPurchaseApplys(DEFAULT_PAGE, DEFAULT_ROWS);
  23. },
  24. _initEvent:function(){
  25. vc.on('purchaseApplyManage','listPurchaseApply',function(_param){
  26. vc.component._listPurchaseApplys(DEFAULT_PAGE, DEFAULT_ROWS);
  27. });
  28. vc.on('pagination','page_event',function(_currentPage){
  29. vc.component._listPurchaseApplys(_currentPage,DEFAULT_ROWS);
  30. });
  31. },
  32. methods:{
  33. _listPurchaseApplys:function(_page, _rows){
  34. vc.component.purchaseApplyManageInfo.conditions.page = _page;
  35. vc.component.purchaseApplyManageInfo.conditions.row = _rows;
  36. var param = {
  37. params:vc.component.purchaseApplyManageInfo.conditions
  38. };
  39. //发送get请求
  40. vc.http.get('purchaseApplyManage',
  41. 'list',
  42. param,
  43. function(json,res){
  44. var _purchaseApplyManageInfo=JSON.parse(json);
  45. vc.component.purchaseApplyManageInfo.total = _purchaseApplyManageInfo.total;
  46. vc.component.purchaseApplyManageInfo.records = _purchaseApplyManageInfo.records;
  47. vc.component.purchaseApplyManageInfo.purchaseApplys = _purchaseApplyManageInfo.purchaseApplys;
  48. vc.emit('pagination','init',{
  49. total:vc.component.purchaseApplyManageInfo.records,
  50. currentPage:_page
  51. });
  52. },function(errInfo,error){
  53. console.log('请求失败处理');
  54. }
  55. );
  56. },
  57. _openAddPurchaseApplyModal:function(){
  58. vc.emit('addPurchaseApply','openAddPurchaseApplyModal',{});
  59. },
  60. _openEditPurchaseApplyModel:function(_purchaseApply){
  61. vc.emit('editPurchaseApply','openEditPurchaseApplyModal',_purchaseApply);
  62. },
  63. _openDeletePurchaseApplyModel:function(_purchaseApply){
  64. vc.emit('deletePurchaseApply','openDeletePurchaseApplyModal',_purchaseApply);
  65. },
  66. _queryPurchaseApplyMethod:function(){
  67. vc.component._listPurchaseApplys(DEFAULT_PAGE, DEFAULT_ROWS);
  68. },
  69. _moreCondition:function(){
  70. if(vc.component.purchaseApplyManageInfo.moreCondition){
  71. vc.component.purchaseApplyManageInfo.moreCondition = false;
  72. }else{
  73. vc.component.purchaseApplyManageInfo.moreCondition = true;
  74. }
  75. }
  76. }
  77. });
  78. })(window.vc);