/** * 硕博人才生活补贴申报管理初始化 */ var LivingAllowanceInfo = { id: "LivingAllowanceInfoTable", //表格id seItem: null, //选中的条目 table: null, layerIndex: -1 }; /** * 初始化表格的列 */ LivingAllowanceInfo.initColumn = function () { return [ {field: 'selectItem', radio: true}, {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle', width: '80px'}, {title: '申报补贴年次', field: 'applyCount', visible: true, align: 'center', valign: 'middle', width: '100px', formatter: function (value, row, index) { if (value == 1) { return "首年"; } if (value == 2) { return "第二年"; } if (value == 3) { return "第三年"; } } }, {title: '申报类型', field: 'declareTypeName', visible: true, align: 'center', valign: 'middle', width: '80px'}, { title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px", formatter: function (value, row, index) { return row.sex == 1 ? value + '【男】' : value + '【女】'; } }, // {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',width:"100px", // formatter : function (value,row,index){ // return value == 1?"晋江市优秀人才":"集成电路优秀人才"; // } // }, { title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "150px" }, { title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px" }, { title: '最高学历', field: 'highEducation', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px" }, { title: '毕业学校', field: 'graduateSchool', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px" }, { title: '手机号码', field: 'phone', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px" }, { title: '本单位入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px" }, { title: '首次来晋工作时间', field: 'firstInJJTime', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px" }, { title: '兑现状态', field: 'isPay', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px", formatter: function (value, row, index) { if (value == -1) { return "不予兑现" } if (value == 0) { return "未知" } if (value == 1) { return "待兑现" } if (value == 2) { return "已兑现" } } }, { title: '兑现金额', field: 'amount', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px", }, { title: '判断描述', field: 'amountDesc', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px", }, { title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px", formatter: function (value, row, index) { if (value == 1) { return "待提交" } else if (value == 10 || value == 5) { return "已驳回" } else { if (row.isPublic >= 4) { if (value == -1) { return "审核不通过" } else if (value == 35) { return "审核通过" } else { return "审核中" } } else { return "审核中" } } } }, {title: '审核意见', field: 'checkMsg', visible: false, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px", formatter: function (value, row, index) { if (value == 1) { return "" } else if (value == 10 || value == 5) { return value; } else { if (row.isPublic >= 5) { if (value == -1) { return value } else if (value == 35) { return value; } else { return "" } } else { return "" } } } }, {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px", formatter: function (value, row, index) { return "" + "日志" + ""; } } ]; }; /** * 检查是否选中 */ LivingAllowanceInfo.check = function () { var selected = $('#' + this.id).bootstrapTable('getSelections'); if (selected.length == 0) { Feng.info("请先选中表格中的某一记录!"); return false; } else { LivingAllowanceInfo.seItem = selected[0]; return true; } }; /** * 点击添加硕博人才生活补贴申报 */ LivingAllowanceInfo.openAddLivingAllowanceInfo = function () { var ajax = new $ax("/common/batch/checkBatchValid", function (data) { if (data.code == 200) { var index = layer.open({ type: 2, title: '添加人才生活补贴申报', fix: false, //不固定 maxmin: true, content: '/enterprise/living_allowance/apply?year=' + data.batch, btn: [' 保存未提交', ' 提交审核', ' 取消'], btnAlign: 'c', btn1: function (index, layero) { var obj = layero.find("iframe")[0].contentWindow; obj.LivingAllowanceInfoInfoDlg.addSubmit(); }, btn2: function (index, layero) { var obj = layero.find("iframe")[0].contentWindow; obj.LivingAllowanceInfoInfoDlg.submitToCheck(); return false; }, success: function (layero, index) { layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2}); }, end: function () { layer.closeAll('tips'); } }); layer.full(index); LivingAllowanceInfo.layerIndex = index; } else { Feng.info(data.msg); } }, function (data) { Feng.error("校验失败!" + data.responseJSON.message + "!"); }); ajax.set("type", CONFIG.project_master_living_allowance); ajax.start(); }; /** * 打开查看硕博人才生活补贴申报详情 */ LivingAllowanceInfo.openLivingAllowanceInfoDetail = function () { if (this.check()) { var ajax = new $ax("/common/batch/checkBatchValid", function (data) { if (data.code == 200) { var index = layer.open({ type: 2, title: '硕博人才生活补贴修改', area: ['800px', '420px'], //宽高 fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/enterprise/living_allowance/apply/id/' + LivingAllowanceInfo.seItem.id, btn: [' 保存未提交', ' 提交审核', ' 取消'], btnAlign: 'c', btn1: function (index, layero) { var obj = layero.find("iframe")[0].contentWindow; obj.LivingAllowanceInfoInfoDlg.addSubmit(); }, btn2: function (index, layero) { var obj = layero.find("iframe")[0].contentWindow; obj.LivingAllowanceInfoInfoDlg.submitToCheck(); return false; }, success: function (layero, index) { layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2}); }, end: function () { layer.closeAll('tips'); } }); layer.full(index); LivingAllowanceInfo.layerIndex = index; } else { Feng.info(data.msg); } }, function (data) { Feng.error("校验失败!" + data.responseJSON.message + "!"); }); ajax.set("type", CONFIG.project_master_living_allowance); ajax.set("year", LivingAllowanceInfo.seItem.year); ajax.set("first_submit_time", LivingAllowanceInfo.seItem.firstSubmitTime); ajax.start(); } }; /** * 打开查看窗口 */ LivingAllowanceInfo.openLivingAllowanceInfoSelect = function () { if (this.check()) { var index = layer.open({ type: 2, title: '硕博人才生活补贴详情', area: ['800px', '420px'], //宽高 fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/enterprise/living_allowance/detail/id/' + LivingAllowanceInfo.seItem.id, btn: [' 取消'], btnAlign: 'c', }); layer.full(index); LivingAllowanceInfo.layerIndex = index; } } /** * 删除硕博人才生活补贴申报 */ LivingAllowanceInfo.delete = function () { if (this.check()) { if (LivingAllowanceInfo.seItem.checkState != 0) { Feng.error("该申报已提交审核,无法删除"); return; } var operation = function () { var ajax = new $ax(Feng.ctxPath + "/enterprise/living_allowance/delete", function (data) { Feng.success("删除成功!"); LivingAllowanceInfo.table.refresh(); }, function (data) { Feng.error("删除失败!" + data.responseJSON.message + "!"); }); ajax.set("id", LivingAllowanceInfo.seItem.id); ajax.start(); } Feng.confirm("删除后无法恢复,确认删除吗?", operation); } }; /** * 查询硕博人才生活补贴申报列表 */ LivingAllowanceInfo.search = function () { var queryData = {}; queryData['name'] = $("#name").val(); queryData['idCard'] = $("#idCard").val(); LivingAllowanceInfo.table.refresh({query: queryData}); }; LivingAllowanceInfo.reset = function () { $("#name").val(""); $("#idCard").val(""); } LivingAllowanceInfo.showLog = function (id) { layer.open({ type: 1, title: "日志", fixed: false, content: '