 /**
 *HR人事证明单据列表js基类
 */
shr.defineClass("shr.customer.gtiit.HRCertificationBillListEx", shr.empCertification.HRCertificationBillList, {
	// 盖章成功后请刷新页面再预览打印！
	batchCompanySignTips: jsBizMultLan.ssc_ElectroniContractTaskList_27600681_i18n_1074,
	templateName:'',
	templateQueryPK:'',
	pageStep: 0,
	initalizeDOM: function () {
		shr.customer.gtiit.HRCertificationBillListEx.superClass.initalizeDOM.call(this);
        this.loadFiles();
        this.initTabPages();
		this.initBreadcrumb();
		this.addButtonTips('batchCompanySign', this.batchCompanySignTips);
	},
	initBreadcrumb: function(){
		var items = $('#breadcrumb').shrBreadcrumb('getItems');
		var newItem = [];
		items.map(function(item,index){
			if(index === 0 || index === (items.length - 1)){
				newItem.push(item);
			}
		});
		$('#breadcrumb').shrBreadcrumb('setItems',newItem);
		shrDataManager.pageNavigationStore.setDatas(newItem);
	},
	templatePrintAction: function () {
		var that = this;
		
		var talentIds = this.getselectedRowTalentId();

		if (undefined == talentIds || talentIds == null) {
			return
		};
		var talentId = this.getSelectedIds();
		
		//初始化套打模板name和querypk
		that.initTemplateNameQueryPK(talentId);

		that.remoteCall({
			method: "updataPrintPersonInfo",
			param: {
				billId: talentId
			},
			type: "POST",
			success: function (data) {
				if (data == null) {
					shr.showWarning({
						message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_25
					});
				}
				shr.empCertification.HRCertificationBillList.superClass.templatePrintAction.call(that);
			}
		});
	},
	initTabPages: function(){
	    var that = this;
		that.changePageLabelColor();
	    $('#allCRTList').click(function(){ 
			that.pageStep = 0;
			//定义标签样式
			that.changePageLabelColor();
			that.reloadPage({
			uipk: 'com.kingdee.eas.base.hr.app.certificationservice.list'
		    });	
		});
		$('#resignCRTList').click(function(){  
			that.pageStep = 1;
			//定义标签样式
			that.changePageLabelColor();
			that.reloadPage({
			  uipk: 'com.kingdee.shr.empcertification.app.HRResignCertificationBill.list',
		    });	
		});
		$('#empCRTList').click(function(){  
		    that.pageStep = 2;
			//定义标签样式
			that.changePageLabelColor();
			that.reloadPage({
			uipk: 'com.kingdee.shr.empcertification.app.HREmpCertificationBill.list',
			pageStep: 2
		    });	
		});
		$('#commonCRTList').click(function(){  
		    that.pageStep = 3;
			//定义标签样式
			that.changePageLabelColor();
			that.reloadPage({
			uipk: 'com.kingdee.shr.empcertification.app.HRCommonCertificationBill.list',
			pageStep: 3
		    });	
		});
	},
    changePageLabelColor:function(){
		var that = this;
		$("#pageTabs").tabs(); 
		$("#pageTabs").find('ul li').eq(that.pageStep).removeClass("ui-state-default ui-corner-top").addClass("ui-state-default ui-corner-top ui-tabs-active ui-state-active")
		.siblings().removeClass("ui-state-default ui-corner-top ui-tabs-active ui-state-active").addClass("ui-state-default ui-corner-top");
		$("#pageTabs").find('ul li a').css('border','0px');
		$("#pageTabs").find('ul li a').eq(that.pageStep).removeClass("colNameType").addClass("fontGray")
		.siblings().removeClass("fontGray").addClass("colNameType");
	},
	
	previewPrintAction : function () {
		var _self = this;
    	var errorXhr = "";
    	var selectedIds = $("#grid").jqGrid("getSelectedRows");
    	var isSpecial = $('#grid').jqGrid("getCell", selectedIds[0], "isSpecial"); //是否其他模板
    	if (selectedIds == undefined || selectedIds.length==0) {
    		shr.showWarning({
				message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_16,
				hideAfter: null
			});
			return;
    	}
    	if(selectedIds.length>1){
    		shr.showWarning({
				message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_19,
				hideAfter: null
			});
    		return;
    	}
    	if(isSpecial=="1"){//是否其他模板
		    shr.showWarning({
					message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_11,
					hideAfter: null
			});
			return false;
		}
		_self.remoteCall({
			method : "checkButtonDataPermission",
			param : {
				billId : selectedIds
			},
			async: false,
			success : function(data){
				
			},
	         error: function (xhr, data) {
	         	errorXhr = xhr;
	             return;
	         }
		});
	    if(errorXhr != undefined && errorXhr != null && errorXhr != ""){
	     if(errorXhr.result == "error"){
	     	shr.showError({
	                message: errorXhr.summary,
	                hideAfter: null
	            });
	            return;
	     }
	    }
	    var rowData = $('#grid').jqGrid('getRowData', selectedIds);
		var drawUpMode = rowData.drawUpMode; //开具形式 1.纸质 2.电子
		var certificationStatus = rowData.certificationStatus; //证明状态
		var isSign = rowData.isSign; // 是否已签署
		var signNo = rowData.signNO;
		var billId = rowData.id;
		if("2" == drawUpMode && signNo != null && signNo != undefined && signNo != '' && "1" == isSign){//已签署
				var _time1 = 0;
				var intervalID = setInterval(function() { 
					_time1++;
					shr.callService({
						serviceName : 'electronicLaborRefreshLocalService',
						param : {
							contractNo : signNo,
							isDefault : "1"
						},
						async : false,
						success : function(response) {
							if (response.code == 0) {
								var pdfurl = '';
								pdfurl = response.data[0].sealInfo.previewOfPcUrl;

								var downloadUrl = response.data[0].sealInfo.downloadUrl;
								_self.convertPdfToWord(pdfurl,downloadUrl,"已盖章");

								shr.block.hide();
								//shr.openNew(pdfurl);
								clearInterval(intervalID);
							} else {

							}
						},
						error: function(xhr,data){

						}
					});
					console.log(intervalID);
					console.log(_time1);
					if (_time1 > 10){
						shr.block.hide();
						shr.showError({
							message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_13
						});
						clearInterval(intervalID);	
					}										
				}, 500);   				
				return;  
			}else{
				var newDate = new Date();
				var hourStr = newDate.getHours()<10?"0"+newDate.getHours().toString():newDate.getHours().toString();
				var minuteStr = newDate.getMinutes()<10?"0"+newDate.getMinutes().toString():newDate.getMinutes().toString();
				var secondStr = newDate.getSeconds()<10?"0"+newDate.getSeconds().toString():newDate.getSeconds().toString();
				var nowTime = hourStr+minuteStr+secondStr;
				var contractNo = rowData.number;
				shr.block.show();
				shr.callService({
					serviceName : 'empCreateCertificationService',
					param : {
						billId : billId,
						posNum : nowTime
					},
					async : false,
					success : function(response) {
						console.log('createCertificationService success');
						var _time3 = 0;
						var intervalID = setInterval(function() { 
							_time3++;
							shr.callService({
								serviceName : 'electronicLaborRefreshLocalService',
								param : {
									contractNo : contractNo+"-"+nowTime,
									isDefault : "1"
								},
								async : false,
								success : function(response) {
									if (response.code == 0) {
										var pdfurl = '';
										pdfurl = response.data[0].nosealInfo.previewOfPcUrl;

										var downloadUrl = response.data[0].nosealInfo.downloadUrl;
										_self.convertPdfToWord(pdfurl,downloadUrl,"未盖章");

										shr.block.hide();
										// shr.openNew(pdfurl);
										clearInterval(intervalID);
									} else {
	
									}
								},
								error: function(xhr,data){
	
								}
							});
							console.log(intervalID);
							console.log(_time3);
							if (_time3 > 10){
								shr.block.hide();
								shr.showError({
									message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_13
								});
								clearInterval(intervalID);	
							}										
						}, 500);
					},
					error: function(xhr,data){
						shr.showError({
							message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_13
						});
						return;
					}
				});
		}
	},
	convertPdfToWord: function(previewOfPcUrl, downloadUrl, isSign){
		var _self = this;
		previewOfPcUrl = decodeURIComponent(previewOfPcUrl);
		const contractNo = _self.getContractParamsFromURL(previewOfPcUrl);
        downloadUrl = encodeURIComponent(downloadUrl);
		const date = new Date();
		const year = date.getFullYear();
		const month = (date.getMonth() + 1).toString().padStart(2, "0");
		const day = date.getDate().toString().padStart(2, "0");
		var currentDate = year+month+day;
		var fileName = contractNo + isSign + "-" + currentDate + ".docx";

        var urlinner = shr.getContextPath() + shr.dynamicURL + "?downloadUrl="+downloadUrl+"&fileName="+fileName+"&method=convertPdfToWord&handler=com.kingdee.shr.customer.gtiit.handler.HRcertificationbillListHandlerEx"+"&uipk="+shr.getUrlRequestParam('uipk');
        var downloadLink = document.createElement('a');
        downloadLink.href = urlinner;
        document.body.appendChild(downloadLink);
        downloadLink.click();
        document.body.removeChild(downloadLink);
	},
	getContractParamsFromURL: function(url){
		// 定义正则表达式
		const regex = /[?&]contractNo(=([^&#]*)|&|#|$)/;
		// 使用正则表达式获取参数值
		const paramValue = decodeURIComponent(regex.exec(url)[2].replace(/\+/g, ' '));
		return paramValue;
	},
	/**
	 * 发起企业签署
	 */
	batchCompanySignAction: function () {
		var that = this;
		var _self = this;
		var $grid = $(that.gridId);
		var selectedIds = $grid.jqGrid("getSelectedRows");
		var ids = selectedIds.toString();
		if (undefined == selectedIds || selectedIds == null) {
			return
		};
		if(selectedIds.length == 0){
			shr.showWarning({
				message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_16,
				hideAfter: null
			});
		}else{
			var labContractFirstParty = [];
			for (var i = 0, length = selectedIds.length; i < length; i++) {
				var billState = $grid.jqGrid("getCell", selectedIds[i], "billState"); //单据类型
				var drawUpMode = $grid.jqGrid("getCell", selectedIds[i], "drawUpMode"); //开具形式 1.纸质 2.电子
				var certificationStatus = $grid.jqGrid("getCell", selectedIds[i], "certificationStatus"); // 开具状态
				var isSign = $grid.jqGrid("getCell", selectedIds[i], "isSign"); // 是否已签
				var number = $grid.jqGrid("getCell", selectedIds[i], "number");//单据编号
				var billId = $grid.jqGrid("getCell", selectedIds[i], "id");
				labContractFirstParty.push($grid.jqGrid("getCell", selectedIds[i], "labContractFirstParty.id"));
				if(isSign=="1"){//是否已签
				    shr.showWarning({
						message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_14,
						hideAfter: null
					});
					return false;
			    }else if(certificationStatus==103){//开具状态：放弃开具
				    shr.showWarning({
						message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_1,
						hideAfter: null
					});
					return false;
			    }else if(drawUpMode==1){//纸质证明
				    shr.showWarning({
							message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_30,
							hideAfter: null
					});
					return false;
				}else if(billState!=3){//检查是否存在未审批完成的单据
				    shr.showWarning({
						message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_22,
						hideAfter: null
				});
				return false;
			   }	
			}
			_self.remoteCall({
				method: "checkHasSetSignatureImage",
				type: "post",
				param: {
					billIds : ids,
					labContractFirstParty: labContractFirstParty.toString()
				},
				success: function (result) {
					if (result.success) {
						shr.showConfirm(jsBizMultLan.ssc_ElectroniContractTaskList_27600681_i18n_1021, function(){
							that.doRemoteWithBatchAction({
								method : "batchCompanySign",
								billIds : ids
							});
						});
					} else {
						var info = result.list;
						// 以下劳动合同主体没有维护模板对应印章类型的印章，点击【确认】后对应文件将加盖公章
						var noSealType = '<div>' + jsBizMultLan.ssc_ElectroniContractTaskList_27600681_i18n_1022 + '</div>';
						var index = 1;
						for (var company in info) {
							var sealType = info[company];
							for (var value in sealType) {
								// {0}、【{1}】需维护{2}
								var msg = shr.formatMsg(jsBizMultLan.ssc_ElectroniContractTaskList_27600681_i18n_1023, [index, company, sealType[value]]);
								noSealType += '<div>' + msg +'</div>';
								index++;
							}
						}
						shr.showConfirm(noSealType, function() {
							shr.showConfirm(jsBizMultLan.ssc_ElectroniContractTaskList_27600681_i18n_1021, function(){
								that.doRemoteWithBatchAction({
									method : "batchCompanySign",
									billIds : ids
								});
							});
						});
					}
				}
			});
		}
	},
	//初始化模板name和querypk
	initTemplateNameQueryPK: function(rowid){
		var billType = this.getSelectedRowBillType(rowid);
		if(billType==1){
			this.templateName = '/s-HR/SSC/Certification/InComeCertification';
			this.templateQueryPK = 'com.kingdee.shr.certificationservice.app.IncomeCertificationBillQuery';
		}
		if(billType==2){
			this.templateName = '/s-HR/SSC/Certification/EmpCertification';
			this.templateQueryPK = 'com.kingdee.shr.certificationservice.app.EmpCertificationBillQuery';
		}
	},

	/**
	 * 套打模板名称
	 */
	getTemplateName: function () {
		return this.templateName;
	},
	/**
	 * 套打QueryPK
	 */
	getTemplateQueryPK: function () {
		return this.templateQueryPK;

	},
	refreshAction: function () {
		this.reloadPage();
	},
	
	addEmpBillAction :function(){
		this.reloadPage({
			uipk: "com.kingdee.shr.empcertification.app.HRCertificationBill.form",
			method: 'addNew'
		});
	},
	
	addResignBillAction :function(){
		this.reloadPage({
			uipk: "com.kingdee.shr.empcertification.app.HRResignCertificationBill.form",
			method: 'addNew'
		});
	},
	
	addCommonBillAction : function() {
		this.reloadPage({
			uipk: "com.kingdee.shr.empcertification.app.HRcommonCertificationBill.form",
			method: 'addNew'
		});
	},

	updateCRTBillStatusAction: function () {
		var that = this;
		var $grid = $(that.gridId);
		var selectedIds = $grid.jqGrid("getSelectedRows");
		if (undefined == selectedIds || selectedIds == null) {
			return
		};
		if(selectedIds.length == 0){
			shr.showWarning({
				message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_16,
				hideAfter: null
			});
		}else{
			for (var i = 0, length = selectedIds.length; i < length; i++) {
				var billState = $grid.jqGrid("getCell", selectedIds[i], "billState"); //单据状态
				var drawUpMode = $grid.jqGrid("getCell", selectedIds[i], "drawUpMode"); //开具形式 1.纸质 2.电子
				var certificationStatus = $grid.jqGrid("getCell", selectedIds[i], "certificationStatus"); // 证明状态
				var isSign = $grid.jqGrid("getCell", selectedIds[i], "isSign"); // 是否已签
				var number = $grid.jqGrid("getCell", selectedIds[i], "number");//单据编号
				var billId = $grid.jqGrid("getCell", selectedIds[i], "id");
				var msgDetail='';
				if(certificationStatus==102){//检查开具状态
				    shr.showWarning({
							message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_4,
							hideAfter: null
					});
					return false;
				}else if(certificationStatus==103){//检查开具状态
				    shr.showWarning({
							message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_3,
							hideAfter: null
					});
					return false;
				}else if(billState!=3){//检查单据状态
				    shr.showWarning({
						message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_32,
						hideAfter: null
					});
					return false;
			    }else if(drawUpMode==2 && isSign=="0"){//检查是否已企业签
				    shr.showWarning({
							message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_2,
							hideAfter: null
					});
					return false;
				}else{
					that.remoteCall({
						method: "updateCRTBillStatus",
						param: {
							billId: billId,
							selectStatus: 102
						},
						type: "POST",
						async:false,
						success: function (res) {
							if(res && res.type=="SUCCESS"){
								shr.showInfo({
					                message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_0,
					                hiddenAfter: 5
					            });
								that.queryGrid();
							}
						}
					});
				}	
			}
		}
	},
	/**
	 * 放弃开具
	 */
	abandonIssueAction: function (billId, rowid) {
		var _self = this;
		var $grid = $("#grid");
		var ids = $grid.jqGrid("getSelectedRows");
		if (ids.length == 0) {
			shr.showWarning({
				message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_16
			});
			return;
		} else if(ids.length > 1){
			shr.showWarning({
				message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_17
			});
			return;
		}else {
			var data = $grid.jqGrid("getRowData",ids[0]);
			if(!data.certificationStatus || data.certificationStatus == 102){
				shr.showWarning({
					message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_5,
					hiddenAfter: 5
				});
				return;
			}
			if(!data.certificationStatus || data.certificationStatus == 103){
				shr.showWarning({
					message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_6,
					hiddenAfter: 5
				});
				return;
			}
			shr.callHandler({
				handler: "com.kingdee.shr.empCertification.web.handler.HRcertificationbillListHandler",
				action: "updateCRTBillStatus",
				param: {
					billId: ids[0],
					selectStatus:103//放弃开具
				},
				type: "POST",
				async:false,
				success: function (res) {
					if(res && res.type=="SUCCESS"){
						shr.showInfo({
			                message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_0,
			                hiddenAfter: 5
			            });
						_self.queryGrid();
					}
				}
			});
		}
	},
	sendResultViewAction:function(event) {
		_self = this;
		var uipk = "com.kingdee.shr.empcertification.SendEmailResult";
		var curUipk = shr.getUipk();
		if (curUipk == "com.kingdee.shr.certificationservice.app.HRCertificationBill.cmp.list") {
			uipk = "com.kingdee.shr.shareservice.app.SendEmailResult.cmp.list";
		}
		_self.reloadPage({
			uipk: uipk
		});		
	},
	
	/**
	 * 查看，子类需要重写
	 */
	viewAction: function (billId, rowid) {
		// 编辑界面禁用，则直接返回
		if (this.editViewDisable) {
			return;
		}

		var billType = this.getSelectedRowBillType(rowid);
		if(billType == 2){
			this.reloadPage({
				uipk: 'com.kingdee.shr.empcertification.app.HRCertificationBill.form',
				billId: billId,
				method: 'view'
			});
		}
		if(billType == 3){
			this.reloadPage({
				uipk: 'com.kingdee.shr.empcertification.app.HRResignCertificationBill.form',
				billId: billId,
				method: 'view'
			});
		}
		if(billType==4){
			this.reloadPage({
				uipk: 'com.kingdee.shr.empcertification.app.HRcommonCertificationBill.form',
				billId: billId,
				method: 'view'
			});
		}
		if (billType == 1) {
			this.reloadPage({
				uipk: 'com.kingdee.shr.certificationservice.app.IncomeCertificationBill.formAll',
				billId: billId,
				method: 'view',
				shruicode: 'OF_CMP_CERTI'
			});
		}
	},

	/**
	*获取选中行talentId
	*/
	getselectedRowTalentId: function () {
		var $grid = $("#grid");
		var ids = $grid.jqGrid("getSelectedRows");
		if (ids.length > 1 || ids.length == 0) {
			shr.showError({
				message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_17,
				hiddenAfter: 5
			});
			return;
		} else {
			var talentIds = this.getSelectedIds();
			return talentIds;
		}
	},
	
	/**
	*获取选中行billType
	*/
	getSelectedRowBillType: function(rowid){
		var $grid = $(this.gridId);
		var billType = $grid.jqGrid("getCell", rowid, "certificationBillType.billType");
		return billType;
	},
	
	/**
	*获取默认邮箱，发送邮箱
	*/
	sendEmailAction: function () {
		var _self = this;
		var $grid = $(this.gridId);
        var selectedIds = $grid.jqGrid("getSelectedRows");
		if (selectedIds.length == 1) {
			var email = "";			
			var billState = $grid.jqGrid("getCell", selectedIds[0], "billState"); //单据状态			
			var drawUpMode = $grid.jqGrid("getCell", selectedIds[0], "drawUpMode"); //证明类型 1.纸质 2.电子
			var certificationStatus = $grid.jqGrid("getCell", selectedIds[0], "certificationStatus"); // 是否已开证明
			var personName = $grid.jqGrid("getCell", selectedIds[0], "person.name");
			var isSign = $grid.jqGrid("getCell", selectedIds[0], "isSign"); // 是否已签
			var billId = $grid.jqGrid("getCell", selectedIds[0], "id");
			if(billState!=3){
				shr.showWarning({
					message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_21 
				});
				return;
			}
			if(drawUpMode != 2){
				shr.showWarning({
					message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_7 
				});
				return;
			}
			if(isSign != "1"){
				shr.showWarning({
					message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_12 
				});
				return;
			}
			if(certificationStatus == 103){
				shr.showWarning({
					message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_28
				});
				return;
			}
			_self.remoteCall({
				method: "sendEmail",
				param: {
					billId: billId
				},
				success: function(response) {
					shr.showInfo({
						message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_9,
						hideAfter: 3
					});
				},
				error: function(xhr, data) {
					console.log(JSON.stringify(xhr));
					console.log(JSON.stringify(data));	
					return;						
				}
			});			
        }else if(selectedIds.length < 1){
			shr.showInfo({
                message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_18
            });
		}else {
			shr.showInfo({
                message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_29
            });
		}
	
	},
	
	openTaskLoadTip: function(tipString) {
        var _self = this;
		var html = '';
		if(tipString == jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_27){
			html = SendLoadTip();
		}else{
			html = taskLoadTip();
		}
       
        html = juicer(html, { tipMsg: tipString });
        $('#operationEmailDialog').html(html).fadeIn(150);
    },

    closeTaskLoadTip: function(html) {
        $('#operationEmailDialog').html(html).fadeIn(150);
		$('#operationEmailDialog').removeAttr('display');
    },
    deleteAction:function(){	
		var clz = this;
		var $grid = $(clz.gridId);
		var selectedIds = $grid.jqGrid("getSelectedRows");
		if (selectedIds.length == 0) {
			shr.showWarning({
				message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_16
			});
			return;
		} else if(selectedIds.length > 1){
			shr.showWarning({
				message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_17
			});
			return;
		}else{//开具状态为“放弃开具”或者“未提交”“审批不通过”的可以删除
			var certificationStatus = $grid.jqGrid("getCell", selectedIds[0], "certificationStatus"); // 是否已开证明
			var billState = $grid.jqGrid("getCell", selectedIds[0], "billState"); //单据状态
			if(certificationStatus != 103 && billState != 4 && billState != 0){
				shr.showWarning({
					message: jsBizMultLan.emp_HRCertificationBillList_28243376_i18n_31
				});
				return;
			}
			shr.empCertification.HRCertificationBillList.superClass.deleteAction.call(this);
		}
	},
	// 引入工具类
	loadFiles:function(){
		shr.loadScript(shr.getContextPath() + "/addon/shrshareservice/web/js/i18n/shareservice_i18n_" + contextLanguage + ".js");
		shr.loadScript(shr.getContextPath() + '/addon/shrshareservice/web/js/shr/shareservice/viewProgressUtils.js');
	},
	viewApprovalProgressAction: function() {
		var billId = this.getSelectedFields("id");
		viewProgressUtils.getProgressView(billId,"certificationservice");
	},

	addButtonTips: function (field, tips) {
		var btn = $("#" + field);
		btn.css("margin-right", "-3px");
		btn.after("<div id=" + field + "_tips style='display:inline-block;margin-right:10px'></div>");
		var json = {
			content: '<div id="' + field + '_tips">' + tips + '</div>'
		};
		$("#" + field + "_tips").shrTooltip(json);
	},

});

function taskLoadTip() {
	var html = ['<div style="text-align:center; margin-top:-9px;height:72px;">',
		'<p style="font-size:36px;color:#808080;">',
		'<i class="icon-spinner icon-spin" id="load_icon"></i>',
		'</p>',
		'<p style="">${tipMsg}</p>',
		'</div>'
	];
	return html.join('');
}

function SendLoadTip() {
	var html = ['<div style="text-align:center; margin-top:-9px;height:72px;">',
		'<p style="font-size:36px;color:#808080;margin: 0 0 1px">',
		'<i class="icon-spinner icon-spin" id="load_icon"></i>',
		'</p>',
		'<p style="">${tipMsg}</p>',
		'</div>'
	];
	return html.join('');
}