123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- /**
- * 离职管理管理初始化
- */
- 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 '<span class=\'label\'>待提交</span>';
- }
- if (value == 1) {
- return '<span class=\'label label-success\'>待审核</span>';
- }
- if (value == 2) {
- return '<span class=\'label label-danger\'>已驳回</span>';
- }
- if (value == 3) {
- return '<span class=\'label label-primary\'>已通过</span>';
- }
- if (value == 9) {
- return '<span class=\'label label-success\'>重新提交</span>';
- }
- }
- },
- {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
- formatter: function (value, row, index) {
- return "<span class='label label-success' onclick=\"TalentQuit.showLog('" + value + "')\" >" +
- "<i class=\"fa fa-book\"></i>日志" +
- "</span>";
- }
- },
- ];
- };
- /**
- * 检查是否选中
- */
- 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: ['<i class="fa fa-check"></i> 审核', '<i class="fa fa-eraser"></i> 取消'],
- 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: '<table id="' + id + '"></table>',
- area: ['80%', '80%'],
- maxmin: true,
- success: function (layero, index) {
- Feng.getCheckLog(id, {"type": 10, "mainId": id, "typeFileId": "", "active": 1, "category": "close_account"})
- }
- });
- }
- $(function () {
- var defaultColunms = TalentQuit.initColumn();
- var table = new BSTable(TalentQuit.id, "/admin/enterpriseCloseAccount/list", defaultColunms);
- table.setPaginationType("server");
- TalentQuit.table = table.init();
- });
|