guestdetailform.js
来自「一个使用ssh+ext的例子。 希望对开发这个应用的人带来好处。仔细研究里面的」· JavaScript 代码 · 共 587 行 · 第 1/2 页
JS
587 行
Ext.namespace("Neo");
Ext.namespace("Neo.frontdesk");
Neo.frontdesk.GuestDetailForm = function(){
Neo.frontdesk.GuestDetailForm.superclass.constructor.call(this);
}
Neo.frontdesk.GuestDetailForm = Ext.extend(Ext.FormPanel,{
title: '客人详细信息'
,frame:true
,border:false
,labelWidth: 70
,initComponent: function(){
function timeFormat(val){
var date = val.split(' ');
return date[0];
}
var ds = new Ext.data.Store({
url: 'guestctrl.htm?action=dealGuestHistoryQueryRequest'
,reader: new Ext.data.JsonReader({
totalProperty: "totalSize"
,root: "data"
,fields:[
,'balancementId'
,'balancementTime'
,'balancementExpenses'
,'balancementResult'
]
})
});
Ext.apply(this,{
buttons:[
{
id:'addBtn'
,hidden:false
,text:'添加'
,iconCls:'icon-checkin'
}
,{
id:'modifyBtn'
,hidden:true
,disabled:true
,iconCls:'icon-edit'
,text:'修改'
}
,{
id:'cancelBtn'
,hidden:false
,iconCls:'icon-redo'
,text:'重置'
}
,{
id:'checkBtn'
,hidden:false
,iconCls:'icon-save'
,text:'保存数据'
}
]
,items:[
{
xtype: 'fieldset'
,autoHeight:true
,collapsible: true
,title:'客人详细信息'
,items:[
{
layout:'column'
,items:[
{
xtype:'textfield'
,name: 'gtId'
,id: 'guestId' + this.id
,hidden:true
}
,{
columnWidth:.50
,layout:'form'
,labelWidth: 40
,border:false
,items:[
{
fieldLabel: '姓名'
,xtype:'textfield'
,name: 'gtName'
,id: 'guestName' + this.id
,allowBlank: false
,anchor:'95%'
}
,{
fieldLabel:'证件号'
,xtype:'numberfield'
,name:'gtCardId'
//,emptyText:'此项为必填项'
,vtype:'chinaCardId'
,id:'guestCardId' + this.id
,allowBlank:false
,anchor:'95%' //nessasary
//,vtype:'chinaCardId'
},
{
fieldLabel:'国籍'
,xtype:'textfield'
,name:'gtCountry'
,id:'guestCountry' + this.id
,allowBlank:false
,anchor:'95%' //nessasary
//,vtype:'chinaCardId'
}
]
}
,{
columnWidth:.48
,layout:'form'
,labelWidth: 60
,border:false
,items:[
{
fieldLabel:'性别'
,xtype:'combo'
,name:'gtGender'
,id:'guestGender' + this.id
,allowBlank:false
//,emptyText:'此项为必填项'
,anchor:'95%' //nessasary
,displayField:'gtGender'
,mode:'local'
,editable:false
,triggerAction: 'all'
,store:new Ext.data.SimpleStore({
fields:['gtGender']
,data:[
['男'],['女'],['保密']
]
})
}
,{
fieldLabel: '证件类型'
,xtype:'combo'
,name: 'gtCardCatalog'
//,emptyText:'此项为必填项'
,id:'cardCatalog' + this.id
,allowBlank: false
,anchor:'95%'
,displayField:'gtCardCatalog'
,mode:'local'
,triggerAction: 'all' //需加
,editable:false
,store:new Ext.data.SimpleStore({
fields:['gtCardCatalog']
,data:[
['身份证'],['学生证'],['军官证']
,['警官证'],['士兵证'],['驾照']
,['护照'],['户口薄'],['其他']
]
})
}
,{
fieldLabel: '客人类型'
,xtype:'combo'
,name: 'gtType'
,id:'guestType' + this.id
,allowBlank: false
// ,emptyText:'此项为必填项'
,anchor:'95%'
,displayField:'gtType'
,mode:'local'
,triggerAction: 'all' //需加
,editable:false
,store:new Ext.data.SimpleStore({
fields:['gtType']
,data:[
['普通客人'],['会员'],['贵宾']
,['协议单位']
]
})
}
]
}
]
}
,{ //邮编,电话
layout:'column'
,items:[
{
columnWidth:.45
,layout:'form'
,labelWidth: 60
,border:false
,items:[
{
fieldLabel:'邮编'
,xtype:'numberfield'
,name:'gtZip'
,id:'guestZip' + this.id
,anchor:'95%' //nessasary
//,vtype:'chinaCardId'
}
]
}
,{
columnWidth:.54
,layout:'form'
,labelWidth: 60
,border:false
,items:[
{
fieldLabel: '电话号码'
,xtype:'numberfield'
,name: 'gtTelphone'
,id:'guestTelphone' + this.id
,anchor:'95%'
}
]
}
]
}
,{ //手机号码,Email
layout:'column'
,items:[
{
columnWidth:.45
,layout:'form'
,labelWidth: 60
,border:false
,items:[
{
fieldLabel:'手机号码'
,xtype:'numberfield'
,name:'gtMobile'
,id:'guestMobile' + this.id
,anchor:'95%' //nessasary
//,vtype:'chinaCardId'
}
]
}
,{
columnWidth:.54
,layout:'form'
,labelWidth: 60
,border:false
,items:[
{
fieldLabel: 'Email'
,xtype:'textfield'
,name: 'gtEmail'
,id:'guestEmail' + this.id
,vtype:'email'
,anchor:'95%'
}
]
}
]
}
,{ //家庭住址
columnWidth:.41
,border:false
,layout: 'form'
,labelWidth: 60
,items:[
{
xtype:'textfield'
,fieldLabel: '家庭住址'
,name: 'gtAddress'
,id:'guestAddr' + this.id
,anchor:'95%'
}
]
}
,{ //工作地址
columnWidth:.41
,border:false
,layout: 'form'
,labelWidth: 60
,items:[
{
xtype:'textfield'
,fieldLabel: '工作单位'
,name: 'gtCompany'
,id:'guestCompany' + this.id
,anchor:'95%'
}
]
}
]
}
,{//2
xtype: 'fieldset'
,autoHeight:true
,collapsible: true
,title:'客史资料'
,items:[
{
id:'guestHistory' + this.id
,title:'请选择要查询的用户'
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?