index.php 17 KB

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