index.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. {extend name='table'}
  2. {block name="button"}
  3. {if auth("add")}
  4. <button data-open='{:url("add")}' class='layui-btn layui-btn-sm layui-btn-primary'>发布</button>
  5. {/if}
  6. {/block}
  7. {block name="content"}
  8. <div class="layui-tab layui-tab-card">
  9. <ul class="layui-tab-title">
  10. {foreach ['index'=>$title,] as $k=>$v}
  11. <li data-open="{:url('index')}?type={$k}">{$v}</li>{/foreach}
  12. </ul>
  13. <div class="layui-tab-content">
  14. <form action="{:sysuri()}" autocomplete="off" class="layui-form layui-form-pane form-search" method="get" onsubmit="return false">
  15. <div class="layui-form-item layui-inline">
  16. <label class="layui-form-label">名称</label>
  17. <label class="layui-input-inline">
  18. <input class="layui-input" name="name" placeholder="商家名称" value="{$get.name|default=''}">
  19. </label>
  20. </div>
  21. <div class="layui-form-item layui-inline">
  22. <label class="layui-form-label">状态</label>
  23. <label class="layui-input-inline">
  24. <select name="status">
  25. <option value="">全部</option>
  26. {foreach $status as $k=>$a}
  27. <option value="{$k}">{$a}</option>
  28. {/foreach}
  29. </select>
  30. </label>
  31. </div>
  32. <div class="layui-form-item layui-inline">
  33. <label class="layui-form-label">创建时间</label>
  34. <label class="layui-input-inline">
  35. <input class="layui-input" data-date-range name="create_time" placeholder="请选择创建时间" value="{$get.create_time|default=''}">
  36. </label>
  37. </div>
  38. <div class="layui-form-item layui-inline">
  39. <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
  40. </div>
  41. </form>
  42. <div class="layui-tab-content">
  43. <table class="layui-table margin-top-10" lay-skin="line">
  44. {notempty name='list'}
  45. <thead>
  46. <tr>
  47. <th>ID</th>
  48. <th>订单号</th>
  49. <th>商家名称</th>
  50. <th>联系人</th>
  51. <th>联系方式</th>
  52. <th>交货地址</th>
  53. <th>交货时间</th>
  54. <!-- <th>已报价价格</th>-->
  55. <th>发布时间</th>
  56. <th>取消状态</th>
  57. <th>操作面板</th>
  58. </tr>
  59. </thead>
  60. {/notempty}
  61. <tbody>
  62. {foreach $list as $key=>$vo}
  63. <tr>
  64. <!-- <td class='list-table-check-td think-checkbox'>-->
  65. <!-- <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>-->
  66. <!-- </td>-->
  67. <td class="nowrap">
  68. {$vo.id}
  69. </td>
  70. <td class="nowrap">
  71. {$vo.order_no}
  72. </td>
  73. <td class="nowrap">
  74. {$vo.merchant.name}
  75. </td>
  76. <td class="nowrap">
  77. {$vo.real_name}
  78. </td>
  79. <td class="nowrap">
  80. {$vo.mobile}
  81. </td>
  82. <td class="nowrap">
  83. {$vo.post_address}
  84. </td>
  85. <td class="nowrap">
  86. {$vo.post_time}
  87. </td>
  88. <!-- <td class="nowrap">-->
  89. <!-- {if $vo.amount == 0.00}-->
  90. <!-- '未匹配'-->
  91. <!-- {else}-->
  92. <!-- {$vo.amount}-->
  93. <!-- {/if}-->
  94. <!-- </td>-->
  95. <td class="nowrap">
  96. {$vo.create_time}
  97. </td>
  98. <td class="nowrap">
  99. {if $vo.status == 0}
  100. 已取消
  101. {else}
  102. 未取消
  103. {/if}
  104. </td>
  105. <td class="nowrap">
  106. <div>
  107. <a class="layui-btn layui-btn-primary layui-btn-sm" data-modal="{:url('detail')}?id={$vo.id}" data-area='["1200px","90%"]'>查看详情</a>
  108. {if $vo.status == 1}
  109. <a class="layui-btn layui-btn-primary layui-btn-sm" data-open="{:url('edit')}?id={$vo.id}" data-area='["1200px","90%"]'>编辑</a>
  110. <a class="layui-btn layui-btn-primary layui-btn-sm" data-confirm="确定要取消订单吗?" data-action="{:url('cancellation')}?id={$vo.id}" data-area='["1200px","90%"]'>取消订单</a>
  111. {/if}
  112. </div>
  113. </td>
  114. </tr>
  115. {/foreach}
  116. </tbody>
  117. </table>
  118. {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
  119. </div>
  120. <!-- <table id="NewsTable" data-url="{:sysuri()}" data-target-search="form.form-search"></table>-->
  121. </div>
  122. </div>
  123. {/block}
  124. {block name='script'}
  125. <script>
  126. let status={:json_encode($status,256)};
  127. $(function () {
  128. // 初始化表格组件
  129. $('#NewsTable').layTable({
  130. even: true, height: 'full',
  131. sort: {field: 'id desc', type: 'desc'},
  132. where: {},
  133. cols: [[
  134. //{checkbox: true, fixed: true},
  135. {field: 'id', title: 'ID', align: "center"},
  136. {field: 'order_no', title: '订单号', align: "center"},
  137. {field: '', title: '商家名称', align: "center",templet(a){
  138. return a.merchant?a.merchant.name:''
  139. }},
  140. {field: 'real_name', title: '联系人', align: "center"},
  141. {field: 'mobile', title: '联系方式', align: "center"},
  142. {field: 'post_address', title: '交货地址', align: "left"},
  143. {field: 'post_time', title: '交货时间', align: "left"},
  144. {field: 'create_time', title: '发布时间', align: 'center', minWidth: 170, sort: true},
  145. {toolbar: '#toolbar', title: '操作面板', align: 'center', minWidth: 80, fixed: 'right'},
  146. ]]
  147. });
  148. // 数据状态切换操作
  149. layui.form.on('switch(StatusSwitch)', function (obj) {
  150. var data = {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0};
  151. $.form.load("{:url('state')}", data, 'post', function (ret) {
  152. if (ret.code < 1) $.msg.error(ret.info, 3, function () {
  153. $('#NewsTable').trigger('reload');
  154. }); else {
  155. $('#NewsTable').trigger('reload');
  156. }
  157. return false;
  158. }, false);
  159. });
  160. });
  161. </script>
  162. <!-- 列表排序权重模板 -->
  163. <script type="text/html" id="SortInputTpl">
  164. <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">
  165. </script>
  166. <!-- 数据状态切换模板 -->
  167. <script type="text/html" id="StatusSwitchTpl">
  168. <!--{if auth("state")}-->
  169. <input type="checkbox" value="{{d.id}}" lay-skin="switch" lay-text="已激活|已禁用" lay-filter="StatusSwitch" {{-d.status>0?'checked':''}}>
  170. <!--{else}-->
  171. {{-d.status ? '<b class="color-green">已启用</b>' : '<b class="color-red">已禁用</b>'}}
  172. <!--{/if}-->
  173. </script>
  174. <!-- 数据操作工具条模板 -->
  175. <script type="text/html" id="toolbar">
  176. <!--{if auth("detail")}-->
  177. <a class="layui-btn layui-btn-primary layui-btn-sm" data-modal="{:url('detail')}?id={{d.id}}" data-area='["1200px","90%"]'>查看详情</a>
  178. <!--{/if}-->
  179. </script>
  180. {/block}