esf-xxjy.js 4.55 KB
$(function () {
    layui.use('element', function () {
        let element = layui.element;
    });
    addTabs('#wssq')
    _acceptanceProcess(GetRequest('ywid').ywid)
    // 业务
    layui.use(['form'], function () {
        var form = layui.form
        //自定义验证规则
        form.verify({
            title: function (value) {
                if (value.length == 0) {
                    return '权利人不能为空';
                } else if (value.length < 2) {
                    return '权利人至少得2个字符啊';
                }
            }
        });

        //监听提交
        form.on('submit(submit)', function (data) {
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });
    })
    // 结果弹框
    $('.reset').click(function () {
        successResult()
        // seizureResult()
    })

})
function successResult() {
    layui.use('layer', function () {
        layer.open({
            title: '<p class="system_prompt successInfo">房屋状态:正常</p>',
            area: ['370px', '335px'],
            scrollbar: false,
            btn: ['下一步'],
            yes: function () {
                window.location.href = "./esf-tbxx.html";
            },
            content: '<ul class="dialog_con">'
                + '<li><span>姓名:</span>任超</li>'
                + '<li><span>身份证号:</span>610124193335522</li>'
                + '<li><span>联系电话:</span>18740677386</li>'
                + '<li><span>产权证号:</span>89897987987987</li>'
                + '<li><span>坐落:</span>西安市雁塔区南二环西段</li>'
                + '<li><span>面积:</span>2000</li>'
                + '<li><span>合同备案号:</span>9798798798798</li>'
                + '</ul>'
        });
    })

}

function seizureResult() {
    layui.use('layer', function () {
        layer.open({
            title: '<p class="system_prompt seizureInfo">房屋状态:正常</p>',
            area: ['370px', '335px'],
            scrollbar: false,
            btn: ['下一步'],
            content: '<ul class="dialog_con">'
                + '<li><span>姓名:</span>任超</li>'
                + '<li><span>身份证号:</span>610124193335522</li>'
                + '<li><span>联系电话:</span>18740677386</li>'
                + '<li><span>产权证号:</span>89897987987987</li>'
                + '<li><span>坐落:</span>西安市雁塔区南二环西段</li>'
                + '<li><span>面积:</span>2000</li>'
                + '<li><span>合同备案号:</span>9798798798798</li>'
                + '</ul>'
        });
    })
}

// 获取受理流程信息
function _acceptanceProcess(ywid, lclb = 1) {
    $.ajax({
        type: "post",  //提交方式  
        url: portal.api_url + "/portal/ApplyBusinessService/getApplyFlow",//路径  
        dataType: "json",
        data: {
            "ywid": ywid,
            "lclb": lclb
        },
        //数据,这里使用的是Json格式进行传输  
        success: function (result) {//返回数据根据结果进行相应的处理
            if (result.code == 200 && result.data != null) {
                console.log(result.data)
                $('.name_title h2').text(result.data.shortName)
                $('.name_title p').text(result.data.businessName)
                data.progressList = result.data.stepList
            }
            layui.use('laytpl', function () {
                laytpl = layui.laytpl;
                var getTpl = document.getElementById('progress').innerHTML
                    , view = document.getElementById('app_progress');
                laytpl(getTpl).render(data, function (html) {
                    view.innerHTML = html;
                });
        
                layui.use(['element'], function () {
                    var element = layui.element;
                    //初始化动态元素,一些动态生成的元素如果不设置初始化,将不会有默认的动态效果
                    element.init();
                });
            });
        }
    });
}
function GetRequest() {
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("?");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}
var data = { //数据
    'progressList': [],
};