123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765 |
- /**
- * 初始化购房补贴详情对话框
- */
- var HousepurchaseInfoDlg = {
- housepurchaseInfoData: {},
- validateFields: {
- enterpriseId: {validators: {notEmpty: {message: '所属企业不能为空'}}},
- name: {validators: {notEmpty: {message: '姓名不能为空'}}},
- declareObject: {validators: {notEmpty: {message: '申报对象不能为空'}}},
- declareType: {validators: {notEmpty: {message: '申报类型不能为空'}}},
- cardType: {validators: {notEmpty: {message: '证件类型不能为空'}}},
- idCard: {validators: {notEmpty: {message: '证件号码不能为空'}}},
- marryStatus: {validators: {notEmpty: {message: '婚姻状态不能为空'}}},
- // houseAddress: {validators: {notEmpty: {message: '房屋坐落地址不能为空'}}},
- // houseArea: {validators: {notEmpty: {message: '房源购置面积不能为空'}}},
- // recordTime: {validators: {notEmpty: {message: '商品房购房合同备案时间不能为空'}}},
- // houseMoney: {validators: {notEmpty: {message: '房屋成交金额不能为空'}}},
- // isEnjoyOther: {validators: {notEmpty: {message: '是否享受我市其他政策不能为空'}}},
- // realEstateNo: {
- // validators: {
- // notEmpty: {
- // message: '不动产权证编号不能为空'
- // },
- // regexp: {
- // regexp: /^闽\([0-9]{4}\)晋江市不动产权第\([0-9]+\)号$/,
- // message: "不动产权证编号格式不正确"
- // }
- // }
- // },
- // recordNo: {
- // validators: {
- // notEmpty: {
- // message: '备案合同编号不能为空'
- // },
- // regexp: {
- // regexp: /^\d+$/,
- // message: "备案合同编号格式不正确"
- // }
- // }
- // },
- phone: {
- validators: {
- notEmpty: {
- message: '手机号码不能为空'
- },
- regexp: {
- regexp: /0?(13|14|15|16|17|18|19)[0-9]{9}/,
- message: "手机号码格式不正确"
- }
- }
- },
- bank: {
- validators: {
- notEmpty: {
- message: '开户银行不能为空'
- },
- regexp: {
- regexp: /^[\u4e00-\u9fa5]*银行$/,
- message: "开户银行格式不正确"
- }
- }
- },
- bankAccount: {
- validators: {
- notEmpty: {
- message: '银行账号不能为空'
- },
- regexp: {
- regexp: /^\d+$/,
- message: "银行账号格式不正确"
- }
- }
- },
- // number:{
- // validators: {
- // notEmpty: {
- // message: '享受第几次购房补贴不能为空'
- // },
- // regexp: {
- // regexp: /^[1-5]$/,
- // message: "享受第几次购房补贴格式不正确"
- // }
- // }
- // }
- }
- };
- /**
- * 清除数据
- */
- HousepurchaseInfoDlg.clearData = function () {
- this.housepurchaseInfoData = {};
- }
- /**
- * 设置对话框中的数据
- * @param key 数据的名称
- * @param val 数据的具体值
- */
- HousepurchaseInfoDlg.set = function (key, val) {
- this.housepurchaseInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
- return this;
- }
- /**
- * 设置对话框中的数据
- * @param key 数据的名称
- * @param val 数据的具体值
- */
- HousepurchaseInfoDlg.get = function (key) {
- return $("#" + key).val();
- }
- /**
- * 关闭此对话框
- */
- HousepurchaseInfoDlg.close = function () {
- parent.layer.close(window.parent.Housepurchase.layerIndex);
- }
- /**
- * 收集数据
- */
- HousepurchaseInfoDlg.collectData = function () {
- this
- .set('id')
- .set('talentId')
- .set('type')
- .set('declareType')
- .set('declareObject')
- .set('year')
- .set('name')
- .set('cardType')
- .set('idCard')
- .set('provinceCode')
- .set('cityCode')
- .set('countyCode')
- .set('street')
- .set('talentType')
- .set('talentArrange')
- .set('certificateStartTime')
- .set('certificateEndTime')
- .set('identifyCondition')
- .set('idenfityConditionName')
- .set('identifyGetTime')
- .set('phone')
- .set('marryStatus')
- .set('spouseName')
- .set('spouseCardType')
- .set('spouseIdcard')
- .set('childName')
- .set('childCardType')
- .set('childIdCard')
- .set('number')
- .set('houseAddress')
- .set('houseArea')
- .set('recordTime')
- .set('houseMoney')
- .set('realEstateNo')
- .set('recordNo')
- .set('isEnjoyOther')
- .set('bank')
- .set('bankNetwork')
- .set('bankAccount')
- .set('bankNumber')
- .set('spouseIsLibrary');
- if ($("#provinceCode").val() != null && $("#provinceCode").val() != '') {
- this.housepurchaseInfoData["provinceName"] = $("#provinceCode").find("option:selected").text();
- }
- if ($("#cityCode").val() != null && $("#cityCode").val() != '') {
- this.housepurchaseInfoData["cityName"] = $("#cityCode").find("option:selected").text();
- }
- if ($("#countyCode").val() != null && $("#countyCode").val() != '') {
- this.housepurchaseInfoData["countyName"] = $("#countyCode").find("option:selected").text();
- }
- }
- /**
- * 验证数据
- */
- HousepurchaseInfoDlg.validate = function () {
- $('#houseInfoForm').data("bootstrapValidator").resetForm();
- $('#houseInfoForm').bootstrapValidator('validate');
- return $("#houseInfoForm").data('bootstrapValidator').isValid();
- }
- HousepurchaseInfoDlg.nameChange = function () {
- var talentId = $("#talentId").val();
- var declareType = $("#declareType").val();
- if (Feng.isEmptyStr(declareType)) {
- Feng.info("请先选择申报类型");
- $("#talentId").val("").trigger('chosen:updated');
- ;
- return;
- }
- if (Feng.isNotEmptyStr(talentId)) {
- var ajax = new $ax(Feng.ctxPath + "/enterprise/house/getTalentInfo/id/" + talentId, function (data) {
- if (data.code == 200) {
- var talentInfo = data.obj.talentInfo;
- var houseInfo = data.obj.houseInfo;
- if (houseInfo && houseInfo.count >= 5) {
- Feng.info("当前申报人所关联房产已享受5次补贴,无法再次申报");
- return;
- }
- $("#name").val(talentInfo.name);
- $("#cardType").val(talentInfo.card_type);
- $("#idCard").val(talentInfo.card_number);
- $("#provinceCode").val(talentInfo.province).trigger("change");
- $("#cityCode").val(talentInfo.city).trigger("change");
- $("#countyCode").val(talentInfo.county);
- $("#street").val(talentInfo.street);
- $("#phone").val(talentInfo.phone);
- $("#bank").val(talentInfo.enterpriseBank);
- $("#bankNumber").val(talentInfo.bank_number);
- $("#bankNetwork").val(talentInfo.enterpriseBankNetwork);
- $("#bankAccount").val(talentInfo.enterpriseBankCard);
- $("#talentArrange").val(talentInfo.talentArrange).trigger("change");
- $("#certificateStartTime").val(talentInfo.certificateStartTime);
- $("#certificateEndTime").val(talentInfo.certificateOutTime);
- $("#identifyCondition").val(talentInfo.talent_condition);
- $("#idenfityConditionName").val(talentInfo.identifyConditionName);
- $("#identifyGetTime").val(talentInfo.identifyGetTime);
- if (Feng.isNotEmptyStr(houseInfo)) {
- $("#realEstateNo").val(houseInfo.realEstateNo).attr("style", "pointer-events: none;background-color: #eee;");
- $("#recordNo").val(houseInfo.recordNo).attr("style", "pointer-events: none;background-color: #eee;");
- $("#houseAddress").val(houseInfo.houseAddress).attr("style", "pointer-events: none;background-color: #eee;");
- $("#houseArea").val(houseInfo.houseArea).attr("style", "pointer-events: none;background-color: #eee;");
- $("#recordTime").val(houseInfo.recordTime).attr("style", "pointer-events: none;background-color: #eee;");
- $("#houseMoney").val(houseInfo.houseMoney).attr("style", "pointer-events: none;background-color: #eee;");
- } else {
- $("#realEstateNo").val("").removeAttr("style");
- $("#recordNo").val("").attr("style");
- $("#houseAddress").val("").attr("style");
- $("#houseArea").val("").attr("style");
- $("#recordTime").val("").attr("style");
- $("#houseMoney").val("").attr("style");
- }
- } else {
- $("#talentId,#cardType,#idCard,#provinceCode,#cityCode,#countyCode,#street,#phone,#bank,#bankNumber,#bankNetwork,#bankAccount,#talentArrange,#identifyCondition,#identifyConditionName,#identifyGetTime").val("");
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("查询失败!" + data.responseJSON.message + "!");
- });
- ajax.set("year", $("#year").val())
- ajax.set("declareType", declareType)
- ajax.start();
- }
- }
- /**
- * 添加未成年子女
- */
- HousepurchaseInfoDlg.addChild = function () {
- var options = $("#cardType").html();
- $("#childData").append(
- '<div class="col-sm-12">\n' +
- '<input type="hidden" name="id"/>\n' +
- '<input type="hidden" name="pId"/>' +
- '<div class="rowGroup col-sm-3">\n' +
- '<input type="text" class="form-control" name="childName" placeholder="未成年子女姓名"/>\n' +
- '</div>\n' +
- '<div class="rowGroup col-sm-3">\n' +
- '<select class="form-control" name="childCardType" placeholder="未成年子女证件类型">\n' +
- options +
- '</select>\n' +
- '</div>\n' +
- '<div class="rowGroup col-sm-3">\n' +
- '<input type="text" class="form-control" name="childIdCard" placeholder="未成年子女证件号码"/>\n' +
- '</div>\n' +
- '<div class="add-btn" onclick="HousepurchaseInfoDlg.addChild()"></div>\n' +
- '<div class="reduce" onclick="HousepurchaseInfoDlg.reduceChild(this)"></div>' +
- '</div>');
- }
- /**
- * 删除子女信息
- */
- HousepurchaseInfoDlg.reduceChild = function (context) {
- var id = $(context).parent().find("input[name='id']").val();
- if (Feng.isEmptyStr(id)) {
- $(context).parent().remove();
- } else {
- if (!validateIsEdit())
- return;
- var operation = function () {
- var ajax = new $ax(Feng.ctxPath + "/enterprise/house/deleteChildren", function (data) {
- if (data.code == 200) {
- $(context).parent().remove();
- Feng.success(data.msg);
- } else {
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("删除失败!" + data.responseJSON.message + "!");
- });
- ajax.set("id", id);
- ajax.start();
- }
- Feng.confirm("删除后无法恢复,确认删除吗?", operation);
- }
- }
- /**
- * 提交添加
- */
- HousepurchaseInfoDlg.addSubmit = function () {
- var id = $("#id").val();
- if (Feng.isNotEmptyStr(id)) {
- HousepurchaseInfoDlg.editSubmit(1);
- return;
- }
- this.clearData();
- this.collectData();
- if (!HousepurchaseInfoDlg.validate()) {
- return;
- }
- if (Feng.isNotEmptyStr(this.housepurchaseInfoData.houseMoney) && !/^([1-9][0-9]*)+(\.[0-9]{0,10})?$/.test(this.housepurchaseInfoData.houseMoney)) {
- Feng.info("房屋成交金额格式不正确!");
- return;
- }
- if (Feng.isNotEmptyStr(this.housepurchaseInfoData.houseArea) && !/^([1-9][0-9]*)+(\.[0-9]{0,10})?$/.test(this.housepurchaseInfoData.houseArea)) {
- Feng.info("房屋建筑面积格式不正确!");
- return;
- }
- if (this.housepurchaseInfoData.declareObject == 2 || this.housepurchaseInfoData.declareObject == 3) {
- Feng.info("此种申报对象请通过线下申报,系统不支持旧政策申报流程!");
- return;
- }
- //提交信息
- var child = new Array();
- var error = "";
- $("#childData .col-sm-12").each(function (index) {
- var id = $(this).find("input[name='id']").val();
- var pId = $(this).find("input[name='pId']").val();
- var childName = $(this).find("input[name='childName']").val();
- var childCardType = $(this).find("select[name='childCardType']").val();
- var childIdCard = $(this).find("input[name='childIdCard']").val();
- if (Feng.isNotEmptyStr(id) || Feng.isNotEmptyStr(pId) || Feng.isNotEmptyStr(childName) || Feng.isNotEmptyStr(childCardType) || Feng.isNotEmptyStr(childIdCard)) {
- if (Feng.isEmptyStr(childName)) {
- error = error + "第" + (index + 1) + "行未成年子女姓名为空;\n";
- }
- if (Feng.isEmptyStr(childCardType)) {
- error = error + "第" + (index + 1) + "行未成年子女证件类型为空;\n";
- }
- if (Feng.isEmptyStr(childIdCard)) {
- error = error + "第" + (index + 1) + "行未成年子女证件号码为空;\n";
- }
- child.push({"id": id, "pId": pId, "name": childName, "cardType": childCardType, "idCard": childIdCard});
- }
- });
- this.housepurchaseInfoData['childList'] = child;
- var ajax = new $ax(Feng.ctxPath + "/enterprise/house/apply", function (data) {
- if (data.code == 200) {
- var obj = data.obj;
- var childList = obj.childList;
- Feng.success(data.msg);
- $("#id").val(obj.id);
- $("#type").val(obj.type);
- $("#fileLi").removeAttr("style");
- $("#checkState").val(obj.checkState);
- $("#talentId").prop("disabled", true).trigger("chosen:updated");
- HousepurchaseInfoDlg.initChildData(childList);
- } else {
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("添加失败!" + data.responseJSON.message + "!");
- });
- ajax.setcontentType("application/json;charset=utf-8");
- ajax.setData(JSON.stringify(this.housepurchaseInfoData));
- ajax.start();
- }
- /**
- * 提交修改
- */
- HousepurchaseInfoDlg.editSubmit = function (type) {
- this.clearData();
- this.collectData();
- if (!validateIsEdit())
- return;
- if (!HousepurchaseInfoDlg.validate()) { //校验
- return;
- }
- if (this.housepurchaseInfoData.declareObject == 2 || this.housepurchaseInfoData.declareObject == 3) {
- Feng.info("此种申报对象请通过线下申报,系统不支持旧政策申报流程!");
- return;
- }
- //提交信息
- var child = new Array();
- var error = "";
- $("#childData .col-sm-12").each(function (index) {
- var id = $(this).find("input[name='id']").val();
- var pId = $(this).find("input[name='pId']").val();
- var childName = $(this).find("input[name='childName']").val();
- var childCardType = $(this).find("select[name='childCardType']").val();
- var childIdCard = $(this).find("input[name='childIdCard']").val();
- if (Feng.isNotEmptyStr(id) || Feng.isNotEmptyStr(pId) || Feng.isNotEmptyStr(childName) || Feng.isNotEmptyStr(childCardType) || Feng.isNotEmptyStr(childIdCard)) {
- if (Feng.isEmptyStr(childName)) {
- error = error + "第" + (index + 1) + "行未成年子女姓名为空;\n";
- }
- if (Feng.isEmptyStr(childCardType)) {
- error = error + "第" + (index + 1) + "行未成年子女证件类型为空;\n";
- }
- if (Feng.isEmptyStr(childIdCard)) {
- error = error + "第" + (index + 1) + "行未成年子女证件号码为空;\n";
- }
- child.push({"id": id, "pId": pId, "name": childName, "cardType": childCardType, "idCard": childIdCard});
- }
- });
- this.housepurchaseInfoData['childList'] = child;
- //提交信息
- var ajax = new $ax(Feng.ctxPath + "/enterprise/house/apply", function (data) {
- if (data.code == 200) {
- if (type == 1) {
- var childList = data.obj.childList;
- Feng.success(data.msg);
- HousepurchaseInfoDlg.initChildData(childList);
- } else {
- HousepurchaseInfoDlg.submitToCheck();
- }
- } else {
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("修改失败!" + data.responseJSON.message + "!");
- });
- ajax.setcontentType("application/json;charset=utf-8");
- ajax.setData(JSON.stringify(this.housepurchaseInfoData));
- ajax.start();
- }
- /**
- * 初始化子女信息
- * @param list
- */
- HousepurchaseInfoDlg.initChildData = function (list) {
- var options = $("#cardType").html();
- var html = "";
- for (var key in list) {
- html = html +
- '<div class="col-sm-12">\n' +
- '<input type="hidden" name="id" value="' + list[key].id + '"/>\n' +
- '<input type="hidden" name="pId" value="' + list[key].pId + '"/>' +
- '<div class="rowGroup col-sm-3">\n' +
- '<input type="text" class="form-control" name="childName" value="' + list[key].name + '" placeholder="未成年子女姓名"/>\n' +
- '</div>\n' +
- '<div class="rowGroup col-sm-3">\n' +
- '<select class="form-control" name="childCardType" value="' + list[key].cardType + '" placeholder="未成年子女证件类型">\n' +
- options +
- '</select>\n' +
- '</div>\n' +
- '<div class="rowGroup col-sm-3">\n' +
- '<input type="text" class="form-control" name="childIdCard" value="' + list[key].idCard + '" placeholder="未成年子女证件号码"/>\n' +
- '</div>\n' +
- '<div class="add-btn" onclick="HousepurchaseInfoDlg.addChild()"></div>\n' +
- '<div class="reduce" onclick="HousepurchaseInfoDlg.reduceChild(this)"></div>' +
- '</div>';
- }
- if (Feng.isEmptyStr(html)) {
- html = html +
- '<div class="col-sm-12">\n' +
- '<input type="hidden" name="id" />\n' +
- '<input type="hidden" name="pId" />' +
- '<div class="rowGroup col-sm-3">\n' +
- '<input type="text" class="form-control" name="childName" placeholder="未成年子女姓名"/>\n' +
- '</div>\n' +
- '<div class="rowGroup col-sm-3">\n' +
- '<select class="form-control" name="childCardType" placeholder="未成年子女证件类型">\n' +
- options +
- '</select>\n' +
- '</div>\n' +
- '<div class="rowGroup col-sm-3">\n' +
- '<input type="text" class="form-control" name="childIdCard" placeholder="未成年子女证件号码"/>\n' +
- '</div>\n' +
- '<div class="add-btn" onclick="HouseRentingInfoDlg.addChild()"></div>\n' +
- '</div>';
- }
- $("#childData").empty().append(html);
- $("#childData select").each(function () {
- $(this).val($(this).attr("value"))
- })
- if (list == null) {
- HousepurchaseInfoDlg.addChild();
- }
- }
- /**
- * 提交审核
- */
- HousepurchaseInfoDlg.submitToCheck = function () {
- if (!validateIsEdit())
- return;
- var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
- if (data.code == 200) {
- var operation = function () {
- var ajax = new $ax(Feng.ctxPath + "/enterprise/house/submitToCheck", 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.set("id", $("#id").val());
- ajax.start();
- }
- Feng.confirm("请确认基础信息已核对无误,相应附件已上传,一旦提交,无法修改", operation);
- } else {
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("查询失败!" + data.responseJSON.message + "!");
- });
- ajax.set("type", CONFIG.project_house);
- ajax.set("id", $("#id").val())
- ajax.start();
- }
- /**
- * 申报对象级联
- */
- HousepurchaseInfoDlg.declareObjChange = function () {
- var declareObj = $("#declareObject").val();
- switch (declareObj) {
- case "":
- break;
- case "1": //新政策中公布入选为晋江市现代产业体系人才后再购房对象
- break;
- case "2": //旧政策中取得购房补贴指标后完成购房,且符合新政策认定标准对象(在库)
- Feng.info("此种对象请通过线下申报,线上不支持旧政策的申报流程!");
- break;
- case "3": //旧政策中取得购房补贴指标后完成购房,且符合新政策认定标准对象(在库)
- Feng.info("此种对象请通过线下申报,线上不支持旧政策的申报流程!");
- break;
- }
- }
- /**
- * 根据申报类型
- */
- HousepurchaseInfoDlg.typeChange = function () {
- var type = $("#declareType").val();
- if (type == null) {
- $("#realEstateNo,#recordNo,#houseAddress,#houseArea,#recordTime,#houseMoney,#number,#isEnjoyOther").val("").parent().css("display", "none");
- }
- if (type == 1) {
- $("#realEstateNo,#recordNo,#houseAddress,#houseArea,#recordTime,#houseMoney,#number,#isEnjoyOther").parent().css("display", "block");
- }
- if (type == 2) {
- $("#realEstateNo,#recordNo,#houseAddress,#houseArea,#recordTime,#houseMoney,#number,#isEnjoyOther").val("").parent().css("display", "none");
- }
- }
- /**
- * 获取认定条件
- */
- HousepurchaseInfoDlg.getIdentifyCondition = function () {
- var level = $("#talentArrange").val();
- if (level == null || level == '') {
- $("#identifyCondition").empty();
- return;
- }
- Feng.addAjaxSelect({
- "id": "identifyCondition",
- "displayCode": "id",
- "displayName": "name",
- "type": "GET",
- "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel?level=" + level
- });
- }
- /**
- * 校验是否显示按钮
- * @param type 类型 1-上传按钮,2-修改删除按钮
- * @param row
- * @returns {string}
- */
- function validUploadButton(type, row, fileId) {
- var files = $("#files").val();
- var checkState = $("#checkState").val();
- if (Feng.isEmptyStr(checkState) || checkState == 1 || (checkState == 10 && files.indexOf(row.id) != -1)) {
- return type == 1 ?
- "<button type='button' onclick=\"checkFile(this,'" + row.id + "','" + null + "')\" style='margin-right: 10px' class=\"btn btn-xs btn-info\">" +
- "<i class=\"fa fa-upload\"></i>上传" +
- "</button>"
- :
- "<button type=\'button\' onclick=\"checkFile(this,'" + row.id + "','" + fileId + "')\" style=\'margin-right: 10px\' class=\"btn btn-xs btn-info\">" +
- "<i class=\"fa fa-paste\"></i>修改" +
- "</button>" +
- "<button type='button' onclick=\"deleteFile('" + fileId + "','" + CONFIG.project_house + "')\" class=\"btn btn-xs btn-danger\">" +
- "<i class=\"fa fa-times\"></i>删除" +
- "</button>";
- } else {
- return type == 1 ? "" : "";
- }
- }
- function validateIsEdit() {
- var id = $("#id").val();
- var checkState = $("#checkState").val();
- if (Feng.isEmptyStr(id)) {
- Feng.info("请先填写基础信息并上传附件");
- return false;
- }
- if (checkState != 1 && checkState != 10) {
- if (checkState == -1) {
- Feng.error("您的申报审核不通过,无法修改");
- return false;
- } else if (checkState >= 40) {
- Feng.error("您的申报已审核通过,无法修改");
- return false;
- } else {
- Feng.error("您的申报正在审核中,请耐心等待");
- return false;
- }
- }
- return true;
- }
- //设置不可修改的字段
- HousepurchaseInfoDlg.setNoChangeField = function () {
- var checkState = $("#checkState").val();
- var fields = $("#fields").val();
- if (checkState == 10) {
- $("#basicData input,textarea").each(function () {
- $(this).attr("readonly", "readonly");
- });
- $("#basicData select").each(function () {
- $(this).attr("disabled", "disabled");
- });
- if (fields != null && fields != '') {
- var arr = fields.split(",");
- for (var key in arr) {
- var name = $("#" + arr[key]).prop("tagName");
- if (name == 'select' || name == 'SELECT') {
- $("#" + arr[key]).removeAttr("disabled");
- }
- if (name == "input" || name == 'textarea' || name == "INPUT" || name == 'TEXTAREA') {
- $("#" + arr[key]).removeAttr("readonly");
- }
- }
- }
- }
- }
- /**
- * 获取房产信息
- */
- HousepurchaseInfoDlg.getHouseInfo = function () {
- var idCard = $("#idCard").val();
- var spouseIdcard = $("#spouseIdcard").val();
- if (Feng.isEmptyStr(idCard)) {
- Feng.info("请选择申报人");
- return;
- }
- var ajax = new $ax(Feng.ctxPath + "/enterprise/house/getHouseInfo", function (data) {
- if (data.code == 200) {
- var houseInfo = data.obj;
- if (houseInfo.count >= 5) {
- Feng.info("当前申报人(或配偶)所关联房产已享受5次补贴,无法再次申报");
- return;
- }
- if (Feng.isNotEmptyStr(houseInfo)) {
- $("#realEstateNo").val(houseInfo.realEstateNo).attr("style", "pointer-events: none;background-color: #eee;");
- $("#recordNo").val(houseInfo.recordNo).attr("style", "pointer-events: none;background-color: #eee;");
- $("#houseAddress").val(houseInfo.houseAddress).attr("style", "pointer-events: none;background-color: #eee;");
- $("#houseArea").val(houseInfo.houseArea).attr("style", "pointer-events: none;background-color: #eee;");
- $("#recordTime").val(houseInfo.recordTime).attr("style", "pointer-events: none;background-color: #eee;");
- $("#houseMoney").val(houseInfo.houseMoney).attr("style", "pointer-events: none;background-color: #eee;");
- } else {
- $("#realEstateNo").val("").removeAttr("style");
- $("#recordNo").val("").attr("style");
- $("#houseAddress").val("").attr("style");
- $("#houseArea").val("").attr("style");
- $("#recordTime").val("").attr("style");
- $("#houseMoney").val("").attr("style");
- }
- } else {
- $("#talentId,#cardType,#idCard,#provinceCode,#cityCode,#countyCode,#street,#phone,#bank,#bankNumber,#bankNetwork,#bankAccount,#talentArrange,#identifyCondition,#identifyConditionName,#identifyGetTime").val("");
- Feng.info(data.msg);
- }
- }, function (data) {
- Feng.error("查询失败!" + data.responseJSON.message + "!");
- });
- ajax.set("idCard", idCard);
- ajax.set("spouseIdcard", spouseIdcard);
- ajax.start();
- }
- $(function () {
- Feng.initValidatorTip("houseInfoForm", HousepurchaseInfoDlg.validateFields);
- Feng.addAjaxSelect({
- "id": 'talentId',
- "displayCode": "id",
- "displayName": "name",
- "type": "GET",
- "url": Feng.ctxPath + "/enterprise/talent/findTalentByEnterpriseInLibrary?type=2&year=" + $("#year").val()
- });
- //批量加载字典表数据
- var arr = [
- {"name": "cardType", "code": "card_type"},
- {"name": "spouseCardType", "code": "card_type"},
- {"name": "childCardType", "code": "card_type"},
- {"name": "marryStatus", "code": "marry_status"},
- {"name": "talentArrange", "code": "talent_arrange"},
- {"name": "street", "code": "street"}];
- Feng.findChildDictBatch(JSON.stringify(arr));
- $("select[name='childCardType']").append($("#cardType").html());
- $(".other_talentArrange").empty().append($("#talentArrange").html());
- loadProvince();
- //加载时间控件
- $(".date").each(function () {
- laydate.render({
- elem: this, type: 'date', trigger: 'click'
- });
- });
- var id = $("#id").val();
- if (Feng.isNotEmptyStr(id)) {
- $("select").each(function () {
- $(this).val($(this).attr("value")).trigger("change");
- });
- $("#fileLi").removeAttr("style");
- Feng.getCheckLog("logTable", {"type": CONFIG.project_house, "mainId": id, "typeFileId": "", "active": 1})
- } else {
- $("#fileLi").attr("style", "pointer-events: none");
- $("#talentId").on('chosen:ready', function (e, params) {
- $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
- });
- $("#talentId").chosen({
- search_contains: true, //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
- disable_search: false,
- width: "100%",
- enable_split_word_search: true
- });
- }
- HousepurchaseInfoDlg.setNoChangeField();
- toastr.options = {
- "closeButton": true,
- "debug": false,
- "positionClass": "toast-bottom-right",
- "onclick": null,
- "showDuration": "300",
- "hideDuration": "1000",
- "timeOut": "600000",
- "extendedTimeOut": "1000",
- "showEasing": "swing",
- "hideEasing": "linear",
- "showMethod": "fadeIn",
- "hideMethod": "fadeOut",
- "tapToDismiss": true
- };
- toastr.success("免租入住仅人才标签为在站博士后的人才申报!!!");
- });
|