|
@@ -1,4 +1,4 @@
|
|
|
-{extend name="../../admin/view/main"}
|
|
|
+{extend name="../../admin/view/table"}
|
|
|
|
|
|
{block name="button"}
|
|
|
<!--{if auth("add")}-->
|
|
@@ -12,59 +12,76 @@
|
|
|
|
|
|
{block name="content"}
|
|
|
<div class="layui-tab layui-tab-card think-bg-white">
|
|
|
+ <ul class="layui-tab-title">
|
|
|
+ {foreach ['index'=>'费用模板','recycle'=>'回 收 站'] as $k=>$v}
|
|
|
+ {if isset($type) and $type eq $k}
|
|
|
+ <li class="layui-this" data-open="{:url('index')}?type={$k}">{$v}</li>
|
|
|
+ {else}
|
|
|
+ <li data-open="{:url('index')}?type={$k}">{$v}</li>
|
|
|
+ {/if}{/foreach}
|
|
|
+ </ul>
|
|
|
<div class="layui-tab-content">
|
|
|
{include file='base/postage/template/index_search'}
|
|
|
- <table class="layui-table" lay-skin="line">
|
|
|
- {notempty name='list'}
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th class='list-table-check-td think-checkbox'>
|
|
|
- <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
|
|
|
- </th>
|
|
|
- <th class='list-table-sort-td'>
|
|
|
- <button class="layui-btn layui-btn-xs" data-reload type="button">刷 新</button>
|
|
|
- </th>
|
|
|
- <th class='text-left nowrap'>模板编号</th>
|
|
|
- <th class='text-left nowrap'>模板名称</th>
|
|
|
- <th class='text-left nowrap'>使用状态</th>
|
|
|
- <th class="text-left">创建时间</th>
|
|
|
- <th></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- {/notempty}
|
|
|
- <tbody>
|
|
|
- {foreach $list as $key=>$vo}
|
|
|
- <tr data-dbclick>
|
|
|
- <td class='list-table-check-td think-checkbox'>
|
|
|
- <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>
|
|
|
- </td>
|
|
|
- <td class='list-table-sort-td'>
|
|
|
- <label><input class="list-sort-input" data-action-blur="{:sysuri()}" data-loading="false" data-value="id#{$vo.id};action#sort;sort#{value}" value="{$vo.sort}"></label>
|
|
|
- </td>
|
|
|
- <td class='text-left nowrap'>{$vo.code|default=''}</td>
|
|
|
- <td class='text-left nowrap'>{$vo.name|default=''}</td>
|
|
|
- <td class="text-left nowrap">{if $vo.status eq 0}<span class="color-red">已禁用</span>{elseif $vo.status eq 1}<span class="color-green">已激活</span>{/if}</td>
|
|
|
- <td class='text-left nowrap'>{$vo.create_at|format_datetime}</td>
|
|
|
- <td class='text-left nowrap'>
|
|
|
- <!--{if auth("edit")}-->
|
|
|
- <a class="layui-btn layui-btn-sm" data-dbclick data-open='{:url("edit")}?code={$vo.code}' data-title="编辑快递公司">编 辑</a>
|
|
|
- <!--{/if}-->
|
|
|
-
|
|
|
- <!--{if auth("state") and $vo.status eq 1}-->
|
|
|
- <a class="layui-btn layui-btn-warm layui-btn-sm" data-action="{:url('state')}" data-value="code#{$vo.code};status#0">禁 用</a>
|
|
|
- <!--{elseif auth("state") and $vo.status eq 0}-->
|
|
|
- <a class="layui-btn layui-btn-warm layui-btn-sm" data-action="{:url('state')}" data-value="code#{$vo.code};status#1">激 活</a>
|
|
|
- <!--{/if}-->
|
|
|
-
|
|
|
- <!--{if auth("remove")}-->
|
|
|
- <a class="layui-btn layui-btn-danger layui-btn-sm" data-action="{:url('remove')}" data-confirm="确定要删除数据吗?" data-value="code#{$vo.code}">删 除</a>
|
|
|
- <!--{/if}-->
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- {/foreach}
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
|
|
|
+ <table id="DataTable" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
|
|
|
</div>
|
|
|
</div>
|
|
|
+{/block}
|
|
|
+
|
|
|
+
|
|
|
+{block name='script'}
|
|
|
+<script>
|
|
|
+ $(function () {
|
|
|
+ $('#DataTable').layTable({
|
|
|
+ even: true, height: 'full',
|
|
|
+ sort: {field: 'sort desc,id', type: 'desc'},
|
|
|
+ where: {type: '{$type|default="index"}'},
|
|
|
+ cols: [[
|
|
|
+ {checkbox: true},
|
|
|
+ {field: 'sort', title: '排序权重', width: 100, align: 'center', sort: true, templet: '#SortInputTpl'},
|
|
|
+ {field: 'code', title: '模板编号', align: "left", minWidth: 100},
|
|
|
+ {field: 'name', title: '模板名称', align: "left", minWidth: 100},
|
|
|
+ {field: 'status', title: '使用状态', align: 'center', minWidth: 110, templet: '#StatusSwitchTpl'},
|
|
|
+ {field: 'create_at', title: '添加时间', align: 'center', minWidth: 170},
|
|
|
+ {toolbar: '#toolbar', title: '操作面板', align: 'center', fixed: 'right'}
|
|
|
+ ]]
|
|
|
+ });
|
|
|
+
|
|
|
+ // 数据状态切换操作
|
|
|
+ layui.form.on('switch(StatusSwitch)', function (obj, data) {
|
|
|
+ data = {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0};
|
|
|
+ $.form.load("{:url('state')}", data, 'post', function (ret) {
|
|
|
+ if (ret.code < 1) $.msg.error(ret.info, 3, function () {
|
|
|
+ $('#DataTable').trigger('reload');
|
|
|
+ }); else {
|
|
|
+ $('#DataTable').trigger('reload');
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }, false);
|
|
|
+ });
|
|
|
+ });
|
|
|
+</script>
|
|
|
+
|
|
|
+<!-- 排序权重模板 -->
|
|
|
+<script type="text/html" id="SortInputTpl">
|
|
|
+ <input type="number" min="0" data-blur-number="0" data-action-blur="{:sysuri()}" data-value="id#{{d.id}};action#sort;sort#{value}" data-loading="false" value="{{d.sort}}" class="layui-input text-center">
|
|
|
+</script>
|
|
|
+
|
|
|
+<!-- 状态切换模板 -->
|
|
|
+<script type="text/html" id="StatusSwitchTpl">
|
|
|
+ <!--{if auth("state")}-->
|
|
|
+ <input type="checkbox" value="{{d.id}}" lay-skin="switch" lay-text="已激活|已禁用" lay-filter="StatusSwitch" {{d.status>0?'checked':''}}>
|
|
|
+ <!--{else}-->
|
|
|
+ {{d.status ? '<b class="color-red">已激活</b>' : '<b class="color-green">已禁用</b>'}}
|
|
|
+ <!--{/if}-->
|
|
|
+</script>
|
|
|
+
|
|
|
+<!-- 操作面板模板 -->
|
|
|
+<script type="text/html" id="toolbar">
|
|
|
+ <!--{if auth("edit") and isset($type) and $type eq 'index'}-->
|
|
|
+ <a class="layui-btn layui-btn-sm" data-open="{:url('edit')}?id={{d.id}}">编 辑</a>
|
|
|
+ <!--{/if}-->
|
|
|
+ <!--{if auth("remove") and isset($type) and $type neq 'index'}-->
|
|
|
+ <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('remove')}" data-value="id#{{d.id}}" data-confirm="确定要删除该用户吗?">删 除</a>
|
|
|
+ <!--{/if}-->
|
|
|
+</script>
|
|
|
{/block}
|