/** * Created by zhouy on 2018/10/18. */ Ext.define('saas.view.document.kind.Kind', { extend: 'Ext.panel.Panel', xtype: 'document-kind', autoScroll: true, layout:'fit', controller:'document-kind', viewModel: { type: 'document-kind' }, defaultType:'', requires: [ 'Ext.button.Segmented' ], tbar: [{ xtype: 'segmentedbutton', reference: 'dataKind', value: 'customerkind', name : 'segmentedbutton', bind:'{segmented}', items: [{ name:'customerkind', text: '客户', value: 'customerkind', typeText:'客户类型' }, { name:'vendorkind', text: '供应商', value: 'vendorkind', typeText:'供应商类型' }, { name:'productkind', text: '物料', value: 'productkind', typeText:'物料类型' }, { name:'inoutkind', text: '收支', value: 'inoutkind', typeText:'收支类别' }], listeners: { toggle: 'onKindToggle' } },'->', { xtype:'button', text:'新增', listeners: { click: 'onAdd' } },{ xtype:'button', text:'刷新', listeners: { click: 'onRefresh' } }], items:[{ xtype:'grid', reference: 'document-kind-Grid', margin: '10 0 0 0', flex: 1, frame:true, plugins: [{ ptype: 'menuclipboard' }], bind:{ selection: '{selectedCompany}' }, listeners:{ render:'loadDefualt' } }], etc:{ customerkind:{ columns: [{ text: '客户类型', dataIndex: 'ck_name', flex: 1 }], keyField:'id', reqUrl:'/api/document/customerkind/save', delUrl:'/api/document/customerkind/delete' }, vendorkind:{ columns: [{ text: '供应商类型', dataIndex: 'vk_name', flex: 1 }], keyField:'id', reqUrl:'/api/document/vendorkind/save', delUrl:'/api/document/vendorkind/delete' }, productkind:{ columns: [{ text: '物料类型', dataIndex: 'pt_name', flex: 1 }], keyField:'id', reqUrl:'/api/document/producttype/save', delUrl:'/api/document/producttype/delete' }, inoutkind:{ columns: [{ text: '收支名称', dataIndex: 'ft_name', flex: 1 },{ text: '收支类别', dataIndex: 'ft_kind', flex: 1 }], keyField:'id', reqUrl: '/api/document/fundinouttype/save', delUrl: '/api/document/fundinouttype/delete' }, maxnumbers:{ columns: [{ text : "单据名称", width : 200.0, dataIndex : "mn_caller" }, { text : "单据前缀", dataIndex : "mn_leadcode", width : 150.0 }, { text : "单据规则", dataIndex : "mn_rule", width : 250.0 },{ text : "流水长度", dataIndex : "mn_number", width : 90.0, xtype: 'numbercolumn', }], keyField:'id', reqUrl:'/api/commons/number/save' }, personpower:{ columns: [ { text : "编号", dataIndex : "code", width : 150.0, xtype : "", },{ text : "角色名称", width : 200.0, dataIndex : "name", xtype : "", }, { text : "角色描述", dataIndex : "description", width : 250.0 } ], keyField:'id', reqUrl:'/api/account/role/save', updateUrl:'/api/account/role/update', }, accountinformation:{ columns:[{ dataIndex:'accountId', },{ dataIndex: 'roleNames', width: 150 },{ dataIndex: 'mobile', width: 110 },{ dataIndex: 'email', width: 110 }], reqUrl:'/api/account/account/bind/roles', }, accountadd:{ columns:[{ dataIndex:'realname', },{ dataIndex: 'mobile', },{ dataIndex: 'email', }], reqUrl: '/api/account/account/register/add', } }, refresh:function(){ var me = this; var grid = me.items.items[0]; var button = grid.ownerCt.dockedItems.items[0].down('[name='+grid.ownerCt.ownerCt.viewConfig+']'); if(button&&button.xtype!="tbfill"){ button.click(); me.ownerCt.setTitle(button.typeText + '查询'); } } })