KindModel.js 6.0 KB

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