/**
* 初始化购房补贴详情对话框
*/
var HousepurchaseInfoDlg = {
housepurchaseInfoData: {}
};
var locked = false;
/**
* 关闭此对话框
*/
HousepurchaseInfoDlg.close = function () {
parent.layer.close(window.parent.Housepurchase.layerIndex);
}
/**
* 显示初审审核模态框
*/
HousepurchaseInfoDlg.showFirstCheckModal = function () {
var process = $("#process").val();
var ajax = new $ax(Feng.ctxPath + "/housepurchase/validateIsCheck", function (data) {
if (data.code == 200) {
layer.open({
type: 1,
id: "checkModel",
title: '审核',
area: ['800px', '450px'], //宽高
fix: false, //不固定
shade: 0,
maxmin: true,
content: HousepurchaseInfoDlg.createFirstCheckHtml(data.obj.number),
btn: [' 提交', ' 关闭'],
btnAlign: 'c',
zIndex: layer.zIndex,
success: function (layero, index) {
layer.setTop(layero);
var obj = data.obj.obj;
var fileList = data.obj.fileTypeList;
var html = '';
for (var key in fileList) {
html = html + '
';
}
$("#field_file").empty().append(html);
$("#checkForm")[0].reset();
$("#checkStateFirstModal").val(obj.checkState).trigger("change");
$("#checkMsgFirst").val(obj.checkMsg);
if (Feng.isNotEmptyStr(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 (Feng.isNotEmptyStr(obj.files)) {
$("#field_file input").each(function () {
if (obj.files.indexOf($(this).val()) != -1) this.checked = true;
});
}
},
yes: function (index, layero) {
var checkState = $("#checkStateFirstModal").val();
var checkMsg = $("#checkMsgFirst").val();
if (checkState == null || checkState == '') {
Feng.info("请选择审核状态");
return;
}
if (checkMsg == null || checkMsg == '') {
Feng.info("请填写审核意见");
return;
}
var fields = '', 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 (checkState == 2 && fields == '' && files == '') {
Feng.info("请选择可修改的字段或附件!");
return;
}
if (locked) return;
locked = true;
var ajax = new $ax(Feng.ctxPath + "/housepurchase/check", function (data) {
if (data.code == 200) {
layer.close(index);
Feng.success(data.msg);
} else {
Feng.error(data.msg);
}
locked = false;
}, function (data) {
Feng.error("提交审核失败!" + data.responseJSON.message + "!");
locked = false;
});
ajax.setData({
"id": $("#id").val(), "checkState": checkState, "checkMsg": checkMsg,
"process": $("#process").val(), "fields": fields, "files": files
})
ajax.start();
}
});
} else {
Feng.error(data.msg);
}
}, function (data) {
Feng.error("校验失败!" + data.responseJSON.message + "!");
});
ajax.setData({"id": $("#id").val(), "process": process, "companyId": $("#companyId").val()})
ajax.start();
}
/**
* 显示各单位审核页面
*/
HousepurchaseInfoDlg.showDepCheckModal = function () {
var process = $("#process").val();
var ajax = new $ax(Feng.ctxPath + "/housepurchase/validateIsCheck", function (data) {
if (data.code == 200) {
var company = data.obj.company;
var obj = data.obj.obj;
layer.open({
type: 1,
id: "checkModel",
title: company.name + '核查结果录入',
area: ['800px', '450px'], //宽高
fix: false, //不固定
shade: 0,
maxmin: true,
content:
"",
btn: [' 提交', ' 关闭'],
btnAlign: 'c',
zIndex: layer.zIndex,
success: function (layero, index) {
layer.setTop(layero);
if (company.code = CONFIG.COM_ZJJ) $("#hcMsg").val(obj.zjjCheckDetail);
if (company.code = CONFIG.COM_ZRZYJ) $("#hcMsg").val(obj.zrzzjCheckDetail);
if (company.code = CONFIG.COM_MZJ) $("#hcMsg").val(obj.mzjCheckDetail);
},
yes: function (index, layero) {
var msg = $("#hcMsg").val();
if (Feng.isEmptyStr(msg)) {
Feng.info("请填写核查结果!");
return;
}
var ajax = new $ax(Feng.ctxPath + "/housepurchase/depCheck", 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").val(), "description": msg, "companyId": company.id})
ajax.start();
}
});
} else {
Feng.error(data.msg);
}
}, function (data) {
Feng.error("校验失败!" + data.responseJSON.message + "!");
});
ajax.setData({"id": $("#id").val(), "process": process, "companyId": $("#companyId").val()})
ajax.start();
}
/**
* 显示复核审核页面
*/
HousepurchaseInfoDlg.showThirdCheckModal = function () {
var process = $("#process").val();
var ajax = new $ax(Feng.ctxPath + "/housepurchase/validateIsCheck", function (data) {
if (data.code == 200) {
layer.open({
type: 1,
id: "checkModel",
title: '审核',
area: ['800px', '450px'], //宽高
fix: false, //不固定
shade: 0,
maxmin: true,
content: HousepurchaseInfoDlg.createThirdCheckHtml(),
btn: [' 提交', ' 关闭'],
btnAlign: 'c',
zIndex: layer.zIndex,
success: function (layero, index) {
layer.setTop(layero);
$('#toDep').chosen({width: '100%',placeholder_text_multiple: '请选择兑现对象'});
$("#checkStateFirstModal").val(data.obj.obj.checkState);
$("#checkMsgFirst").val(data.obj.obj.checkMsg);
$("#toProcess").val(data.obj.obj.toProcess);
$("#cashType").val(data.obj.obj.cashType).trigger("change");
if (Feng.isNotEmptyStr(data.obj.obj.toDep)) {
$("#toDep").val(data.obj.obj.toDep.split(",")).trigger("chosen:updated");
}
},
yes: function (index, layero) {
var checkState = $("#checkStateFirstModal").val();
var checkMsg = $("#checkMsgFirst").val();
var toProcess = $("#toProcess").val();
var toDep = $("#toDep").val();
var cashType = $("#cashType").val();
if (checkState == null || checkState == '') {
Feng.info("请选择审核状态");
return;
}
if (checkMsg == null || checkMsg == '') {
Feng.info("请填写审核意见");
return;
}
if (checkState == 2) {
if (Feng.isEmptyStr(toProcess)) {
Feng.info("请选择驳回至流程");
return;
}
if (toProcess == 2 && Feng.isEmptyStr(toDep)) {
Feng.info("请选择驳回单位");
return;
}
}
if (checkState == 3 && Feng.isEmptyStr(cashType)) {
Feng.info("请选择兑现状态");
return;
}
var companyCodes = "", cashObjs = "";
for (var key in toDep) {
if (Feng.isNotEmptyStr(top[key])) {
companyCodes = companyCodes + toDep[key] + ",";
}
}
companyCodes = companyCodes.substring(0, companyCodes.length - 1);
cashObjs = cashObjs.substring(0, cashObjs.length - 1);
var ajax = new $ax(Feng.ctxPath + "/housepurchase/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").val(),
"checkState": checkState,
"checkMsg": checkMsg,
"cashType": cashType,
"process": $("#process").val(),
"companyId": $("#companyId").val(),
"toProcess": $("#toProcess").val(),
"toDep": companyCodes
});
ajax.start();
}
});
} else {
Feng.error(data.msg);
}
}, function (data) {
Feng.error("校验失败!" + data.responseJSON.message + "!");
});
ajax.setData({"id": $("#id").val(), "process": process, "companyId": $("#companyId").val()})
ajax.start();
}
/**
* 公示再审核保存数据
*/
HousepurchaseInfoDlg.saveDepDataAtAfter = function () {
}
/**
* 公示再审核提交
*/
HousepurchaseInfoDlg.showAfterCheckModal = function () {
var process = $("#process").val();
var ajax = new $ax(Feng.ctxPath + "/housepurchase/validateIsCheck", function (data) {
if (data.code == 200) {
layer.open({
type: 1,
id: "checkModel",
title: '审核',
area: ['800px', '450px'], //宽高
fix: false, //不固定
shade: 0,
maxmin: true,
content: HousepurchaseInfoDlg.createAfterCheckHtml(),
btn: [' 提交', ' 关闭'],
btnAlign: 'c',
zIndex: layer.zIndex,
success: function (layero, index) {
layer.setTop(layero);
var housepurchase = data.obj.housepurchase;
$("#decideMoneyDetail").val(housepurchase.decideMoneyDetail);
$("#realEnjoyMoney").val(housepurchase.realEnjoyMoney);
},
yes: function (index, layero) {
var declareType = $("#declareType").val();
var checkState = $("#checkStateFirstModal").val();
var checkMsg = $("#checkMsgFirst").val();
var cashType = $("#cashType").val();
var decideMoneyDetail = $("#decideMoneyDetail").val();
var shouldEnjoyMoney = $("#shouldEnjoyMoney").val();
if (checkState == null || checkState == '') {
Feng.info("请选择审核状态");
return;
}
if (checkMsg == null || checkMsg == '') {
Feng.info("请填写审核意见");
return;
}
if (checkState == 3) {
if (Feng.isEmptyStr(cashType)) {
Feng.info("请选择兑现状态");
return;
}
if (cashType == 1) {
if (declareType == 1 && Feng.isEmptyStr(shouldEnjoyMoney)) {
Feng.info("请填写应享受金额");
return;
}
}
}
var cashObjs = "";
cashObjs = cashObjs.substring(0, cashObjs.length - 1);
var operation = function () {
var ajax = new $ax(Feng.ctxPath + "/housepurchase/afterCheck", function (data) {
if (data.code == 200) {
Feng.success(data.msg);
layer.close(index);
HousepurchaseInfoDlg.close();
window.parent.Housepurchase.table.refresh();
} else {
Feng.error(data.msg);
}
}, function (data) {
Feng.error("审核失败!" + data.responseJSON.message + "!");
});
ajax.setData({
"id": $("#id").val(),
"checkState": checkState,
"checkMsg": checkMsg,
"cashType": cashType,
"decideMoneyDetail": decideMoneyDetail,
"shouldEnjoyMoney": shouldEnjoyMoney
});
ajax.start();
}
Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
}
});
} else {
Feng.error(data.msg);
}
}, function (data) {
Feng.error("校验失败!" + data.responseJSON.message + "!");
});
ajax.setData({"id": $("#id").val(), "process": process, "companyId": $("#companyId").val()})
ajax.start();
}
/**
* 提交审核
*/
HousepurchaseInfoDlg.submitCheck = function () {
var operation = function () {
var ajax = new $ax(Feng.ctxPath + "/housepurchase/submitCheck", function (data) {
if (data.code == 200) {
Feng.success(data.msg);
window.parent.Housepurchase.table.refresh();
HousepurchaseInfoDlg.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);
}
HousepurchaseInfoDlg.createFirstCheckHtml = function () {
var declareType = $("#declareType").val();
var field =
// '手机号码 \n' +
'婚姻状态 \n' +
'配偶姓名 \n' +
'配偶证件类型 \n' +
'配偶证件号码 \n'+
'配偶是否在库人才 \n';
if (declareType == 1) {
field = field +
'不动产权证编号 \n' +
'备案合同编号 \n' +
'房屋坐落地址 \n' +
'房屋建筑面积 \n' +
'商品房购房合同备案时间/不动产权证书办理时间 \n' +
'房屋成交金额 \n' +
'是否享受我市其他政策 \n';
}
return '\n' +
' \n' +
' 审核状态 \n' +
' \n' +
' 请选择 \n' +
' 审核通过 \n' +
' 审核驳回 \n' +
' \n' +
'
\n' +
' \n' +
' ';
}
/**
* 公示在审核
*/
HousepurchaseInfoDlg.createAfterCheckHtml = function () {
var idCard = $("#idCard").val();
var name = $("#name").val();
var spouseName = $("#spouseName").val();
var spouseIdcard = $("#spouseIdcard").val();
var options = "" + name + " ";
if (Feng.isNotEmptyStr(spouseIdcard)) {
options = options + "" + spouseName + " ";
}
return '\n' +
'\n' +
'审核状态 \n' +
'\n' +
'请选择 \n' +
'审核通过 \n' +
'审核不通过 \n' +
' \n' +
'
\n' +
'\n' +
'审核意见 \n' +
' \n' +
'
\n' +
'\n' +
'兑现状态 \n' +
'\n' +
'请选择 \n' +
'兑现 \n' +
'不予兑现 \n' +
' \n' +
'
\n' +
'\n' +
'计算说明 \n' +
' \n' +
'
\n' +
'\n' +
'应该享受金额(不扣除其他政策金额前) \n' +
' \n' +
'
\n' +
' ';
}
HousepurchaseInfoDlg.afterToggleField = function (context) {
var checkState = $(context).val();
if (checkState == -1) {
$("#cashType").attr("style", "pointer-events: none;background-color: #eee;").val(2).trigger("change");
} else {
$("#cashType").removeAttr("style").val("");
}
}
HousepurchaseInfoDlg.afterCashTypeChange = function () {
var declareType = $("#declareType").val();
var cashType = $("#cashType").val();
if (cashType == 1) {
if (declareType == 1) {
$("#descideDesc,#moneyDiv").css("display", "block");
} else {
$("#descideDesc,#moneyDiv").css("display", "none");
}
} else {
$("#descideDesc,#moneyDiv").css("display", "none");
$("#descideDesc,#moneyDiv").val("");
}
}
/**
* 复核页面
*/
HousepurchaseInfoDlg.createThirdCheckHtml = function () {
var idCard = $("#idCard").val();
var name = $("#name").val();
var spouseName = $("#spouseName").val();
var spouseIdcard = $("#spouseIdcard").val();
var options = "" + name + " ";
if (Feng.isNotEmptyStr(spouseIdcard)) {
options = options + "" + spouseName + " ";
}
return '\n' +
'\n' +
'审核状态 \n' +
'\n' +
'请选择 \n' +
'审核通过 \n' +
'审核驳回 \n' +
'审核不通过 \n' +
' \n' +
'
\n' +
'\n' +
'审核意见 \n' +
' \n' +
'
\n' +
'\n' +
'兑现状态 \n' +
'\n' +
'请选择 \n' +
'兑现 \n' +
'不予兑现 \n' +
' \n' +
'
\n' +
'\n' +
'驳回至 \n' +
'\n' +
'请选择 \n' +
'初级审核 \n' +
'部门审核 \n' +
' \n' +
'
\n' +
'\n' +
'驳回单位 \n' +
'\n' +
'请选择 \n' +
'民政局 \n' +
'自然资源局 \n' +
'住建局 \n' +
' \n' +
'
\n' +
' ';
}
/**
* 显示字段或者隐藏字段选择
*/
HousepurchaseInfoDlg.toggleField = function () {
var checkState = $("#checkStateFirstModal").val();
var process = $("#process").val();
var checkMsgFirst = $("#checkMsgFirst").val();
if (checkState == 2 && process == 1) {
$("#field").show();
$("#checkMsgFirst").val("");
} else if (checkState == 3) {
$("#field").hide();
$("#field").find("input[type=checkbox]").removeAttr("checked");
if (Feng.isEmptyStr(checkMsgFirst)) {
$("#checkMsgFirst").val("审核通过");
}
} else if (checkState == -1) {
$("#field").hide();
$("#checkMsgFirst").val("审核不通过");
}
}
/**
* 复核状态变更
*/
HousepurchaseInfoDlg.thirdToggleField = function () {
var checkState = $("#checkStateFirstModal").val();
if (checkState == -1) {
$("#checkMsgFirst").val("审核不通过");
$("#toProcess,#toDep,#cashType").val("");
$("#toProcessDiv,#toDepDiv,#cashTypeDiv,#cashObjDiv").css("display", "none");
}
if (checkState == 2) {
$("#checkMsgFirst").val("");
$("#cashType").val("");
$("#cashTypeDiv,#cashObjDiv").css("display", "none");
$("#toProcessDiv,#toDepDiv").css("display", "block");
}
if (checkState == 3) {
$("#checkMsgFirst").val("审核通过");
$("#toProcess,#toDep").val("");
$("#toProcessDiv,#toDepDiv").css("display", "none");
$("#cashTypeDiv").css("display", "block");
}
}
/**
* 删除享受其他政策
* @param context
*/
HousepurchaseInfoDlg.deleteEnjoyOther = function (context) {
var id = $(context).parent().next().find("input[name='id']").val()
var pId = $(context).parent().next().find("input[name='pId']").val()
if (Feng.isEmptyStr(id)) {
$(context).parent().parent().remove();
} else {
var operation = function () {
var ajax = new $ax(Feng.ctxPath + "/housepurchase/validateIsCheck", function (data) {
if (data.code == 200) {
var ajax1 = new $ax(Feng.ctxPath + "/housepurchase/deleteOtherOrHouse", function (data) {
if (data.code == 200) {
Feng.success(data.msg);
$(context).parent().parent().remove();
} else {
Feng.info(data.msg);
}
}, function (data) {
Feng.error("删除失败!" + data.responseJSON.message + "!");
});
ajax1.set("id", id);
ajax1.set("type", 1);
ajax1.start();
} 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);
}
}
/**
* 删除其他房产信息
* @param context
*/
HousepurchaseInfoDlg.deleteOtherHouse = function (context) {
var id = $(context).parent().next().find("input[name='id']").val()
var pId = $(context).parent().next().find("input[name='pId']").val()
if (Feng.isEmptyStr(id)) {
$(context).parent().parent().remove();
} else {
var operation = function () {
var ajax = new $ax(Feng.ctxPath + "/housepurchase/validateIsCheck", function (data) {
if (data.code == 200) {
var ajax1 = new $ax(Feng.ctxPath + "/housepurchase/deleteOtherOrHouse", function (data) {
if (data.code == 200) {
Feng.success(data.msg);
$(context).parent().parent().remove();
} else {
Feng.info(data.msg);
}
}, function (data) {
Feng.error("删除失败!" + data.responseJSON.message + "!");
});
ajax1.set("id", id);
ajax1.set("type", 2);
ajax1.start();
} 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);
}
}
/**
* 删除配偶信息
* @param context
*/
HousepurchaseInfoDlg.deleteSpouse = function (context) {
var id = $(context).parent().next().find("input[name='id']").val()
if (Feng.isEmptyStr(id)) {
$(context).parent().parent().remove();
} else {
var operation = function () {
var ajax = new $ax(Feng.ctxPath + "/housepurchase/validateIsCheck", function (data) {
if (data.code == 200) {
var ajax1 = new $ax(Feng.ctxPath + "/housepurchase/deleteSpouse", function (data) {
if (data.code == 200) {
Feng.success(data.msg);
$(context).parent().parent().remove();
} else {
Feng.info(data.msg);
}
}, function (data) {
Feng.error("删除失败!" + data.responseJSON.message + "!");
});
ajax1.set("id", id);
ajax1.start();
} 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);
}
}
/***
* 保存部门内审核录入数据
*/
HousepurchaseInfoDlg.saveDepCheckData = function () {
var companyCode = $("#companyCode").val();
var mainId = $("#id").val();
var declareType = $("#declareType").val();
var error = "";
var obj = null;
switch (companyCode) {
case CONFIG.COM_ZJJ:
var enjoyOtherObject = new Array();
var otherHouseObject = new Array();
var checkIsTradeRecord = $("#zjjData").find("select[name='checkIsTradeRecord']").val();
var checkRecordTime = $("#zjjData").find("input[name='checkRecordTime']").val();
var zjjCheckDetail = $("#zjjData").find("input[name='zjjCheckDetail']").val();
if (declareType == 1) {
if (Feng.isEmptyStr(checkIsTradeRecord)) {
Feng.info("请选择是否交易备案");
return;
}
if (checkIsTradeRecord == 1 && Feng.isEmptyStr(checkRecordTime)) {
Feng.info("请选填写交易备案时间");
return;
}
}
var error = HousepurchaseInfoDlg.getZjjData(enjoyOtherObject, otherHouseObject);
if (Feng.isNotEmptyStr(error)) {
Feng.info(error);
return;
}
obj = {
"id": mainId,
"companyId": $("#companyId").val(),
"checkIsTradeRecord": checkIsTradeRecord,
"checkRecordTime": checkRecordTime,
"zjjCheckDetail": zjjCheckDetail,
"otherList": enjoyOtherObject,
"houseList": otherHouseObject
};
var ajax = new $ax(Feng.ctxPath + "/housepurchase/zjjCheck", function (data) {
if (data.code == 200) {
HousepurchaseInfoDlg.initZzj(data.obj.otherList, data.obj.houseList);
Feng.success(data.msg);
} else {
Feng.info(data.msg);
}
}, function (data) {
Feng.error("提交失败!" + data.responseJSON.message + "!");
});
ajax.setcontentType("application/json;charset=utf-8");
ajax.setData(JSON.stringify(obj));
ajax.start();
break;
case CONFIG.COM_ZRZYJ:
var otherHouseObject = new Array();
var isHasBdcCard = $("#isHasBdcCard").val();
var bdcRegistTime = $("#bdcRegistTime").val();
var isOwner = $("#isOwner").val();
var transferMethod = $("#transferMethod").val();
var transferTime = $("#transferTime").val();
var zrzzjCheckDetail = $("#zrzzjCheckDetail").val();
if (declareType == 1) {
if (Feng.isEmptyStr(isHasBdcCard)) {
Feng.info("请选择是否已办理不动产权证");
return;
}
if (isHasBdcCard == 1 && Feng.isEmptyStr(bdcRegistTime)) {
Feng.info("请填写不动产权证书登记时间");
return;
}
if (Feng.isEmptyStr(isOwner)) {
Feng.info("请选择其购置的房屋是否还在名下");
return;
}
if (isOwner == 2 && Feng.isEmptyStr(transferMethod)) {
Feng.info("请填写过户方式");
return;
}
if (isOwner == 2 && Feng.isEmptyStr(transferTime)) {
Feng.info("请填写过户时间");
return;
}
}
var error = HousepurchaseInfoDlg.getZrzyjData(otherHouseObject);
if (Feng.isNotEmptyStr(error)) {
Feng.info(error);
return;
}
obj = {
"id": mainId,
"companyId": $("#companyId").val(),
"isHasBdcCard": isHasBdcCard,
"bdcRegistTime": bdcRegistTime,
"isOwner": isOwner,
"transferMethod": transferMethod,
"transferTime": transferTime,
"zrzzjCheckDetail": zrzzjCheckDetail,
"houseList": otherHouseObject
};
var ajax = new $ax(Feng.ctxPath + "/housepurchase/zrzyjCheck", function (data) {
if (data.code == 200) {
HousepurchaseInfoDlg.initZrzyj(data.obj.houseList);
Feng.success(data.msg);
} else {
Feng.info(data.msg);
}
}, function (data) {
Feng.error("提交失败!" + data.responseJSON.message + "!");
});
ajax.setcontentType("application/json;charset=utf-8");
ajax.setData(JSON.stringify(obj));
ajax.start();
break;
case CONFIG.COM_MZJ:
var spouseObj = new Array();
var mzjCheckDetail = $("#mzjCheckDetail").val();
$("#mzjMarryData .panel-body").each(function (index) {
var id = $(this).find("input[name='id']").val();
var pId = $(this).find("input[name='pId']").val();
var type = $(this).find("select[name='type']").val();
var name = $(this).find("input[name='name']").val();
var registerTime = $(this).find("input[name='registerTime']").val();
var idCard = $(this).find("input[name='idCard']").val();
// var description = $(this).find("input[name='description']").val();
if (Feng.isNotEmptyStr(id) || Feng.isNotEmptyStr(pId) || Feng.isNotEmptyStr(type) || Feng.isNotEmptyStr(name) ||
Feng.isNotEmptyStr(registerTime) || Feng.isNotEmptyStr(idCard)) {
if (Feng.isEmptyStr(type)) {
error = error + "婚姻状况" + (index + 1) + "登记类型为空;\n";
}
if (Feng.isEmptyStr(name)) {
error = error + "婚姻状况" + (index + 1) + "配偶姓名为空;\n";
}
if (Feng.isEmptyStr(idCard)) {
error = error + "婚姻状况" + (index + 1) + "配偶证件号码为空;\n";
}
if (Feng.isEmptyStr(registerTime)) {
error = error + "婚姻状况" + (index + 1) + "登记时间为空;\n";
} else if (!/^\d{4}-\d{2}-\d{2}$/.test(registerTime)) {
error = error + "房产信息" + (index + 1) + "登记时间格式不正确;\n";
}
spouseObj.push({
"id": id,
"type": type,
"name": name,
"registerTime": registerTime,
"idCard": idCard
});
}
});
if (Feng.isNotEmptyStr(error)) {
Feng.info(error);
return;
}
obj = {
"id": mainId,
"companyId": $("#companyId").val(),
"mzjCheckDetail": mzjCheckDetail,
"spouseList": spouseObj
};
var ajax = new $ax(Feng.ctxPath + "/housepurchase/mzjCheck", function (data) {
if (data.code == 200) {
HousepurchaseInfoDlg.initMzj(data.obj.spouseList);
Feng.success(data.msg);
} else {
Feng.info(data.msg);
}
}, function (data) {
Feng.error("提交失败!" + data.responseJSON.message + "!");
});
ajax.setcontentType("application/json;charset=utf-8");
ajax.setData(JSON.stringify(obj));
ajax.start();
break;
break;
}
}
HousepurchaseInfoDlg.getZjjData = function (enjoyOtherObject, otherHouseObject) {
var error = "";
$("#zzjOtherBody .panel-body").not(".history").each(function (index) {
var id = $(this).find("input[name='id']").val();
var pId = $(this).find("input[name='pId']").val();
var name = $(this).find("input[name='name']").val();
var idCard = $(this).find("input[name='idCard']").val();
var houseAddress = $(this).find("input[name='houseAddress']").val();
var recordNo = $(this).find("input[name='recordNo']").val();
var enjoyPolicyName = $(this).find("input[name='enjoyPolicyName']").val();
var money = $(this).find("input[name='money']").val();
var enjoyTime = $(this).find("input[name='enjoyTime']").val();
var description = $(this).find("input[name='description']").val();
if (Feng.isNotEmptyStr(id) || Feng.isNotEmptyStr(pId) || Feng.isNotEmptyStr(name) || Feng.isNotEmptyStr(houseAddress) || Feng.isNotEmptyStr(idCard) ||
Feng.isNotEmptyStr(recordNo) || Feng.isNotEmptyStr(enjoyPolicyName) || Feng.isNotEmptyStr(money) || Feng.isNotEmptyStr(enjoyTime)) {
if (Feng.isEmptyStr(name)) {
error = error + "享受其他政策" + (index + 1) + ")享受人姓名为空;\n";
}
if (Feng.isEmptyStr(idCard)) {
error = error + "享受其他政策" + (index + 1) + ")享受人证件号码为空;\n";
}
if (Feng.isEmptyStr(houseAddress)) {
error = error + "享受其他政策" + (index + 1) + "房屋坐落地址为空;\n";
}
if (Feng.isEmptyStr(recordNo)) {
error = error + "享受其他政策" + (index + 1) + "合同编号为空;\n";
}
if (Feng.isEmptyStr(enjoyPolicyName)) {
error = error + "享受其他政策" + (index + 1) + "享受政策名称为空;\n";
}
if (Feng.isEmptyStr(money)) {
error = error + "享受其他政策" + (index + 1) + "补贴发放金额为空;\n";
} else if (!/^([1-9][0-9]*)+(\.[0-9]{1,10})?$/.test(money)) {
error = error + "享受其他政策" + (index + 1) + "金额格式不正确;\n";
}
if (Feng.isEmptyStr(enjoyTime)) {
error = error + "享受其他政策" + (index + 1) + "发放时间为空;\n";
} else if (!/^\d{4}-\d{2}-\d{2}$/.test(enjoyTime)) {
error = error + "享受其他政策" + (index + 1) + "发放时间格式不正确;\n";
}
enjoyOtherObject.push({
"id": id,
"pId": pId,
"name": name,
"idCard": idCard,
"houseAddress": houseAddress,
"recordNo": recordNo,
"enjoyPolicyName": enjoyPolicyName,
"money": money,
"description": description,
"enjoyTime": enjoyTime
});
}
});
if (Feng.isNotEmptyStr(error)) {
return error;
}
$("#zzjOtherHouse .panel-body").each(function (index) {
var error = "";
var id = $(this).find("input[name='id']").val();
var pId = $(this).find("input[name='pId']").val();
var type = $(this).find("input[name='type']").val();
var name = $(this).find("input[name='name']").val();
var idCard = $(this).find("input[name='idCard']").val();
var number = $(this).find("input[name='number']").val();
var houseAddress = $(this).find("input[name='houseAddress']").val();
var area = $(this).find("input[name='area']").val();
var recordTime = $(this).find("input[name='recordTime']").val();
var tradeMethod = $(this).find("input[name='tradeMethod']").val();
var description = $(this).find("input[name='description']").val();
if (Feng.isNotEmptyStr(id) || Feng.isNotEmptyStr(pId) || Feng.isNotEmptyStr(type) || Feng.isNotEmptyStr(name) || Feng.isNotEmptyStr(number) || Feng.isNotEmptyStr(idCard) ||
Feng.isNotEmptyStr(houseAddress) || Feng.isNotEmptyStr(area) || Feng.isNotEmptyStr(recordTime) || Feng.isNotEmptyStr(tradeMethod)) {
if (Feng.isEmptyStr(name)) {
error = error + "其他房产信息" + (index + 1) + "购房人姓名为空;\n";
}
if (Feng.isEmptyStr(idCard)) {
error = error + "其他房产信息" + (index + 1) + "购房人证件号码为空;\n";
}
if (Feng.isEmptyStr(number)) {
error = error + "其他房产信息" + (index + 1) + "合同编号为空;\n";
}
if (Feng.isEmptyStr(houseAddress)) {
error = error + "其他房产信息" + (index + 1) + "房屋坐落地址为空;\n";
}
if (Feng.isEmptyStr(area)) {
error = error + "其他房产信息" + (index + 1) + "面积为空;\n";
} else if (!/^([1-9][0-9]*)+(\.[0-9]{0,10})?$/.test(area)) {
error = error + "其他房产信息" + (index + 1) + "面积格式不正确;\n";
}
if (Feng.isEmptyStr(recordTime)) {
error = error + "其他房产信息记录中第" + (index + 1) + "交易备案时间为空;\n";
} else if (!/^\d{4}-\d{2}-\d{2}$/.test(recordTime)) {
error = error + "其他房产信息" + (index + 1) + "交易备案时间格式不正确;\n";
}
if (Feng.isEmptyStr(tradeMethod)) {
error = error + "其他房产信息" + (index + 1) + "交易方式为空;\n";
}
otherHouseObject.push({
"id": id,
"type": type,
"name": name,
"idCard": idCard,
"number": number,
"houseAddress": houseAddress,
"area": area,
"recordTime": recordTime,
"tradeMethod": tradeMethod,
"description": description
});
}
});
if (Feng.isNotEmptyStr(error)) {
return error;
}
return null;
}
HousepurchaseInfoDlg.getZrzyjData = function (otherHouseObject) {
var error = "";
$("#zrzyOtherHouse .panel-body").each(function (index) {
var id = $(this).find("input[name='id']").val();
var pId = $(this).find("input[name='pId']").val();
var type = $(this).find("input[name='type']").val();
var name = $(this).find("input[name='name']").val();
var idCard = $(this).find("input[name='idCard']").val();
var houseAddress = $(this).find("input[name='houseAddress']").val();
var number = $(this).find("input[name='number']").val();
var area = $(this).find("input[name='area']").val();
var recordTime = $(this).find("input[name='recordTime']").val();
var description = $(this).find("input[name='description']").val();
if (Feng.isNotEmptyStr(id) || Feng.isNotEmptyStr(pId) || Feng.isNotEmptyStr(type) || Feng.isNotEmptyStr(name) || Feng.isNotEmptyStr(idCard) ||
Feng.isNotEmptyStr(houseAddress) || Feng.isNotEmptyStr(area) || Feng.isNotEmptyStr(recordTime) || Feng.isNotEmptyStr(number)) {
if (Feng.isEmptyStr(name)) {
error = error + "房产信息" + (index + 1) + "产权人姓名为空;\n";
}
if (Feng.isEmptyStr(idCard)) {
error = error + "房产信息" + (index + 1) + "产权人证件号码为空;\n";
}
if (Feng.isEmptyStr(houseAddress)) {
error = error + "房产信息" + (index + 1) + "房屋坐落地址为空;\n";
}
if (Feng.isEmptyStr(area)) {
error = error + "房产信息" + (index + 1) + "面积为空;\n";
} else if (!/^([1-9][0-9]*)+(\.[0-9]{1,10})?$/.test(area)) {
error = error + "其他房产信息" + (index + 1) + "面积格式不正确;\n";
}
if (Feng.isEmptyStr(recordTime)) {
error = error + "房产信息" + (index + 1) + "房屋登记时间为空;\n";
} else if (!/^\d{4}-\d{2}-\d{2}$/.test(recordTime)) {
error = error + "房产信息" + (index + 1) + "房屋登记时间格式不正确;\n";
}
otherHouseObject.push({
"id": id,
"type": type,
"name": name,
"idCard": idCard,
"houseAddress": houseAddress,
"area": area,
"recordTime": recordTime,
"number": number,
"description": description
});
}
});
if (Feng.isNotEmptyStr(error)) {
return error;
}
return null;
}
/**
* 公示再审核修改住建局、自然资源局录入数据
*/
HousepurchaseInfoDlg.afterCheckEdit = function () {
var mainId = $("#id").val();
var declareType = $("#declareType").val();
var enjoyOtherObject = new Array();
var zjjOtherHouseObject = new Array();
var zrzyjOtherHouseObject = new Array();
var checkIsTradeRecord = $("#zjjData").find("select[name='checkIsTradeRecord']").val();
var checkRecordTime = $("#zjjData").find("input[name='checkRecordTime']").val();
var zjjCheckDetail = $("#zjjData").find("input[name='zjjCheckDetail']").val();
if (declareType == 1) {
if (Feng.isEmptyStr(checkIsTradeRecord)) {
Feng.info("请选择是否交易备案");
return;
}
if (checkIsTradeRecord == 1 && Feng.isEmptyStr(checkRecordTime)) {
Feng.info("请选填写交易备案时间");
return;
}
}
var error = HousepurchaseInfoDlg.getZjjData(enjoyOtherObject, zjjOtherHouseObject);
if (Feng.isNotEmptyStr(error)) {
Feng.info(error);
return;
}
var isHasBdcCard = $("#isHasBdcCard").val();
var bdcRegistTime = $("#bdcRegistTime").val();
var isOwner = $("#isOwner").val();
var transferMethod = $("#transferMethod").val();
var transferTime = $("#transferTime").val();
var zrzzjCheckDetail = $("#zrzzjCheckDetail").val();
if (declareType == 1) {
if (Feng.isEmptyStr(isHasBdcCard)) {
Feng.info("请选择是否已办理不动产权证");
return;
}
if (isHasBdcCard == 1 && Feng.isEmptyStr(bdcRegistTime)) {
Feng.info("请填写不动产权证书登记时间");
return;
}
if (Feng.isEmptyStr(isOwner)) {
Feng.info("请选择其购置的房屋是否还在名下");
return;
}
if (isOwner == 2 && Feng.isEmptyStr(transferMethod)) {
Feng.info("请填写过户方式");
return;
}
if (isOwner == 2 && Feng.isEmptyStr(transferTime)) {
Feng.info("请填写过户时间");
return;
}
}
error = HousepurchaseInfoDlg.getZrzyjData(zrzyjOtherHouseObject);
if (Feng.isNotEmptyStr(error)) {
Feng.info(error);
return;
}
var obj = {
"id": mainId,
"checkIsTradeRecord": checkIsTradeRecord,
"checkRecordTime": checkRecordTime,
"zjjCheckDetail": zjjCheckDetail,
"isHasBdcCard": isHasBdcCard,
"bdcRegistTime": bdcRegistTime,
"isOwner": isOwner,
"transferMethod": transferMethod,
"transferTime": transferTime,
"zrzzjCheckDetail": zrzzjCheckDetail,
"zjjHouseList": zjjOtherHouseObject,
"zrzyjHouseList":zrzyjOtherHouseObject,
"otherList": enjoyOtherObject
};
var ajax = new $ax(Feng.ctxPath + "/housepurchase/afterCheckEdit", function (data) {
if (data.code == 200) {
HousepurchaseInfoDlg.initZzj(data.obj.otherList, data.obj.zjjOtherHouseObject);
HousepurchaseInfoDlg.initZrzyj(data.obj.zrzyjOtherHouseObject);
Feng.success(data.msg);
} else {
Feng.info(data.msg);
}
}, function (data) {
Feng.error("提交失败!" + data.responseJSON.message + "!");
});
ajax.setcontentType("application/json;charset=utf-8");
ajax.setData(JSON.stringify(obj));
ajax.start();
}
HousepurchaseInfoDlg.initZzj = function (otherList, houseList) {
if (otherList != null) {
var html = "";
for (var key in otherList) {
html = html +
'\n' +
'
\n' +
' \n' +
' ' + otherList[key].enjoyPolicyName + ' \n' +
' \n' +
' × \n' +
' \n' +
'
\n' +
'
\n' +
'
';
}
$("#zzjOtherBody .panel-default").not(".history").remove();
$("#zzjOtherBody").append(html);
}
if (houseList != null) {
var html = "";
for (var key in houseList) {
html = html +
'\n' +
'
\n' +
' \n' +
' ' + houseList[key].houseAddress + ' \n' +
' \n' +
' × \n' +
' \n' +
'
\n' +
'
\n' +
'
';
}
$("#zzjOtherHouse").empty().append(html);
}
}
HousepurchaseInfoDlg.initZrzyj = function (houseList) {
if (houseList != null) {
var html = "";
for (var key in houseList) {
html = html +
'\n' +
'
\n' +
' \n' +
' ' + houseList[key].houseAddress + ' \n' +
' \n' +
' × \n' +
' \n' +
'
\n' +
'
\n' +
'
'
}
$("#zrzyOtherHouse").empty().append(html);
}
}
HousepurchaseInfoDlg.initMzj = function (spouseList) {
if (spouseList != null) {
var html = "";
for (var key in spouseList) {
html = html +
'\n' +
'
\n' +
' \n' +
' ' + spouseList[key].registerTime + ' \n' +
' \n' +
' × \n' +
' \n' +
'
\n' +
'
\n' +
'
\n' +
'
\n' +
'
\n' +
'
\n' +
' 登记类型 \n' +
' \n' +
' 请选择 \n' +
' 初婚 \n' +
' 复婚 \n' +
' 再婚 \n' +
' 离婚 \n' +
' \n' +
'
\n' +
'
\n' +
' 登记时间 \n' +
' \n' +
'
\n' +
'
\n' +
' 配偶姓名 \n' +
' \n' +
'
\n' +
'
\n' +
' 配偶证件号码 \n' +
' \n' +
'
\n' +
'
\n' +
'
\n' +
'
'
}
$("#mzjMarryData").empty().append(html);
$("select").each(function () {
$(this).val($(this).attr("value"));
});
}
}
HousepurchaseInfoDlg.initDate = function () {
$(".date").removeAttr('lay-key');
$(".date").each(function () {
laydate.render({
elem: this
, type: 'date'
, trigger: 'click'
});
});
}
$(function () {
$("select").each(function () {
$(this).val($(this).attr("value"));
});
Feng.getCheckLog("logTable", {
"type": CONFIG.project_house,
"mainId": $("#id").val(),
"typeFileId": "",
"active": 1
})
HousepurchaseInfoDlg.initDate();
Feng.showMiniFileModal(CONFIG.project_house,$("#type").val(),$("#id").val());
initNoBtnFileTable(CONFIG.project_house,'fileTable');
var declareType = $("#declareType").val();
if (declareType == 1) {
$('#historyTable').bootstrapTable({
url: Feng.ctxPath + "/housepurchase/getHistoryRecord?id=" + $("#id").val(),
method: 'POST',
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
showRefresh: false, // 是否显示刷新按钮
clickToSelect: true, // 是否启用点击选中行
singleSelect: true, // 设置True 将禁止多选
striped: true, // 是否显示行间隔色
pagination: false, // 设置为 true 会在表格底部显示分页条
paginationHAlign: "left",
paginationDetailHAlign: "right",
sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
showColumns: false,
rowStyle: function (row, index) {
return {
css: {
"word-break": "break-word",
"white-space": "inherit"
}
}
},
columns:
[
{
title: '年度',
field: 'year',
visible: true,
align: 'center',
valign: 'middle',
width: "80px",
'class': 'uitd_showTip',
},
{
title: '姓名',
field: 'name',
visible: true,
align: 'center',
valign: 'middle',
width: "100px",
'class': 'uitd_showTip'
},
{
title: '证件号码',
field: 'idCard',
visible: true,
align: 'center',
valign: 'middle',
width: "150px",
'class': 'uitd_showTip'
},
{
title: '婚姻状态',
field: 'marryStatusName',
visible: true,
align: 'center',
valign: 'middle',
width: "100px",
'class': 'uitd_showTip'
},
{
title: '配偶姓名',
field: 'spouseName',
visible: true,
align: 'center',
valign: 'middle',
width: "100px",
'class': 'uitd_showTip'
},
{
title: '配偶证件号码',
field: 'spouseIdcard',
visible: true,
align: 'center',
valign: 'middle',
width: "100px",
'class': 'uitd_showTip'
},
{
title: '房屋地址',
field: 'houseAddress',
visible: true,
align: 'center',
valign: 'middle',
width: "100px",
'class': 'uitd_showTip'
},
{
title: '房屋建筑面积',
field: 'houseArea',
visible: true,
align: 'center',
valign: 'middle',
width: "100px",
'class': 'uitd_showTip'
},
{
title: '房源成交金额',
field: 'houseMoney',
visible: true,
align: 'center',
valign: 'middle',
width: "100px",
'class': 'uitd_showTip'
},
{
title: '计算结果',
field: 'realEnjoyMoney',
visible: true,
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) +
"万元2.个人余额(未扣除本次):" + (parseFloat(row.balanceMoney) / 10000).toFixed(2) +
"万元3.房产余额(未扣除本次):" + (parseFloat(row.houseBalanceMoney) / 10000).toFixed(2) +
"万元4.上一年度未扣除其他政策金额:" + (parseFloat(row.lastOtherMoney) / 10000).toFixed(2) +
"万元5.本年度新增享受其他政策金额:" + (parseFloat(row.nowOtherMoney) / 10000).toFixed(2) +
"万元6.本年度人才层次可享受金额:" + (parseFloat(row.talentArrangeMoney) / 10000).toFixed(2) +
"万元7.本年度应享受金额(2,3,6比较得到):" + (parseFloat(row.shouldEnjoyMoney) / 10000).toFixed(2) +
"万元8.本年度扣除享受其他政策金额:" + (parseFloat(row.nowSubOtherMoney) / 10000).toFixed(2) +
"万元9.本年度未扣除享受其他政策金额:" + (parseFloat(row.nowNotSubOtherMoney) / 10000).toFixed(2) +
"万元10.本年度最终可到账金额:" + (parseFloat(row.realEnjoyMoney) / 10000).toFixed(2) + "万元";
return "" +
" 查看" +
" ";
} else {
return "无";
}
}
}
]
,
onPostBody: function () {
$('#' + id + "td.uitd_showTip").bind("mouseover", function () {
var htm = $(this).html();
$(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
});
}
});
}
});