Ext.define('saas.view.document.customer.BasePanel', { extend: 'saas.view.core.base.BasePanel', xtype: 'document-customer-basepanel', controller: 'document-customer-basepanel', viewModel: 'document-customer-basepanel', deleteMoreMsg: '删除的客户资料将不能恢复,请确认是否删除?', deleteOneMsg: '删除的客户资料将不能恢复,请确认是否删除?', searchField:[{ xtype : "textfield", name : "cu_name", width:150, emptyText:'客户编号或名称', getCondition: function(value) { return ' (cu_code like\'%' + value + '%\'' +' or cu_name like \'%'+value+'%\' ) '; } },{ xtype : "remotecombo", storeUrl:'/api/document/customerkind/getCombo', name : "cu_type", emptyText : "类型", width:110, hiddenBtn:true },{ xtype: 'combobox', name: 'cu_statuscode', queryMode: 'local', displayField: 'cu_status', valueField: 'cu_statuscode', emptyText :'状态', editable:false, width:90, store: Ext.create('Ext.data.ArrayStore', { fields: ['cu_statuscode', 'cu_status'], data: [ ["ALL", "全部"], ["OPEN", "已开启"], ["CLOSE", "已关闭"] ] }), getCondition: function(value) { if(value == 'ALL'||value==null) { return '1=1'; }else { return 'cu_statuscode=\'' + value + '\''; } } },{ xtype : "textfield", name : "cu_sellername", emptyText : "业务员", width:110 }], //字段属性 caller:'Customer', _formXtype:'document-customer-formpanel', _title:'客户资料', _deleteUrl:'/api/document/customer/delete', _batchOpenUrl:'/api/document/customer/batchOpen', _batchCloseUrl:'/api/document/customer/batchClose', _batchDeleteUrl:'/api/document/customer/batchDelete', gridConfig: { idField: 'id', codeField: 'cu_code', statusCodeField:'cu_statuscode', dataUrl: '/api/document/customer/list', columns : [ { text : "客户id", hidden:true, dataIndex : "id", xtype : "numbercolumn", },{ text : "客户编号", width : 150.0, dataIndex : "cu_code" }, { text : "客户名称", width : 250.0, dataIndex : "cu_name" }, { text : "状态", dataIndex : "cu_status", width : 90.0 }, { text : "类型", dataIndex : "cu_type", width : 110.0 }, { text : "税率", dataIndex : "cu_taxrate", xtype: 'numbercolumn', width : 110.0, renderer : function(v) { return Ext.util.Format.number(v, '0'); } }, { text : "结算天数", xtype: 'numbercolumn', dataIndex : "cu_promisedays", renderer : function(v) { return Ext.util.Format.number(v, '0'); } }, { text: '应收余额', xtype: 'numbercolumn', dataIndex: 'cu_leftamount', width: 120, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(); return Ext.util.Format.number(v, format); } }, { text : "业务员", dataIndex : "cu_sellername", width: 110 }, { text : "备注", dataIndex : "cu_text1", width: 250 }] }, refresh:function(){ this.items.items[0].store.load() } });