123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658 |
- $(function() {
- //工号选择
- $('select[node-hrNature]').change(function() {
- var nature=$(this).val();
- if(nature==1){
- $('#regularStaff').show();
- $('#internStaff').hide();
- }else{
- $('#internStaff').show();
- $('#regularStaff').hide();
- }
- });
-
- //审批和抄送的cidKey交互
- $('a[node-employeeApprovals]').click(function() {
- $("#cidKey").val($(this).attr("node-cidKey"));
- });
- $('a[node-employeeCC]').click(function() {
- $("#CCcidKey").val($(this).attr("node-cidKey"));
- });
-
- $("input[id^='verify_']").click(function(){
-
- var uid=$(this).val();
- var uname=$(this).attr('data');
- var ischeck=$(this).attr('checked');
-
- if(ischeck==undefined){
- alert('请清空重新设置审批流程');
- return ;
- }else{
- $(this).attr("disabled","disabled");
- }
-
- var chk_value =[];
- $('input[name="staff[]"]:checked').each(function(){
- chk_value.push($(this).val());
- });
-
- if(chk_value.length==1){
- $("#AUTDO").html(uname);
- $('#uidlist').val(uid);
- }else{
- var html2=$("#AUTDO").html();
- $("#AUTDO").html(html2+'->'+uname);
- var uil=$('#uidlist').val();
- $('#uidlist').val(uil+','+uid);
- }
- return ;
- });
-
- //设置抄送人员
- $("input[node-approvalsStaff]").click(function(){
- var didkey=$(this).attr('node-didkey');
- var cidkey=$(this).val();
- if($(this).is(':checked')) {
- if(didkey=='')
- $("input[node-cidKey="+cidkey+"]").attr("checked",true);
- else
- $("input[node-didKey="+cidkey+"_"+didkey+"]").attr("checked",true);
- }else{
- if(didkey=='')
- $("input[node-cidKey="+cidkey+"]").attr("checked",false);
- else
- $("input[node-didKey="+cidkey+"_"+didkey+"]").attr("checked",false);
- }
- });
-
- //获得入职审批数据
- $("a[node-approvals]").click(function(){
- var sidkey=$(this).attr('node-sidKey');
- var type='STAFF';
-
- var url = "/ajaxGetStaffInfoByType";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : sidkey,
- type:type
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
- $("#sidKey").val(data.sidKey);
- $("#staffDetailNC").html(data.html);
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- $("div[loading-msg='true']").html("");
- }
- });
- });
-
- //获得离职审批数据
- $("a[node-approvalsRegular]").click(function(){
- var sidkey=$(this).attr('node-sidKey');
- var type='STAFF';
-
- var url = "/ajaxGetStaffInfoByType";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : sidkey,
- type:type
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
- $("#sidKeyRegular").val(data.sidKey);
- $("#staffDetailAD").html(data.html);
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- $("div[loading-msg='true']").html("");
- }
- });
- });
-
- //获得离职审批数据
- $("a[node-approvalsDimission]").click(function(){
- var sidkey=$(this).attr('node-sidKey');
- var type='STAFF';
-
- var url = "/ajaxGetStaffInfoByType";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : sidkey,
- type:type
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
- $("#sidKeyDimission").val(data.sidKey);
- $("#staffDetailDi").html(data.html);
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- $("div[loading-msg='true']").html("");
- }
- });
- });
-
- //获得晋升审批数据
- $("a[node-approvalsPromote]").click(function(){
- var sidkey=$(this).attr('node-sidKey');
- var type='STAFF';
-
- var url = "/ajaxGetStaffInfoByType";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : sidkey,
- type:type
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
- $("#sidKeyPromote").val(data.sidKey);
- $("#staffDetailP").html(data.html);
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- $("div[loading-msg='true']").html("");
- }
- });
- });
-
- //获得再入职审批数据
- $("a[node-approvalsReentry]").click(function(){
- var sidkey=$(this).attr('node-sidKey');
- var type='STAFF';
-
- var url = "/ajaxGetStaffInfoByType";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : sidkey,
- type:type
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
- $("#sidKeyReentry").val(data.sidKey);
- $("#staffDetailReentry").html(data.html);
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- $("div[loading-msg='true']").html("");
- }
- });
- });
-
- //获得员工更新数据
- $("a[node-employeeInfo]").click(function(){
- var sidkey=$(this).attr('node-sidKey');
- var type='EMPLOYEE';
-
-
-
- var url = "/ajaxGetStaffInfoByType";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : sidkey,
- type:type
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
- $("#sidKeyEmployeeInfo").val(data.sidKey);
- $("#EMPLOYEENC").html(data.html);
-
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- $("div[loading-msg='true']").html("");
- }
- });
- });
-
- //转职为试用
- $("a[node-Transfer]").click(function(){
- var sidkey=$(this).attr('node-sidKey');
-
- var url = "/ajaxGetStaffInfoBySid";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : sidkey
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
-
- $("#sidKeyTRIAL").val(data.detail.sidKey);
- $("#transferJobNumber").html(data.detail.jobNumber);
- $("#transferUsername").html(data.detail.username);
-
- var cateDepart=data.detail.category;
- if(data.detail.department)
- cateDepart+=data.detail.department.departmentName;
- $("#transferCategory").html(cateDepart);
-
- $("#transferPosition").html(data.detail.position);
- $("#transferHiredate").html(data.detail.hiredate);
- $("#transferHiredate2").html(' 已入职 '+data.detail.workforce+' 天');
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- }
- });
- });
-
- //转职为正式
- $("a[node-TransferFORMAL]").click(function(){
- var sidkey=$(this).attr('node-sidKey');
-
- var url = "/ajaxGetStaffInfoBySid";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : sidkey
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
-
- $("#sidKeyREGULARS").val(data.detail.sidKey);
- $("#formalJobNumber").html(data.detail.jobNumber);
- $("#formalUsername").html(data.detail.username);
-
- var cateDepart=data.detail.category;
- if(data.detail.department)
- cateDepart+=data.detail.department.departmentName;
- $("#formalCategory").html(cateDepart);
-
- $("#formalPosition").html(data.detail.position);
- $("#formalHiredate").html(data.detail.hiredate);
- $("#formalHiredate2").html(' 已入职 '+data.detail.workforce+' 天');
- $("#formalProbationaryDate").html(data.detail.probationaryDate);
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- }
- });
- });
-
- //转职为离职
- $("a[node-TransferDimission]").click(function(){
- var sidkey=$(this).attr('node-sidKey');
-
- var url = "/ajaxGetStaffInfoBySid";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : sidkey
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
- console.log(data);
- $("#sidKeyDismiss").val(data.detail.sidKey);
- $("#DimissionJobNumber").html(data.detail.jobNumber);
- $("#DimissionUsername").html(data.detail.username);
-
- var cateDepart=data.detail.category;
- if(data.detail.departmentID!=0)
- cateDepart+="/"+data.detail.department.departmentName;
- $("#DimissionCategory").html(cateDepart);
-
- $("#DimissionPosition").html(data.detail.positionDetail.positionName);
- $("#DimissionHiredate").html(data.detail.hiredate);
- $("#DimissionHiredate2").html(' 已入职 '+data.detail.workforce+' 天');
- $("#applyLeaveDate2").val(data.detail.applyLeaveDate);
-
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- }
- });
- });
-
- //在入职
- $("a[node-TransferReentry]").click(function(){
- var sidkey=$(this).attr('node-sidKey');
-
- var url = "/ajaxGetStaffInfoBySid";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : sidkey
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
-
- $("#sidKeyReentry").val(data.detail.sidKey);
- $("#ReentryJobNumber").html(data.detail.jobNumber);
- $("#ReentryUsername").html(data.detail.username);
-
- var cateDepart=data.detail.category;
- if(data.detail.department)
- cateDepart+=data.detail.department.departmentName;
- $("#ReentryCategory").html(cateDepart);
-
- $("#ReentryPosition").html(data.detail.position);
- $("#ReentryHiredate").html(data.detail.dimissionDate);
- $("#ReentryHiredate2").html(' 已离职 '+data.detail.workforceDimission+' 天');
-
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- }
- });
- });
-
- //员工的筛选
- $('select[node-pendStatus]').change(function() {
- $('#hrEmployee').submit();
- });
- $('select[node-nature]').change(function() {
- $('#hrEmployee').submit();
- });
- $('select[node-cid_did]').change(function() {
- $('#hrEmployee').submit();
- });
-
- //编辑员工CLD访问权限
- $('a[employee-access]').click(function() {
- var sidkey=$(this).attr('node-sidKey');
- var selectData=$(this).attr('select-data');
- console.log(selectData);
- $("#Access_INFORMATION").attr("checked",false);
- $("#Access_DIRECTORIES").attr("checked",false);
- $("#Access_LOCK").attr("checked",false);
- $("#Access_RECEIPTS").attr("checked",false);
- $("#Access_INVOICE").attr("checked",false);
- $("#Access_HR").attr("checked",false);
- $("#Access_BUILD").attr("checked",false);
- if(selectData!=''){
- var jsonStr = JSON.parse(selectData);
- for(var j = 0;j<jsonStr.length;j++){
- console.log(jsonStr[j]);
- if(jsonStr[j]=='INFORMATION'){
- $("#Access_INFORMATION").attr("checked",true);
- }
- if(jsonStr[j]=='DIRECTORIES'){
- $("#Access_DIRECTORIES").attr("checked",true);
- }
- if(jsonStr[j]=='LOCK'){
- $("#Access_LOCK").attr("checked",true);
- }
- if(jsonStr[j]=='RECEIPTS'){
- $("#Access_RECEIPTS").attr("checked",true);
- }
- if(jsonStr[j]=='INVOICE'){
- $("#Access_INVOICE").attr("checked",true);
- }
- if(jsonStr[j]=='HR'){
- $("#Access_HR").attr("checked",true);
- }
- if(jsonStr[j]=='BUILD'){
- $("#Access_BUILD").attr("checked",true);
- }
- }
- }
-
- $("#sidKeyAccess").val(sidkey);
- });
-
- //编辑员工访问客户地区权限
- $('a[employee-district]').click(function() {
- var sidkey=$(this).attr('node-sidKey');
- $("#sidKeyDistrict").val(sidkey);
- var url = "/ajaxGetDistrictByLv1";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- serial : sidkey
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
- $("#StaffDistrictHtml").html(data.html);
-
- } else
- $("#StaffDistrictHtml").html("illegal request");
- },
- error : function(err) {
- }
- });
-
-
-
- });
-
- //跳转到员工权限设置页面
- $('input[node-setApproval]').click(function() {
- window.location.replace("/hrEmployeeApprovalsSetting");
- });
-
- //跳转到员工页面
- $('input[node-employeeInfo]').click(function() {
- window.location.replace("/hrEmployee");
- });
-
-
- //岗位设置
- $("a[node-ediPosition]").click(function(){
- var pidkey=$(this).attr('pidKey');
-
- var url = "/ajaxGetPositionByPid";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- pidkey : pidkey
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
-
-
- $("#pidkeyUpdate").val(data.detail.pidKey);
- $("#positionNameEdi").val(data.detail.positionName);
- $("#positionDescribeEdi").val(data.detail.positionDescribe);
- $("#baseWageEdi").val(data.detail.baseWage);
- $("#postWageEdi").val(data.detail.postWage);
- $("#achievementBonusEdi").val(data.detail.achievementBonus);
-
-
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- }
- });
- });
-
-
- $("a[node-delPosition]").click(function(){
- var pidkey=$(this).attr('pidKey');
-
- var url = "/ajaxGetPositionByPid";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- pidkey : pidkey
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
- $("#pidkeyDel").val(data.detail.pidKey);
- $("#delPositionHtml").html("是否删除岗位“"+data.detail.positionName+"“");
- } else
- $("div[loading-msg='true']").html("illegal request");
- },
- error : function(err) {
- }
- });
- });
-
- $("a[node-PositionStaff]").click(function(){
- var pidkey=$(this).attr('pidKey');
-
- var url = "/ajaxGetStaffByPid";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- pidkey : pidkey
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
-
-
- $("#positionNameHtml").html(data.positionName);
- $("#positionStaffHTMl").html(data.html);
- } else
- $("#positionStaffHTMl").html("illegal request");
- },
- error : function(err) {
- }
- });
- });
-
- $("a[node-Promotion]").click(function(){
- var sidkey=$(this).attr('node-sidKey');
-
- var url = "/ajaxGetPromotionStaffByPid";
- $.ajax({
- url : url,
- type : "post",
- cache : false,
- dataType : "json",
- data : {
- sidkey : sidkey
- },
- global : true,
- success : function(data) {
- if (data.status == 1) {
-
-
- $("#sidKeyPromote").val(data.detail.sidKey);
- $("#staffPromotionHtml").html(data.html);
- //data.detail.positionId
- //$("#positionStaffSelect").find("option[text='程序员']").attr("selected",true);
-
- $("#positionStaffSelect").find("option[value='"+data.detail.positionIdKey+"_"+data.detail.positionDetail.positionName+"']").attr("selected",'selected');
-
- $("#promotionBaseWage").val(data.detail.positionDetail.baseWage);
- $("#promotionpostWage").val(data.detail.positionDetail.postWage);
- $("#promotionAchievementBonus").val(data.detail.positionDetail.achievementBonus);
- } else
- $("#staffPromotionHtml").html("illegal request");
- },
- error : function(err) {
- }
- });
- });
-
-
- $("#positionStaffSelect").change(function(){
-
- var nodeWages=$("option:selected", this).attr("node-wages");
- var nw=nodeWages.split("_");
-
- //var nodeWages=$(this).attr('node-wages');
- //console.log(nw);
-
- $("#promotionBaseWage").val(nw[0]);
- $("#promotionpostWage").val(nw[1]);
- $("#promotionAchievementBonus").val(nw[2]);
-
-
- });
-
- $("#positionStaffAddSelect").change(function(){
-
- var nodeWages=$("option:selected", this).attr("node-wages");
- var nw=nodeWages.split("_");
-
- //var nodeWages=$(this).attr('node-wages');
- //console.log(nw);
-
- $("#promotionAddBaseWage").val(nw[0]);
- $("#promotionAddpostWage").val(nw[1]);
- $("#promotionAddAchievementBonus").val(nw[2]);
-
-
- });
-
-
-
-
- })
- function CLEARTUIL(){
- $('input[name="staff[]"]:checked').each(function(){
- $(this).removeAttr("disabled");
- $(this).attr('checked',false);
- });
- $("#AUTDO").html('');
- $('#uidlist').val('');
- }
|