DataListModel.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Created by zhouy on 2018/10/18.
  3. */
  4. Ext.define('make.saas.view.document.warehouse.DataListModel', {
  5. extend: 'Ext.app.ViewModel',
  6. alias: 'viewmodel.document-warehouse-datalist',
  7. stores: {
  8. warehouse: {
  9. fields:[
  10. {name: 'id', type: 'int'},
  11. {name: 'wh_code', type: 'string'},
  12. {name: 'wh_type', type: 'string'},
  13. {name: 'wh_description', type: 'string'},
  14. {name: 'wh_statuscode', type: 'string'},
  15. {name: 'wh_ifmrp', type: 'int'},
  16. {name: 'wh_status', type: 'string'}
  17. ],
  18. proxy: {
  19. type: 'ajax',
  20. url: '/api/document/warehouse/list',
  21. actionMethods: {
  22. read: 'GET'
  23. },
  24. reader: {
  25. type: 'json',
  26. rootProperty: 'data.list'
  27. },
  28. listeners: {
  29. exception: function(proxy, response, operation, eOpts) {
  30. if(operation.success) {
  31. if(response.timedout) {
  32. saas.util.BaseUtil.showErrorToast('请求超时');
  33. }
  34. }else {
  35. console.error('exception: ', response);
  36. saas.util.BaseUtil.showErrorToast('查询失败:' + (response.responseJson?response.responseJson.message:'请求超时'));
  37. }
  38. }
  39. }
  40. },
  41. pageSize: null,
  42. autoLoad: false,
  43. listeners: {
  44. beforeload: function (store, op) {
  45. Ext.apply(store.proxy.extraParams, {
  46. number: 1,
  47. size: 1000
  48. });
  49. }
  50. }
  51. }
  52. }
  53. });