index.php 21 KB

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