| | |
| | | $("#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) { |
| | |
| | | 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){ |