index.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  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-inline">
  49. <input id="store_name" type="text" name="store_name" class="layui-input" placeholder="订单号,账号,昵称,编号">
  50. </div>
  51. </div>
  52. <div class="layui-inline">
  53. <label class="layui-form-label" style="top: -4.5px">商品名称</label>
  54. <div class="layui-input-inline">
  55. <input type="text" id="product_name" name="product_name" class="layui-input" placeholder="商品名称">
  56. </div>
  57. </div>
  58. <div class="layui-inline">
  59. <label class="layui-form-label" style="top: -4.5px">所有场次</label>
  60. <div class="layui-input-block">
  61. <select id="auction_id" name="auction_id">
  62. <option value=" ">全部</option>
  63. {volist name='auction' id='vo'}
  64. <option value="{$vo.id}">{$vo.nickname}</option>
  65. {/volist}
  66. </select>
  67. </div>
  68. </div>
  69. <div class="layui-inline">
  70. <label class="layui-form-label" style="top: -4.5px">所有场馆</label>
  71. <div class="layui-input-block">
  72. <select id="gu_id" name="gu_id">
  73. <option value=" ">全部</option>
  74. {volist name='gu' id='vo'}
  75. <option value="{$vo.id}">{$vo.name}</option>
  76. {/volist}
  77. </select>
  78. </div>
  79. </div>
  80. <div class="layui-col-lg12" id="app1">
  81. <div class="layui-col-lg12">
  82. <label class="layui-form-label">创建状态:</label>
  83. <div class="layui-input-block" v-cloak="">
  84. <button class="layui-btn layui-btn-sm" type="button" v-for="item in statusList"
  85. @click="where.status = item.value"
  86. :class="{'layui-btn-primary':where.status!==item.value}">{{item.name}}
  87. </button>
  88. </div>
  89. </div>
  90. <div class="layui-col-lg12">
  91. <label class="layui-form-label">创建时间:</label>
  92. <div class="layui-input-block" data-type="data" v-cloak="">
  93. <button class="layui-btn layui-btn-sm" type="button" v-for="item in dataList"
  94. @click="setData(item)"
  95. :class="{'layui-btn-primary':where.data!=item.value}">{{item.name}}
  96. </button>
  97. <button class="layui-btn layui-btn-sm" type="button" ref="time"
  98. @click="setData({value:'zd',is_zd:true})"
  99. :class="{'layui-btn-primary':where.data!='zd'}">自定义
  100. </button>
  101. <button type="button" class="layui-btn layui-btn-sm layui-btn-primary"
  102. v-show="showtime==true" ref="date_time">{$year.0} - {$year.1}
  103. </button>
  104. </div>
  105. </div>
  106. <button @click="excel" type="button"
  107. class="layui-btn layui-btn-warm layui-btn-sm export" type="button">
  108. <i class="fa fa-floppy-o" style="margin-right: 3px;"></i>导出
  109. </button>
  110. </div>
  111. <div class="layui-inline" style="top: -5px">
  112. <div class="layui-input-inline">
  113. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search" >
  114. <i class="layui-icon layui-icon-search"></i>搜索
  115. </button>
  116. </div>
  117. </div>
  118. </div>
  119. </form>
  120. </div>
  121. </div>
  122. </div>
  123. <!-- 中间详细信息-->
  124. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  125. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  126. </div>
  127. <!--enb-->
  128. </div>
  129. <!--列表-->
  130. <div class="layui-row layui-col-space15">
  131. <div class="layui-col-md12">
  132. <div class="layui-card">
  133. <div class="layui-card-header">订单列表</div>
  134. <div class="layui-card-body">
  135. <!-- <div class="layui-btn-container" id="container-action">-->
  136. <!-- <a class="layui-btn layui-btn-sm" href="{:Url('create')}">添加商品</a>-->
  137. <!-- <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
  138. <!-- </div>-->
  139. <table class="layui-hide" id="List" lay-filter="List"></table>
  140. <script type="text/html" id="image" >
  141. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}" style="cursor: pointer">
  142. </script>
  143. <script type="text/html" id="au_name" >
  144. <div>{{d.gu_name}}</div>
  145. <div>{{d.au_name}}</div>
  146. </script>
  147. <script type="text/html" id="status">
  148. {{# if(d.status < 1){ }}
  149. <button type="button" name="status" class="layui-btn-disabled layui-btn-xs" id="">
  150. 过期
  151. </button>
  152. {{# } else if(d.status == 1) { }}
  153. <button type="button" name="status" class="layui-btn-xs layui-btn-disabled" id="">
  154. 待上传
  155. </button>
  156. {{# } else if(d.status == 2) { }}
  157. <button type="button" name="status" class="layui-btn layui-btn-xs layui-btn-danger" id="">
  158. 待审核
  159. </button>
  160. {{# } else if(d.status == 3) { }}
  161. <button type="button" name="status" class="layui-btn layui-btn-xs layui-btn-danger" id="">
  162. 完成
  163. </button>
  164. {{# } }}
  165. </script>
  166. <script type="text/html" id="upload_image">
  167. {{# if(d.upload_image === ''){ }}
  168. <button type="button" name="status" class="layui-btn-disabled layui-btn-xs" id="">
  169. 未上传打款凭证
  170. </button>
  171. {{# } else { }}
  172. <img style="cursor: pointer" lay-event="open_upload_image" src="{{d.upload_image}}" style="cursor: pointer">
  173. {{# } }}
  174. </script>
  175. <script type="text/html" id="appeal">
  176. {{# if(d.appeal < 1){ }}
  177. <button type="button" name="status" class="layui-btn layui-btn-xs" id="">
  178. 未申诉
  179. </button>
  180. {{# } else { }}
  181. <button type="button" name="status" class="layui-btn layui-btn-xs" id=""style="background: red;">
  182. 申诉中
  183. </button>
  184. {{# } }}
  185. </script>
  186. <script type="text/html" id="act">
  187. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='qd' id="">
  188. 通过
  189. </button>
  190. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  191. 删除
  192. </button>
  193. </script>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. <!--end-->
  199. </div>
  200. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  201. {/block}
  202. {block name="script"}
  203. <script>
  204. //实例化form
  205. layList.form.render();
  206. layList.tableList('List', "{:Url('list')}", function () {
  207. return [
  208. {type: 'checkbox'},
  209. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  210. {field: 'image', title: '图片', templet: '#image', align: 'center', width: '5%'},
  211. {field: 'order_id', title: '订单号', templet: '#order_id', align: 'center'},
  212. {field: 'au_name', title: '场次', templet: '#au_name', align: 'center'},
  213. {field: 'account', title: '购买用户账号', templet: '#account', align: 'center'},
  214. {field: 'nickname', title: '购买用户呢称', templet: '#nickname', align: 'center'},
  215. {field: 'us_account', title: '卖家账号', templet: '#us_account', align: 'us_account'},
  216. {field: 'name', title: '商品', templet: '#name', align: 'center'},
  217. {field: 'price', title: '购买价格', templet: '#price', align: 'center', style : 'color: #DC143C;'},
  218. {field: 'upload_image', title: '打款凭证', templet: '#upload_image', align: 'center',width: '5%'},
  219. {field: 'status', title: '状态', templet: '#status', align: 'center'},
  220. {field: 'appeal', title: '申诉状态', templet: '#appeal', align: 'center'},
  221. {field: 'create_time', title: '预约时间', templet: '#date', align: 'center'},
  222. {field: 'right', title: '操作', align: 'center', toolbar: '#act'},
  223. ];
  224. });
  225. //点击事件绑定
  226. layList.tool(function (event,data,obj) {
  227. switch (event) {
  228. case 'delete':
  229. var url=layList.U({c:'auction.auction_order',a:'delete',q:{id:data.id}});
  230. var code = {title:"操作提示",text:"确定删除?",type:'info',confirm:'是的,删除'};
  231. $eb.$swal('delete',function(){
  232. $eb.axios.get(url).then(function(res){
  233. if(res.status == 200 && res.data.code == 200) {
  234. $eb.$swal('success',res.data.msg);
  235. obj.del();
  236. location.reload();
  237. }else
  238. return Promise.reject(res.data.msg || '删除失败')
  239. }).catch(function(err){
  240. $eb.$swal('error',err);
  241. });
  242. },code)
  243. break;
  244. case 'qd':
  245. var url=layList.U({c:'auction.auction_order',a:'qd',q:{id:data.id}});
  246. var code = {title:"操作提示",text:"确定通过订单吗?",type:'info',confirm:'是的,确定'};
  247. $eb.$swal('delete',function(){
  248. $eb.axios.get(url).then(function(res){
  249. if(res.status == 200 && res.data.code == 200) {
  250. $eb.$swal('success',res.data.msg);
  251. obj.del();
  252. location.reload();
  253. }else
  254. return Promise.reject(res.data.msg || '失败')
  255. }).catch(function(err){
  256. $eb.$swal('error',err);
  257. });
  258. },code)
  259. break;
  260. case 'open_image':
  261. $eb.openImage(data.image);
  262. break;
  263. case 'open_upload_image':
  264. $eb.openImage(data.upload_image);
  265. break;
  266. case 'edit':
  267. location.href = layList.U({a:'edit',q:{id:data.id}});
  268. break;
  269. }
  270. })
  271. //查询
  272. layList.search('search',function(where){
  273. layList.reload(where,true);
  274. });
  275. //改状态
  276. layList.switch('is_show',function (odj,value) {
  277. if(odj.elem.checked==true){
  278. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:1,id:value}}),function (res) {
  279. layList.msg(res.msg, function () {
  280. layList.reload();
  281. });
  282. });
  283. }else{
  284. layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:0,id:value}}),function (res) {
  285. layList.msg(res.msg, function () {
  286. layList.reload();
  287. });
  288. });
  289. }
  290. });
  291. require(['vue'], function (Vue) {
  292. new Vue({
  293. el: "#app1",
  294. data: {
  295. badge: [],
  296. dataList: [
  297. {name: '全部', value: ''},
  298. {name: '今天', value: 'today'},
  299. {name: '昨天', value: 'yesterday'},
  300. {name: '最近7天', value: 'lately7'},
  301. {name: '最近30天', value: 'lately30'},
  302. {name: '本月', value: 'month'},
  303. {name: '本年', value: 'year'},
  304. ],
  305. statusList:[
  306. {name: '全部', value: ''},
  307. {name: '过期', value: '0'},
  308. {name: '待上传', value: '1'},
  309. {name: '待审核', value: '2'},
  310. {name: '完成', value: '3'}
  311. ],
  312. where: {
  313. data: '',
  314. status: status,
  315. type: '',
  316. pay_type: '',
  317. excel: 0,
  318. },
  319. showtime: false,
  320. },
  321. watch: {
  322. 'where.status': function () {
  323. this.where.excel = 0;
  324. this.getBadge();
  325. layList.reload(this.where, true);
  326. },
  327. 'where.data': function () {
  328. this.where.excel = 0;
  329. this.getBadge();
  330. layList.reload(this.where, true);
  331. },
  332. 'where.type': function () {
  333. this.where.excel = 0;
  334. this.getBadge();
  335. layList.reload(this.where, true);
  336. },
  337. 'where.pay_type': function () {
  338. this.where.excel = 0;
  339. this.getBadge();
  340. layList.reload(this.where, true);
  341. }
  342. },
  343. methods: {
  344. setData: function (item) {
  345. var that = this;
  346. if (item.is_zd == true) {
  347. that.showtime = true;
  348. this.where.data = this.$refs.date_time.innerText;
  349. } else {
  350. this.showtime = false;
  351. this.where.data = item.value;
  352. }
  353. },
  354. getBadge: function () {
  355. var that = this;
  356. layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
  357. that.badge = rem.data;
  358. });
  359. },
  360. search: function () {
  361. this.where.excel = 0;
  362. this.getBadge();
  363. layList.reload(this.where, true);
  364. },
  365. refresh: function () {
  366. layList.reload();
  367. this.getBadge();
  368. },
  369. excel: function () {
  370. var store_name = $('#store_name').val();
  371. var product_name = $('#product_name').val();
  372. var auction_id = $('#auction_id').val();
  373. var gu_id = $('#gu_id').val();
  374. this.where['store_name'] = store_name;
  375. this.where['product_name'] = product_name;
  376. this.where['auction_id'] = auction_id;
  377. this.where['gu_id'] = gu_id;
  378. this.where.excel = 1;
  379. location.href = layList.U({c: 'Auction.auction_order', a: 'list', q: this.where});
  380. this.where.excel = 0;
  381. }
  382. },
  383. mounted: function () {
  384. var that = this;
  385. that.getBadge();
  386. window.formReload = this.search;
  387. layList.laydate.render({
  388. elem: this.$refs.date_time,
  389. trigger: 'click',
  390. eventElem: this.$refs.time,
  391. range: true,
  392. change: function (value) {
  393. that.where.data = value;
  394. }
  395. });
  396. }
  397. })
  398. });
  399. </script>
  400. {/block}