yysq.js 4.9 KB
    layui.use('element', function () {
        let element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
    });
    addTabs('#wssq')
    var data = {
        'progressList': [
            {
                stepName: "信息效验",
                stepState: 2 //0:未办理 1:正在办理 2:已办理
            },
            {
                stepName: "填报信息",
                stepState: 1
            },
            {
                stepName: "完税核税",
                stepState: 0
            },
            {
                stepName: "身份认证",
                stepState: 0
            },
            {
                stepName: "资料审核",
                stepState: 0
            },
            {
                stepName: "线上缴费",
                stepState: 0
            },
            {
                stepName: "生成电子证书",
                stepState: 0
            }
        ],
    }
    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();
        });
    });
    // form 表单
    layui.use('form', function () {
        var form = layui.form;
        form.on('select(typeId)', function (data) {
            console.log(data.value);
        });
        //自定义验证规则
        form.verify({
            title: function (value) {
                if (value.length == 0) {
                    return '权利人不能为空';
                } else if (value.length < 2) {
                    return '权利人至少得2个字符啊';
                }
            }
        });

        //监听提交
        form.on('submit(demo1)', function (data) {
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });
    })
    $('.radioInfo').click(function () {
        let index = $(this).attr("value")
        if (index == 2 || index == 3) {
            $('.add_form').show()
        } else {
            $('.add_form').hide()
        }
    })
    // form 添加
    $('.add_form').click(function () {
        $('.layui-form').append(
            '<div class="layui-form-item">' +
            '<div class="layui-inline">' +
            '<label class="layui-form-label">姓名</label>' +
            '<div class="layui-input-block">' +
            '<input type="text" name="name" required lay-verify="name" placeholder="请输权利人" class="layui-input">' +
            '</div>' +
            '</div>' +
            '<div class="layui-inline idCard">' +
            '<label class="layui-form-label">身份证类型</label>' +
            '<div class="layui-input-block">' +
            '<select lay-filter="typeId">' +
            '<option value="1">身份证</option>' +
            '<option value="2">军官证</option>' +
            '</select>' +
            '</div>' +
            '</div>' +
            '<div class="layui-inline">' +
            '<label class="layui-form-label">证件号码</label>' +
            '<div class="layui-input-block">' +
            '<input type="tel" name="card" maxlength="18" required lay-verify="card" placeholder="请输证件号码" class="layui-input">' +
            '</div>' +
            '</div>' +
            '<div class="layui-inline">' +
            '<label class="layui-form-label">联系方式</label>' +
            '<div class="layui-input-block">' +
            '<input type="tel" name="phone" maxlength="11" required lay-verify="phone" placeholder="请输联系方式" class="layui-input">' +
            '</div>' +
            '</div>' +
            '<i class="layui-icon layui-icon-reduce-circle"></i>' +
            '</div>'
        )

        layui.use('form', function () {
            var form = layui.form;
            form.render('select');
            form.on('select(typeId)', function (data) {
                console.log(data.value);
            });
        })
        // 编辑
        $(document).on("click", ".layui-icon-reduce-circle", function (e) {
            $(this).parent().remove()
        })
    })
    // 图片上传
    // 询问笔录
    $('.record').click(function(event){
        event.stopPropagation();
        console.log('下载模板99')
    })
    var flieList = [];  // 登记证书列表
    var flieList1 = [];  // 房屋所有权证书列表
    var flieList3 = [];  // 询问笔录
    $('.next_button a').click(function(){
        console.log(999, flieList,5689, flieList1,98999, flieList3)
        return false
    })