/** * 初始化人才认定申报详情对话框 */ var TalentAllowanceInfoDlg = { talentAllowanceData: {} }; /** * 关闭此对话框 */ TalentAllowanceInfoDlg.close = function () { parent.layer.close(window.parent.TalentAllowanceInfo.layerIndex); } /** * 初始化工作单位及核查项目情况表 */ TalentAllowanceInfoDlg.initContract = function () { $("#projectTable").bootstrapTable({ url: Feng.ctxPath + "/admin/talentAllowance/findAllowanceContractDetail", method: 'POST', contentType: "application/x-www-form-urlencoded; charset=UTF-8", search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端 showRefresh: false, // 是否显示刷新按钮 clickToSelect: true, // 是否启用点击选中行 singleSelect: true, // 设置True 将禁止多选 striped: true, // 是否显示行间隔色 escape: true, pagination: false, // 设置为 true 会在表格底部显示分页条 paginationHAlign: "left", paginationDetailHAlign: "right", sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server' showColumns: false, detailView: true, //父子表 queryParams: function (params) { return $.extend({"mainId": $("#id").val()}, params) }, columns: TalentAllowanceInfoDlg.initContractColumns(), onPostBody: function () { $("td.uitd_showTip").bind("mouseover", function () { var htm = $(this).html(); $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show'); }); }, onLoadSuccess: function (data) { $("#projectTable").bootstrapTable('expandAllRows'); }, onExpandRow: function (index, row, $detail) { var enterpriseId = row.enterpriseId; var cur_table = $detail.html('
').find('table'); $(cur_table).bootstrapTable({ url: Feng.ctxPath + "/admin/talentAllowance/findAllowanceProject", method: 'POST', contentType: "application/x-www-form-urlencoded; charset=UTF-8", search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端 showRefresh: false, // 是否显示刷新按钮 clickToSelect: true, // 是否启用点击选中行 singleSelect: true, // 设置True 将禁止多选 striped: true, // 是否显示行间隔色 escape: true, pagination: false, // 设置为 true 会在表格底部显示分页条 paginationHAlign: "left", paginationDetailHAlign: "right", sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server' showColumns: false, queryParams: function (params) { return $.extend({"mainId": $("#id").val(), "baseId": row.id, "companyCode": ""}, params) }, columns: TalentAllowanceInfoDlg.initProjectColumns(), }); } }); TalentAllowanceInfoDlg.initArrange(); } TalentAllowanceInfoDlg.initArrange = function () { $("#arrangeTable").bootstrapTable({ url: Feng.ctxPath + "/admin/talentAllowance/findAllowanceArrange", method: 'POST', contentType: "application/x-www-form-urlencoded; charset=UTF-8", search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端 showRefresh: false, // 是否显示刷新按钮 clickToSelect: true, // 是否启用点击选中行 singleSelect: true, // 设置True 将禁止多选 striped: true, // 是否显示行间隔色 escape: true, pagination: false, // 设置为 true 会在表格底部显示分页条 paginationHAlign: "left", paginationDetailHAlign: "right", sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server' showColumns: false, pageList: [10, 30, 50], queryParams: function (params) { return $.extend({"mainId": $("#id").val()}, params) }, columns: [ {field: 'selectItem', checkbox: false, visible: false}, {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', width: "100px"}, {title: '认定条件', field: 'identifyConditionText', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'}, {title: '开始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle', width: "100px"}, {title: '结束时间', field: 'endTime', visible: true, align: 'center', valign: 'middle', width: "100px"}, {title: '忽略其他条件可享受月份', field: 'prepareMonths', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'}, {title: '综合可享受月份', field: 'months', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'}, {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'}, ], onPostBody: function () { $("td.uitd_showTip").bind("mouseover", function () { var htm = $(this).html(); $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show'); }); } }); } //显示修改工作单位合同情况模态框 TalentAllowanceInfoDlg.showEditContractModel = function (id) { var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/validateIsCheck", function (data) { if (data.code == 200) { $("#contractForm")[0].reset(); $("#contractId").val(id); $("#contractModal").modal("show"); } else { Feng.info(data.msg); } }, function (data) { Feng.error("校验失败!" + data.responseJSON.message + "!"); }); ajax.set("id", id); ajax.set("type", 1); ajax.set("process", $("#process").val()) ajax.set("companyId", $("#companyId").val()) ajax.start(); } //修改合同起止时间提交 TalentAllowanceInfoDlg.editContract = function () { var id = $("#contractId").val(); var startTime = $("#startTime").val(); var endTime = $("#endTime").val(); if (startTime == null || startTime == '') { Feng.info("请选择合同起始时间"); return; } if (endTime == null || endTime == '') { Feng.info("请选择合同截止时间"); return; } var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editContract", function (data) { if (data.code == 200) { Feng.success(data.msg); $("#projectTable").bootstrapTable("refresh", {}); $("#contractModal").modal("hide"); } else { Feng.info(data.msg); } }, function (data) { Feng.error("提交失败!" + data.responseJSON.message + "!"); }); ajax.set({"id": id, "startTime": startTime, "endTime": endTime, "process": $("#process").val()}); ajax.start(); } TalentAllowanceInfoDlg.saveProjectData = function (id, project, allowanceType) { var description = $("#d" + id).val(); var months = []; var error = ""; if (project == 4 && allowanceType == 2) { $("#m" + id + " input[name=day]").each(function () { var days = $(this).val(); var max = $(this).attr("max"); var num = $(this).attr("num"); if (isNaN(days)) { error = error + num + "月的考勤天数不是数字;"; } else { if (days < 0 || days > max) { error = error + num + "月的考勤天数不在范围内(1-" + max + ");"; } } if (days == null || days == '') { days = 0; } months.push(num + "=" + days); }) } else { $("#m" + id + " input[name=month]").each(function () { if (this.checked) { months.push($(this).val()); } }) } if (error != "") { Feng.error(error); return; } var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editProject", function (data) { if (data.code == 200) { Feng.success(data.msg); } else { Feng.info(data.msg); } }, function (data) { Feng.error("提交失败!" + data.responseJSON.message + "!"); }); ajax.set({"id": id, "months": months.join(","), "description": description}); ajax.start(); } //显示编辑项目模态框 TalentAllowanceInfoDlg.showEditProjectModal = function (project, id, enterpriseId, months, days, content) { var desc = $(content).attr("data-value"); var type = $("#type").val(); TalentAllowanceInfoDlg.initICheck(); $("#description").val(desc); switch (project) { case "1": $("#contractCheckForm")[0].reset(); $("#contractCheckId").val(id); $("#contractEnterpriseId").val(enterpriseId); $("#contractCheckModal").modal("show"); break; case "4": var allowanceType = $("#allowanceType").val(); if (allowanceType == 2) { $("#attendanceModalLabel").html("考勤"); $("#heading").html("请填写每月考勤天数(不填写或填写0则代表无考勤记录)"); $("#attendanceForm")[0].reset(); $("#attendanceId").val(id); $("#attendanceEnterpriseId").val(enterpriseId); if (months != null && months != '') { var arr = months.split(","); for (var key in arr) { var num = arr[key].split("=")[0]; var day = arr[key].split("=")[1]; $("#attendMonths input").each(function () { if ($(this).attr('num') == num) $(this).val(day); }); } } $("#attendanceModal").modal("show"); } else if (allowanceType == 1) { $('#jjAttendanceModal').on('show.bs.modal', function () { $("#jjmonths input").each(function () { $(this).iCheck("uncheck"); }); $("#jjAttendanceId").val(id); $("#jjAttendanceEnterpriseId").val(enterpriseId); if (Feng.isNotEmptyStr(months)) { if (months.indexOf(",") != -1) { var arr = months.split(","); for (var key in arr) { $("#jjmonths input").each(function () { if ($(this).val() == arr[key]) $(this).iCheck("check"); }); } } } }); if (days != null && days != '') $("#days").val(days); $("#jjAttendanceModal").modal("show"); } break; case "15": $("#attendanceModalLabel").html("在境时间"); $("#heading").html("请填写每月在境内天数(不填写则代表为0天)"); $("#attendanceForm")[0].reset(); $("#attendanceId").val(id); $("#attendanceEnterpriseId").val(enterpriseId); if (months != null && months != '') { var arr = months.split(","); for (var key in arr) { var num = arr[key].split("=")[0]; var day = arr[key].split("=")[1]; $("#attendMonths input").each(function () { if ($(this).attr('num') == num) $(this).val(day); }); } } $("#attendanceModal").modal("show"); break; case "16": $("#attendanceModalLabel").html("境内工作日时间"); $("#heading").html("请填写每月境内工作日天数(不填写则代表为0天)"); $("#attendanceForm")[0].reset(); $("#attendanceId").val(id); $("#attendanceEnterpriseId").val(enterpriseId); if (months != null && months != '') { var arr = months.split(","); for (var key in arr) { var num = arr[key].split("=")[0]; var day = arr[key].split("=")[1]; $("#attendMonths input").each(function () { if ($(this).attr('num') == num) $(this).val(day); }); } } $("#attendanceModal").modal("show"); break; default: $('#projectModal').on('show.bs.modal', function () { $("#months input").each(function () { $(this).iCheck("uncheck"); }); $("#projectId").val(id); $("#enterpriseId").val(enterpriseId); TalentAllowanceInfoDlg.initICheck(); if (Feng.isNotEmptyStr(months)) { var arr = months.split(","); for (var key in arr) { $("#months input").each(function () { if ($(this).val() == arr[key]) $(this).iCheck("check"); }); } } }); $("#projectModal").modal("show"); break; } } //审核合同满两年提交 TalentAllowanceInfoDlg.contractCheckSubmit = function () { var id = $("#contractCheckId").val(); var enterpriseId = $("#contractEnterpriseId").val(); var description = $("#msg").val(); var months = $("#state").val(); var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editProject", function (data) { if (data.code == 200) { Feng.success(data.msg); $("#" + enterpriseId).bootstrapTable("refresh", {}); $("#contractCheckModal").modal("hide"); } else { Feng.info(data.msg); } }, function (data) { Feng.error("提交失败!" + data.responseJSON.message + "!"); }); ajax.set({"id": id, "months": months, "description": description, "process": $("#process").val()}); ajax.start(); } //编辑项目提交 TalentAllowanceInfoDlg.editProject = function () { var id = $("#projectId").val(); var enterpriseId = $("#enterpriseId").val(); var description = $("#description").val(); var months = ""; $("#months input").each(function () { if (this.checked) { months = months + $(this).val() + ","; } }) var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editProject", function (data) { if (data.code == 200) { Feng.success(data.msg); $("#" + enterpriseId).bootstrapTable("refresh", {}); $("#projectModal").modal("hide"); } else { Feng.info(data.msg); } }, function (data) { Feng.error("提交失败!" + data.responseJSON.message + "!"); }); ajax.set({"id": id, "months": months, "description": description, "process": $("#process").val()}); ajax.start(); } /** * 提交晋江市现代产业体系人才的考勤 */ TalentAllowanceInfoDlg.editJJAttendance = function () { var id = $("#jjAttendanceId").val(); var enterpriseId = $("#jjAttendanceEnterpriseId").val(); var description = $("#jjDescription").val(); var days = $("#days").val(); var months = ""; $("#jjmonths input").each(function () { if (this.checked) { months = months + $(this).val() + ","; } }) if (months == "" && (days == null || days == "")) { //Feng.info("请填写考勤信息"); //return; } if (months != null && months != '' && days != null && days != '') { Feng.info("考勤天数和考勤月份只能选择一个填写"); return; } $("#attendanceMonths").val(months); $("#jjAttendanceForm")[0].submit(); var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editProject", function (data) { if (data.code == 200) { Feng.success(data.msg); $("#" + enterpriseId).bootstrapTable("refresh", {}); $("#jjAttendanceModal").modal("hide"); } else { Feng.info(data.msg); } }, function (data) { Feng.error("提交失败!" + data.responseJSON.message + "!"); }); ajax.set({"id": id, "months": months, "days": days, "description": description, "process": $("#process").val()}); ajax.start(); } TalentAllowanceInfoDlg.editAttendanceProject = function () { var id = $("#attendanceId").val(); var enterpriseId = $("#attendanceEnterpriseId").val(); var description = $("#attendanceDescription").val(); var months = ""; var error = ""; $("#attendMonths input").each(function () { var days = $(this).val(); var num = $(this).attr("num"); if (isNaN(days)) { error = error + num + "月的考勤天数不是数字;"; } else { if (days < 0 || days > 31) { error = error + num + "月的考勤天数不在范围内(1-31);"; } } if (days == null || days == '') { days = 0; } months = months + num + "=" + days + ","; }); if (error != "") { Feng.error(error); return; } var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/editProject", function (data) { if (data.code == 200) { Feng.success(data.msg); $("#" + enterpriseId).bootstrapTable("refresh", {}); $("#attendanceModal").modal("hide"); } else { Feng.info(data.msg); } }, function (data) { Feng.error("提交失败!" + data.responseJSON.message + "!"); }); ajax.set({"id": id, "months": months, "description": description, "process": $("#process").val()}); ajax.start(); } /** * 计算津补贴额度 */ TalentAllowanceInfoDlg.showCheckModal = function () { layer.open({ id: "afterCheck", type: 1, title: "津补贴计算", fixed: false, resize: true, scrollbar: false, content: '
\n' + '
推荐津补贴类型
\n' + '
\n' + '
\n' + '
\n' + ' \n' + ' \n' + '
\n' + '
\n' + ' \n' + ' \n' + '
\n' + '
\n' + ' \n' + ' \n' + '
\n' + '
\n' + ' \n' + ' \n' + '
\n' + '
\n' + '
\n' + '
\n' + '
\n' + '
确认津补贴
\n' + '
\n' + '
\n' + ' \n' + ' \n' + '
\n' + '
\n' + ' \n' + ' \n' + '
\n' + '
\n' + ' \n' + ' \n' + '
\n' + '
\n' + ' \n' + ' \n' + '
\n' + ' \n' + ' \n' + ' \n' + ' \n' + '
\n' + '
', area: ['80%', '80%'], maxmin: true, btn: ['  提交审核', '  关闭'], btnAlign: 'c', success: function (layero, index) { var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/suppleCheckCalculate", function (data) { if (data.code == 200) { var info = data.obj.info; var list = data.obj.detailList; if (info.recommendAllowanceType == 1) { $("#recommendallowanceType").val("工作津贴"); } if (info.recommendAllowanceType == 2) { $("#recommendallowanceType").val("一次性交通补贴"); } if (info.recommendAllowanceType == 3) { $("#recommendallowanceType").val("不予兑现"); } $("#recommenddxMonths").val(info.recommendMonths); $("#recommendAllowanceMsg").val(info.recommendAllowanceMsg); $("#recommendMoneyDesc").val(info.recommendMoneyDesc); var html = ""; for (var key in list) { var title = info.type == 1 ? list[key].enterpriseName + "(" + list[key].entryTime + "至" + list[key].quitTime + ")-" + list[key].talentTypeName : list[key].enterpriseName + "(" + list[key].entryTime + "至" + list[key].quitTime + ")"; html = html + '
\n' + '' + '' + title + '' + '\n' + '编辑\n' + '
\n'; } $("#setMonths").append(html); } else { Feng.info(data.msg); } }, function (data) { Feng.error("提交失败!" + data.responseJSON.message + "!"); }); ajax.set({"id": $("#id").val()}); ajax.start(); }, yes: function (index, layero) { var operation = function () { var checkState = $("#checkStateAfter").val(); var checkMsg = $("#checkMsgAfter").val(); var zxState = $("#zxState").val(); var zxMsg = $("#zxMsg").val(); var source = $("#source").val(); var resAllowanceType = $("#resAllowanceType").val(); var resAllowanceMsg = $("#resAllowanceMsg").val(); var details = new Array(); $(".detailMonths").each(function () { var id = $(this).find(".detailId").val(); var months = $(this).find(".months").val(); details.push({"id": id, "months": months}); }); if (Feng.isEmptyStr(checkState)) { Feng.info("请选择审核状态"); return; } if (Feng.isEmptyStr(checkMsg)) { Feng.info("请填写审核意见"); return; } if (Feng.isEmptyStr(zxState)) { Feng.info("请选择征信状态"); return; } if (zxState == 2 && Feng.isEmptyStr(zxMsg)) { Feng.info("请填写失信原因"); return; } if (checkState == 3 && zxState == 1) { if (Feng.isEmptyStr(source)) { Feng.info("请选择判定类型"); return; } if (source == 2) { if (Feng.isEmptyStr(resAllowanceType)) { Feng.info("请选择津补贴类型"); return; } if (resAllowanceType == 1 && details.length == 0) { Feng.info("请选择工作津贴可享受的月份"); return; } if (Feng.isEmptyStr(resAllowanceMsg)) { Feng.info("请填写判定说明"); return; } } } var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/afterCheck", function (data) { if (data.code == 200) { Feng.success(data.msg); window.parent.TalentAllowanceInfo.table.refresh(); TalentAllowanceInfoDlg.close(); } else { Feng.info(data.msg); } }, function (data) { Feng.error("提交失败!" + data.responseJSON.message + "!"); }); ajax.setData(JSON.stringify({"id": $("#id").val(), "checkState": checkState, "checkMsg": checkMsg, "zxState": zxState, "zxMsg": zxMsg, "source": source, "resAllowanceType": resAllowanceType, "resAllowanceMsg": resAllowanceMsg, "details": details})) ajax.setcontentType("application/json;charset=utf-8"); ajax.start(); }; Feng.confirm("一旦提交将无法修改,确认提交吗?", operation); } }); } TalentAllowanceInfoDlg.showEditMonths = function (content) { layer.open({ id: "setMoths", type: 1, title: "津补贴计算", fixed: false, resize: true, scrollbar: false, content: '\n', area: ['60%', '40%'], maxmin: true, btn: ['  确定', '  关闭'], btnAlign: 'c', yes: function (index, layero) { var months = ""; $("#resMonths input").each(function () { if (this.checked) { months = months + $(this).val() + ","; } }); months = months.substring(0, months.length - 1); $(content).prev().val(months); layer.close(index); }, }); } TalentAllowanceInfoDlg.allowanceTypeChange = function (content) { var allowanceType = $(content).val(); if (allowanceType == 1) { $(".personDiv").css("display", "none"); } else { $(".personDiv").css("display", "block"); } } TalentAllowanceInfoDlg.checkStateChange = function (content) { var checkState = $(content).val(); var zxState = $("#zxState").val(); if (checkState == -1) { $(".notPassDiv").css("display", "none"); } else if (checkState == 3 && zxState == 1) { $(".sourceDiv").css("display", "block"); } else { $(".notPassDiv").css("display", "none").trigger("change"); } } TalentAllowanceInfoDlg.zxChange = function (content) { var zxState = $(content).val(); var checkState = $("#checkStateAfter").val(); if (checkState == 2) { $(".notPassDiv").css("display", "none"); } else if (zxState == 1 && checkState == 3) { $(".sourceDiv").css("display", "block"); } else { $(".notPassDiv").css("display", "none").trigger("change"); } } TalentAllowanceInfoDlg.attendanceCallBack = function () { if (data.code == 200) { Feng.success(data.msg); $("#" + data.obj).bootstrapTable("refresh", {}); $("#jjAttendanceModal").modal("hide"); } else { Feng.info(data.msg); } } TalentAllowanceInfoDlg.initICheck = function () { $('input[type=checkbox]').iCheck({ labelHover: false, cursor: true, checkboxClass: 'icheckbox_square-green', radioClass: 'iradio_square-greene', increaseArea: '20%' }); } TalentAllowanceInfoDlg.initContractColumns = function () { var type = $("#type").val(); var process = $("#process").val(); if (type == 1) { return [ {field: 'selectItem', checkbox: false, visible: false}, {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'}, {title: '合同起始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle', width: "90px", 'class': 'uitd_showTip'}, {title: '合同截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle', width: "90px", 'class': 'uitd_showTip'}, {title: '入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'}, {title: '本年度工作截止时间', field: 'quitTime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'}, {title: '人才标签', field: 'talentTypeName', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'}, {title: '首次来晋行政介绍信时间', field: 'letterTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'}, {title: '认定条件证书取得时间', field: 'identifyGetTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'}, {title: '操作', field: 'id', visible: true, align: 'left', valign: 'middle', width: "150px", formatter: function (value, row, index) { return "" + ""; } } ]; } else { return [ {field: 'selectItem', checkbox: false, visible: false}, {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'}, {title: '合同起始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'}, {title: '合同截止时间', field: 'endTime', visible: true, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'}, {title: '入职时间', field: 'entryTime', visible: true, align: 'center', valign: 'middle', width: "80px"}, {title: '本年度工作截止时间', field: 'quitTime', visible: true, align: 'center', valign: 'middle', width: "80px"}, {title: '操作', field: 'id', visible: true, align: 'left', valign: 'middle', width: "150px", formatter: function (value, row, index) { return "" + ""; } } ]; } } //初始化项目表的列 TalentAllowanceInfoDlg.initProjectColumns = function () { return [ {field: 'selectItem', checkbox: false, visible: false}, {title: '核查项目名称', field: 'projectName', visible: true, align: 'center', valign: 'middle', width: "15%", 'class': 'uitd_showTip'}, {title: '详情', field: 'months', visible: true, align: 'center', valign: 'middle', width: "45%", formatter: function (value, row, index) { var allowanceType = $("#allowanceType").val(); var html = ""; if (row.project == 4 && allowanceType == 2) { html = TalentAllowanceInfoDlg.createDaySelector(row.id, value); } else { html = TalentAllowanceInfoDlg.createMonthSelector(row.id, value); } return html; } }, /*{title: '附件材料', field: 'fileUrl', visible: true, align: 'center', valign: 'middle',width:"35%", formatter : function(value,row,index){ if(value!=null && value!=''){ var sn = value.lastIndexOf("."); var suffix = value.substring(sn+1,value.length); return suffix=="pdf"||suffix=="PDF"?"" :''; }else{ return "未上传"; } } },*/ {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "25%", 'class': 'uitd_showTip', formatter: function (value, row, index) { var html = ''; return html; } }, {title: '操作', field: 'project', visible: true, align: 'left', valign: 'middle', width: "15%", formatter: function (value, row, index) { var allowanceType = $("#allowanceType").val(); var html = "" + ""; /*if (value == 1 || value ==2){ html = html + "" ; }*/ return html; } } ]; } TalentAllowanceInfoDlg.createDaySelector = function (id, selectDays) { var dayArr = selectDays ? selectDays.split(",") : []; var tmpKv = {}; for (var d = 0; d < dayArr.length; d++) { var kv = dayArr[d].split("="); tmpKv["m" + kv[0]] = kv[1]; } var html = '
*填写对应月份打卡天数,没有填写则记为0天
' return html; } TalentAllowanceInfoDlg.createMonthSelector = function (id, selectMonths) { var monthArr = selectMonths ? selectMonths.split(",") : []; var html = '
' return html; } TalentAllowanceInfoDlg.showFileTable = function (project) { var api = (project == 1) ? CONFIG.jbt_concat : CONFIG.jbt_tax; var index = layer.open({ type: 1, title: "附件材料", fixed: false, content: '', area: ['50%', '50%'], maxmin: true, btn: ['  关闭'], success: function (layero, index) { var ajax = new $ax(Feng.ctxPath + "/api/common/getTalentFileByApi?api=" + api + "&mainId=" + $("#id").val(), function (data) { if (data.code == 500) { Feng.error(data.msg); return; } var html = ""; var files = data.obj; for (var key in files) { var sn = files[key].url.lastIndexOf("."); var suffix = files[key].url.substring(sn + 1, files[key].url.length); var imgStr = ""; if (suffix == "pdf" || suffix == "PDF") { imgStr = ""; } else { imgStr = ''; } html = html + '
  • ' + files[key].id + '
  • \n' + '
  • ' + files[key].orignName + '
  • \n' + '
  • ' + imgStr + '
  • \n' + "
  • "; } $(".showImgs").append(html); $(".showImgs").viewer({ fullscreen: false }); }); ajax.start(); } }); } TalentAllowanceInfoDlg.showLog = function (id) { layer.open({ type: 1, title: "日志", fixed: false, content: '
    ', area: ['80%', '80%'], maxmin: true, success: function (layero, index) { $('#' + id).bootstrapTable({ url: Feng.ctxPath + "/common/api/getJbtCheckLog", method: 'POST', contentType: "application/x-www-form-urlencoded; charset=UTF-8", search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端 showRefresh: false, // 是否显示刷新按钮 clickToSelect: true, // 是否启用点击选中行 singleSelect: true, // 设置True 将禁止多选 striped: true, // 是否显示行间隔色 pagination: false, // 设置为 true 会在表格底部显示分页条 paginationHAlign: "left", paginationDetailHAlign: "right", sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server' showColumns: false, queryParams: function (params) { return {"type": CONFIG.project_jbt, "mainId": $("#id").val(), "typeFileId": id, "active": 1} }, columns: [ {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle', width: "10%", formatter: function (value, row, index) { return "" + value; } }, {title: '操作人', field: 'createUser', visible: true, align: 'center', valign: 'middle', width: "15%"}, {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "20%"}, {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle', width: "45%", formatter: function (value, row, index) { return '"' + value + '"'; } } ] , onPostBody: function () { $('#' + id + "td.uitd_showTip").bind("mouseover", function () { var htm = $(this).html(); $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show'); }); } }); } }); } //全选 TalentAllowanceInfoDlg.newCheckAll = function (id, obj) { var checked = $(obj).is(":checked"); if (checked) { $("#m" + id + " input[name=month]").each(function () { $(this).prop("checked", "checked"); }) } else { $("#m" + id + " input[name=month]").each(function () { $(this).removeAttr("checked"); }) } } //全选 TalentAllowanceInfoDlg.checkAll = function (id) { $("#" + id + " input").each(function () { $(this).iCheck("check"); }) } //反选 TalentAllowanceInfoDlg.unCheckAll = function (id) { $("#" + id + " input").each(function () { if (this.checked) { $(this).iCheck("uncheck"); } else { $(this).iCheck("check"); } }) } //初始化附件类别表单 TalentAllowanceInfoDlg.initFileTable = function () { TalentAllowanceInfoDlg.initContract(); var queryData = {}; queryData["mainId"] = $("#id").val(); queryData['project'] = CONFIG.project_jbt; queryData['type'] = $("#type").val(); queryData['allowanceType'] = $("#allowanceType").val(); $("#fileTable").bootstrapTable({ url: Feng.ctxPath + "/common/api/findCommonFileType", method: 'POST', contentType: "application/x-www-form-urlencoded; charset=UTF-8", search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端 showRefresh: false, // 是否显示刷新按钮 clickToSelect: true, // 是否启用点击选中行 singleSelect: true, // 设置True 将禁止多选 striped: true, // 是否显示行间隔色 escape: true, pagination: false, // 设置为 true 会在表格底部显示分页条 paginationHAlign: "left", paginationDetailHAlign: "right", sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server' showColumns: false, detailView: true, //是否显示父子表 pageList: [10, 30, 50], queryParams: function (params) { return $.extend(queryData, params) }, rowStyle: function (row, index) { return {classes: "info"}; }, columns: [ {field: 'selectItem', checkbox: false, visible: false}, {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle', width: "20%", 'class': 'uitd_showTip', formatter: function (value, row, index) { var postType = $("#postType").val(); if (row.must == 1 && (typeof postType == "undefined" || postType != 8)) { return ' * ' + value; } return '' + value; } }, {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "68%", 'class': 'uitd_showTip'}, {title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: "12%", formatter: function (value, row, index) { if (value == null || value == '' || value == 'null') { return '无'; } return ""; } } ], onPostBody: function () { $("td.uitd_showTip").bind("mouseover", function () { var htm = $(this).html(); $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show'); }); }, onLoadSuccess: function (data) { $("#fileTable").bootstrapTable('expandAllRows'); }, onExpandRow: function (index, row, $detail) { var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentFile", function (data) { if (data == null || data.length == 0) { return; } var html = ''; $detail.html(html); $(".imgs").viewer({ // toolbar:false, fullscreen: false }); }, function (data) { Feng.error("查询失败!" + data.responseJSON.message + "!"); }); var queryData = {}; queryData["mainId"] = $("#id").val(); queryData["fileTypeId"] = row.id; ajax.set(queryData); ajax.start(); } }); } //初始化通用附件 TalentAllowanceInfoDlg.initCommonFileTable = function () { var queryData = {}; queryData.id = $("#id").val(); $("#commonFileTable").bootstrapTable({ url: Feng.ctxPath + "/common/api/listTalentAllowanceCommonFile", method: 'POST', contentType: "application/x-www-form-urlencoded; charset=UTF-8", search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端 showRefresh: false, // 是否显示刷新按钮 clickToSelect: true, // 是否启用点击选中行 singleSelect: true, // 设置True 将禁止多选 striped: true, // 是否显示行间隔色 pagination: false, // 设置为 true 会在表格底部显示分页条 paginationHAlign: "left", paginationDetailHAlign: "right", sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server' showColumns: false, queryParams: function (params) { return $.extend(queryData, params) }, rowStyle: function (row, index) { return {css: {"word-break": "break-word", "white-space": "inherit"}} }, columns: [ {title: '附件原名', field: 'originalName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '60%', formatter: function (value, row, index) { return value; }}, {title: '附件类型', field: 'fileTypeName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '20%', formatter: function (value, row, index) { return value; }}, {title: '预览', field: 'url', visible: true, align: 'center', valign: 'middle', width: "20%", formatter: function (value, row, index) { var sn = value.lastIndexOf("."); var suffix = value.substring(sn + 1, value.length); var imgStr = ""; if (suffix == "pdf" || suffix == "PDF") { imgStr = ""; } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') { imgStr = ""; } else { imgStr = ''; } return imgStr; } } ], onPostBody: function () { $("td.uitd_showTip").bind("mouseover", function () { var htm = $(this).html(); $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show'); }); $(".cImgUrl").viewer({fullscreen: false}); } }); } TalentAllowanceInfoDlg.showAllLog = function () { var id = $("#id").val(); if (Feng.isNotEmptyStr(id)) { Feng.getCheckLog("logTable", {"type": CONFIG.project_jbt, "mainId": $("#id").val(), "typeFileId": "", "active": 1}) } } $(function () { if ($("#type").val() == 2) { $("#bankNumberSpan,#talentTypeSpan,#introductionModeSpan,#firstInJJTimeSpan").attr("style", "display:none"); } $("select").each(function () { $(this).val($(this).attr("value")); }); TalentAllowanceInfoDlg.initFileTable(); TalentAllowanceInfoDlg.initContract(); TalentAllowanceInfoDlg.initCommonFileTable(); //批量加载时间控件 $(".date").each(function () { laydate.render({elem: "#" + $(this).attr("id"), type: 'date', trigger: 'click'}); }); TalentAllowanceInfoDlg.showAllLog(); });