KindModel.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /**
  2. * Created by zhouy on 2018/10/18.
  3. */
  4. Ext.define('saas.view.document.kind.KindModel', {
  5. extend: 'Ext.app.ViewModel',
  6. alias: 'viewmodel.document-kind',
  7. data: {
  8. title: '客户类型'
  9. },
  10. stores: {
  11. customerkind: {
  12. fields:[
  13. {name: 'id', type: 'int'},
  14. {name: 'ck_name', type: 'string'}
  15. ],
  16. proxy: {
  17. type: 'ajax',
  18. url: '/api/document/customerkind/list',
  19. actionMethods: {
  20. read: 'GET'
  21. },
  22. reader: {
  23. type: 'json',
  24. rootProperty: 'data'
  25. },
  26. listeners: {
  27. exception: function(proxy, response, operation, eOpts) {
  28. if(operation.success) {
  29. if(response.timedout) {
  30. saas.util.BaseUtil.showErrorToast('请求超时');
  31. }
  32. }else {
  33. console.error('exception: ', response.responseJson);
  34. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  35. }
  36. }
  37. }
  38. },
  39. pageSize: null,
  40. autoLoad: false,
  41. listeners: {
  42. beforeload: function (store, op) {
  43. Ext.apply(store.proxy.extraParams, {
  44. number: 1,
  45. size: 1000
  46. });
  47. }
  48. }
  49. },
  50. vendorkind:{
  51. fields:[
  52. {name: 'id', type: 'int'},
  53. {name: 'vk_name', type: 'string'}
  54. ],
  55. proxy: {
  56. type: 'ajax',
  57. url: '/api/document/vendorkind/list',
  58. actionMethods: {
  59. read: 'GET'
  60. },
  61. reader: {
  62. type: 'json',
  63. rootProperty: 'data'
  64. },
  65. listeners: {
  66. exception: function(proxy, response, operation, eOpts) {
  67. if(operation.success) {
  68. if(response.timedout) {
  69. saas.util.BaseUtil.showErrorToast('请求超时');
  70. }
  71. }else {
  72. console.error('exception: ', response.responseJson);
  73. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  74. }
  75. }
  76. }
  77. },
  78. pageSize: null,
  79. autoLoad: false,
  80. listeners: {
  81. beforeload: function (store, op) {
  82. Ext.apply(store.proxy.extraParams, {
  83. number: 1,
  84. size: 1000
  85. });
  86. }
  87. }
  88. },
  89. productkind:{
  90. fields:[
  91. {name: 'id', type: 'int'},
  92. {name: 'pt_name', type: 'string'}
  93. ],
  94. proxy: {
  95. type: 'ajax',
  96. url: '/api/document/producttype/list',
  97. actionMethods: {
  98. read: 'GET'
  99. },
  100. reader: {
  101. type: 'json',
  102. rootProperty: 'data'
  103. },
  104. listeners: {
  105. exception: function(proxy, response, operation, eOpts) {
  106. if(operation.success) {
  107. if(response.timedout) {
  108. saas.util.BaseUtil.showErrorToast('请求超时');
  109. }
  110. }else {
  111. console.error('exception: ', response.responseJson);
  112. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  113. }
  114. }
  115. }
  116. },
  117. pageSize: null,
  118. autoLoad: false,
  119. listeners: {
  120. beforeload: function (store, op) {
  121. Ext.apply(store.proxy.extraParams, {
  122. number: 1,
  123. size: 1000
  124. });
  125. }
  126. }
  127. },
  128. inoutkind:{
  129. fields:[
  130. {name: 'id', type: 'int'},
  131. {name: 'ft_kind', type: 'string'},
  132. {name: 'ft_name', type: 'string'}
  133. ],
  134. proxy: {
  135. type: 'ajax',
  136. url: '/api/document/fundinouttype/list',
  137. actionMethods: {
  138. read: 'GET'
  139. },
  140. reader: {
  141. type: 'json',
  142. rootProperty: 'data'
  143. },
  144. listeners: {
  145. exception: function(proxy, response, operation, eOpts) {
  146. if(operation.success) {
  147. if(response.timedout) {
  148. saas.util.BaseUtil.showErrorToast('请求超时');
  149. }
  150. }else {
  151. console.error('exception: ', response.responseJson);
  152. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  153. }
  154. }
  155. }
  156. },
  157. pageSize: null,
  158. autoLoad: false,
  159. listeners: {
  160. beforeload: function (store, op) {
  161. Ext.apply(store.proxy.extraParams, {
  162. number: 1,
  163. size: 1000
  164. });
  165. }
  166. }
  167. }
  168. }
  169. });