1.

 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>基本工资信息</title> <script type="text/javascript">
var salaryBasic = new SalaryBasic();
var tabId = Ext.getCmp('mainTab').getActiveTab().id.split('_')[1];
juage(tabId,"salb",salaryBasic,"salaryBasic");
</script> </head>
<body>
<div id="salaryBasic" ></div>
</body>
</html>

2、

 /**
* 员工工资基本信息管理
* @author sux 2011-02-23
* @memberOf {TypeName}
* @return {TypeName}
*/
var SalaryBasic = Ext.extend(Ext.grid.EditorGridPanel,{
id: 'salaryBasicId',
constructor: function(){
Ext.form.Field.prototype.msgTarget = 'title';
var number = new Ext.grid.RowNumberer();
var sm = new Ext.grid.CheckboxSelectionModel();
var salBasicStore = new Ext.data.JsonStore({
url: 'salBasic_list.action',
root: 'root',
totalProperty: 'totalProperty',
fields: ['sbId','employee','sbBasic','sbEndowment','sbHospitalization','sbUnemployment','sbInjury',
'sbMaternity','sbHousing','sbTraffic','sbEatery','sbTelephone']
})
var cm = new Ext.grid.ColumnModel([
number, sm,
{
header: '编号',
dataIndex: 'sbId',
align: 'center'
},{
header: '员工工号',
dataIndex: 'employee',
align: 'center',
renderer: function(value){
//判断其类型是否为object类型
if(typeof(value) == "object"){
return value.empId;
}else{
return value;
}
},
editor: new Ext.form.TextField({
allowBlank: false,
blankText: '不能为空',
id: 'salaryBasicEmp',
listeners: {'blur':this.uniqueEmp}
})
},{
header: '员工姓名',
dataIndex: 'employee',
align: 'center',
renderer: function(value){
if(value)
return value.empName;
}
},{
header: '基本工资',
dataIndex: 'sbBasic',
align: 'center',
editor: new Ext.form.TextField()
},{
header: '养老保险',
dataIndex: 'sbEndowment',
align: 'center',
editor: new Ext.form.ComboBox({
mode: 'local',
triggerAction: 'all',
editable: false,
store: new Ext.data.SimpleStore({
fields: ['name','value'],
data: [['是','1'],['否','0']]
}),
displayField: 'name',
valueField: 'value'
}),
renderer: function(value){
if(value == '1') return '是';
return '否';
}
},{
header: '医疗保险',
dataIndex: 'sbHospitalization',
align: 'center',
editor: new Ext.form.ComboBox({
mode: 'local',
triggerAction: 'all',
editable: false,
store: new Ext.data.SimpleStore({
fields: ['name','value'],
data: [['是','1'],['否','0']]
}),
displayField: 'name',
valueField: 'value'
}),
renderer: function(value){
if(value == '1') return '是';
return '否';
}
},{
header: '失业保险',
dataIndex: 'sbUnemployment',
align: 'center',
editor: new Ext.form.ComboBox({
mode: 'local',
editable: false,
triggerAction: 'all',
store: new Ext.data.SimpleStore({
fields: ['name','value'],
data: [['是','1'],['否','0']]
}),
displayField: 'name',
valueField: 'value'
}),
renderer: function(value){
if(value == '1') return '是';
return '否';
}
},{
header: '工伤保险',
dataIndex: 'sbInjury',
align: 'center',
editor: new Ext.form.ComboBox({
mode: 'local',
triggerAction: 'all',
editable: false,
store: new Ext.data.SimpleStore({
fields: ['name','value'],
data: [['是','1'],['否','0']]
}),
displayField: 'name',
valueField: 'value'
}),
renderer: function(value){
if(value == '1') return '是';
return '否';
}
},{
header: '生育保险',
dataIndex: 'sbMaternity',
align: 'center',
editor: new Ext.form.ComboBox({
mode: 'local',
triggerAction: 'all',
editable: false,
store: new Ext.data.SimpleStore({
fields: ['name','value'],
data: [['是','1'],['否','0']]
}),
displayField: 'name',
valueField: 'value'
}),
renderer: function(value){
if(value == '1') return '是';
return '否';
}
},{
header: '住房公积金',
dataIndex: 'sbHousing',
align: 'center',
editor: new Ext.form.ComboBox({
mode: 'local',
editable: false,
triggerAction: 'all',
store: new Ext.data.SimpleStore({
fields: ['name','value'],
data: [['是','1'],['否','0']]
}),
displayField: 'name',
valueField: 'value'
}),
renderer: function(value){
if(value) return '是';
return '否';
}
},{
header: '交通补贴',
dataIndex: 'sbTraffic',
align: 'center',
editor: new Ext.form.NumberField()
},{
header: '餐费补贴',
dataIndex: 'sbEatery',
align: 'center',
editor: new Ext.form.NumberField()
},{
header: '通迅补贴',
dataIndex: 'sbTelephone',
align: 'center',
editor: new Ext.form.NumberField()
}])
SalaryBasic.superclass.constructor.call(this, {
width: Ext.getCmp('mainTab').getActiveTab().getInnerWidth(),
height: Ext.getCmp('mainTab').getActiveTab().getInnerHeight(),
/**表格高度自适应 document.body.clientHeight浏览器页面高度 start**/
monitorResize: true,
doLayout: function() {
this.setWidth(document.body.clientWidth-205);
this.setHeight(document.body.clientHeight-140);
Ext.grid.GridPanel.prototype.doLayout.call(this);
} ,
viewConfig: {
forceFit: true
},
sm: sm,
cm: cm,
store: salBasicStore,
tbar: new Ext.Toolbar({
items: ['条目:',{
xtype: 'combo',
width: 80,
triggerAction: 'all',
editable: false,
mode: 'local',
store: new Ext.data.SimpleStore({
fields: ['name','value'],
data: [[" "," "],["empId","员工工号"],["empName","员工姓名"]]
}),
id: 'sb_condition',
displayField: 'value',
valueField: 'name'
},'内容',{
xtype: 'textfield',
id: 'sb_conditionValue',
width: 80
},{
text: '查看',
handler: salViewFn,
iconCls: 'search'
},{
text: '删除',
handler: salDelFn,
id: 'salb_delete',
iconCls: 'delete'
},{
text: '新增',
id: 'salb_add',
handler: salNewFn,
iconCls: 'add'
},{
text: '修改或保存',
iconCls: 'save',
id: 'salb_saveorupdate',
handler: salUpdateOrSaveFn
}]
}),
bbar: new PagingToolbar(salBasicStore, 20)
})
salBasicStore.load({
params: {
start: 0,
limit: 20
}
});
},
//员工工号
uniqueEmp: function(obj){
var empId = obj.getValue();
Ext.Ajax.request({
url: 'salBasic_uniqueEmp.action',
success: function(response, options){
var obj = Ext.util.JSON.decode(response.responseText);
if(obj.msg == false){
Ext.Msg.alert("提示","此员工的工资已配置");
}
},
failure: hrmsys.util.common.failure,
params: {
empId: empId
}
})
}
});
//查看
salViewFn = function(){
var condition = Ext.getCmp("sb_condition").getValue();
var conditionValue = Ext.getCmp("sb_conditionValue").getValue();
Ext.getCmp('salaryBasicId').getStore().load({
params: {
type: 'query',
condition: condition,
conditionValue: conditionValue,
start: 0,
limit: 20
}
});
};
//删除
salDelFn = function(){
gridDel('salaryBasicId','sbId', 'salBasic_delete.action');
};
//新增
salNewFn = function(){
var DefaultRecord = new Ext.data.Record.create([{name: 'sbId', mapping: 0},{name: 'employee', mapping: 1},
{name: 'empName', mapping:2},{name: 'sbBasic', mapping: 3},{name: 'sbEndowment', mapping: 4},
{name: 'sbHospitalization', mapping: 5},{name: 'sbUnemployment', mapping: 6},{name: 'sbInjury', mapping: 7},
{name: 'sbMaternity', mapping: 8},{name: 'sbHousing', mapping:9},{name: 'sbTraffic', mapping: 10},
{name: 'sbEatery', mapping: 11},{name: 'sbTelephone', mapping: 12}]);
var num = Ext.getCmp('salaryBasicId').getStore().getCount();
var newRecord = new DefaultRecord({
sbId: num+1
});
Ext.getCmp('salaryBasicId').getStore().insert(0,newRecord);
}; //保存或者修改
salUpdateOrSaveFn = function(){
var modifiedRecords = Ext.getCmp('salaryBasicId').getStore().getModifiedRecords();
var salBasics = reSalBasicJson(modifiedRecords);
//alert(salBasics);
Ext.Ajax.request({
url: 'salBasic_save.action',
method: 'post',
waitTitle: '提示',
waitMsg: '正在保存数据...',
params: {
json: salBasics
},
success: salBasicSuccessFn,
failure: boonModifyfailureFn
})
};
//保存成功保存
salBasicSuccessFn = function(response, options){
var datas = Ext.util.JSON.decode(response.responseText);
Ext.Msg.alert('提示',datas.msg,function(){
Ext.getCmp('salaryBasicId').getStore().load({
params: {
start: 0,
limit: 20
}
});
});
};
//json
reSalBasicJson = function(modifiedRecords){
var count = modifiedRecords.length;
var salBasics='';
//有修改或保存
if(count > 0){
salBasics = "[";
for(i=0; i<count; i++){
salBasics += "{";
var sbId = modifiedRecords[i].get('sbId');
var employee = modifiedRecords[i].get('employee');
if(typeof(employee) == "object"){
var empId = employee.empId;
}else{
var empId = employee;
}
//var empName = modifiedRecords[i].get('empName');
var sbBasic = modifiedRecords[i].get('sbBasic');
var sbEndowment = modifiedRecords[i].get('sbEndowment');
var sbHospitalization = modifiedRecords[i].get('sbHospitalization');
var sbUnemployment = modifiedRecords[i].get('sbUnemployment');
var sbInjury = modifiedRecords[i].get('sbInjury');
var sbEatery = modifiedRecords[i].get('sbEatery');
var sbMaternity = modifiedRecords[i].get('sbMaternity');
var sbHousing = modifiedRecords[i].get('sbHousing');
var sbTraffic = modifiedRecords[i].get('sbTraffic');
var sbTelephone = modifiedRecords[i].get('sbTelephone');
salBasics += '"sbId":'+sbId+', "empId":"'+empId+'","sbBasic":'+sbBasic+
',"sbEndowment":'+sbEndowment+', "sbHospitalization":'+sbHospitalization+', "sbUnemployment":'+sbUnemployment+
', "sbInjury":'+sbInjury+', "sbEatery":'+sbEatery+', "sbMaternity":'+sbMaternity+', "sbHousing":'+sbHousing+
', "sbTraffic":'+sbTraffic+', "sbTelephone":'+sbTelephone+'}';
if( i != count-1)
salBasics += ","
}
salBasics += "]"
}
return salBasics;
}

74.资金管理-员工工资配置 extjs 页面的更多相关文章

  1. 70.资金管理-福利表管理 Extjs 页面

    1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8&quo ...

  2. 69.资金管理-税率表管理extjs 页面

    1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8&quo ...

  3. 79.员工薪水报表 Extjs 页面

    1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8" ...

  4. HR开发 读取员工工资

    1.使用函数读取员工工资. ①数据结构工资结果 DATA: GT_RGDIR TYPE TABLE OF PC261 , GS_RGDIR TYPE PC261 , GT_PAYRESULT TYPE ...

  5. web.config配置aspx页面默认引用的namespace

    如果我们在aspx页面上使用<%%>的方式使用某些类的时候很多都没办法直接使用,我们必须要在页面上引用命名空间, 如:如果我们要使用DataTable类的时候,我们必须先使用<%@ ...

  6. Eclipse(非J2EE版本)配置Extjs环境以及安装部署Tomcat

    Eclipse(非J2EE版本)配置Extjs环境(Spket) 1. 安装spket插件,帮助->安装新软件->http://www.agpad.com/update. 2. 设置Spk ...

  7. Webpack 2 视频教程 019 - Webpack 2 中配置多页面编译

    原文发表于我的技术博客 这是我免费发布的高质量超清「Webpack 2 视频教程」. Webpack 作为目前前端开发必备的框架,Webpack 发布了 2.0 版本,此视频就是基于 2.0 的版本讲 ...

  8. SpringMVC 实现文件上传与下载,并配置异常页面

    目录 上传文件的表单要求 Spring MVC实现上传文件 需要导入的jar包 配置MultipartResolver解析器 编写接收上传文件的控制器 Spring MVC实现文件下载 下载文件时的h ...

  9. SpringMVC项目配置欢迎页面为index.html

    一.问题 在web.xml中添加如下配置无效 <welcome-file-list> <welcome-file>index.html</welcome-file> ...

随机推荐

  1. 基于saltstack svn的一个发布系统

      1.登录页 2.分组管理页 3.添加项目页 4.项目列表和项目编辑页 5.项目发布回滚页

  2. mybatis 简单的入门实例

    第一步:添加mybaties的架包 第二步:配置mybaties的文件 <?xml version="1.0" encoding="UTF-8" ?> ...

  3. Spring装配之——JAVA代码装配Bean

    首先创建几个普通的JAVA对象,用于测试JAVA代码装配bean的功能. package soundsystemJava; //作为接口 定义了CD播放器对一盘CD所能进行的操作 public int ...

  4. tp定时任务,传参问题

    <?phpnamespace app\command; use think\console\Command;use think\console\Input;use think\console\i ...

  5. vue和iview中native点击事件修饰

    在父组件中给子组件绑定一个原生的事件,就将子组件变成了普通的HTML标签,不加'. native'事件是无法触 在vue中使用iview的dropdownMenu 上单纯的@click也不生效,要写成 ...

  6. 关于javascript原型链的记录

    构造函数拥有名为prototype属性,每个对象都拥有__proto__属性,而且每个对象的__proto__属性指向自身构造函数prototype. **当调用某种方法或属性时,首先会在自身调用或查 ...

  7. 数据结构与算法(6) -- heap

    binary heap就是一种complete binary tree(完全二叉树).也就是说,整棵binary tree除了最底层的叶节点之外,都是满的.而最底层的叶节点由左至右又不得有空隙. 以上 ...

  8. swap() 函数实现的方法

    swap()函数总结: 一.利用临时变量 1.引用(交换任意类型) template <typename T> void swap(T& x,T& y) { T tmp; ...

  9. Linux之强大的selinux

    简单点说,SELinux就是用来加强系统安全性的.它给一些特定程序(这些程序也在不断增加)做了一个沙箱,它将文件打上了一个安全标签,这些标签属于不同的类,也只能执行特定的操作,也就是规定了某个应用程序 ...

  10. 4.几个「不难但却很有用」的 Git 技能点

    阅读 Git 原理详解及实用指南 记录 tag:不可移动的 branch tag 是一个和 branch 非常相似的概念,它和 branch 最大的区别是:tag 不能移动.所以在很多团队中,tag ...