index.php 18 KB

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