stair_order.php 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="layui-fluid">
  4. <div class="layui-row layui-col-space15" id="app" v-cloak="">
  5. <!--搜索条件-->
  6. <div class="layui-col-md12">
  7. <div class="layui-card">
  8. <div class="layui-card-header">搜索条件</div>
  9. <div class="layui-card-body">
  10. <div class="layui-carousel layadmin-carousel layadmin-shortcut" lay-anim="" lay-indicator="inside" lay-arrow="none" style="background:none">
  11. <div class="layui-card-body">
  12. <div class="layui-row layui-col-space10 layui-form-item">
  13. <div class="layui-col-lg12">
  14. <label class="layui-form-label">时间选择:</label>
  15. <div class="layui-input-block" data-type="data" v-cloak="">
  16. <button class="layui-btn layui-btn-sm" type="button" v-for="item in dataList" @click="setData(item)" :class="{'layui-btn-primary':where.data!=item.value}">{{item.name}}</button>
  17. <button class="layui-btn layui-btn-sm" type="button" ref="time" @click="setData({value:'zd',is_zd:true})" :class="{'layui-btn-primary':where.data!='zd'}">自定义</button>
  18. <button type="button" class="layui-btn layui-btn-sm layui-btn-primary" v-show="showtime==true" ref="date_time">{$year.0} - {$year.1}</button>
  19. </div>
  20. </div>
  21. <div class="layui-col-lg12">
  22. <label class="layui-form-label">订单类型:</label>
  23. <div class="layui-input-block" v-cloak="">
  24. <button class="layui-btn layui-btn-sm" :class="{'layui-btn-primary':where.type!=item.value}" @click="where.type = item.value" type="button" v-for="item in spread_type">{{item.name}}
  25. <span v-if="item.count!=undefined" class="layui-badge layui-bg-gray">{{item.count}}</span></button>
  26. </div>
  27. </div>
  28. <div class="layui-col-lg12">
  29. <label class="layui-form-label">订单号:</label>
  30. <div class="layui-input-block">
  31. <input type="text" name="order_id" style="width: 50%" v-model="where.order_id" placeholder="请输入姓名、电话、UID、订单号" class="layui-input">
  32. </div>
  33. </div>
  34. <div class="layui-col-lg12">
  35. <div class="layui-input-block">
  36. <button @click="search" type="button" class="layui-btn layui-btn-sm layui-btn-normal">
  37. <i class="layui-icon layui-icon-search"></i>搜索</button>
  38. <button @click="refresh" type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
  39. <i class="layui-icon layui-icon-refresh" ></i>刷新</button>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <!--end-->
  49. <!-- 中间详细信息-->
  50. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col+' layui-col-xs'+item.col:'layui-col-sm6 layui-col-md3'" v-for="item in badge" v-cloak="" v-if="item.count > 0">
  51. <div class="layui-card">
  52. <div class="layui-card-header">
  53. {{item.name}}
  54. <span class="layui-badge layuiadmin-badge" :class="item.background_color">{{item.field}}</span>
  55. </div>
  56. <div class="layui-card-body">
  57. <p class="layuiadmin-big-font">{{item.count}}</p>
  58. <p v-show="item.content!=undefined">
  59. {{item.content}}
  60. <span class="layuiadmin-span-color">{{item.sum}}<i :class="item.class"></i></span>
  61. </p>
  62. </div>
  63. </div>
  64. </div>
  65. <!--enb-->
  66. </div>
  67. <div class="layui-row layui-col-space15">
  68. <div class="layui-col-md12">
  69. <div class="layui-card">
  70. <div class="layui-card-header">分销员列表</div>
  71. <div class="layui-card-body">
  72. <div class="layui-btn-container">
  73. <div class="layui-btn-group conrelTable">
  74. <button class="layui-btn layui-btn-sm layui-btn-normal" type="button" data-type="refresh"><i class="layui-icon layui-icon-refresh" ></i>刷新</button>
  75. </div>
  76. </div>
  77. <table class="layui-hide" id="userList" lay-filter="userList"></table>
  78. <script type="text/html" id="time">
  79. <p>下单:{{d._add_time}}</p><br/>
  80. <p>支付:{{d._pay_time}}</p><br/>
  81. <p>收货:{{d.take_time}}</p>
  82. </script>
  83. <script type="text/html" id="user_info">
  84. <p>{{d.user_info}}</p>
  85. </script>
  86. <script type="text/html" id="order_id">
  87. <a href="javascript:;" lay-event="order_id">{{d.order_id}}</a>
  88. </script>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  95. {/block}
  96. {block name="script"}
  97. <script>
  98. var action={
  99. refresh:function () {
  100. layList.reload();
  101. }
  102. },uid = {$uid};
  103. layList.form.render();
  104. layList.tableList('userList',"{:Url('get_stair_order_list',['uid'=>$uid])}",function () {
  105. return [
  106. {field: 'order_id', title: '订单ID',templet:'#order_id'},
  107. {field: 'user_info', title: '用户信息' ,templet:'#user_info'},
  108. // {field: 'spread_info', title: '上级信息' },
  109. // {field: 'order_info', title: '订单详情' },
  110. {field: 'time', title: '时间',templet:'#time'},
  111. {field: 'number_price', title: '返佣金额'},
  112. ];
  113. });
  114. layList.date({elem:'#start_time',theme:'#393D49',type:'datetime'});
  115. layList.date({elem:'#end_time',theme:'#393D49',type:'datetime'});
  116. layList.search('search',function(where){
  117. if(where.start_time!='' && where.end_time=='') return layList.msg('请选择结束时间');
  118. if(where.end_time!='' && where.start_time=='') return layList.msg('请选择开始时间');
  119. layList.reload(where,true);
  120. });
  121. $('.conrelTable').find('button').each(function () {
  122. var type=$(this).data('type');
  123. $(this).on('click',function () {
  124. action[type] && action[type]();
  125. })
  126. })
  127. layList.tool(function (event,data,obj) {
  128. switch (event){
  129. case 'order_id':
  130. $eb.createModalFrame('订单列表',layList.U({c:'order.store_order',a:'index',q:{real_name:data.order_id}}),{w:1100});
  131. break;
  132. }
  133. });
  134. require(['vue'],function(Vue) {
  135. new Vue({
  136. el: "#app",
  137. data: {
  138. badge: [],
  139. dataList: [
  140. {name: '全部', value: ''},
  141. {name: '今天', value: 'today'},
  142. {name: '昨天', value: 'yesterday'},
  143. {name: '最近7天', value: 'lately7'},
  144. {name: '最近30天', value: 'lately30'},
  145. {name: '本月', value: 'month'},
  146. {name: '本年', value: 'year'},
  147. ],
  148. spread_type:[
  149. {name:'全部',value:''},
  150. {name:'一级推广人订单',value:'1'},
  151. {name:'二级推广人订单',value:'2'},
  152. ],
  153. where:{
  154. data:'',
  155. order_id: '',
  156. type:'',
  157. uid:uid
  158. },
  159. showtime: false,
  160. },
  161. watch:{
  162. },
  163. methods:{
  164. getBadge:function(){
  165. var that=this;
  166. layList.baseGet(layList.Url({a:'get_stair_order_badge',q:that.where}),function (rem) {
  167. that.badge=rem.data;
  168. });
  169. },
  170. setData:function(item){
  171. var that=this;
  172. if(item.is_zd==true){
  173. that.showtime=true;
  174. this.where.data=this.$refs.date_time.innerText;
  175. }else{
  176. this.showtime=false;
  177. this.where.data=item.value;
  178. }
  179. },
  180. search:function () {
  181. this.where.excel=0;
  182. this.getBadge();
  183. layList.reload(this.where,true);
  184. },
  185. refresh:function () {
  186. layList.reload();
  187. this.getBadge();
  188. }
  189. },
  190. mounted:function () {
  191. that = this;
  192. this.getBadge();
  193. layList.laydate.render({
  194. elem:this.$refs.date_time,
  195. trigger:'click',
  196. eventElem:this.$refs.time,
  197. range:true,
  198. change:function (value){
  199. that.where.data=value;
  200. }
  201. });
  202. }
  203. })
  204. });
  205. </script>
  206. {/block}