index.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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" id="app1">
  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 if (d.status === 1){ }}
  105. <button type="button" name="status" class="layui-btn layui-btn-xs layui-btn-danger" id="">
  106. 正常
  107. </button>
  108. {{# } else{ }}
  109. <button type="button" name="status" class="layui-btn layui-btn-xs layui-btn-danger" id="">
  110. 扣除
  111. </button>
  112. {{# } }}
  113. </script>
  114. <script type="text/html" id="act">
  115. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='th' id="">
  116. 退回
  117. </button>
  118. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  119. 删除
  120. </button>
  121. </script>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <!--end-->
  127. </div>
  128. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  129. {/block}
  130. {block name="script"}
  131. <script>
  132. //实例化form
  133. layList.form.render();
  134. layList.tableList('List', "{:Url('list')}", function () {
  135. return [
  136. {type: 'checkbox'},
  137. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  138. {field: 'name', title: '场次', templet: '#name', align: 'center'},
  139. {field: 'account', title: '账号', templet: '#account', align: 'center'},
  140. {field: 'nickname', title: '呢称', templet: '#nickname', align: 'center'},
  141. {field: 'anticipate', title: '预约卷', templet: '#price', align: 'center', style : 'color: #DC143C;'},
  142. {field: 'frequency', title: '场次', templet: '#frequency', align: 'center'},
  143. {field: 'status', title: '状态', templet: '#status', align: 'center'},
  144. {field: 'create_time', title: '预约时间', templet: '#date', align: 'center'},
  145. {field: 'right', title: '操作', align: 'center', toolbar: '#act'},
  146. ];
  147. });
  148. //点击事件绑定
  149. layList.tool(function (event,data,obj) {
  150. switch (event) {
  151. case 'delete':
  152. var url=layList.U({c:'auction.auction_booking',a:'delete',q:{id:data.id}});
  153. var code = {title:"操作提示",text:"确定删除?",type:'info',confirm:'是的,删除'};
  154. $eb.$swal('delete',function(){
  155. $eb.axios.get(url).then(function(res){
  156. if(res.status == 200 && res.data.code == 200) {
  157. $eb.$swal('success',res.data.msg);
  158. obj.del();
  159. location.reload();
  160. }else
  161. return Promise.reject(res.data.msg || '删除失败')
  162. }).catch(function(err){
  163. $eb.$swal('error',err);
  164. });
  165. },code)
  166. break;
  167. case 'th':
  168. var url=layList.U({c:'auction.auction_booking',a:'th',q:{id:data.id}});
  169. var code = {title:"操作提示",text:"确定退回预约卷?",type:'info',confirm:'是的,退回'};
  170. $eb.$swal('delete',function(){
  171. $eb.axios.get(url).then(function(res){
  172. if(res.status == 200 && res.data.code == 200) {
  173. $eb.$swal('success',res.data.msg);
  174. obj.del();
  175. location.reload();
  176. }else
  177. return Promise.reject(res.data.msg || '退回失败')
  178. }).catch(function(err){
  179. $eb.$swal('error',err);
  180. });
  181. },code)
  182. break;
  183. break;
  184. case 'edit':
  185. location.href = layList.U({a:'edit',q:{id:data.id}});
  186. break;
  187. }
  188. })
  189. //查询
  190. layList.search('search',function(where){
  191. console.log(111);
  192. layList.reload(where,true);
  193. });
  194. //改状态
  195. layList.switch('is_show',function (odj,value) {
  196. if(odj.elem.checked==true){
  197. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:1,id:value}}),function (res) {
  198. layList.msg(res.msg, function () {
  199. layList.reload();
  200. });
  201. });
  202. }else{
  203. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:0,id:value}}),function (res) {
  204. layList.msg(res.msg, function () {
  205. layList.reload();
  206. });
  207. });
  208. }
  209. });
  210. require(['vue'], function (Vue) {
  211. new Vue({
  212. el: "#app1",
  213. data: {
  214. badge: [],
  215. dataList: [
  216. {name: '全部', value: ''},
  217. {name: '今天', value: 'today'},
  218. {name: '昨天', value: 'yesterday'},
  219. {name: '最近7天', value: 'lately7'},
  220. {name: '最近30天', value: 'lately30'},
  221. {name: '本月', value: 'month'},
  222. {name: '本年', value: 'year'},
  223. ],
  224. where: {
  225. data: '',
  226. status: status,
  227. type: '',
  228. pay_type: '',
  229. excel: 0,
  230. },
  231. showtime: false,
  232. },
  233. watch: {
  234. 'where.status': function () {
  235. this.where.excel = 0;
  236. this.getBadge();
  237. layList.reload(this.where, true);
  238. },
  239. 'where.data': function () {
  240. this.where.excel = 0;
  241. this.getBadge();
  242. layList.reload(this.where, true);
  243. },
  244. 'where.type': function () {
  245. this.where.excel = 0;
  246. this.getBadge();
  247. layList.reload(this.where, true);
  248. },
  249. 'where.pay_type': function () {
  250. this.where.excel = 0;
  251. this.getBadge();
  252. layList.reload(this.where, true);
  253. }
  254. },
  255. methods: {
  256. setData: function (item) {
  257. var that = this;
  258. if (item.is_zd == true) {
  259. that.showtime = true;
  260. this.where.data = this.$refs.date_time.innerText;
  261. } else {
  262. this.showtime = false;
  263. this.where.data = item.value;
  264. }
  265. },
  266. getBadge: function () {
  267. var that = this;
  268. layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
  269. that.badge = rem.data;
  270. });
  271. },
  272. search: function () {
  273. this.where.excel = 0;
  274. this.getBadge();
  275. layList.reload(this.where, true);
  276. },
  277. refresh: function () {
  278. layList.reload();
  279. this.getBadge();
  280. },
  281. excel: function () {
  282. this.where.excel = 1;
  283. location.href = layList.U({c: 'order.store_order', a: 'order_list', q: this.where});
  284. this.where.excel = 0;
  285. }
  286. },
  287. mounted: function () {
  288. var that = this;
  289. that.getBadge();
  290. window.formReload = this.search;
  291. layList.laydate.render({
  292. elem: this.$refs.date_time,
  293. trigger: 'click',
  294. eventElem: this.$refs.time,
  295. range: true,
  296. change: function (value) {
  297. that.where.data = value;
  298. }
  299. });
  300. }
  301. })
  302. });
  303. </script>
  304. {/block}