Ext.define('saas.view.sys.config.FormPanel', { extend: 'Ext.form.Panel', xtype: 'sys-config-formpanel', controller: 'sys-config-formpanel', viewModel: 'sys-config-formpanel', //工具类 FormUtil: Ext.create('saas.util.FormUtil'), BaseUtil: Ext.create('saas.util.BaseUtil'), //字段属性 _idField: 'id', _readUrl:'/api/commons/enterprise/read', _saveUrl:'/api/commons/enterprise/save', //基础属性 frame:true, initId: 0, layout: 'vbox', autoScroll: true, border: 1, bodyPadding: 5, fieldDefaults: { margin: '0 5 5 30', labelAlign: 'right', labelWidth: 90, width:300, blankText: '该字段不能为空' }, tbar:{ style: { 'border-bottom': '1px solid #35baf6 !important' }, frame:true, items:['->',{ text:'保存', formBind:true, name:'save' }] }, items: [{ bind:'{companyId}', xtype: 'hidden', name: 'companyId', fieldLabel: 'id', allowBlank: true, width:600 },{ bind:'{en_name}', xtype: 'textfield', name: 'en_name', fieldLabel: '公司名称', allowBlank: true, editable:false, readOnly:true, width:600 },{ bind:'{en_address}', xtype: 'textfield', name: 'en_address', fieldLabel: '公司地址', allowBlank: false, width:600 },{ bind:'{en_tel}', xtype: 'textfield', name: 'en_tel', fieldLabel: '电话', allowBlank: false, columnWidth: 0.25 },{ bind:'{en_fax}', xtype: 'textfield', name: 'en_fax', fieldLabel: '传真', allowBlank: true, columnWidth: 0.5 },{ bind:'{en_begindate}', xtype : "datefield", name : "en_begindate", format:'Y-m-d H:i:s', fieldLabel : "开账日期", allowBlank : true, editable:false, hideTrigger:true, readOnly:true },{ bind:'{en_pricemethod}', displayField : "display", editable:false, hideTrigger : false, maxLength : 100.0, minValue : null, queryMode : "local", valueField : "value", xtype : "combo", store:{ fields: ['display', 'value'], data : [ {"display":"加权平均法", "value":'1'}, {"display":"先进先出法", "value":'0'} ] }, name : "en_pricemethod", fieldLabel : "库存计算方式", allowBlank : false, columnWidth : 0.25 },{ bind:'{en_signet}', xtype : "textfield", name : "en_signet", fieldLabel : "打印章上传", allowBlank : true, editable:false, columnWidth : 0.25 },{ ignore:true, bind:'{updateTime}', xtype : "datefield", name : "updateTime", fieldLabel : "更新时间", allowBlank : true, hideTrigger:true, format:'Y-m-d H:i:s', editable:false, readOnly:true, columnWidth : 0.25 }], initComponent: function () { var me = this, viewModel = me.getViewModel(); var url = me._readUrl; me.BaseUtil.request({url }) .then(function(res) { if(res.success) { var d = res.data; viewModel.setData(d) } }) .catch(function(response) { console.error(response); }); me.callParent(arguments); } });