12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013 |
- /**
- * 初始化人才认定申报详情对话框
- */
- 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 + index;
- var cur_table = $detail.html('<table id="' + enterpriseId + '"></table>').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) {
- var companyCode = "";
- if ($("#process").val() == 1) {
- companyCode = $("#companyCode").val();
- }
- return $.extend({"mainId": $("#id").val(), "baseId": row.id, "companyCode": companyCode}, params)
- },
- onPostBody: function () {
- $("td.uitd_showTip").bind("mouseover", function () {
- var htm = $(this).html();
- $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
- });
- },
- onLoadSuccess: function (data) {
- $(".imgs").viewer({
- // toolbar:false,
- fullscreen: false
- });
- },
- columns: TalentAllowanceInfoDlg.initProjectColumns(enterpriseId),
- });
- }
- });
- 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: TalentAllowanceInfoDlg.initArrangeColumn(),
- 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);
- $(".date").each(function () {
- laydate.render({elem: "#" + $(this).attr("id"), type: 'date', trigger: 'click'});
- });
- $("#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.showEditProjectModal = function (project, id, enterpriseId, months, days, content) {
- var desc = $(content).attr("data-value");
- var type = $("#type").val();
- var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/validateIsCheck", function (data) {
- if (data.code == 200) {
- $("#description").val(desc);
- TalentAllowanceInfoDlg.initICheck();
- 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 == 1) {
- $('#jjAttendanceModal').on('show.bs.modal', function () {
- $("#jjAttendanceForm")[0].reset();
- $("#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");
- } else {
- $("#attendanceModalLabel").html("考勤");
- $("#heading").html("请填写每月考勤天数<span style=\"color: red\">(不填写或填写0则代表无考勤记录)</span>");
- $("#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 "15":
- $("#attendanceModalLabel").html("在境时间");
- $("#heading").html("请填写每月在境内天数<span style=\"color: red\">(不填写则代表为0天)</span>");
- $("#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("请填写每月境内工作日天数<span style=\"color: red\">(不填写则代表为0天)</span>");
- $("#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;
- }
- } else {
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("校验失败!" + data.responseJSON.message + "!");
- });
- ajax.set("id", id);
- ajax.set("type", 2);
- ajax.set("process", $("#process").val())
- ajax.set("companyId", $("#companyId").val())
- ajax.start();
- }
- //审核合同满两年提交
- 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();
- }
- /**
- * 锁定工作单位合同
- * @param id
- */
- TalentAllowanceInfoDlg.lockContract = function (id) {
- var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/validateIsCheck", function (data) {
- if (data.code == 200) {
- var operation = function () {
- var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/lockContract", function (data) {
- if (data.code == 200) {
- Feng.success(data.msg);
- $("#projectTable").bootstrapTable("refresh", {});
- } else {
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("删除失败!" + data.responseJSON.message + "!");
- });
- ajax.set("id", id);
- ajax.set("process", $("#process").val())
- ajax.start();
- }
- Feng.confirm("一旦锁定无法修改,确认锁定吗?", operation);
- } 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();
- }
- /**
- * 锁定项目
- * @param id
- */
- TalentAllowanceInfoDlg.lockProject = function (id, enterpriseId) {
- var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/validateIsCheck", function (data) {
- if (data.code == 200) {
- var operation = function () {
- var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/lockProject", function (data) {
- if (data.code == 200) {
- Feng.success(data.msg);
- $("#" + enterpriseId).bootstrapTable("refresh", {});
- } else {
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("删除失败!" + data.responseJSON.message + "!");
- });
- ajax.set("id", id);
- ajax.set("process", $("#process").val())
- ajax.start();
- }
- Feng.confirm("一旦锁定无法修改,确认锁定吗?", operation);
- } else {
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("校验失败!" + data.responseJSON.message + "!");
- });
- ajax.set("id", id);
- ajax.set("type", 2);
- ajax.set("process", $("#process").val())
- ajax.set("companyId", $("#companyId").val())
- ajax.start();
- }
- /**
- * 显示审核模态框
- */
- TalentAllowanceInfoDlg.showCheckModal = function () {
- var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/validateIsCheck", function (data) {
- if (data.code == 200) {
- layer.open({
- type: 1,
- id: "neewFieldFormModel",
- title: '审核',
- area: ['800px', '450px'], //宽高
- fix: false, //不固定
- shade: 0,
- maxmin: true,
- content: TalentAllowanceInfoDlg.createCheckHtml(),
- btn: ['<i class="fa fa-save"></i> 提交', '<i class="fa fa-eraser"></i> 关闭'],
- btnAlign: 'c',
- zIndex: layer.zIndex,
- success: function (layero, index) {
- var projectList = data.obj.projects;
- var fileList = data.obj.files;
- var concatList = data.obj.concats;
- var files = data.obj.info.files;
- var projects = data.obj.info.projects;
- var concats = data.obj.info.concats;
- var fields = data.obj.info.fields;
- var info = data.obj.info;
- var calResult = typeof data.obj.calResult != "undefined" ? data.obj.calResult : {};
- //初始化附件、核查项目、合同
- if (projectList != null && projectList.length != 0) {
- var html = '<ul>';
- for (var key in projectList) {
- html = html + '<li style="width: 100%"><input type="checkbox" value="' + projectList[key].id + '"><span>' + projectList[key].projectName + '</span></li>';
- }
- html = html + "</ul>";
- $("#field_project").empty().append(html);
- }
- if (fileList != null && fileList.length != 0) {
- var html = '';
- for (var key in fileList) {
- html = html + '<ul><li style="width: 100%"><input type="checkbox" data-type="' + fileList[key].isConditionFile + '" value="' + fileList[key].id + '"><span>' + fileList[key].name + '</span></li></ul>';
- }
- $("#field_file").empty().append(html);
- }
- if (concatList != null && concatList.length != 0) {
- var html = '';
- for (var key in concatList) {
- html = html + '<ul><li style="width: 100%"><input type="checkbox" value="' + concatList[key].id + '"><span>' + concatList[key].enterpriseName + '</span></li></ul>';
- }
- $("#field_concat").empty().append(html);
- }
- if (calResult) {
- $("#otherEnjoyedMoney").data("money", calResult.recommendMoney);
- $("#finalMoney").val(calResult.recommendMoney);
- if (calResult.recommendAllowanceType == 1) {
- var text = "补贴类型:工作津贴\n满足条件的月份:" + calResult.recommendMonths;
- text += "\n可享受补贴(元):" + calResult.recommendMoney;
- $("#calResult").text(text);
- } else if (calResult.recommendAllowanceType == 2) {
- var text = "补贴类型:一次性交通补贴";
- text += "\n可享受补贴(元):" + calResult.recommendMoney;
- $("#calResult").text(text);
- } else {
- $("#calResult").text(calResult.recommendAllowanceMsg);
- }
- }
- TalentAllowanceInfoDlg.initICheck();
- //回显数据
- $("#checkStateModal").val(info.checkState).trigger("change");
- $("#toProcess").val(info.toProcess).trigger("change");
- if (Feng.isNotEmptyStr(info.toDep))
- $("#toDep").val(info.toDep.split(",")).trigger("chosen:updated");
- $("#checkMsg").val(info.checkMsg);
- if (Feng.isNotEmptyStr(projects)) {
- $("#field_project input").each(function () {
- if (projects.indexOf($(this).val()) != -1) {
- $(this).iCheck("check");
- }
- });
- }
- if (files != null && files != '') {
- $("#field_file input").each(function () {
- if (files.indexOf($(this).val()) != -1) {
- $(this).iCheck("check");
- }
- });
- }
- if (concats != null && concats != '') {
- $("#field_concat input").each(function () {
- if (concats.indexOf($(this).val()) != -1) {
- $(this).iCheck("check");
- }
- });
- }
- if (Feng.isNotEmptyStr(fields)) {
- $("#field_field input").each(function () {
- if (fields.indexOf($(this).val()) != -1) {
- $(this).iCheck("check");
- }
- });
- }
- $("input[type=checkbox][value=allowanceType]").on("ifChanged", function (e) {
- var isChecked = $(this).is(":checked") ? "check" : "uncheck";
- $("#field_file input").each(function () {
- $(this).iCheck(isChecked);
- })
- $("#field_project input").each(function () {
- $(this).iCheck(isChecked);
- })
- })
- $("input[type=checkbox][value=postType]").on("ifChanged", function (e) {
- var isChecked = $(this).is(":checked") ? "check" : "uncheck";
- $("#field_file input").each(function () {
- $(this).iCheck(isChecked);
- })
- })
- if (calResult) {
- $("#otherEnjoyedMoney").val(info.otherEnjoyedMoney);
- $("#otherEnjoyedDescription").val(info.otherEnjoyedDescription);
- TalentAllowanceInfoDlg.cal();
- }
- var list = data.obj.detailList;
- 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 +
- '<div class="input-group detailMonths">\n' +
- '<input type="hidden" class="detailId" value="' + list[key].id + '">' +
- '<span class="input-group-addon" title="' + title + '">' + title + '</span>' +
- '<input type="text" class="form-control months" >\n' +
- '<span class="input-group-addon btn-danger" onclick="TalentAllowanceInfoDlg.showEditMonths(this)">编辑</span>\n' +
- '</div>\n';
- }
- $("#setMonths").append(html);
- },
- yes: function (index, layero) {
- TalentAllowanceInfoDlg.checkSubmit(index);
- }
- });
- } else {
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("校验失败!" + data.responseJSON.message + "!");
- });
- ajax.set("id", $("#id").val());
- ajax.set("type", 3);
- ajax.set("process", $("#process").val())
- ajax.set("companyId", $("#companyId").val())
- ajax.start();
- }
- TalentAllowanceInfoDlg.cal = function () {
- var value = $("#otherEnjoyedMoney").val();
- var totalMoney = $("#otherEnjoyedMoney").data("money");
- var result = totalMoney - value;
- $("#finalMoney").val(result);
- }
- /**
- * 显示/隐藏设置津补贴类型
- */
- TalentAllowanceInfoDlg.toggleSetAllowance = function () {
- var checkState = $("#reviewState").val();
- if (checkState == 2) {
- $("#setAllowanceHeading,#setAllowanceBody").css("display", "none");
- $("#processLable,#processDiv").css("display", "block");
- $("#checkMsg").val("审核通过");
- } else if (checkState == 3) {
- $("#setAllowanceHeading,#setAllowanceBody").css("display", "block");
- $("#processLable,#processDiv").css("display", "none");
- }
- }
- /**
- * 保存复核审核结果
- */
- TalentAllowanceInfoDlg.saveReviewCheck = function () {
- var id = $("#id").val();
- var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/validateIsCheck", function (data) {
- if (data.code == 200) {
- var checkState = $("#reviewState").val();
- var checkMsg = $("#allowanceCheckMsg").val();
- if (checkState == null || checkState == '') {
- Feng.info("请选择审核状态");
- return;
- }
- var toPorcess = $("#toProcess").val();
- var allowanceType = null, months = "", allowanceMsg = null;
- if (checkState == 3) {
- allowanceType = $("#newAllowanceType").val();
- $("#allowanceMonths input[type=checkbox]").each(function () {
- if (this.checked) {
- months = months + $(this).val() + ",";
- }
- });
- allowanceMsg = $("#newAllowanceMsg").val();
- }
- var param = {"id": id, "checkState": checkState, "checkMsg": checkMsg, "process": $("#process").val(),
- "toPorcess": toPorcess, "allowanceType": allowanceType, "allowanceMsg": allowanceMsg, "months": months, "source": $("#source").val(), "resAllowanceType": $("#resAllowanceType").val(), resAllowanceMsg: $("#resAllowanceMsg").val()};
- var checkAjax = new $ax(Feng.ctxPath + "/admin/talentAllowance/reviewCheck", function (res) {
- if (res.code == 200) {
- Feng.success(res.msg)
- } else {
- Feng.error(res.msg);
- }
- }, function (data) {
- Feng.error("提交失败!" + data.responseJSON.message + "!");
- });
- checkAjax.setData(param);
- checkAjax.start();
- } else {
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("校验失败!" + data.responseJSON.message + "!");
- });
- ajax.set("id", id);
- ajax.set("type", 3);
- ajax.set("process", $("#process").val())
- ajax.set("companyId", $("#companyId").val())
- ajax.start();
- }
- /**
- * 显示字段或者隐藏字段选择
- */
- TalentAllowanceInfoDlg.toggleField = function () {
- var checkState = $("#checkStateModal").val();
- var process = $("#process").val();
- var type = $("#type").val();
- $("#otherEnjoyedMoney").val(0);
- TalentAllowanceInfoDlg.cal();
- //$("#otherEnjoyed").css("display", "none");
- if (checkState == 2 || checkState == -2) {
- $("#toProcessDiv").css("display", process == 3 ? "block" : "none");
- $("#field").show();
- $("#otherSence").css("display", "none");
- } else {
- if (checkState == 3) {
- if (type == 6) {
- $("#otherSence").css("display", "block");
- }
- $("#checkMsg").val(process == 3 ? "复核通过,待核查征信" : "初审通过");
- }
- $("#field").hide();
- $("#field").find("input[type=checkbox]").each(function () {
- $(this).iCheck("uncheck");
- });
- $("#toProcessDiv").css("display", "none");
- }
- }
- TalentAllowanceInfoDlg.save = function () {
- var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/validateIsCheck", function (data) {
- if (data.code == 200) {
- var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/save", function (data) {
- if (data.code == 200) {
- Feng.success(data.msg);
- } else {
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("提交审核失败!" + data.responseJSON.message + "!");
- });
- var id = $("#id").val();
- var allowanceType = $("#allowanceType").val();
- ajax.setData({"id": id, "allowanceType": allowanceType});
- ajax.start();
- } else {
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("校验失败!" + data.responseJSON.message + "!");
- });
- ajax.set("id", $("#id").val());
- ajax.set("type", 3);
- ajax.set("process", $("#process").val())
- ajax.set("companyId", $("#companyId").val())
- ajax.start();
- }
- /**
- * 审核信息提交
- */
- TalentAllowanceInfoDlg.checkSubmit = function (index) {
- var id = $("#id").val();
- var type = $("#type").val();
- var checkState = $("#checkStateModal").val();
- var checkMsg = $("#checkMsg").val();
- var process = $("#process").val();
- var companyCode = $("#companyCode").val();
- var companyCodes = "";
- var otherEnjoyedMoney = $("#otherEnjoyedMoney").val();
- var otherEnjoyedDescription = $("#otherEnjoyedDescription").val();
- // var absolute_control = $("input[name='absolute_control']").val()
- var crontol_money = $("#crontol_money").val();
- if (Feng.isEmptyStr(checkState)) {
- Feng.info("请选择审核状态");
- return;
- }
- if (Feng.isEmptyStr(checkMsg)) {
- Feng.info("请填写审核意见");
- return;
- }
- if (type == 6 && process == 3 && checkState == 3 && otherEnjoyedMoney != 0 && Feng.isEmptyStr(otherEnjoyedDescription)) {
- Feng.info("其它补贴金额不为0时需要填写其它补贴金额说明");
- return;
- }
- /*if (process == 3 && checkState == 2) {
- var toProcess = $("#toProcess").val();
- if (Feng.isEmptyStr(toProcess)) {
- Feng.info("请选择驳回至流程");
- return;
- }
- if (toProcess == 1) {
- var toDep = $("#toDep").val();
- for (var key in toDep) {
- companyCodes = companyCodes + toDep[key] + ",";
- }
- if (Feng.isEmptyStr(companyCodes)) {
- Feng.info("请选择驳回单位");
- return;
- }
- }
- }*/
- var projects = '', files = '', concats = '', fields = "";
- if (process == 1) {
- $("#field_project li input").each(function (index) {
- if ($(this).is(":checked")) {
- projects = projects + $(this).val() + ",";
- }
- });
- $("#field_file li input").each(function (index) {
- if ($(this).is(":checked")) {
- files = files + $(this).val() + ",";
- }
- });
- //if(companyCode == CONFIG.COM_RSJ || companyCode == CONFIG.COM_IC){
- $("#field_concat li input").each(function (index) {
- if ($(this).is(":checked")) {
- concats = concats + $(this).val() + ",";
- }
- });
- $("#field_field li input").each(function (index) {
- if ($(this).is(":checked")) {
- fields = fields + $(this).val() + ",";
- }
- });
- fields = fields.substring(0, fields.length - 1);
- //}
- }
- // if(process ==1 && checkState==2 && projects=='' && files==''){
- // Feng.info("请选择可修改的项目或附件!");
- // return ;
- // }
- if (Feng.isNotEmptyStr(companyCodes)) {
- companyCodes = companyCodes.substring(0, companyCodes.length - 1);
- }
- 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});
- });
- var source = $("#source").val();
- var resAllowanceType = $("#resAllowanceType").val();
- var resAllowanceMsg = $("#resAllowanceMsg").val();
- 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/check", function (data) {
- if (data.code == 200) {
- layer.close(index);
- Feng.success(data.msg);
- } else {
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("提交审核失败!" + data.responseJSON.message + "!");
- });
- ajax.setData({"id": id, "checkState": checkState, "checkMsg": checkMsg, "process": $("#process").val(), "projects": projects, "files": files, "concats": concats, "fields": fields, "companyId": $("#companyId").val(), "toProcess": $("#toProcess").val(), "toDep": companyCodes, otherEnjoyedMoney: otherEnjoyedMoney, otherEnjoyedDescription: otherEnjoyedDescription, source: source, resAllowanceType: resAllowanceType, resAllowanceMsg: resAllowanceMsg, "details": details});
- ajax.start();
- }
- /**
- * 提交审核
- */
- TalentAllowanceInfoDlg.submitCheck = function () {
- var operation = function () {
- var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/submitCheck", function (data) {
- if (data.code == 200) {
- Feng.success(data.msg);
- window.parent.TalentAllowanceInfo.table.refresh();
- TalentAllowanceInfoDlg.close();
- } else {
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("提交审核失败!" + data.responseJSON.message + "!");
- });
- ajax.setData({"id": $("#id").val(), "process": $("#process").val(), "companyId": $("#companyId").val()});
- ajax.start();
- }
- Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
- }
- TalentAllowanceInfoDlg.attendanceCallBack = function (data) {
- 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.showAllLog = function () {
- var id = $("#id").val();
- if (Feng.isNotEmptyStr(id)) {
- Feng.getCheckLog("logTable", {"type": CONFIG.project_jbt, "mainId": $("#id").val(), "typeFileId": "", "active": 1})
- }
- }
- TalentAllowanceInfoDlg.fileChange = function (context) {
- var file = $(context).val();
- var pos = file.lastIndexOf("\\");
- $("#fileInput").val(file.substring(pos + 1));
- }
- TalentAllowanceInfoDlg.calculator = function () {
- var id = $("#id").val();
- var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/calculator/id/" + id, function (data) {
- var message = data.recommendAllowanceMsg.join("<br>");
- if (data.recommendAllowanceType != 3) {
- message += "<br>试算补贴金额:<span style='color:red;font-weight:bold;'>" + data.finnalMoney + "</span>";
- }
- $("#cal-result").html(message);
- }, function (data) {
- Feng.error("查询失败!" + data.responseJSON.message + "!");
- });
- ajax.start();
- }
- TalentAllowanceInfoDlg.allowanceTypeChange = function (content) {
- var allowanceType = $(content).val();
- console.log(allowanceType)
- if (allowanceType == 1) {
- $(".personDiv").css("display", "none");
- $("#otherEnjoyed").css("display", "block");
- } else {
- $(".personDiv").css("display", "block");
- $("#otherEnjoyed").css("display", "none");
- }
- }
- $(function () {
- if ($("#type").val() == 2) {
- $("#bankNumberSpan,#talentTypeSpan,#introductionModeSpan,#firstInJJTimeSpan").attr("style", "display:none");
- }
- /*if ($("#type").val() == 6 && $("#process").val() == 1) {
- $(":input").prop("disabled", false);
- $(":input").prop("readonly", false);
- }*/
- $("select").each(function () {
- +
- $(this).val($(this).attr("value"));
- });
- TalentAllowanceInfoDlg.initFileTable();
- TalentAllowanceInfoDlg.initCommonFileTable();
- TalentAllowanceInfoDlg.initContract();
- TalentAllowanceInfoDlg.showAllLog();
- //批量加载时间控件
- $(".date").each(function () {
- laydate.render({elem: "#" + $(this).attr("id"), type: 'date', trigger: 'click'});
- });
- var process = $("#process").val();
- var compayCode = $("#companyCode").val();
- TalentAllowanceInfoDlg.calculator();
- });
|