index.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. {/block}
  4. {block name="content"}
  5. <style>
  6. .btn-outline{
  7. border:none;
  8. }
  9. .btn-outline:hover{
  10. background-color: #0e9aef;
  11. color: #fff;
  12. }
  13. .layui-form-item .layui-btn {
  14. margin-top: 5px;
  15. margin-right: 10px;
  16. }
  17. .layui-btn-primary{
  18. margin-right: 10px;
  19. margin-left: 0!important;
  20. }
  21. label{
  22. margin-bottom: 0!important;
  23. margin-top: 4px;
  24. }
  25. </style>
  26. <div class="layui-fluid">
  27. <div class="layui-row layui-col-space15" id="app">
  28. <!--搜索条件-->
  29. <div class="layui-col-md12">
  30. <div class="layui-card">
  31. <div class="layui-card-header">搜索条件</div>
  32. <div class="layui-card-body">
  33. <form class="layui-form layui-form-pane" action="">
  34. <div class="layui-form-item">
  35. <div class="layui-inline">
  36. <label class="layui-form-label" style="top: -4.5px">所有场馆</label>
  37. <div class="layui-input-block">
  38. <select name="auction_id">
  39. <option value=" ">全部</option>
  40. {volist name='auction' id='vo'}
  41. <option value="{$vo.id}">{$vo.nickname}</option>
  42. {/volist}
  43. </select>
  44. </div>
  45. </div>
  46. <div class="layui-inline">
  47. <label class="layui-form-label" style="top: -4.5px">搜索</label>
  48. <div class="layui-input-block">
  49. <input type="text" name="store_name" class="layui-input" placeholder="账号,昵称.,编号">
  50. </div>
  51. </div>
  52. <div class="layui-col-lg12">
  53. <label class="layui-form-label">创建时间:</label>
  54. <div class="layui-input-block" data-type="data" v-cloak="">
  55. <button class="layui-btn layui-btn-sm" type="button" v-for="item in dataList"
  56. @click="setData(item)"
  57. :class="{'layui-btn-primary':where.data!=item.value}">{{item.name}}
  58. </button>
  59. <button class="layui-btn layui-btn-sm" type="button" ref="time"
  60. @click="setData({value:'zd',is_zd:true})"
  61. :class="{'layui-btn-primary':where.data!='zd'}">自定义
  62. </button>
  63. <button type="button" class="layui-btn layui-btn-sm layui-btn-primary"
  64. v-show="showtime==true" ref="date_time">{$year.0} - {$year.1}
  65. </button>
  66. </div>
  67. </div>
  68. <div class="layui-inline" style="top: -5px">
  69. <div class="layui-input-inline">
  70. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search" >
  71. <i class="layui-icon layui-icon-search"></i>搜索</button>
  72. </div>
  73. </div>
  74. </div>
  75. </form>
  76. </div>
  77. </div>
  78. </div>
  79. <!-- 中间详细信息-->
  80. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  81. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  82. </div>
  83. <!--enb-->
  84. </div>
  85. <!--列表-->
  86. <div class="layui-row layui-col-space15">
  87. <div class="layui-col-md12">
  88. <div class="layui-card">
  89. <div class="layui-card-header">预约列表</div>
  90. <div class="layui-card-body">
  91. <!-- <div class="layui-btn-container" id="container-action">-->
  92. <!-- <a class="layui-btn layui-btn-sm" href="{:Url('create')}">添加商品</a>-->
  93. <!-- <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
  94. <!-- </div>-->
  95. <table class="layui-hide" id="List" lay-filter="List"></table>
  96. <script type="text/html" id="image">
  97. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
  98. </script>
  99. <script type="text/html" id="status">
  100. {{# if(d.status < 1){ }}
  101. <button type="button" name="status" class="layui-btn-disabled layui-btn-xs" id="">
  102. 已退回
  103. </button>
  104. {{# } else { }}
  105. <button type="button" name="status" class="layui-btn layui-btn-xs layui-btn-danger" id="">
  106. 正常
  107. </button>
  108. {{# } }}
  109. </script>
  110. <script type="text/html" id="act">
  111. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='th' id="">
  112. 退回
  113. </button>
  114. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  115. 删除
  116. </button>
  117. </script>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. <!--end-->
  123. </div>
  124. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  125. {/block}
  126. {block name="script"}
  127. <script>
  128. //实例化form
  129. layList.form.render();
  130. layList.tableList('List', "{:Url('list')}", function () {
  131. return [
  132. {type: 'checkbox'},
  133. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  134. {field: 'name', title: '场馆', templet: '#name', align: 'center'},
  135. {field: 'account', title: '账号', templet: '#account', align: 'center'},
  136. {field: 'nickname', title: '呢称', templet: '#nickname', align: 'center'},
  137. {field: 'anticipate', title: '预约卷', templet: '#price', align: 'center', style : 'color: #DC143C;'},
  138. {field: 'frequency', title: '场次', templet: '#frequency', align: 'center'},
  139. {field: 'status', title: '状态', templet: '#status', align: 'center'},
  140. {field: 'create_time', title: '预约时间', templet: '#date', align: 'center'},
  141. {field: 'right', title: '操作', align: 'center', toolbar: '#act'},
  142. ];
  143. });
  144. //点击事件绑定
  145. layList.tool(function (event,data,obj) {
  146. switch (event) {
  147. case 'delete':
  148. var url=layList.U({c:'auction.auction_booking',a:'delete',q:{id:data.id}});
  149. var code = {title:"操作提示",text:"确定删除?",type:'info',confirm:'是的,删除'};
  150. $eb.$swal('delete',function(){
  151. $eb.axios.get(url).then(function(res){
  152. if(res.status == 200 && res.data.code == 200) {
  153. $eb.$swal('success',res.data.msg);
  154. obj.del();
  155. location.reload();
  156. }else
  157. return Promise.reject(res.data.msg || '删除失败')
  158. }).catch(function(err){
  159. $eb.$swal('error',err);
  160. });
  161. },code)
  162. break;
  163. case 'th':
  164. var url=layList.U({c:'auction.auction_booking',a:'th',q:{id:data.id}});
  165. var code = {title:"操作提示",text:"确定退回预约卷?",type:'info',confirm:'是的,退回'};
  166. $eb.$swal('delete',function(){
  167. $eb.axios.get(url).then(function(res){
  168. if(res.status == 200 && res.data.code == 200) {
  169. $eb.$swal('success',res.data.msg);
  170. obj.del();
  171. location.reload();
  172. }else
  173. return Promise.reject(res.data.msg || '退回失败')
  174. }).catch(function(err){
  175. $eb.$swal('error',err);
  176. });
  177. },code)
  178. break;
  179. break;
  180. case 'edit':
  181. location.href = layList.U({a:'edit',q:{id:data.id}});
  182. break;
  183. }
  184. })
  185. //查询
  186. layList.search('search',function(where){
  187. console.log(111);
  188. layList.reload(where,true);
  189. });
  190. //改状态
  191. layList.switch('is_show',function (odj,value) {
  192. if(odj.elem.checked==true){
  193. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:1,id:value}}),function (res) {
  194. layList.msg(res.msg, function () {
  195. layList.reload();
  196. });
  197. });
  198. }else{
  199. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:0,id:value}}),function (res) {
  200. layList.msg(res.msg, function () {
  201. layList.reload();
  202. });
  203. });
  204. }
  205. });
  206. require(['vue'], function (Vue) {
  207. new Vue({
  208. el: "#app",
  209. data: {
  210. badge: [],
  211. dataList: [
  212. {name: '全部', value: ''},
  213. {name: '今天', value: 'today'},
  214. {name: '昨天', value: 'yesterday'},
  215. {name: '最近7天', value: 'lately7'},
  216. {name: '最近30天', value: 'lately30'},
  217. {name: '本月', value: 'month'},
  218. {name: '本年', value: 'year'},
  219. ],
  220. where: {
  221. data: '',
  222. status: status,
  223. type: '',
  224. pay_type: '',
  225. excel: 0,
  226. },
  227. showtime: false,
  228. },
  229. watch: {
  230. 'where.status': function () {
  231. this.where.excel = 0;
  232. this.getBadge();
  233. layList.reload(this.where, true);
  234. },
  235. 'where.data': function () {
  236. this.where.excel = 0;
  237. this.getBadge();
  238. layList.reload(this.where, true);
  239. },
  240. 'where.type': function () {
  241. this.where.excel = 0;
  242. this.getBadge();
  243. layList.reload(this.where, true);
  244. },
  245. 'where.pay_type': function () {
  246. this.where.excel = 0;
  247. this.getBadge();
  248. layList.reload(this.where, true);
  249. }
  250. },
  251. methods: {
  252. setData: function (item) {
  253. var that = this;
  254. if (item.is_zd == true) {
  255. that.showtime = true;
  256. this.where.data = this.$refs.date_time.innerText;
  257. } else {
  258. this.showtime = false;
  259. this.where.data = item.value;
  260. }
  261. },
  262. getBadge: function () {
  263. var that = this;
  264. layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
  265. that.badge = rem.data;
  266. });
  267. },
  268. search: function () {
  269. this.where.excel = 0;
  270. this.getBadge();
  271. layList.reload(this.where, true);
  272. },
  273. refresh: function () {
  274. layList.reload();
  275. this.getBadge();
  276. },
  277. excel: function () {
  278. this.where.excel = 1;
  279. location.href = layList.U({c: 'order.store_order', a: 'order_list', q: this.where});
  280. this.where.excel = 0;
  281. }
  282. },
  283. mounted: function () {
  284. var that = this;
  285. that.getBadge();
  286. window.formReload = this.search;
  287. layList.laydate.render({
  288. elem: this.$refs.date_time,
  289. trigger: 'click',
  290. eventElem: this.$refs.time,
  291. range: true,
  292. change: function (value) {
  293. that.where.data = value;
  294. }
  295. });
  296. }
  297. })
  298. });
  299. </script>
  300. {/block}