| | |
| | | var cascader = layui.cascader; |
| | | var tree = layui.tree; |
| | | var dropdown = layui.dropdown; |
| | | var element = layui.element; |
| | | |
| | | $('#organization').html(localStorage.getItem('nickname') + ' <i class="layui-icon"></i>'); |
| | | |
| | |
| | | |
| | | // 添加 |
| | | $("#planAddBtn").click(function () { |
| | | showEditModel(); |
| | | let loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/planType/list/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | admin.open({ |
| | | type: 1, |
| | | area: '300px', |
| | | title: '新建售前规划申请单', |
| | | content: $('#addDialogPre').html(), |
| | | success: function (layero, dIndex) { |
| | | element.init(); |
| | | form.render(); |
| | | layer.close(loadIndex); |
| | | console.log(res.data); |
| | | } |
| | | }) |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | // 删除 |
| | |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(plan)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |