/** * 房租补助管理初始化 */ var HouseRentingFees = { id: "HouseRentingFeesTable", //表格id seItem: null, //选中的条目 table: null, layerIndex: -1 }; /** * 初始化表格的列 */ HouseRentingFees.initColumn = function () { return [ {field: 'selectItem', radio: true}, {title: '申报单位', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'}, {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip', formatter : function (value,row,index) { if(row.sex==1){ return value+'【男】'; }if(row.sex==2){ return value+'【女】'; } } }, {title: '证件类型', field: 'cardTypeName', visible: true, align: 'center', valign: 'middle',width:"80px",'class': 'uitd_showTip'}, {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'}, {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'}, {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'}, {title: '婚姻状态', field: 'marryStatusName', visible: true, align: 'center', valign: 'middle',width:"80px",'class': 'uitd_showTip'}, {title: '配偶姓名', field: 'spouseName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip', formatter : function (value,row,index) { if(row.spouseSex==1){ return value+'【男】'; }if(row.spouseSex==2){ return value+'【女】'; } } }, {title: '配偶证件类型', field: 'spouseCardTypeName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'}, {title: '配偶证件号码', field: 'spouseIdCard', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'}, {title: '配偶人才层次', field: 'spouseTalentArrangeName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'}, {title: '拟申请租住人才社区', field: 'houseTypeName', visible: true, align: 'center', valign: 'middle',width:"130px",'class': 'uitd_showTip'}, {title: '承租开始日期', field: 'rentStartTime', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'}, {title: '承租截止时间', field: 'rentEndTime', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'}, {title: '承租详细地址', field: 'rentAddress', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'}, {title: '承租金额', field: 'rentMoney', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'}, // {title: '开户银行网点', field: 'bankAddress', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'}, // {title: '银行账号', field: 'bankAccount', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'}, {title: '兑现金额', field: 'money', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'}, {title: '审核状态', field: 'checkStateName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip',width:"100px",}, {title: '公示状态', field: 'publicState', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip',width:"100px", formatter: function (value, row, index) { if (value == 1) { return '待公示'; } if (value == 2) { return '公示中'; } if (value == 3) { return '待兑现'; } if (value == 4) { return '已兑现'; } } }, {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"80px", formatter : function (value,row,index){ return "" + "日志" + ""; } } ]; }; /** * 检查是否选中 */ HouseRentingFees.check = function () { var selected = $('#' + this.id).bootstrapTable('getSelections'); if(selected.length == 0){ Feng.info("请先选中表格中的某一记录!"); return false; }else{ HouseRentingFees.seItem = selected[0]; return true; } }; /** * 打开查看房租补助详情 */ HouseRentingFees.openCheckHouseRentingFees = function () { if (this.check()) { var index = layer.open({ type: 2, title: '房租补助详情', area: ['800px', '420px'], //宽高 fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/houseRentingFees/toCheckPage/' + HouseRentingFees.seItem.id, btn: ['  保存未提交','  提交审核', '  取消'], btnAlign: 'c', btn1: function (index, layero) { var obj = layero.find("iframe")[0].contentWindow; obj.HouseRentingFeesInfoDlg.showCheckModal(); },btn2: function(index, layero){ var obj = layero.find("iframe")[0].contentWindow; obj.HouseRentingFeesInfoDlg.submitCheck(); return false; }, success: function (layero, index) { layer.tips('审核完成并确认无误后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2}); }, end :function () { layer.closeAll('tips'); HouseRentingFees.table.refresh(); } }); HouseRentingFees.layerIndex = index; layer.full(index); } }; /** * 查询表单提交参数对象 * @returns {{}} */ HouseRentingFees.formParams = function() { var queryData = {}; queryData['enterpriseName'] = $("#enterpriseName").val(); queryData['name'] = $("#name").val(); queryData['sex'] = $("#sex").val(); queryData['cardType'] = $("#cardType").val(); queryData['idCard'] = $("#idCard").val(); queryData['talentArrange'] = $("#talentArrange").val(); queryData['marryStatus'] = $("#marryStatus").val(); queryData['spouseName'] = $("#spouseName").val(); queryData['spouseSex'] = $("#spouseSex").val(); queryData['spouseCardType'] = $("#spouseCardType").val(); queryData['spouseIdcard'] = $("#spouseIdcard").val(); queryData['spouseTalentArrange'] = $("#spouseTalentArrange").val(); queryData['houseType'] = $("#houseType").val(); queryData['checkState'] = $("#checkState").val(); return queryData; } /** * 查询购房补贴列表 */ HouseRentingFees.search = function () { HouseRentingFees.table.refresh({query: HouseRentingFees.formParams()}); }; /** * 重置 */ HouseRentingFees.reset = function(){ $("#enterpriseName").val(""); $("#name").val(""); $("#sex").val(""); $("#cardType").val(""); $("#idCard").val(""); $("#talentArrange").val(""); $("#marryStatus").val(""); $("#spouseName").val(""); $("#spouseSex").val(""); $("#spouseCardType").val(""); $("#spouseIdcard").val(""); $("#spouseTalentArrange").val(""); $("#houseType").val(""); $("#checkState").val(""); } /** * 显示需要处理的数据 * @param type */ HouseRentingFees.showDataCheckModal = function (type) { $("#hczxForm").css("display", "none"); switch (type) { case 1: //公式预览 $("#hczxButton").attr("onclick", "HouseRentingFees.publicExport()").text("导出"); $("#exportCommonModalLabel").text("公式预览"); break; case 2: //待核查征信名单-核查征信通过 $("#hczxButton").attr("onclick", "HouseRentingFees.public()").text("提交"); $("#exportCommonModalLabel").text("公示"); $("#hczxForm").css("display", "block"); $(".time").each(function () { laydate.render({ elem: "#" + $(this).attr("id") , type: 'date' , format: 'yyyy年MM月dd日' }); }); break; case 3: //公示通过 $("#hczxButton").attr("onclick", "HouseRentingFees.publicPass()").text("提交"); $("#exportCommonModalLabel").text("批量公示通过"); break; case 4: //兑现 $("#hczxButton").attr("onclick", "HouseRentingFees.cash()").text("兑现"); $("#exportCommonModalLabel").text("兑现"); break; } $('#dataTable').bootstrapTable('destroy'); $('#dataTable').bootstrapTable({ url: Feng.ctxPath + "/houseRentingFees/selectNeedCheckData?type=" + type, method: 'POST', contentType: "application/x-www-form-urlencoded; charset=UTF-8", search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端 showRefresh: false, // 是否显示刷新按钮 clickToSelect: true, // 是否启用点击选中行 singleSelect: false, // 设置True 将禁止多选 striped: true, // 是否显示行间隔色 pagination: true, // 设置为 true 会在表格底部显示分页条 paginationHAlign: "left", paginationDetailHAlign: "right", sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server' pageNumber: 1, //初始化加载第一页,默认第一页 pageSize: 10, //每页的记录行数(*) pageList: [10, 25, 50, 100, 500, 1000, 1500], //可供选择的每页的行数(*) maintainSelected: true, //全表全选需要开启 showColumns: false, responseHandler: function (res) { $("#exportCommonModal").modal("show"); return res.obj.rows; }, columns: [ {field: "selectItem", checkbox: true}, {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "10%"}, {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "30%"}, {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', width: "10%"}, { title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "10%", formatter: function (value, row, index) { if (value == -1) { return "审核不通过"; } if (value == 5) { return "审核通过"; } } }, ] }); } /** * 是否发送短信 */ HouseRentingFees.toggleMessage = function () { var isMessage = $("input[name='isSend']:checked").val(); if (isMessage == 1) { $("#messageEdit").css("display", "block"); } else if (isMessage == 2) { $("#messageEdit").css("display", "none"); } } HouseRentingFees.prepareSearch = function () { var sex = $("#pub_sex").val(); var checkState = $("#pub_checkState").val(); var name = $("#pub_name").val(); $('#dataTable').bootstrapTable("refresh", {"query": {"sex": sex, "checkState": checkState, "name": name}}); } HouseRentingFees.prepareReset = function () { $("#pub_sex").val(""); $("#pub_checkState").val(""); $("#pub_name").val(""); } /** * 公式预览 */ HouseRentingFees.publicExport = function () { var selected = $('#dataTable').bootstrapTable('getSelections'); if (!selected || selected.length < 1) { Feng.info("请至少选择一行数据!"); return; } var ids = ""; for (var i = 0; i < selected.length; i++) { ids = ids + selected[i].id + ","; } var operation = function () { $("#exportCommonModal").modal("hide"); window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/houseRentingFees/exportPublic?ids=" + ids)); } Feng.confirm("确定要公示预览吗?", operation); } /** * 公示 */ HouseRentingFees.public = function () { var selected = $('#dataTable').bootstrapTable('getSelections'); if (!selected || selected.length < 1) { Feng.info("请至少选择一行数据!"); return; } var ids = ""; for (var i = 0; i < selected.length; i++) { ids = ids + selected[i].id + ","; } var isMessage = $("input[name='isSend']:checked").val(); var typeName = $("#typeName").val(); var address = $("#web").val(); var publicStartTime = $("#publicStartTime").val(); var publicEndTime = $("#publicEndTime").val(); var dep = $("#dep").val(); var phone = $("#fyphone").val(); var email = $("#fyemail").val(); if (isMessage == 1) { if (typeName == null || typeName == '') { Feng.info("请填写公示类型"); return; } if (address == null || address == '') { Feng.info("请填写公示平台"); return; } if (publicStartTime == null || publicStartTime == '') { Feng.info("请填写公示开始时间"); return; } if (publicEndTime == null || publicEndTime == '') { Feng.info("请填写公示截止时间"); return; } if (dep == null || dep == '') { Feng.info("请填写反映单位"); return; } if (phone == null || phone == '') { Feng.info("请填写联系电话"); return; } if (email == null || email == '') { Feng.info("请填写联系邮箱"); return; } } var operation = function () { var ajax = new $ax(Feng.ctxPath + "/houseRentingFees/publicBatch", function (data) { if (data.code == 200) { Feng.success(data.msg); HouseRentingFees.table.refresh(); $("#exportCommonModal").modal("hide"); } else { Feng.error(data.msg); } }, function (data) { Feng.error("公示失败!" + data.responseJSON.message + "!"); }); ajax.set("ids", ids); ajax.set("typeName", typeName); ajax.set("address", address); ajax.set("publicStartTime", publicStartTime); ajax.set("publicEndTime", publicEndTime); ajax.set("dep", dep); ajax.set("phone", phone); ajax.set("email", email); ajax.set("isMessage", isMessage); ajax.start(); } Feng.confirm("确定要公示吗?", operation); } /** * 公示后审核 */ HouseRentingFees.afterCheck = function () { if (this.check()) { var ajax = new $ax(Feng.ctxPath + "/houseRentingFees/validateIsCheck", function (data) { if (data.code == 200) { layer.open({ type: 1, id: "neewFieldFormModel", title: '公示再审核', area: ['800px', '450px'], //宽高 fix: false, //不固定 shade: 0, maxmin: true, content: HouseRentingFees.creatFieldCheckModal(), btn: ['  提交', '  关闭'], btnAlign: 'c', zIndex: layer.zIndex, success: function (layero, index) { layer.setTop(layero); }, yes: function (index, layero) { var checkState = $("#checkStateModel").val(); var checkMsg = $("#checkMsg").val(); if (checkState == null || checkState == '') { Feng.info("请选择审核状态"); return; } if (checkMsg == null || checkMsg == '') { Feng.info("请填写审核意见"); return; } var ajax = new $ax(Feng.ctxPath + "/houseRentingFees/afterCheck", function (data) { if (data.code == 200) { layer.close(index); HouseRentingFees.table.refresh(); Feng.success(data.msg); } else { Feng.error(data.msg); } }, function (data) { Feng.error("审核失败!" + data.responseJSON.message + "!"); }); ajax.setData({"id": HouseRentingFees.seItem.id, "checkState": checkState, "checkMsg": checkMsg}); ajax.start(); } }); } else { Feng.error(data.msg); } }, function (data) { Feng.error("校验失败!" + data.responseJSON.message + "!"); }); ajax.set("id", HouseRentingFees.seItem.id); ajax.set("process", 2); ajax.start(); } } /** * */ HouseRentingFees.creatFieldCheckModal = function () { return '
\n' + '
\n' + ' \n' + ' \n' + '
\n' + '
\n' + ' \n' + ' \n' + '
\n' + '
'; } /** * 公示通过 */ HouseRentingFees.publicPass = function () { var selected = $('#dataTable').bootstrapTable('getSelections'); if (!selected || selected.length < 1) { Feng.info("请至少选择一行数据!"); return; } var ids = ""; for (var i = 0; i < selected.length; i++) { ids = ids + selected[i].id + ","; } var operation = function () { var ajax = new $ax(Feng.ctxPath + "/houseRentingFees/publicPass", function (data) { if (data.code == 200) { Feng.success(data.msg); HouseRentingFees.table.refresh(); $("#exportCommonModal").modal("hide"); } else { Feng.error(data.msg); } }, function (data) { Feng.error("公示通过失败!" + data.responseJSON.message + "!"); }); ajax.set("ids", ids); ajax.start(); } Feng.confirm("一旦提交无法修改,确定公示通过吗?", operation); } /** * 兑现 */ HouseRentingFees.cash = function () { var selected = $('#dataTable').bootstrapTable('getSelections'); if (!selected || selected.length < 1) { Feng.info("请至少选择一行数据!"); return; } var ids = ""; for (var i = 0; i < selected.length; i++) { ids = ids + selected[i].id + ","; } var operation = function () { var ajax = new $ax(Feng.ctxPath + "/houseRentingFees/cash", function (data) { if (data.code == 200) { Feng.success(data.msg); HouseRentingFees.table.refresh(); $("#exportCommonModal").modal("hide"); } else { Feng.error(data.msg); } }, function (data) { Feng.error("兑现失败!" + data.responseJSON.message + "!"); }); ajax.set("ids", ids); ajax.start(); } Feng.confirm("一旦兑现无法修改,确定兑现吗?", operation); } /** * 显示导出模态框 */ HouseRentingFees.showExportModel = function(){ $("#exportForm")[0].reset(); $("#basicExportModal").modal("show"); } /** * 导出基础信息 */ HouseRentingFees.export = function(){ var names = ''; var values = ''; $("#field_info li input").each(function(index){ if($(this).is(":checked")){ values = values + $(this).val() + ","; names = names + $(this).next().text() + ","; } }); var queryData = HouseRentingFees.formParams(); queryData['names'] = names; queryData['values'] = values; var url = Feng.setUrlParam(Feng.ctxPath + "/houseRentingFees/exportBasicInfo",queryData); $("#basicExportModal").modal('hide'); window.location.href = url; } $(function () { var defaultColunms = HouseRentingFees.initColumn(); var table = new BSTable(HouseRentingFees.id, "/houseRentingFees/list", defaultColunms); table.setPaginationType("server"); HouseRentingFees.table = table.init(); //批量加载字典表数据 var arr = [ {"name":"marryStatus","code":"un_marryStatus"}, {"name":"talentArrange","code":"un_talentLevel"}, {"name":"cardType","code":"un_cardType"}, {"name":"spouseCardType","code":"un_cardType"}, {"name":"spouseTalentArrange","code":"un_talentLevel"}, {"name":"houseType","code":"un_renting_houseType"}, {"name":"childCardType","code":"un_cardType"}]; Feng.findChildDictBatch(JSON.stringify(arr)); $('#checkAll').click(function () { $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination'); }) $('#uncheckAll').click(function () { $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination') }) });