checkinform.js
来自「一个使用ssh+ext的例子。 希望对开发这个应用的人带来好处。仔细研究里面的」· JavaScript 代码 · 共 893 行 · 第 1/2 页
JS
893 行
Ext.namespace("Neo");
Ext.namespace("Neo.frontdesk");
/*Neo.frontdesk.CheckInForm = function(){
Neo.frontdesk.CheckInForm.superclass.constructor.call(this);
}*/
Neo.frontdesk.CheckInForm = Ext.extend(Ext.FormPanel,{
title:'登记信息'
,bodyStyle:'padding:5px 5px 0'
//,labelAlign: 'top'
,width: 300
//,border:false
,frame:true
,waitMsgTarget: true
//,autoscroll:true
//,defaultType: 'textfield'
//,width:300
,infoState:'init'
/*,reader:new Ext.data.JsonReader({
successProperty:'success'
,root:'checkinInfo'
,id:'cioInDateTime'
}
, Ext.data.Record.create([
'cioInDateTime', 'daysNumber', 'cioPreOutDateTime'
,'cioGuestType','cioManNumber','cioGuestName','cioGuestGender'
,'cioGuestCardId','cioGuestCardCatalog','cioBedRate','cioTotalRate'
,'cioPaymentModel','cioPaidMoney'
])
)*/
,initComponent: function(){
var Rooms=Ext.data.Record.create([
'rmArea'
,{name:'rmAvailable',type:'boolean'}
,'rmFloor','rmId'
,{name:'rmPrctPrice',type:'float'}
,{name:'rmState',type:'int'}
,'rmTelphone'
,'rmCatalog'
,'roomInfoStateAsColor'
,'rmPicture'
]);
Ext.apply(this,{
buttons:[
{
id:'checkinBtn'
,disabled:true
,text:'登记'
,iconCls:'icon-checkin'
}
,{
id:'checkoutBtn'
,disabled:true
,text:'结账'
,iconCls:'icon-checkout'
}
,{
id:'checkinResetBtn'
,disabled:true
,text:'重置'
,iconCls:'icon-redo'
}
]
,items:[
{
xtype: 'fieldset'
//,bodyStyle:'padding:5px 5px 0'
,autoHeight:true //nessasary
,collapsible: true
,title: '登记信息'
,items:[
{
layout:'column'
,labelAlign: 'top'
,labelWidth: 70
,items:[
{
columnWidth:.8
,border:false
,layout: 'form'
,items: [
{
xtype:'xdatetime'
,timeWidth:70
,name: 'cioInDateTime'
,id:'cioInDateTime'
,fieldLabel: '登记时间'
,dateFormat:'Y-m-d'
,value:new Date().format('Y-m-d')
,anchor:'95%' //nessasary
,allowBlank: false
}
]
}
,{
columnWidth:.2
,border:false
,layout: 'form'
,items:[
{
xtype:'textfield'
,fieldLabel: '天数'
,name: 'daysNumber'
,id:'daysNumber'
,value:'1'
,maxLength:'3'
,maxLengthText:'数值超出正常值,请检查后重新输入数'
,vtype:'numeric'
,anchor:'95%'
}
]
}
]
}
,{
layout:'column'
,labelAlign: 'top'
,labelWidth: 70
,items:[
{
columnWidth:.8
,border:false
,layout: 'form'
,items: [
{
xtype:'xdatetime'
,timeWidth:70
,fieldLabel: '离店时间'
,dateFormat:'Y-m-d'
//,value:new Date().add(Date.DAY,1).format('Y-m-d')
,id:'cioPreOutDateTime'
,name: 'cioPreOutDateTime'
,anchor:'95%' //nessasary
,allowBlank: false
}
]
}
]
}
,{
layout:'column'
,labelAlign: 'left'
,items:[
{
columnWidth:.7
,border:false
,layout: 'form'
,labelWidth: 60
,items: [
{
xtype:'combo'
,fieldLabel: '客人类型'
,name: 'cioGuestType'
,id:'cioGuestType'
,anchor:'95%' //nessasary
,allowBlank: false
,displayField:'cioGuestType'
,mode:'local'
,editable:false
,triggerAction: 'all'
,value:'普通客人'
,store:new Ext.data.SimpleStore({
fields:['cioGuestType']
,data:[
['普通客人'],['会员'],['贵宾']
,['协议单位']
]
})
}
]
}
,{
columnWidth:.3
,border:false
,layout: 'form'
,labelWidth: 30
,items:[
{
xtype:'textfield'
,fieldLabel: '人数'
,name: 'cioManNumber'
,id:'cioManNumber'
,anchor:'95%'
,vtype:'numeric'
,value:'2'
,maxLength:'4'
,maxLengthText:'数值超出正常值,请检查后重新输入'
,allowBlank: false
}
]
}
]
}
]
}
,{
xtype: 'fieldset'
,autoHeight:true
,collapsible: true
,title:'客人资料'
,items:[
{
layout:'column'
,items:[
{
columnWidth:.55
,layout:'form'
,labelWidth: 40
,border:false
,items:[
{
fieldLabel: '姓名'
,xtype:'textfield'
,name: 'cioGuestName'
,id: 'cioGuestName'
,allowBlank: false
,anchor:'95%'
}
]
}
,{
columnWidth:.45
,layout:'form'
,labelWidth: 60
,border:false
,items:[
{
fieldLabel:'性别'
,xtype:'combo'
,name:'cioGuestGender'
,id:'cioGuestGender'
,allowBlank:false
,anchor:'95%' //nessasary
,displayField:'cioGuestGender'
,mode:'local'
,editable:false
,value:'男'
,triggerAction: 'all'
,store:new Ext.data.SimpleStore({
fields:['cioGuestGender']
,data:[
['男'],['女']
]
})
}
]
}
]
}
,{
layout:'column'
,items:[
{
columnWidth:.55
,layout:'form'
,labelWidth: 40
,border:false
,items:[
{
fieldLabel:'证件号'
,xtype:'textfield'
,name:'cioGuestCardId'
,id:'cioGuestCardId'
,allowBlank:false
,vtype:'chinaCardId'
,anchor:'95%' //nessasary
}
]
}
,{
columnWidth:.45
,layout:'form'
,labelWidth: 60
,border:false
,items:[
{
fieldLabel: '证件类型'
,xtype:'combo'
,name: 'cioGuestCardCatalog'
,id:'cioGuestCardCatalog'
,allowBlank: false
,anchor:'95%'
,displayField:'cioGuestCardCatalog'
,mode:'local'
,value:'身份证'
,triggerAction: 'all' //需加
,editable:false
,store:new Ext.data.SimpleStore({
fields:['cioGuestCardCatalog']
,data:[
['身份证'],['学生证'],['军官证']
,['警官证'],['士兵证'],['驾照']
,['护照'],['户口薄'],['其他']
]
})
}
]
}
]
}
]
}
,{//2
xtype: 'fieldset'
,autoHeight:true
,collapsible: true
,title:'费用信息'
,items:[
{
id:'roomsSlected'
,title:'已选择房间'
,xtype:'editorgrid'
,anchor:'100%'
,frame:true
,height:150
,scrollOffset:5
,store:new Ext.data.JsonStore({
url:'checkin.htm?action=findCheckinRooms'
,totalProperty:'totalCount'
,root:'rooms'
,baseParams:{start:0, limit:10}
,fields:[
,'rmId'
,{name:'rmPrctPrice',type:'float'}
,{name:'rmState',type:'int'}
,'rmCatalog'
,'rmPrctDiscount' //Room的预设折扣
,'rmSetPrctDiscount' //Room的实际折扣
,'rmSetPrctPrice' //Room的实际价格
]
})
,columns:[
{id:'rooms',header:'房间',width:50,sortable:true,dataIndex:'rmId'}
,{header:'类型',width:50,sortable:true,dataIndex:'rmCatalog'}
,{header:'预设价',width:60,sortable:true,dataIndex:'rmPrctPrice'}
,{header:'折扣',width:50,sortable:true,dataIndex:'rmSetPrctDiscount'
,editor: new Ext.form.NumberField({
allowBlank: false
,allowNegative: false
,selectOnFocus:true
,maxValue: 100
,minValue:1
})}
,{header:'实际价',width:60,sortable:true,dataIndex:'rmSetPrctPrice'
,editor: new Ext.form.NumberField({
allowBlank: false
,allowNegative: true
,maxValue: 1000000000000
,selectOnFocus:true
})}
]
}
,{
layout:'column'
,frame:true
,items:[
{
columnWidth:.50
,layout:'form'
,labelWidth: 53
,border:false
,items:[
{
fieldLabel:'加床费'
,xtype:'textfield'
,vtype:'money'
,name:'cioBedRate'
,id:'cioBedRate'
,value:'0'
,anchor:'95%' //nessasary
,maxLength:'10'
,maxLengthText:'数值超出正常值,请检查后重新输入'
}
,{
fieldLabel:'总费用'
,xtype:'textfield'
,name:'cioTotalRate'
,id:'cioTotalRate'
,vtype:'money'
,value:'0'
,allowBlank:false
,anchor:'95%' //nessasary
,maxLength:'12'
,maxLengthText:'数值超出正常值,请检查后重新输入'
}
,{
fieldLabel:'营业员'
,xtype:'textfield'
,name:'cioOperator'
,id:'cioOperator'
,value:'Admin'//待读取
,allowBlank:false
,readOnly:true
,disabled:true
,anchor:'95%'
}
]
}
,{
columnWidth:.50
,layout:'form'
,labelWidth: 53
,border:false
,items:[
{
fieldLabel:'付款方式'
,xtype:'combo'
,name:'cioPaymentModel'
,id:'cioPaymentModel'
,allowBlank:false
,anchor:'95%' //nessasary
,displayField:'cioPaymentModel'
,mode:'local'
,value:'现金'
,editable:false
,triggerAction: 'all'
,store:new Ext.data.SimpleStore({
fields:['cioPaymentModel']
,data:[
['现金'],['信用卡'],['支票']
,['其他']
//,['签单帐户'],['免费'],['贵宾卡']
//,['会员储值卡']
]
})
}
,{
fieldLabel:'预付金'
,xtype:'textfield'
,name:'cioPaidMoney'
,id:'cioPaidMoney'
,vtype:'money'
,allowBlank:false
,anchor:'95%' //nessasary
,maxLength:'12'
,value:'0'
,maxLengthText:'数值超出正常值,请检查后重新输入'
}
,{
fieldLabel:'登记单号'
,xtype:'textfield'
,name:'cioOrderId'
,id:'cioOrderId'
,emptyText:'登记后生成'
,disabled:true
,allowBlank:false
,readOnly:true
,anchor:'95%'
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?