123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420 |
- /**
- * 租房申请管理初始化
- */
- var HouseRenting = {
- id: "HouseRentingTable", //表格id
- seItem: null, //选中的条目
- table: null,
- layerIndex: -1
- };
- /**
- * 初始化表格的列
- */
- HouseRenting.initColumn = function () {
- var process = $("#process").val();
- if(process == 4){
- return [
- {field: 'selectItem', radio: true},
- {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"120px",'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+'<span style="color:#6495ED">【男】</span>';
- }if(row.sex==2){
- return value+'<span style="color:#FF82AB">【女】</span>';
- }
- }
- },
- {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: 'nativePlace', 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+'<span style="color:#6495ED">【男】</span>';
- }if(row.spouseSex==2){
- return value+'<span style="color:#FF82AB">【女】</span>';
- }
- }
- },
- {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: '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: 'publicState', visible: true, align: 'center', valign: 'middle',width:"80px",'class': 'uitd_showTip',
- formatter : function (value,row,index){
- if(value==1)return "<span style='color: red'>待兑现</span>";
- if(value==2)return "<span style='color: green'>已兑现</span>";
- }
- },
- {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"80px",
- formatter : function (value,row,index){
- return "<span class='label label-success' onclick=\"Feng.getCheckLogModel('"+value+"','"+CONFIG.project_renting+"',null)\" >" +
- "<i class=\"fa fa-book\"></i>日志" +
- "</span>";
- }
- }
- ];
- }else{
- return [
- {field: 'selectItem', radio: true},
- {title: '审核单位', field: 'companyName', visible: process==2, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
- {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"120px",'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+'<span style="color:#6495ED">【男】</span>';
- }if(row.sex==2){
- return value+'<span style="color:#FF82AB">【女】</span>';
- }
- }
- },
- {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: 'nativePlace', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
- {title: '入职时间', field: 'entryTime', 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+'<span style="color:#6495ED">【男】</span>';
- }if(row.spouseSex==2){
- return value+'<span style="color:#FF82AB">【女】</span>';
- }
- }
- },
- {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: 'spouseNativePlace', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
- {title: '配偶工作单位', field: 'spouseEnterpriseName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
- {title: '配偶联系电话', field: 'spousePhone', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
- {title: '拟申请租住人才社区', field: 'houseTypeName', visible: true, align: 'center', valign: 'middle',width:"130px",'class': 'uitd_showTip'},
- // {title: '养老保险缴纳月份', field: 'pensionDetail', visible: true, align: 'center', valign: 'middle'},
- // {title: '失业保险缴纳月份', field: 'unemploymentDetail', visible: true, align: 'center', valign: 'middle'},
- // {title: '医疗保险缴纳月份', field: 'medicaDetail', visible: true, align: 'center', valign: 'middle'},
- // {title: '个税缴纳月份', field: 'taxDetail', visible: true, align: 'center', valign: 'middle'},
- {title: '审核状态', field: process == 2?'state':'checkState', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip',
- formatter : function (value,row,index){
- if(process == 1 ){
- switch (value) {
- case -1:
- return "<span class='label label-danger'>审核不通过</span>";
- break;
- case 1:
- return "<span class='label'>待提交</span>"
- break;
- case 5:
- return "<span class='label label-success'>待审核</span>";
- break;
- case 8:
- return "<span class='label label-success'>重新提交</span>";
- break;
- case 10:
- return "<span class='label label-danger'>已驳回</span>"
- break;
- case 15:
- return "<span class='label label-success'>上级驳回</span>"
- break;
- case 20:
- case 25:
- case 27:
- case 30:
- return "<span class='label label-primary'>已通过</span>"
- break;
- }
- }else if(process == 2){
- 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 == 4){
- return "<span class='label label-warning'>上级驳回</span>"
- }if(value == 9){
- return "<span class='label label-success'>重新提交</span>"
- }
- }else if(process == 3){
- switch (value) {
- case -1:
- return "<span class='label label-danger'>审核不通过</span>";
- break;
- case 1:
- case 8:
- case 5:
- case 10:
- case 15:
- case 20:
- return "<span class='label label-danger'>已驳回</span>"
- break;
- case 25:
- return "<span class='label label-success'>待审核</span>"
- break;
- case 27:
- return "<span class='label label-success'>重新提交</span>"
- break;
- case 30:
- return "<span class='label label-primary'>已通过</span>"
- break;
- }
- }
- }
- },
- // {title: '承租开始日期', field: 'rentStartTime', visible: true, align: 'center', valign: 'middle'},
- // {title: '承租截止时间', field: 'rentEndTime', visible: true, align: 'center', valign: 'middle'},
- // {title: '承租详细地址', field: 'rentAddress', visible: true, align: 'center', valign: 'middle'},
- {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"80px",
- formatter : function (value,row,index){
- return "<span class='label label-success' onclick=\"Feng.getCheckLogModel('"+value+"','"+CONFIG.project_renting+"',null)\" >" +
- "<i class=\"fa fa-book\"></i>日志" +
- "</span>";
- }
- }
- ];
- }
- };
- /**
- * 检查是否选中
- */
- HouseRenting.check = function () {
- var selected = $('#' + this.id).bootstrapTable('getSelections');
- if(selected.length == 0){
- Feng.info("请先选中表格中的某一记录!");
- return false;
- }else{
- HouseRenting.seItem = selected[0];
- return true;
- }
- };
- /**
- * 点击审核培训补贴
- */
- HouseRenting.openCheckHouseRenting = function (process) {
- if (this.check()) {
- var companyId = Feng.isEmptyStr(HouseRenting.seItem.companyId)?null:HouseRenting.seItem.companyId;
- var index = layer.open({
- type: 2,
- title: '审核租房申请',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/houseRenting/houseRenting_check/' + HouseRenting.seItem.id+"/"+companyId+"/"+process,
- btn: ['<i class="fa fa-eye"></i> 保存未提交', '<i class="fa fa-check layui-bg-green"></i> 提交审核', '<i class="fa fa-eraser"></i> 取消'],
- btnAlign: 'c',
- btn1: function (index, layero) {
- var obj = layero.find("iframe")[0].contentWindow;
- obj.HouseRentingInfoDlg.showCheckModal(process);
- }, btn2: function (index, layero) {
- var obj = layero.find("iframe")[0].contentWindow;
- obj.HouseRentingInfoDlg.submitToCheck(process);
- return false;
- },
- success: function (layero, index) {
- layer.tips('审核完成并确认无误后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
- },
- end: function () {
- layer.closeAll('tips');
- }
- });
- HouseRenting.layerIndex = index;
- layer.full(index);
- }
- };
- HouseRenting.showRegistModel= function(){
- if (this.check()) {
- if(HouseRenting.seItem.publicState == 2){
- Feng.info("不能重复登记");return;
- }
- layer.open({
- type: 1,
- id:"checkModel",
- title: '入住登记',
- area: ['800px', '450px'], //宽高
- fix: false, //不固定
- shade:0,
- maxmin: true,
- content:HouseRenting.createCheckHtml(),
- btn: ['<i class="fa fa-save"></i> 提交' ,'<i class="fa fa-eraser"></i> 关闭'],
- btnAlign: 'c',
- zIndex: layer.zIndex,
- success:function(layero, index){
- $(".date").removeAttr('lay-key');
- $(".date").each(function(){
- laydate.render({elem: this,type: 'date',trigger: 'click'});
- });
- },
- yes: function (index, layero) {
- var rentStartTime = $("#rentStartTime").val();
- var rentEndTime = $("#rentEndTime").val();
- var rentAddress = $("#rentAddress").val();
- var rentMoney = $("#rentMoney").val();
- if(Feng.isEmptyStr(rentStartTime)){
- Feng.info("请填写承租开始时间");
- return ;
- }
- if(Feng.isEmptyStr(rentEndTime)){
- Feng.info("请填写承租截至时间");
- return ;
- }
- if(Feng.isEmptyStr(rentAddress)){
- Feng.info("请填写承租详细地址");
- return ;
- }
- if(Feng.isEmptyStr(rentMoney)){
- Feng.info("请填写承租金额");
- return ;
- }
- var operation = function() {
- var ajax = new $ax(Feng.ctxPath + "/houseRenting/regist", function (data) {
- if (data.code == 200) {
- layer.close(index);
- HouseRenting.table.refresh();
- Feng.success(data.msg);
- } else {
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("入住登记失败!" + data.responseJSON.message + "!");
- });
- ajax.setData({
- "id": HouseRenting.seItem.id,
- "rentStartTime": rentStartTime,
- "rentEndTime": rentEndTime,
- "rentAddress": rentAddress,
- "rentMoney" : rentMoney
- })
- ajax.start();
- }
- Feng.confirm("一旦提交无法修改,确认要提交吗?", operation);
- }
- });
- }
- }
- HouseRenting.createCheckHtml = function(){
- return '<form id="checkForm">\n' +
- '<div class="form-group" style="margin: 10px;">\n' +
- '<label for="checkState" class="control-label">承租开始时间</label>\n' +
- '<input class="form-control date" type="text" id="rentStartTime" >\n' +
- '</div>\n' +
- '<div class="form-group" style="margin: 10px;">\n' +
- '<label for="checkMsg" class="control-label" >承租截至时间</label>\n' +
- '<input class="form-control date" type="text" id="rentEndTime" >\n' +
- '</div>\n' +
- '<div class="form-group" style="margin: 10px;">\n' +
- '<label for="checkMsg" class="control-label" >承租详细地址</label>\n' +
- '<input class="form-control" type="text" id="rentAddress" >\n' +
- '</div>\n' +
- '<div class="form-group" style="margin: 10px;">\n' +
- '<label for="checkMsg" class="control-label" >承租金额</label>\n' +
- '<input class="form-control" type="text" id="rentMoney" >\n' +
- '</div>\n' +
- '</form>';
- }
- HouseRenting.showExportModal = function(){
- $("#exportForm")[0].reset();
- $("#basicExportModal").modal("show");
- }
- /**
- * 导出基础信息
- */
- HouseRenting.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 = HouseRenting.formParams();
- queryData['names'] = names;
- queryData['values'] = values;
- queryData['process'] = $("#process").val();
- var url = Feng.setUrlParam(Feng.ctxPath + "/houseRenting/exportBasicInfo",queryData);
- $("#basicExportModal").modal('hide');
- window.location.href = url;
- }
- /**
- * 查询表单提交参数对象
- * @returns {{}}
- */
- HouseRenting.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;
- }
- /**
- * 查询购房补贴列表
- */
- HouseRenting.search = function () {
- HouseRenting.table.refresh({query: HouseRenting.formParams()});
- };
- /**
- * 重置
- */
- HouseRenting.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("");
- }
- $(function () {
- var defaultColunms = HouseRenting.initColumn();
- var table = new BSTable(HouseRenting.id, "/houseRenting/list/"+$("#process").val(), defaultColunms);
- table.setPaginationType("server");
- HouseRenting.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));
- });
|