index.php 13 KB

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