1
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 <%@ taglib prefix="s" uri="/struts-tags" %> 3 4 5 6 7 8 9 10 15 26 27 28 29
2.
1 SalaryPanel = Ext.extend(Ext.Panel,{ 2 id: 'salaryPanelId', 3 constructor: function(){ 4 SalaryPanel.superclass.constructor.call(this, { 5 items: [{ 6 html: '' 7 }], 8 tbar: new Ext.Toolbar({ 9 items: ['员工工号',{10 xtype: 'textfield',11 id: 'report_empId',12 width: 80,13 listeners: {'blur': blurFn2}14 },'年份',{15 xtype: 'textfield',16 width: 80,17 id: 'year'18 },'月份',{19 xtype: 'combo',20 mode: 'local',21 editable: false,22 store: new Ext.data.SimpleStore({23 fields: ['name','value'],24 data: [[0,"全部"],[1,"一月"],[2,"二月"],[3,"三月"],[4,"四月"],[5,"五月"],25 [6,"六月"],[7,"七月"],[8,"八月"],[9,"九月"],[10,"十月"],[11,"十一月"],26 [12,"十二月"]]27 }),28 id: 'month',29 width: 70,30 triggerAction: 'all',31 displayField: 'value',32 valueField: 'name'33 },{34 text: '工资单预览',35 handler: this.viewFn36 },'-',{37 text: '工资单导出',38 handler: this.exportFn 39 }]40 })41 })42 },43 viewFn: function(){44 var url = 'salary_view.action?empId=';45 var empId = Ext.get('report_empId').dom.value;46 var year = Ext.get('year').dom.value;47 var month = Ext.getCmp('month').getValue();48 Ext.get('viewArea').dom.src = url+empId+"&year="+year+"&month="+month;49 },50 exportFn: function(){51 var url = 'emp_report.action?empId=';52 var empId = Ext.get('report_empId').dom.value;53 var year = Ext.get('year').dom.value;54 var month = Ext.getCmp('month').getValue();55 document.location = 'salary_export.action?empId='+empId+"&year="+year+"&month="+month;56 }57 });58 blurFn2 = function(value){59 var empId = value.getRawValue();60 if(empId != '')61 Ext.Ajax.request({62 url: 'emp_isExist.action',63 method: 'post',64 params: {65 empId: empId66 },67 success: isExistSuccessFn2,68 failure: save_failure69 })70 };71 isExistSuccessFn2 = function(response, options){72 if(response.responseText == ''){73 Ext.Msg.alert('提示','此工号不存在');74 }75 }