中扬CRM客户关系管理系统
#
luxiaotao1123
2022-11-21 d339355ee4801f639ce67ffabf23399955f810f2
src/main/webapp/static/js/plan/plan.js
@@ -196,7 +196,7 @@
    $("#planAddBtn").click(function () {
        let loadIndex = layer.load(2);
        $.ajax({
            url: baseUrl+"/planType/list/auth",
            url: baseUrl+"/planType/list/radio/auth",
            headers: {'token': localStorage.getItem('token')},
            method: 'POST',
            success: function (res) {
@@ -207,10 +207,41 @@
                        title: '新建售前规划申请单',
                        content: $('#addDialogPre').html(),
                        success: function (layero, dIndex) {
                            element.init();
                            form.render();
                            let template = Handlebars.compile($('#planTypeTpl').html());
                            $('#planTypeBox').html(template({list: res.data.map(function (d) {
                                    return {
                                        id: d.id,
                                        name: d.name,
                                        checked: d.checked
                                    }
                                })})
                            );
                            element.init();form.render();
                            layer.close(loadIndex);
                            console.log(res.data);
                            form.on('submit(planTypeSubmit)', function (data) {
                                // var loadIndex = layer.load(2);
                                // $.ajax({
                                //     url: baseUrl+"/plan/"+(mData?'update':'add')+"/auth",
                                //     headers: {'token': localStorage.getItem('token')},
                                //     data: data.field,
                                //     method: 'POST',
                                //     success: function (res) {
                                //         layer.close(loadIndex);
                                //         if (res.code === 200){
                                //             layer.close(dIndex);
                                //             layer.msg(res.msg, {icon: 1});
                                //             tableReload();
                                //         } else if (res.code === 403){
                                //             top.location.href = baseUrl+"/";
                                //         }else {
                                //             layer.msg(res.msg, {icon: 2});
                                //         }
                                //     }
                                // })
                                alert(data.field.planType);
                                return false;
                            });
                        }
                    })
                } else if (res.code === 403){