123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863 |
- /**
- * 购房补贴管理初始化
- */
- var Housepurchase = {
- id: "housepurchaseTable", //表格id
- seItem: null, //选中的条目
- table: null,
- layerIndex: -1
- };
- Housepurchase.formParams = function() {
- var queryData = {};
- queryData['companyName'] = $("#companyName").val();
- queryData['year'] = $("#year").val();
- queryData['name'] = $("#name").val();
- queryData['idCard'] = $("#idCard").val();
- queryData['talentArrange'] = $("#talentArrange").val();
- queryData['spouseName'] = $("#spouseName").val();
- queryData['spouseIdcard'] = $("#spouseIdcard").val();
- queryData['childName'] = $("#childName").val();
- queryData['childIdCard'] = $("#childIdCard").val();
- queryData['marryStatus'] = $("#marryStatus").val();
- queryData['checkState'] = $("#checkState").val();
- queryData['isConflict'] = $("isConflict").val();
- queryData['isRecover'] = $("isRecover").val()
- return queryData;
- }
- /**
- * 查询购房补贴列表
- */
- Housepurchase.search = function () {
- Housepurchase.table.refresh({query: Housepurchase.formParams()});
- };
- /**
- * 重置
- */
- Housepurchase.reset = function(){
- $("#companyName").val("");
- $("#year").val("");
- $("#name").val("");
- $("#idCard").val("");
- $("#talentArrange").val("");
- $("#spouseName").val("");
- $("#spouseIdcard").val("");
- $("#childName").val("");
- $("#childIdCard").val("");
- $("#marryStatus").val("");
- $("#checkState").val("");
- $("isConflict").val("");
- $("isRecover").val("");
- }
- /**
- * 初始化表格的列
- */
- Housepurchase.initColumn = function () {
- var process = $("#process").val();
- var type = $("#type").val();
- return [
- {field: 'selectItem', radio: true},
- {title: '审核单位', field: 'companyName', visible: process == 2, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"130px"},
- {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
- {title: '申报企业', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
- {title: '申报类型', field: 'declareType', visible: type==1, align: 'center', valign: 'middle',width:"80px",
- formatter(value,row,index){
- if(value==1){
- return "购房补贴";
- }else if(value==2){
- return "免租入住";
- }
- }
- },
- {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
- {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"150px"},
- {title: '人才标签', field: 'talentTypeName', visible: type==1, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
- {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
- {title: '认定条件', field: 'identifyConditionCH', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
- {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
- {title: '婚姻状态', field: 'marryStatusName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
- {title: '配偶姓名', field: 'spouseName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
- // {title: '配偶证件类型', field: 'spouseCardTypeName', visible: true, align: 'center', valign: 'middle'},
- {title: '配偶证件号码', field: 'spouseIdcard', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"150px"},
- {title: '享受第几次购房补贴', field: 'number', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"140px"},
- // {title: '房产编号', field: 'houseCode', visible: process != 2, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
- {title: '房屋坐落地址', field: 'houseAddress', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
- {title: '房屋建筑面积', field: 'houseArea', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
- // {title: '商品房购房合同备案时间', field: 'recordTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"150px"},
- {title: '房屋成交金额', field: 'houseMoney', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
- {title: '兑现状态', field: "cashType", visible: process ==4, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px",
- formatter : function (value,row,index){
- if(Feng.isEmptyStr(value))return "<span style='color: black'>未判定</span>";
- if(value==1)return "<span style='color: green'>兑现</span>";
- if(value==2)return "<span style='color: red'>不予兑现</span>";
- }
- },
- // {title: '兑现对象', field: 'cashIdCards', visible: process ==4 , align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
- {title: '计算结果', field: 'realEnjoyMoney', visible: process ==4 , align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px",
- formatter : function (value,row,index){
- if (row.cashType == 1 && row.declareType == 1){
- var html = "1.可享受总金额(首套房产金额):"+ (parseFloat(row.totalMoney)/10000).toFixed(2)+
- "万元</br>2.个人余额(未扣除本次):"+(parseFloat(row.balanceMoney)/10000).toFixed(2)+
- "万元</br>3.房产余额(未扣除本次):"+(parseFloat(row.houseBalanceMoney)/10000).toFixed(2)+
- "万元</br>4.上一年度未扣除其他政策金额:"+(parseFloat(row.lastOtherMoney)/10000).toFixed(2) +
- "万元</br>5.本年度新增享受其他政策金额:"+(parseFloat(row.nowOtherMoney)/10000).toFixed(2)+
- "万元</br>6.本年度人才层次可享受金额:"+(parseFloat(row.talentArrangeMoney)/10000).toFixed(2)+
- "万元</br>7.本年度应享受金额(2,3,6比较得到):"+(parseFloat(row.shouldEnjoyMoney)/10000).toFixed(2)+
- "万元</br>8.本年度扣除享受其他政策金额:"+(parseFloat(row.nowSubOtherMoney)/10000).toFixed(2)+
- "万元</br>9.本年度未扣除享受其他政策金额:"+(parseFloat(row.nowNotSubOtherMoney)/10000).toFixed(2)+
- "万元</br>10.本年度最终可到账金额:"+(parseFloat(row.realEnjoyMoney)/10000).toFixed(2)+
- "万元</br>11.社保缴纳情况:"+ row.sbPayDetail +
- "</br>12.个税缴纳情况:"+ row.taxPayDetail +
- "</br>13.判定说明:"+ row.decideDetail;
- return "<span class='label label-success' onclick=\"layer.alert('"+html+"', {title:'计算结果', skin: 'layui-layer-molv',closeBtn: 0,area: ['500px', '500px']})\" >" +
- "<i class=\"fa fa-book\"></i>查看" +
- "</span>";
- }else{
- return "无";
- }
- }
- },
- {title: '审核状态', field: process == 2?'state':'checkState', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px",
- formatter : function (value,row,index){
- if(process == 1 ){
- if(value==-1){
- return "<span class='label label-danger'>审核不通过</span>";
- }if(value==1){
- return "<span class='label'>待提交</span>"
- }if(value==5){
- return (Feng.isNotEmptyStr(row.highProcess) && row.highProcess>=1)?"<span class='label label-success'>重新提交</span>":"<span class='label label-success'>待审核</span>";
- }if(value==10){
- return "<span class='label label-danger'>已驳回</span>"
- }if(value==15 || value == 25){
- return "<span class='label label-success'>上级驳回</span>"
- }
- if(value == 20 ||value>=30){
- return "<span class='label label-primary'>已通过</span>"
- }
- }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){
- if(value<=30){
- return "<span class='label label-danger'>已驳回</span>"
- }else if(value == 35){
- return (Feng.isNotEmptyStr(row.highProcess) && row.highProcess>=3)?"<span class='label label-success'>重新提交</span>":"<span class='label label-success'>待审核</span>";
- }else if(value == 40){
- return "<span class='label label-primary'>已通过</span>";
- }
- }else if(process == 4){
- if(value==-1){
- return "<span class='label label-danger'>审核不通过</span>";
- }else if(value == 40){
- return "<span class='label label-primary'>已通过</span>";
- }
- }
- }
- },
- {title: '公示状态', field: "publicState", visible: process == 4, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px",
- formatter : function (value,row,index){
- if(value==1)return "<span class='label label-warning'>待公示</span>";
- if(value==2)return "<span class='label label-success'>公示中</span>";
- if(value==3)return "<span class='label label-info'>待兑现</span>";
- if(value==4)return "<span class='label label-primary'>已兑现</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_house+"',null)\" >" +
- "<i class=\"fa fa-book\"></i>日志" +
- "</span>";
- }
- }
- ];
- };
- /**
- * 检查是否选中
- */
- Housepurchase.check = function () {
- var selected = $('#' + this.id).bootstrapTable('getSelections');
- if(selected.length == 0){
- Feng.info("请先选中表格中的某一记录!");
- return false;
- }else{
- Housepurchase.seItem = selected[0];
- return true;
- }
- };
- /**
- * 修改驳回字段
- */
- Housepurchase.updateFieldsAndFiles = function(){
- if (this.check()) {
- var ajax = new $ax(Feng.ctxPath + "/housepurchase/findFieldsAndFiles?id="+Housepurchase.seItem.id, function (data) {
- var obj = data.obj.obj;
- if(data.code==200){
- layer.open({
- type: 1,
- id: "neewFieldFormModel",
- title: '修改',
- area: ['800px', '450px'], //宽高
- fix: false, //不固定
- shade: 0,
- maxmin: true,
- content: Housepurchase.creatFieldCheckModal(data.obj.obj),
- btn: ['<i class="fa fa-save"></i> 提交', '<i class="fa fa-eraser"></i> 关闭'],
- btnAlign: 'c',
- zIndex: layer.zIndex,
- success: function (layero, index) {
- var fileList = data.obj.fileList;
- var html = '';
- for(var key in fileList){
- html = html + '<ul><li style="width: 100%"><input type="checkbox" value="'+fileList[key].id+'"><span>'+fileList[key].name+'</span></li></ul>';
- }
- $("#field_file").empty().append(html);
- if(obj.fields!=null && obj.fields!=''){
- $("#field_info input").each(function () {
- var arr = obj.fields.split(",");
- for(var key in arr){
- if($(this).val()==arr[key]){
- this.checked = true;
- }
- }
- });
- }
- if(obj.files!=null && obj.files!=''){
- $("#field_file input").each(function () {
- if(obj.files.indexOf($(this).val())!=-1){
- this.checked=true;
- }
- });
- }
- },
- yes: function (index, layero) {
- var fields = '';
- var files = '';
- $("#field_info li input").each(function(index){
- if($(this).is(":checked")){
- fields = fields + $(this).val() + ",";
- }
- });
- $("#field_file li input").each(function(index){
- if($(this).is(":checked")){
- files = files + $(this).val() + ",";
- }
- });
- if( Feng.isEmptyStr(fields) && Feng.isEmptyStr(files)){
- Feng.info("请选择可修改的字段或附件!");
- return ;
- }
- var ajax = new $ax(Feng.ctxPath + "/housepurchase/updateFieldsAndFiles", 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":Housepurchase.seItem.id,"fields":fields,"files":files})
- ajax.start();
- }
- });
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("查询失败!" + data.responseJSON.message + "!");
- });
- ajax.start();
- }
- }
- Housepurchase.creatFieldCheckModal = function (obj) {
- var field =
- '<li style="width:10%"><input type="checkbox" value="phone"/><span>手机号码</span></li>\n' +
- '<li style="width:10%"><input type="checkbox" value="marryStatus"/><span>婚姻状态</span></li>\n' +
- '<li style="width:10%"><input type="checkbox" value="spouseName"/><span>配偶姓名</span></li>\n' +
- '<li style="width:20.5%"><input type="checkbox" value="spouseCardType"/><span>配偶证件类型</span></li>\n' +
- '<li style="width:20.5%"><input type="checkbox" value="spouseIdcard"/><span>配偶证件号码</span></li>\n' ;
- if(obj.declareType == 1 ){
- field = field +
- '<li style="width:20.5%"><input type="checkbox" value="realEstateNo"/><span>不动产权证编号</span></li>\n' +
- '<li style="width:20.5%"><input type="checkbox" value="recordNo"/><span>备案合同编号</span></li>\n' +
- '<li style="width:20.5%"><input type="checkbox" value="houseAddress"/><span>房屋坐落地址</span></li>\n' +
- '<li style="width:20.5%"><input type="checkbox" value="houseArea"/><span>房屋建筑面积</span></li>\n' +
- '<li style="width:63%"><input type="checkbox" value="recordTime"/><span>商品房购房合同备案时间/不动产权证书办理时间</span></li>\n' +
- '<li style="width:20.5%"><input type="checkbox" value="houseMoney"/><span>房屋成交金额</span></li>\n' +
- '<li style="width:20.5%"><input type="checkbox" value="isEnjoyOther"/><span>是否享受我市其他政策</span></li>\n' ;
- }
- return '<form id="firstCheckForm">\n' +
- ' <div class="form-group" style="margin: 10px;">\n' +
- ' <div id="field">\n' +
- ' <label for="checkMsg" class="control-label">可修改字段</label>\n' +
- ' <div id="field_info">\n' +
- ' <ul>\n' + field+
- ' </ul>\n' +
- ' </div>\n' +
- ' <label for="checkMsg" class="control-label">可修改附件</label>\n' +
- ' <div id="field_file">\n' +
- ' </div>\n' +
- ' <div class="form-group" style="text-align: center">\n' +
- ' <button type="button" class="btn btn-primary" onclick="Feng.checkAll("field")">全选</button>\n' +
- ' <button type="button" class="btn btn-success" onclick="Feng.unCheckAll("field")">反选</button>\n' +
- ' </div>\n' +
- ' </div>\n' +
- ' </div>\n' +
- ' </form>';
- }
- /**
- * 点击添加购房补贴
- */
- Housepurchase.openCheckHousepurchase = function () {
- if (this.check()) {
- var companyId = Feng.isEmptyStr(Housepurchase.seItem.companyId)?null:Housepurchase.seItem.companyId;
- var process = $("#process").val();
- var index = layer.open({
- type: 2,
- title: '购房补贴审核',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/housepurchase/toCheckPage/' + Housepurchase.seItem.id + '/'+$("#process").val()+"/"+companyId+"/1",
- btn: ['<i class="fa fa-eye"></i> 保存未提交','<i class="fa fa-save layui-bg-green"></i> 提交审核' ,'<i class="fa fa-eraser"></i> 关闭'],
- btnAlign: 'c',
- btn1: function (index, layero) {
- var obj = layero.find("iframe")[0].contentWindow;
- if(process == 1){
- obj.HousepurchaseInfoDlg.showFirstCheckModal();
- }
- if(process == 2){
- // obj.HousepurchaseInfoDlg.showDepCheckModal();
- obj.HousepurchaseInfoDlg.saveDepCheckData();
- }
- if(process == 3){
- obj.HousepurchaseInfoDlg.showThirdCheckModal();
- }
- if(process == 4){
- obj.HousepurchaseInfoDlg.afterCheckEdit();
- }
- },btn2: function(index, layero){
- var obj = layero.find("iframe")[0].contentWindow;
- if(process == 4){
- obj.HousepurchaseInfoDlg.showAfterCheckModal();
- }else{
- obj.HousepurchaseInfoDlg.submitCheck();
- }
- return false;
- },end:function () {
- Housepurchase.table.refresh();
- }
- });
- layer.full(index);
- Housepurchase.layerIndex = index;
- }
- };
- Housepurchase.openHousepurchaseDetail = function(){
- if (this.check()) {
- var companyId = Feng.isEmptyStr(Housepurchase.seItem.companyId)?null:Housepurchase.seItem.companyId;
- var process = $("#process").val();
- var index = layer.open({
- type: 2,
- title: '购房补贴查看',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/housepurchase/toCheckPage/' + Housepurchase.seItem.id + '/'+$("#process").val()+"/"+companyId+"/2",
- });
- layer.full(index);
- Housepurchase.layerIndex = index;
- }
- }
- /**
- * 点击添加购房补贴
- */
- Housepurchase.openAfterCheckHousepurchase = function () {
- if (this.check()) {
- var companyId = Feng.isEmptyStr(Housepurchase.seItem.companyId)?null:Housepurchase.seItem.companyId;
- var index = layer.open({
- type: 2,
- title: '购房补贴审核',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/housepurchase/toCheckPage/' + Housepurchase.seItem.id + '/'+$("#process").val()+"/"+companyId,
- btn: ['<i class="fa fa-save layui-bg-green"></i> 审核' ,'<i class="fa fa-eraser"></i> 关闭'],
- btnAlign: 'c',
- btn1: function (index, layero) {
- var obj = layero.find("iframe")[0].contentWindow;
- obj.HousepurchaseInfoDlg.showAfterCheckModal();
- },end:function () {
- Housepurchase.table.refresh();
- }
- });
- layer.full(index);
- Housepurchase.layerIndex = index;
- }
- };
- /**
- * 撤销复核
- */
- Housepurchase.cancleReview = function(){
- if (this.check()) {
- var index = layer.open({
- type: 1,
- title: '撤销复核',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: '<form >\n' +
- ' <div class="form-group" style="margin: 10px;">\n' +
- ' <label for="checkMsg" class="control-label">撤销原因</label>\n' +
- ' <textarea class="form-control" id="msg" rows="6"></textarea>\n' +
- ' </div>\n' +
- ' </form>',
- btn: ['<i class="fa fa-save layui-bg-green"></i> 提交' ,'<i class="fa fa-eraser"></i> 关闭'],
- yes: function (index, layero) {
- var cancleMsg = $("#msg").val();
- if(Feng.isEmptyStr(cancleMsg)){
- Feng.error("撤销原因不能为空");return ;
- }
- var operation = function(){
- var ajax = new $ax(Feng.ctxPath + "/housepurchase/cancleThirdCheck", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- Housepurchase.table.refresh();
- layer.close(index);
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("撤销复核失败!" + data.responseJSON.message + "!");
- });
- ajax.setData({"id":Housepurchase.seItem.id,"checkMsg":cancleMsg})
- ajax.start();
- };
- Feng.confirm("一旦提交无法修改,确定要撤销吗?", operation);
- }
- });
- }
- }
- /**
- * 显示需要审核的数据(公示/公式通过/兑现)
- * @param type
- */
- Housepurchase.showDataCheckModal = function(type){
- $("#hczxForm").css("display","none");
- switch (type) {
- case 1: //待公示名单(兑现)
- $("#hczxButton").attr("onclick","Housepurchase.public(1)").text("公示");
- $("#exportCommonModalLabel").text("待公示名单(兑现)");
- $("#hczxForm").css("display","block");
- $(".time").each(function(){
- laydate.render({
- elem: "#"+$(this).attr("id")
- ,type: 'date'
- ,format:'yyyy年MM月dd日'
- });
- });
- break;
- case 2: //待公示名单(不予兑现)
- $("#hczxButton").attr("onclick","Housepurchase.public(2)").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","Housepurchase.publicPass()").text("提交");
- $("#exportCommonModalLabel").text("公示通过名单");
- break;
- case 4: //待兑现名单
- $("#hczxButton").attr("onclick","Housepurchase.cash()").text("提交");
- $("#exportCommonModalLabel").text("待兑现名单");
- break;
- case 5: //公示预览(兑现)
- $("#hczxButton").attr("onclick","Housepurchase.publicExport(1)").text("导出");
- $("#exportCommonModalLabel").text("公示预览(兑现)");
- break;
- case 6: //待公示名单(不予兑现)
- $("#hczxButton").attr("onclick","Housepurchase.publicExport(2)").text("导出");
- $("#exportCommonModalLabel").text("公示预览(不予兑现)");
- break;
- }
- $('#dataTable').bootstrapTable('destroy');
- $('#dataTable').bootstrapTable({
- url: Feng.ctxPath + "/housepurchase/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:"20%"},
- {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:"30%"},
- {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"50%"},
- ]
- });
- }
- /**
- * 公示预览
- * @param type 1-需要兑现,2-不予兑现
- */
- Housepurchase.publicExport = function(type){
- 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 + "/housepurchase/exportPublic?ids="+ids+"&type="+type));
- }
- Feng.confirm("确定要预览吗?", operation);
- }
- /**
- * 公示
- * @param type 1-需要兑现,2-不予兑现
- */
- Housepurchase.public = function(type){
- 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 + "/housepurchase/publicBatch", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- Housepurchase.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);
- }
- /**
- * 批量公示通过
- * @param type
- */
- Housepurchase.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 + "/housepurchase/publicPass", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- Housepurchase.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);
- }
- /**
- * 兑现
- */
- Housepurchase.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 + "/housepurchase/cash", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- Housepurchase.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);
- }
- /**
- * 部门批量提交审核
- */
- Housepurchase.depSubmitBatch = function(){
- var selected = $('#' + this.id).bootstrapTable('getSelections');
- if(selected.length == 0){
- Feng.info("请先选择提交审核的名单!");
- return false;
- }
- var ids = "";
- for(var key in selected){
- ids = ids + selected[key].id + ",";
- }
- var operation = function(){
- var ajax = new $ax(Feng.ctxPath + "/housepurchase/depSubmitBatch", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- Housepurchase.table.refresh();
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("提交审核失败!" + data.responseJSON.message + "!");
- });
- ajax.set("ids",ids);
- ajax.set("companyId",selected[0].companyId);
- ajax.start();
- }
- Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
- }
- /**
- * 显示导出模态框
- */
- Housepurchase.showExportModal = function(){
- $("#exportForm")[0].reset();
- $("#exportModal").modal('show');
- }
- /**
- * 导出
- */
- Housepurchase.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 = Housepurchase.formParams();
- queryData['names'] = names;
- queryData['values'] = values;
- queryData['process'] = $("#process").val();
- $("#exportModal").modal('hide');
- var url = Feng.setUrlParam(Feng.ctxPath + "/housepurchaseExport/basicDataExport",queryData);
- window.hiddenIframe.location.href = url;
- }
- /**
- * 导出录入模板
- * @param type 模板类型
- */
- Housepurchase.exportTemplate = function(type){
- var selected = $('#' + this.id).bootstrapTable('getSelections');
- if(selected.length == 0){
- Feng.info("请先选择名单!");
- return false;
- }
- var ids = "";
- for(var key in selected){
- ids = ids + selected[key].id + ",";
- }
- window.hiddenIframe.location.href = Feng.ctxPath + "/housepurchaseExport/exportTemplate?type="+type+"&ids="+ids;
- }
- /**
- * 导入核查结果
- * @param type
- */
- Housepurchase.import = function(type){
- $("#import-form")[0].reset();
- $('#importModal').on('show.bs.modal', function () {
- $("#type").val(type);
- });
- $("#importModal").modal("show");
- }
- /**
- * 导入核查结果提交
- */
- Housepurchase.importSubmit = function(){
- var file = $("#file").val();
- if(Feng.isEmptyStr(file)){
- Feng.info("请选择需要导入的文件");return;
- }
- $("#import-form")[0].submit();
- }
- /**
- * 回调
- * @param data
- */
- Housepurchase.callBack = function(data){
- Feng.info(data.msg);
- }
- /**
- * 是否发送短信
- */
- Housepurchase.toggleMessage = function(){
- var isMessage = $("input[name='isSend']:checked").val();
- if (isMessage==1) {
- $("#messageEdit").css("display","block");
- } else if ( isMessage == 2){
- $("#messageEdit").css("display","none");
- }
- }
- /**
- * 刷新检索
- */
- Housepurchase.prepareSearch = function () {
- var name = $("#preName").val();
- var idCard = $("#preIdCard").val();
- $('#dataTable').bootstrapTable("refresh",{"query":{"name":name,"idCard":idCard}});
- }
- /**
- * 重置
- */
- Housepurchase.prepareReset = function () {
- $("#preName").val("");
- $("#preIdCard").val("");
- }
- $(function () {
- var defaultColunms = Housepurchase.initColumn();
- var table = new BSTable(Housepurchase.id, "/housepurchase/list/"+$("#process").val(), defaultColunms);
- table.setPaginationType("server");
- table.setOnDblClickRow(function () {
- Housepurchase.openCheckHousepurchase();
- });
- table.setRowStyle(function (row, index) {
- if(row.isConflict == 1){
- return {classes: 'danger'}
- }
- if(row.isRecover == 1){
- return {classes:'info'};
- }
- return {};
- });
- Housepurchase.table = table.init();
- $('#checkAll').click(function () {
- $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
- })
- $('#uncheckAll').click(function () {
- $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
- })
- });
|