Ext.define('saas.view.sys.config.FormPanel', {
extend: 'Ext.form.Panel',
xtype: 'sys-config-formpanel',
controller: 'sys-config-formpanel',
viewModel: 'sys-config-formpanel',
//字段属性
_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: '该字段不能为空'
},
bbar:{
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: '公司地址',
beforeLabelTextTpl : "*",
allowBlank: false,
width:600
},{
bind:'{en_tel}',
xtype: 'textfield',
name: 'en_tel',
fieldLabel: '电话',
beforeLabelTextTpl : "*",
allowBlank: false,
width:500
},{
bind:'{en_fax}',
xtype: 'textfield',
name: 'en_fax',
fieldLabel: '传真',
allowBlank: true,
width:500
},{
bind:'{en_begindate}',
xtype : "datefield",
name : "en_begindate",
format:'Y-m-d H:i:s',
fieldLabel : "开账日期",
allowBlank : true,
editable:false,
hideTrigger:true,
readOnly:true,
width:500
},{
bind:'{en_pricemethod}',
displayField : "display",
editable:false,
hideTrigger : false,
maxLength : 100.0,
width:500,
minValue : null,
queryMode : "local",
valueField : "value",
xtype : "combo",
value:'WACC',
store:{
fields: ['display', 'value'],
data : [
{"display":"加权平均法", "value":'WACC'},
{"display":"先进先出法", "value":'FIFO'}
]
},
name : "en_pricemethod",
beforeLabelTextTpl : "*",
fieldLabel : "库存计算方式",
allowBlank : false,
},{
bind:'{en_signet}',
name : "en_signet",
fieldLabel : "打印章上传",
allowBlank : false,
width:500,
xtype: 'filefield',
beforeLabelTextTpl : "*",
emptyText: '请选择图片',
buttonText: '',
buttonConfig: {
iconCls: 'x-fa fa-picture-o'
}
},{
bind:'{en_logo}',
name : "en_logo",
fieldLabel : "Logo上传",
allowBlank : false,
width:500,
xtype: 'filefield',
beforeLabelTextTpl : "*",
emptyText: '请选择图片',
buttonText: '',
buttonConfig: {
iconCls: 'x-fa fa-picture-o'
}
},{
ignore:true,
bind:'{updateTime}',
xtype : "datefield",
name : "updateTime",
fieldLabel : "更新时间",
allowBlank : true,
hideTrigger:true,
format:'Y-m-d H:i:s',
editable:false,
readOnly:true,
width:500,
}],
initComponent: function () {
var me = this,
viewModel = me.getViewModel();
var url = me._readUrl;
saas.util.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);
},
refresh:function(){
this.ownerCt.setTitle('参数设置')
}
});