KindModel.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  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. productbrand:{
  129. fields:[
  130. {name: 'id', type: 'int'},
  131. {name: 'pb_name', type: 'string'}
  132. ],
  133. proxy: {
  134. type: 'ajax',
  135. url: '/api/document/productbrand/list',
  136. actionMethods: {
  137. read: 'GET'
  138. },
  139. reader: {
  140. type: 'json',
  141. rootProperty: 'data'
  142. },
  143. listeners: {
  144. exception: function(proxy, response, operation, eOpts) {
  145. if(operation.success) {
  146. if(response.timedout) {
  147. saas.util.BaseUtil.showErrorToast('请求超时');
  148. }
  149. }else {
  150. console.error('exception: ', response.responseJson);
  151. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  152. }
  153. }
  154. }
  155. },
  156. pageSize: null,
  157. autoLoad: false,
  158. listeners: {
  159. beforeload: function (store, op) {
  160. Ext.apply(store.proxy.extraParams, {
  161. number: 1,
  162. size: 1000
  163. });
  164. }
  165. }
  166. },
  167. bankinformation:{
  168. fields:[
  169. {name: 'id', type: 'int'},
  170. {name: 'bk_bankname', type: 'string'},
  171. {name: 'bk_bankcode', type: 'string'},
  172. {name: 'bk_type', type: 'string'},
  173. {name: 'bk_beginamount', type: 'float'},
  174. {name: 'bk_thisamount', type: 'float'},
  175. {name: 'bk_date', type: 'date'},
  176. {name: 'updateTime', type: 'date'}
  177. ],
  178. proxy: {
  179. type: 'ajax',
  180. url: '/api/document/bankinformation/list',
  181. actionMethods: {
  182. read: 'GET'
  183. },
  184. reader: {
  185. type: 'json',
  186. rootProperty: 'data.list'
  187. },
  188. listeners: {
  189. exception: function(proxy, response, operation, eOpts) {
  190. if(operation.success) {
  191. if(response.timedout) {
  192. saas.util.BaseUtil.showErrorToast('请求超时');
  193. }
  194. }else {
  195. console.error('exception: ', response.responseJson);
  196. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  197. }
  198. }
  199. }
  200. },
  201. pageSize: null,
  202. autoLoad: false,
  203. listeners: {
  204. beforeload: function (store, op) {
  205. Ext.apply(store.proxy.extraParams, {
  206. number: 1,
  207. size: 1000
  208. });
  209. }
  210. }
  211. },
  212. inoutkind:{
  213. fields:[
  214. {name: 'id', type: 'int'},
  215. {name: 'ft_kind', type: 'string'},
  216. {name: 'ft_name', type: 'string'}
  217. ],
  218. proxy: {
  219. type: 'ajax',
  220. url: '/api/document/fundinouttype/list',
  221. actionMethods: {
  222. read: 'GET'
  223. },
  224. reader: {
  225. type: 'json',
  226. rootProperty: 'data'
  227. },
  228. listeners: {
  229. exception: function(proxy, response, operation, eOpts) {
  230. if(operation.success) {
  231. if(response.timedout) {
  232. saas.util.BaseUtil.showErrorToast('请求超时');
  233. }
  234. }else {
  235. console.error('exception: ', response.responseJson);
  236. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  237. }
  238. }
  239. }
  240. },
  241. pageSize: null,
  242. autoLoad: false,
  243. listeners: {
  244. beforeload: function (store, op) {
  245. Ext.apply(store.proxy.extraParams, {
  246. number: 1,
  247. size: 1000
  248. });
  249. }
  250. }
  251. },
  252. warehouse: {
  253. fields:[
  254. {name: 'id', type: 'int'},
  255. {name: 'wh_code', type: 'string'},
  256. {name: 'wh_type', type: 'string'},
  257. {name: 'wh_description', type: 'string'},
  258. {name: 'wh_statuscode', type: 'string'},
  259. {name: 'wh_status', type: 'string'}
  260. ],
  261. proxy: {
  262. type: 'ajax',
  263. url: '/api/document/warehouse/list',
  264. actionMethods: {
  265. read: 'GET'
  266. },
  267. reader: {
  268. type: 'json',
  269. rootProperty: 'data.list'
  270. },
  271. listeners: {
  272. exception: function(proxy, response, operation, eOpts) {
  273. if(operation.success) {
  274. if(response.timedout) {
  275. saas.util.BaseUtil.showErrorToast('请求超时');
  276. }
  277. }else {
  278. console.error('exception: ', response.responseJson);
  279. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  280. }
  281. }
  282. }
  283. },
  284. pageSize: null,
  285. autoLoad: false,
  286. listeners: {
  287. beforeload: function (store, op) {
  288. Ext.apply(store.proxy.extraParams, {
  289. number: 1,
  290. size: 1000
  291. });
  292. }
  293. }
  294. },
  295. address: {
  296. fields:[
  297. {name: 'id', type: 'int'},
  298. {name: 'ad_address', type: 'string'}
  299. ],
  300. proxy: {
  301. type: 'ajax',
  302. url: '/api/document/address/list',
  303. actionMethods: {
  304. read: 'GET'
  305. },
  306. reader: {
  307. type: 'json',
  308. rootProperty: 'data'
  309. },
  310. listeners: {
  311. exception: function(proxy, response, operation, eOpts) {
  312. if(operation.success) {
  313. if(response.timedout) {
  314. saas.util.BaseUtil.showErrorToast('请求超时');
  315. }
  316. }else {
  317. console.error('exception: ', response.responseJson);
  318. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  319. }
  320. }
  321. }
  322. },
  323. pageSize: null,
  324. autoLoad: false,
  325. listeners: {
  326. beforeload: function (store, op) {
  327. Ext.apply(store.proxy.extraParams, {
  328. number: 1,
  329. size: 1000
  330. });
  331. }
  332. }
  333. },
  334. accountinformation: {
  335. fields:[
  336. {name: 'id', type: 'int'},
  337. {name: 'rl_name', type: 'string'}
  338. ],
  339. proxy: {
  340. type: 'ajax',
  341. url: '/api/account/account/accountRole/list',
  342. actionMethods: {
  343. read: 'GET'
  344. },
  345. reader: {
  346. type: 'json',
  347. rootProperty: 'data'
  348. },
  349. listeners: {
  350. exception: function(proxy, response, operation, eOpts) {
  351. if(operation.success) {
  352. if(response.timedout) {
  353. saas.util.BaseUtil.showErrorToast('请求超时');
  354. }
  355. }else {
  356. console.error('exception: ', response.responseJson);
  357. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  358. }
  359. }
  360. }
  361. },
  362. pageSize: null,
  363. autoLoad: false,
  364. listeners: {
  365. beforeload: function (store, op) {
  366. Ext.apply(store.proxy.extraParams, {
  367. number: 1,
  368. size: 1000
  369. });
  370. }
  371. }
  372. },
  373. employee:{
  374. fields:[
  375. {name: 'id', type: 'int'},
  376. {name: 'em_code', type: 'string'},
  377. {name: 'em_mobile', type: 'string'},
  378. {name: 'em_email', type: 'string'},
  379. {name: 'em_clasee', type: 'string'}
  380. ],
  381. proxy: {
  382. type: 'ajax',
  383. url: '/api/document/employee/list',
  384. actionMethods: {
  385. read: 'GET'
  386. },
  387. reader: {
  388. type: 'json',
  389. rootProperty: 'data.list'
  390. },
  391. listeners: {
  392. exception: function(proxy, response, operation, eOpts) {
  393. if(operation.success) {
  394. if(response.timedout) {
  395. saas.util.BaseUtil.showErrorToast('请求超时');
  396. }
  397. }else {
  398. console.error('exception: ', response.responseJson);
  399. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  400. }
  401. }
  402. }
  403. },
  404. pageSize: null,
  405. autoLoad: false,
  406. listeners: {
  407. beforeload: function (store, op) {
  408. Ext.apply(store.proxy.extraParams, {
  409. number: 1,
  410. size: 1000
  411. });
  412. }
  413. }
  414. },
  415. productunit: {
  416. fields:[
  417. {name: 'id', type: 'int'},
  418. {name: 'pu_name', type: 'string'}
  419. ],
  420. proxy: {
  421. type: 'ajax',
  422. url: '/api/document/productunit/list',
  423. actionMethods: {
  424. read: 'GET'
  425. },
  426. reader: {
  427. type: 'json',
  428. rootProperty: 'data'
  429. },
  430. listeners: {
  431. exception: function(proxy, response, operation, eOpts) {
  432. if(operation.success) {
  433. if(response.timedout) {
  434. saas.util.BaseUtil.showErrorToast('请求超时');
  435. }
  436. }else {
  437. console.error('exception: ', response.responseJson);
  438. saas.util.BaseUtil.showErrorToast('查询失败:' + response.responseJson.message);
  439. }
  440. }
  441. }
  442. },
  443. pageSize: null,
  444. autoLoad: false,
  445. listeners: {
  446. beforeload: function (store, op) {
  447. Ext.apply(store.proxy.extraParams, {
  448. number: 1,
  449. size: 1000
  450. });
  451. }
  452. }
  453. }
  454. }
  455. });