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', searchField:[{ xtype : "textfield", name : "cu_code", emptyText : "客户编号", width:90, },{ xtype : "textfield", name : "cu_name", emptyText : "客户名称", width:90, },{ editable:false, hiddenBtn:true, xtype : "remotecombo", storeUrl:'/api/document/customerkind/getCombo', name : "cu_type", emptyText : "客户类型", width:120, },{ xtype : "textfield", name : "cu_sellername", emptyText : "业务员", width:120, },{ xtype : "textfield", name : "cu_promisedays", emptyText : "承付天数", width:120, getCondition: function(value) { if(value.indexOf("=")>=0||value.indexOf("<")>=0||value.indexOf(">")>=0){ return ' cu_promisedays ' + value; }else if(value){ return ' cu_promisedays = ' + value; }else{ return '1=1'; } } },{ xtype : "textfield", name : "cu_credit", emptyText : "额度", width:70, dataIndex : "cu_credit", getCondition: function(value) { if(value.indexOf("=")>=0||value.indexOf("<")>=0||value.indexOf(">")>=0){ return ' cu_credit ' + value; }else if(value){ return ' cu_credit = ' + value; }else{ return '1=1'; } } },{ xtype: 'combobox', name: 'cu_statuscode', queryMode: 'local', displayField: 'cu_status', valueField: 'cu_statuscode', emptyText :'状态', editable:false, width:100, 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 + '\''; } } }], //字段属性 _formXtype:'document-customer-formpanel', _title:'客户资料', _deleteUrl:'/api/document/customer/delete/', // _dataUrl:'/api/ducument/customer/list', _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 : 200.0, dataIndex : "cu_code", }, { text : "客户名称", dataIndex : "cu_name" }, { text : "客户UU", dataIndex : "cu_uu" }, { text : "类型", dataIndex : "cu_type" }, { text : "业务员编号", dataIndex : "cu_sellercode" }, { text : "业务员", dataIndex : "cu_sellername" },{ text : "税率", dataIndex : "cu_taxrate", xtype: 'numbercolumn' }, { text: '应收款余额', dataIndex: 'cu_leftamount', width: 120, xtype: 'numbercolumn' }, { text : "承付天数", xtype: 'numbercolumn', dataIndex : "cu_promisedays", renderer : function(v) { return Ext.util.Format.number(v, '0'); } }, { text : "额度", xtype: 'numbercolumn', dataIndex : "cu_credit", renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length)).fill('0'); var format = '0,000.' + xr.join(); return Ext.util.Format.number(v, format); } }, { text : "开户银行", dataIndex : "cu_bankaccount" },{ text : "银行账户", dataIndex : "cu_bankcode" },{ text : "客户状态", dataIndex : "cu_status", }, { text : "客户状态码", dataIndex : "cu_statuscode", hidden:true }, { text : "默认客户地址", dataIndex : "ca_address", hidden:true }, { text : "默认客户联系人", dataIndex : "cc_name", hidden:true }] }, refresh:function(){ this.items.items[0].store.load() } });