12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- /**
- * Created by zhouy on 2018/10/18.
- */
- Ext.define('trade.saas.view.document.warehouse.DataListModel', {
- extend: 'Ext.app.ViewModel',
- alias: 'viewmodel.document-warehouse-datalist',
- stores: {
- warehouse: {
- fields:[
- {name: 'id', type: 'int'},
- {name: 'wh_code', type: 'string'},
- {name: 'wh_type', type: 'string'},
- {name: 'wh_description', type: 'string'},
- {name: 'wh_statuscode', type: 'string'},
- {name: 'wh_status', type: 'string'}
- ],
- proxy: {
- type: 'ajax',
- url: '/api/document/warehouse/list',
- actionMethods: {
- read: 'GET'
- },
- reader: {
- type: 'json',
- rootProperty: 'data.list'
- },
- listeners: {
- exception: function(proxy, response, operation, eOpts) {
- if(operation.success) {
- if(response.timedout) {
- saas.util.BaseUtil.showErrorToast('请求超时');
- }
- }else {
- console.error('exception: ', response);
- saas.util.BaseUtil.showErrorToast('查询失败:' + (response.responseJson?response.responseJson.message:'请求超时'));
- }
- }
- }
- },
- pageSize: null,
- autoLoad: false,
- listeners: {
- beforeload: function (store, op) {
- Ext.apply(store.proxy.extraParams, {
- number: 1,
- size: 1000
- });
- }
- }
- }
- }
- });
|