index.php 13 KB

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