123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- {extend name='table'}
- {block name="button"}
- {if auth("add")}
- <button data-open='{:url("add")}' class='layui-btn layui-btn-sm layui-btn-primary'>发布</button>
- {/if}
- {/block}
- {block name="content"}
- <div class="layui-tab layui-tab-card">
- <ul class="layui-tab-title">
- {foreach ['index'=>$title,] as $k=>$v}
- <li data-open="{:url('index')}?type={$k}">{$v}</li>{/foreach}
- </ul>
- <div class="layui-tab-content">
- <form action="{:sysuri()}" autocomplete="off" class="layui-form layui-form-pane form-search" method="get" onsubmit="return false">
- <div class="layui-form-item layui-inline">
- <label class="layui-form-label">名称</label>
- <label class="layui-input-inline">
- <input class="layui-input" name="name" placeholder="商家名称" value="{$get.name|default=''}">
- </label>
- </div>
- <div class="layui-form-item layui-inline">
- <label class="layui-form-label">状态</label>
- <label class="layui-input-inline">
- <select name="status">
- <option value="">全部</option>
- {foreach $status as $k=>$a}
- <option value="{$k}">{$a}</option>
- {/foreach}
- </select>
- </label>
- </div>
- <div class="layui-form-item layui-inline">
- <label class="layui-form-label">创建时间</label>
- <label class="layui-input-inline">
- <input class="layui-input" data-date-range name="create_time" placeholder="请选择创建时间" value="{$get.create_time|default=''}">
- </label>
- </div>
- <div class="layui-form-item layui-inline">
- <button class="layui-btn layui-btn-primary"><i class="layui-icon"></i> 搜 索</button>
- </div>
- </form>
- <div class="layui-tab-content">
- <table class="layui-table margin-top-10" lay-skin="line">
- {notempty name='list'}
- <thead>
- <tr>
- <th>ID</th>
- <th>订单号</th>
- <th>商家名称</th>
- <th>联系人</th>
- <th>联系方式</th>
- <th>交货地址</th>
- <th>交货时间</th>
- <!-- <th>已报价价格</th>-->
- <th>发布时间</th>
- <th>取消状态</th>
- <th>操作面板</th>
- </tr>
- </thead>
- {/notempty}
- <tbody>
- {foreach $list as $key=>$vo}
- <tr>
- <!-- <td class='list-table-check-td think-checkbox'>-->
- <!-- <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>-->
- <!-- </td>-->
- <td class="nowrap">
- {$vo.id}
- </td>
- <td class="nowrap">
- {$vo.order_no}
- </td>
- <td class="nowrap">
- {$vo.merchant.name}
- </td>
- <td class="nowrap">
- {$vo.real_name}
- </td>
- <td class="nowrap">
- {$vo.mobile}
- </td>
- <td class="nowrap">
- {$vo.post_address}
- </td>
- <td class="nowrap">
- {$vo.post_time}
- </td>
- <!-- <td class="nowrap">-->
- <!-- {if $vo.amount == 0.00}-->
- <!-- '未匹配'-->
- <!-- {else}-->
- <!-- {$vo.amount}-->
- <!-- {/if}-->
- <!-- </td>-->
- <td class="nowrap">
- {$vo.create_time}
- </td>
- <td class="nowrap">
- {if $vo.status == 0}
- 已取消
- {else}
- 未取消
- {/if}
- </td>
- <td class="nowrap">
- <div>
- <a class="layui-btn layui-btn-primary layui-btn-sm" data-modal="{:url('detail')}?id={$vo.id}" data-area='["1200px","90%"]'>查看详情</a>
- {if $vo.status == 1}
- <a class="layui-btn layui-btn-primary layui-btn-sm" data-open="{:url('edit')}?id={$vo.id}" data-area='["1200px","90%"]'>编辑</a>
- <a class="layui-btn layui-btn-primary layui-btn-sm" data-confirm="确定要取消订单吗?" data-action="{:url('cancellation')}?id={$vo.id}" data-area='["1200px","90%"]'>取消订单</a>
- {/if}
- </div>
- </td>
- </tr>
- {/foreach}
- </tbody>
- </table>
- {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
- </div>
- <!-- <table id="NewsTable" data-url="{:sysuri()}" data-target-search="form.form-search"></table>-->
- </div>
- </div>
- {/block}
- {block name='script'}
- <script>
- let status={:json_encode($status,256)};
- $(function () {
- // 初始化表格组件
- $('#NewsTable').layTable({
- even: true, height: 'full',
- sort: {field: 'id desc', type: 'desc'},
- where: {},
- cols: [[
- //{checkbox: true, fixed: true},
- {field: 'id', title: 'ID', align: "center"},
- {field: 'order_no', title: '订单号', align: "center"},
- {field: '', title: '商家名称', align: "center",templet(a){
- return a.merchant?a.merchant.name:''
- }},
- {field: 'real_name', title: '联系人', align: "center"},
- {field: 'mobile', title: '联系方式', align: "center"},
- {field: 'post_address', title: '交货地址', align: "left"},
- {field: 'post_time', title: '交货时间', align: "left"},
- {field: 'create_time', title: '发布时间', align: 'center', minWidth: 170, sort: true},
- {toolbar: '#toolbar', title: '操作面板', align: 'center', minWidth: 80, fixed: 'right'},
- ]]
- });
- // 数据状态切换操作
- layui.form.on('switch(StatusSwitch)', function (obj) {
- var 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 () {
- $('#NewsTable').trigger('reload');
- }); else {
- $('#NewsTable').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-green">已启用</b>' : '<b class="color-red">已禁用</b>'}}
- <!--{/if}-->
- </script>
- <!-- 数据操作工具条模板 -->
- <script type="text/html" id="toolbar">
- <!--{if auth("detail")}-->
- <a class="layui-btn layui-btn-primary layui-btn-sm" data-modal="{:url('detail')}?id={{d.id}}" data-area='["1200px","90%"]'>查看详情</a>
- <!--{/if}-->
- </script>
- {/block}
|