| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- /**
- * 离职申请:专业用户
- */
- shr.defineClass("shr.affair.hrman.ResignBizBillHrManEditEx", shr.affair.hrman.ResignBizBillHrManEdit, {
- initalizeDOM : function () {
- shr.affair.hrman.ResignBizBillHrManEditEx.superClass.initalizeDOM.call(this);
- var self = this;
- self.quittempEvent();
- self.beforeFilterFields();
- self.setRequiredquittemp();
- self.setRequiredSocialElec();
- self.setLabCont();
- },
- /**
- * 点击前过滤字段
- */
- beforeFilterFields: function () {
- var quittemp_el = $('#entrys_quittemp');
- if (quittemp_el.length > 0) {
- quittemp_el.shrPromptBox("setFilter", "BaseInfo.name like '%离职证明%'");
- }
- var socialtemp = $('#entrys_socialtemp');
- if (socialtemp.length > 0) {
- socialtemp.shrPromptBox("setFilter", "BaseInfo.name like '%社保%'");
- }
- },
- setRequiredquittemp: function () {
- var self = this;
- var entrys_quitElec = $("#entrys_quitElec");
- if (entrys_quitElec.shrCheckbox('isSelected')) {
- $('#entrys_quittemp').shrPromptBox("enable");
- $('#entrys_quittemp').shrPromptBox('option', 'required', true);
- } else {
- $('#entrys_quittemp').shrPromptBox("disable");
- }
- },
- setRequiredSocialElec: function () {
- var entrys_socialElec = $("#entrys_socialElec");
- if (entrys_socialElec.shrCheckbox('isSelected')) {
- $('#entrys_socialtemp').shrPromptBox("enable");
- $('#entrys_socialtemp').shrPromptBox('option', 'required', true);
- } else {
- $('#entrys_socialtemp').shrPromptBox("disable");
- }
- },
- setLabCont: function () {
- var entrys_quitElec = $("#entrys_quitElec");
- var entrys_socialElec = $("#entrys_socialElec");
- if (entrys_socialElec.shrCheckbox('isSelected')
- || entrys_quitElec.shrCheckbox('isSelected')){
- $('#entrys_labContractFirstParty').shrPromptBox("enable");
- $('#entrys_labContractFirstParty').shrPromptBox('option', 'required', true);
- }else{
- $('#entrys_labContractFirstParty').shrPromptBox("disable");
- }
- },
- /**
- * 值改变事件
- */
- quittempEvent:function (){
- var self = this;
- var entrys_quitElec = $("#entrys_quitElec");
- var entrys_socialElec = $("#entrys_socialElec");
- if(entrys_quitElec){
- entrys_quitElec.change(function(val,e){
- self.setRequiredquittemp();
- self.checkContractSubject();
- });
- }
- if(entrys_socialElec){
- entrys_socialElec.change(function(){
- self.setRequiredSocialElec();
- self.checkContractSubject();
- });
- }
- },
- /**
- * 判断两个选择框是否有其中一个被选中
- * 如果选中则合同主体必填
- */
- checkContractSubject: function () {
- var entrys_quitElec = $("#entrys_quitElec");
- var entrys_socialElec = $("#entrys_socialElec");
- if (entrys_quitElec.length > 0 && entrys_socialElec.length > 0) {
- if (entrys_quitElec.shrCheckbox('isSelected') || entrys_socialElec.shrCheckbox('isSelected')) {
- $('#entrys_labContractFirstParty').shrPromptBox('option', 'required', true);
- } else {
- $('#entrys_labContractFirstParty').shrPromptBox('option', 'required', false);
- }
- }
- },
- });
|