index.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <include file="public@header"/>
  2. </head>
  3. <body>
  4. <div class="wrap js-check-wrap">
  5. <ul class="nav nav-tabs">
  6. <li class="active"><a>订单列表</a></li>
  7. </ul>
  8. <form class="well form-inline margin-top-20" method="post" action="{:url('order/index')}">
  9. <select class="form-control" name="status" id="status">
  10. <option value="0">全部</option>
  11. <option value="1" <if condition="$status == 1">selected</if>>待发货</option>
  12. <option value="2" <if condition="$status == 2">selected</if>>已发货</option>
  13. <option value="3" <if condition="$status == 3">selected</if>>已完成</option>
  14. </select>
  15. <input type="text" class="form-control js-bootstrap-date" name="start_time"
  16. value="{$start_time|default=''}"
  17. style="width: 140px;" autocomplete="off" placeholder="开始时间">-
  18. <input type="text" class="form-control js-bootstrap-date" name="end_time"
  19. value="{$end_time|default=''}"
  20. style="width: 140px;" autocomplete="off" placeholder="结束时间">
  21. 关键字:
  22. <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}"
  23. placeholder="下单人名称/订单号">
  24. <input type="submit" class="btn btn-primary" value="搜索"/>
  25. <a class="btn btn-default" href="{:url('order/index')}">清空</a>
  26. <a class="btn btn-warning" href="{:url('order/export')}">导出</a>
  27. <a class="btn btn-danger" onclick="doDelete()">批量删除</a>
  28. </form>
  29. <form method="post" class="js-ajax-form">
  30. <table class="table table-hover table-bordered">
  31. <thead>
  32. <tr>
  33. <th><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">全选</th>
  34. <th>订单号</th>
  35. <th width="80">下单人名称</th>
  36. <th>商品</th>
  37. <th>积分价格</th>
  38. <th>数量</th>
  39. <th width="60">总价</th>
  40. <th width="60">支付方式</th>
  41. <th width="80">收货信息</th>
  42. <th width="60">备注</th>
  43. <th width="60">兑换时间</th>
  44. <th>{:lang('STATUS')}</th>
  45. <th width="100">{:lang('ACTIONS')}</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. <php>
  50. $user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));
  51. </php>
  52. <foreach name="list" item="vo">
  53. <tr>
  54. <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
  55. value="{$vo.id}" title="ID:{$vo.id}"></td>
  56. <td>{$vo['order_sn']?$vo['order_sn']:''}</td>
  57. <td>{$vo['real_name']?$vo['real_name']:''}</td>
  58. <td>
  59. <a href="javascript:imagePreviewDialog('{:cmf_get_image_preview_url($vo.thumb)}');">
  60. <img src="{:cmf_get_image_preview_url($vo.thumb)}" alt="" width="48" height="48">
  61. <p>{$vo['goods_name']?$vo['goods_name']:''}</p>
  62. </a>
  63. </td>
  64. <td>{$vo['score']?$vo['score']:0.00}</td>
  65. <td>{$vo['nums']?$vo['nums']:0}</td>
  66. <td>{$vo['total']?$vo['total']:0}</td>
  67. <td>
  68. <switch name="vo.pay_type">
  69. <case value="1">
  70. 积分
  71. </case>
  72. <case value="2">
  73. 余额
  74. </case>
  75. </switch>
  76. </td>
  77. <!--<td>{$vo['contact_name']?$vo['contact_name']:lang('NOT_FILLED')}</td>-->
  78. <td>{$vo['realname']} {$vo['mobile']} {$vo['address']}</td>
  79. <td>{$vo['remark']}</td>
  80. <td>{$vo['created_at']?$vo['created_at']:lang('NOT_FILLED')}</td>
  81. <td>
  82. <switch name="vo.status">
  83. <case value="1">
  84. <span class="text-success">待发货</span>
  85. </case>
  86. <case value="2">
  87. <span class="text-danger">已发货</span>
  88. </case>
  89. <case value="3">
  90. <span class="text-danger">已完成</span>
  91. </case>
  92. </switch>
  93. </td>
  94. <td>
  95. <if condition="$vo.status == 1">
  96. <a class="btn btn-xs btn-success" onclick="send('{$vo.id}')">发货</a>
  97. </if>
  98. <a class="btn btn-xs btn-danger js-ajax-dialog-btn"
  99. href="{:url('order/del',array('id'=>$vo['id']))}"
  100. data-msg="确认删除该兑换记录?">删除</a>
  101. </td>
  102. </tr>
  103. </foreach>
  104. </tbody>
  105. </table>
  106. <div class="pagination">{$page}</div>
  107. </form>
  108. </div>
  109. <script src="__STATIC__/js/admin.js"></script>
  110. <script>
  111. function reloadPage(win) {
  112. win.location.reload();
  113. }
  114. $(function () {
  115. setCookie("refersh_time", 3);
  116. Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
  117. //批量冻结
  118. $('#js-batch-delete').click(function (e) {
  119. var ids = [];
  120. $("input[name='ids[]']").each(function () {
  121. if ($(this).is(':checked')) {
  122. ids.push($(this).val());
  123. }
  124. });
  125. if (ids.length == 0) {
  126. return false;
  127. }
  128. ids = ids.join(',');
  129. });
  130. //end
  131. });
  132. });
  133. </script>
  134. <script>
  135. function doDelete() {
  136. // Wind.use('artDialog', function () {
  137. var ids = [];
  138. $(".js-check:checked").each(function () {
  139. var id = $(this).val();
  140. if (id > 0) {
  141. ids.push(id);
  142. }
  143. });
  144. if (ids.length <= 0) {
  145. showMsg('请先选择操作项');
  146. return false;
  147. }
  148. if (confirm('确定批量删除选择项?不可恢复')) {
  149. $.post('/admin/order/del', {id: ids}, function (res) {
  150. if (res.code == 1) {
  151. showMsg(res.msg);
  152. setTimeout(function () {
  153. location.reload();
  154. }, 800)
  155. } else {
  156. showMsg(res.msg);
  157. }
  158. }, "json")
  159. }
  160. }
  161. /**
  162. * 发货
  163. * @param id
  164. */
  165. function send(id){
  166. var remark = prompt('确认发货?请填写发货信息,如:快递单号等');
  167. if(id>0 && remark){
  168. $.post('/admin/order/send', {id: id, remark: remark}, function (res) {
  169. if (res.code == 'success') {
  170. showMsg(res.message);
  171. setTimeout(function(){
  172. location.reload();
  173. }, 500)
  174. }else {
  175. showMsg(res.message);
  176. }
  177. },"json");
  178. }
  179. }
  180. </script>
  181. </body>
  182. </html>