截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lists.html 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. {layout name="layout1" /}
  2. <div class="wrapper">
  3. <div class="layui-card">
  4. <!-- 操作提示 -->
  5. <div class="layui-card-body">
  6. <div class="layui-collapse" style="border:1px dashed #c4c4c4">
  7. <div class="layui-colla-item">
  8. <h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
  9. <div class="layui-colla-content layui-show">
  10. <p>*商城发票管理中心。</p>
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. <!-- 搜索区域 -->
  16. <div class="layui-card-body layui-form">
  17. <div class="layui-form-item">
  18. <div class="layui-inline">
  19. <label for="order_sn" class="layui-form-label">订单编号:</label>
  20. <div class="layui-inline" style="margin-right:0;">
  21. <div class="layui-input-inline" >
  22. <input type="text" id="order_sn" name="order_sn" autocomplete="off" class="layui-input">
  23. </div>
  24. </div>
  25. </div>
  26. <div class="layui-inline">
  27. <label class="layui-form-label">订单状态:</label>
  28. <div class="layui-input-block">
  29. <select name="order_status" id="order_status">
  30. <option value="">全部</option>
  31. {foreach $order_status as $item => $val}
  32. <option value="{$item}">{$val}</option>
  33. {/foreach}
  34. </select>
  35. </div>
  36. </div>
  37. <div class="layui-row">
  38. <div class="layui-inline">
  39. <label class="layui-form-label">下单时间:</label>
  40. <div class="layui-input-inline">
  41. <div class="layui-input-inline">
  42. <input type="text" name="start_time" class="layui-input" id="start_time"
  43. placeholder="" autocomplete="off">
  44. </div>
  45. </div>
  46. <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
  47. <label class="layui-form-mid">至</label>
  48. </div>
  49. <div class="layui-input-inline">
  50. <input type="text" name="end_time" class="layui-input" id="end_time"
  51. placeholder="" autocomplete="off">
  52. </div>
  53. </div>
  54. <div class="layui-inline">
  55. <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
  56. <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
  57. <a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="data-export">导出</a>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <!-- 主体区域 -->
  63. <div class="layui-card-body">
  64. <div class="layui-tab layui-tab-card" lay-filter="like-tab">
  65. <ul class="layui-tab-title">
  66. <li lay-id="" class="layui-this">全部</li>
  67. <li lay-id="0">未开票</li>
  68. <li lay-id="1">已开票</li>
  69. </ul>
  70. <div class="layui-tab-content" style="padding:20px;">
  71. <table id="like-table-lists" lay-filter="like-table-lists"></table>
  72. <script type="text/html" id="table-operation">
  73. <a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="invoice">发票详情</a>
  74. <a class="layui-btn layui-btn-sm layui-btn-primary" lay-event="detail">订单详情</a>
  75. </script>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <script>
  82. layui.use(["table", "form", "element", "laydate"], function(){
  83. var table = layui.table;
  84. var form = layui.form;
  85. var element = layui.element;
  86. var laydate = layui.laydate;
  87. //日期时间范围
  88. laydate.render({
  89. elem: '#start_time'
  90. , type: 'datetime'
  91. , theme: '#1E9FFF'
  92. });
  93. laydate.render({
  94. elem: '#end_time'
  95. , type: 'datetime'
  96. , theme: '#1E9FFF'
  97. });
  98. like.tableLists("#like-table-lists", "{:url('order.Invoice/lists')}", [
  99. {field:"order_sn", width:200, align:"center",title:"订单编号"}
  100. ,{field:"order_amount", width:100, align:"center", title:"订单金额"}
  101. ,{field:"type_text", width:220, align:"center", title:"发票类型"}
  102. ,{field:"header_type_text", width:130, align:"center", title:"发票抬头类型"}
  103. ,{field:"status_text", width:100, align:"center", title:"开票状态"}
  104. ,{field:"order_status", width:160, align:"center", title:"订单状态"}
  105. ,{field:"order_create_time", width:160, align:"center", title:"下单时间"}
  106. ,{title:"操作", width:200, align:"center", fixed:"right", toolbar:"#table-operation"}
  107. ]);
  108. var active = {
  109. invoice: function (obj) {
  110. layer.open({
  111. type: 2
  112. ,title: "发票详情"
  113. ,content: "{:url('order.invoice/detail')}?id=" + obj.data.id
  114. ,area: ["90%", "90%"]
  115. ,yes: function(index, layero){
  116. }
  117. });
  118. },
  119. detail: function (obj) {
  120. layer.open({
  121. type: 2
  122. ,title: '订单详情'
  123. ,content: '{:url("order.order/detail")}?id='+obj.data.order_id
  124. ,area: ['90%', '90%']
  125. ,yes: function(index, layero){
  126. }
  127. })
  128. }
  129. };
  130. like.eventClick(active);
  131. element.on("tab(like-tab)", function(){
  132. var status = this.getAttribute("lay-id");
  133. table.reload("like-table-lists", {
  134. where: {status: status},
  135. page: {
  136. curr: 1
  137. }
  138. });
  139. });
  140. form.on("submit(search)", function(data){
  141. table.reload("like-table-lists", {
  142. where: data.field,
  143. page: {
  144. curr: 1
  145. }
  146. });
  147. });
  148. form.on("submit(clear-search)", function(){
  149. $("#order_sn").val("");
  150. $("#order_status").val("");
  151. $("#start_time").val("");
  152. $("#end_time").val("");
  153. form.render();
  154. table.reload("like-table-lists", {
  155. where: {},
  156. page: {
  157. curr: 1
  158. }
  159. });
  160. });
  161. // 导出
  162. form.on('submit(data-export)', function (data) {
  163. var field = data.field;
  164. like.ajax({
  165. url: '{:url("order.invoice/export")}'
  166. , data: field
  167. , type: 'get'
  168. , success: function (res) {
  169. if (res.code == 1) {
  170. window.location.href = res.data.url;
  171. }
  172. }
  173. });
  174. });
  175. })
  176. </script>