123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>店面列表</title>
- <link rel="stylesheet" href="__LAYUI__/layui/css/layui.css" media="all">
- <script src="__LAYUI__/layui/layui.js"></script>
- <style>
- .wfooter {
- position: fixed;
- bottom: 0px;
- left: 0px;
- z-index: 999;
- width: 100%;
- height: 50px;
- background-color: #fff;
- box-sizing: border-box;
- padding: 0px 20px;
- display: flex;
- justify-content: flex-end;
- align-items: center;
- }
- button {
- cursor: pointer;
- }
- #copySetting {
- margin-left: 20px;
- width: 64px;
- height: 28px;
- line-height: 28px;
- }
- #addSetting {
- width: 64px;
- height: 28px;
- line-height: 28px;
- }
- .copyBoxStyle {
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- padding: 20px 20px 20px 0px;
- }
- .submitStyle {
- margin-top: 150px;
- }
- .layui-form-label {
- padding: 10px 5px;
- width: 85px;
- }
- .flex-btn {
- margin-left: 20px;
- display: flex;
- justify-content: center;
- }
- </style>
- </head>
- <body>
- <div id="shop-list">
- <table id="shop-list-table" class="layui-table" lay-filter="shop-list">
- <thead>
- <tr>
- <th lay-data="{field:'corp_id',width: '40%'}">企业微信ID</th>
- <th lay-data="{field:'agentid',width:'40%'}">应用ID</th>
- <th lay-data="{field:'op',width:'20%'}">操作</th>
- </tr>
- </thead>
- <tbody>
- {volist name="list" id="vo"}
- <tr>
- <td>
- {notempty name="$vo['corp_id']"}
- {$vo.corp_id}
- {else /}
- 暂未设置
- {/notempty}
- </td>
- <td>
- {notempty name="$vo['agentid']"}
- {$vo.agentid}
- {else /}
- 暂未设置
- {/notempty}
- </td>
- <td>
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i
- class="layui-icon layui-icon-edit"></i>编辑</a>
- <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"><i
- class="layui-icon layui-icon-delete"></i>删除</a>
- </td>
- </tr>
- {/volist}
- </tbody>
- </table>
- </div>
- <div class="wfooter">
- <button class="layui-btn layui-btn-normal layui-btn-xs" id="addSetting">添加设置</button>
- <button class="layui-btn layui-btn-normal layui-btn-xs" id="copySetting">复制设置</button>
- </div>
- </body>
- <script type="text/html">
- <div></div>
- </script>
- <script>
- var wlist = JSON.parse('{:$list}');
- var company_id = '{$company_id}';
- layui.use(['table', 'form'], function () {
- let table = layui.table;
- let form = layui.form;
- let $ = layui.$;
- table.init('shop-list', { limit: 10000 });
- table.on('tool(shop-list)', function (obj) {
- if (obj.event === "edit") {
- let index = obj.tr.index();
- let data = wlist[index];
- parent.wechatEditSetting({...data,company_id:company_id});
- } else {
- let index = obj.tr.index();
- let data = wlist[index];
- layer.confirm('确定删除此设置?', function(index) {
- $.ajax({
- type: 'post',
- url: "{:url('company/wework_delete')}",
- data: {
- id: data.id
- },
- success: function(res) {
- if(res.code == 0) {
- layer.msg(res.msg, {
- anim: 0
- },function(){
- //执行重载
- location.reload();
- layer.close(index);
- });
- } else {
- layer.msg(res.msg, {
- anim: 6
- });
- }
- }
- });
-
- });
- }
- });
- document.querySelector('#addSetting').onclick = function (e) {
- parent.wechatSetting({ id: company_id })
- }
- parent.reloadFunc = function () {
- location.reload();
- }
- document.querySelector('#copySetting').onclick = function (e) {
- layer.open({
- type: 2,
- title: '复制企微设置',
- content: "{:url('company/wework_copy')}?company_id=" + company_id, //这里content是一个DOM,注意:最好该元素要存放在body最外层,否则可能被其它的相对元素所影响
- area: ['500px', '350px'],
- end: function () {
- location.reload();
- }
- });
- }
- });
- </script>
- </html>
|