/** * 离职管理管理初始化 */ var TalentQuit = { id: "TalentQuitTable", //表格id seItem: null, //选中的条目 table: null, layerIndex: -1 }; /** * 初始化表格的列 */ TalentQuit.initColumn = function () { var type = $("#type").val(); var idCardTypeName = "统一社会信用代码"; var coTypeName = "企业/单位名称"; switch (type) { case 5: idCardTypeName = "登记号"; coTypeName = "医院名称"; break; case 6: coTypeName = "学校名称"; break; } if (type == 5) { idCardTypeName = "登记号"; } return [ {field: 'selectItem', radio: true}, {title: coTypeName, field: 'name', visible: true, align: 'center', valign: 'middle', width: "80px", 'class': 'uitd_showTip'}, {title: idCardTypeName, field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'}, {title: '账号', field: 'username', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'}, {title: '首次提交时间', field: 'firstSubmitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'}, {title: '最新提交时间', field: 'newSubmitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'}, {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "80px", formatter: function (value, row, index) { if (value == -1) { return '待提交'; } if (value == 1) { return '待审核'; } if (value == 2) { return '已驳回'; } if (value == 3) { return '已通过'; } if (value == 9) { return '重新提交'; } } }, {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px", formatter: function (value, row, index) { return "" + "日志" + ""; } }, ]; }; /** * 检查是否选中 */ TalentQuit.check = function () { var selected = $('#' + this.id).bootstrapTable('getSelections'); if (selected.length == 0) { Feng.info("请先选中表格中的某一记录!"); return false; } else { TalentQuit.seItem = selected[0]; return true; } }; /** * 打开查看离职管理审核页面 */ TalentQuit.openTalentQuitCheck = function () { if (this.check()) { if (TalentQuit.seItem.checkState != 1 && TalentQuit.seItem.checkState != 9) { Feng.info("不在审核范围内"); return; } var index = layer.open({ type: 2, title: '账号注销审核', fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/admin/enterpriseCloseAccount/check/id/' + TalentQuit.seItem.id, btn: [' 审核', ' 取消'], btnAlign: 'c', yes: function (index, layero) { var obj = layero.find("iframe")[0].contentWindow; obj.TalentQuitInfoDlg.submitCheck(); } }); TalentQuit.layerIndex = index; layer.full(index); } }; /** * 打开查看离职管理页面 */ TalentQuit.openTalentQuitDetail = function () { if (this.check()) { var index = layer.open({ type: 2, title: '账号注销详情', fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/admin/enterpriseCloseAccount/check/id/' + TalentQuit.seItem.id }); TalentQuit.layerIndex = index; layer.full(index); } }; /** * 查询表单提交参数对象 * @returns {{}} */ TalentQuit.formParams = function () { var queryData = {}; queryData['talentName'] = $("#talentName").val(); queryData['idCard'] = $("#idCard").val(); queryData['enterpriseName'] = $("#enterpriseName").val(); queryData['talentArrange'] = $("#talentArrange").val(); queryData['checkState'] = $("#checkState").val(); return queryData; } /** * 重置 */ TalentQuit.reset = function () { $("#talentName").val(""); $("#idCard").val(""); $("#enterpriseName").val(""); $("#talentArrange").val(""); $("#checkState").val(""); } /** * 查询离职管理列表 */ TalentQuit.search = function () { TalentQuit.table.refresh({query: TalentQuit.formParams()}); }; /** * 导出 */ TalentQuit.export = function () { var queryData = TalentQuit.formParams(); var url = Feng.ctxPath + "/admin/enterpriseCloseAccount/export?" + "&talentName=" + queryData.talentName + "&idCard=" + queryData.idCard + "&enterpriseName=" + queryData.enterpriseName + "&talentArrange=" + queryData.talentArrange + "&checkState=" + queryData.checkState; window.location.href = encodeURI(encodeURI(url)); } /** * 打包下载附件 */ TalentQuit.download = function () { if (this.check()) { window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=109&id=" + TalentQuit.seItem.id)); } } /** * 显示审核日志 */ TalentQuit.showLog = function (id) { layer.open({ type: 1, title: "日志", fixed: false, content: '