index.html 8.2 KB

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