index.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. <div class="layui-carousel layadmin-carousel layadmin-shortcut" lay-anim="" lay-indicator="inside" lay-arrow="none" style="background:none">
  34. <form class="layui-form layui-form-pane" action="">
  35. <div class="layui-form-item">
  36. <div class="layui-col-lg12">
  37. <label class="layui-form-label" style="top: -5.5px;">搜索用户</label>
  38. <div class="layui-input-inline">
  39. <input type="text" id="name" name="name" class="layui-input" placeholder="输入用户UID,昵称">
  40. </div>
  41. <!-- <label class="layui-form-label" style="top: -5.5px;">搜索会员卡</label>-->
  42. <!-- <div class="layui-input-inline">-->
  43. <!-- <input type="text" id="title" name="title" class="layui-input" placeholder="输入会员卡名称">-->
  44. <!-- </div>-->
  45. <!-- <label class="layui-form-label" style="top: -5.5px;">搜索订单号</label>-->
  46. <!-- <div class="layui-input-inline">-->
  47. <!-- <input type="text" id="order_id" name="order_id" class="layui-input" placeholder="输入订单号">-->
  48. <!-- </div>-->
  49. </div>
  50. <div class="layui-col-lg12" id="app1">
  51. <button @click="excel" type="button"
  52. class="layui-btn layui-btn-warm layui-btn-sm export" type="button">
  53. <i class="fa fa-floppy-o" style="margin-right: 3px;"></i>导出
  54. </button>
  55. </div>
  56. <div class="layui-inline">
  57. <div class="layui-input-inline">
  58. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  59. <i class="layui-icon layui-icon-search"></i>搜索</button>
  60. </div>
  61. </div>
  62. </div>
  63. </form>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <!-- 中间详细信息-->
  69. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  70. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  71. </div>
  72. <!--enb-->
  73. </div>
  74. <!--列表-->
  75. <div class="layui-row layui-col-space15">
  76. <div class="layui-col-md12">
  77. <div class="layui-card">
  78. <div class="layui-card-header">查询记录</div>
  79. <div class="layui-card-body">
  80. <div class="layui-btn-container" id="container-action">
  81. <!-- <a class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}',{h:500,w:500})">添加厚度分类</a>-->
  82. <!-- <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
  83. </div>
  84. <table class="layui-hide" id="List" lay-filter="List"></table>
  85. <script type="text/html" id="image">
  86. <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
  87. </script>
  88. <script type="text/html" id="is_warm">
  89. {{# if(d.is_warm == 0){ }}
  90. 不需要
  91. {{# } else if(d.is_warm > 0) { }}
  92. 需要
  93. {{# } }}
  94. </script>
  95. <script type="text/html" id="is_channel">
  96. {{# if(d.is_channel == 0){ }}
  97. 不需要
  98. {{# } else if(d.is_channel > 0) { }}
  99. 需要
  100. {{# } }}
  101. </script>
  102. <script type="text/html" id="is_ladder">
  103. {{# if(d.is_ladder == 0){ }}
  104. 不需要
  105. {{# } else if(d.is_ladder == 1) { }}
  106. 需要
  107. {{# } }}
  108. </script>
  109. <script type="text/html" id="is_gc">
  110. {{# if(d.is_gc == 0){ }}
  111. 正常
  112. {{# } else if(d.is_gc == 1) { }}
  113. 大公差
  114. {{# } }}
  115. </script>
  116. <script type="text/html" id="act">
  117. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('详情','{:Url('details')}?id={{d.id}}',{h:1100,w:1100})">
  118. 详情
  119. </button>
  120. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='excel' >
  121. 导出
  122. </button>
  123. <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('转为订单','{:Url('create')}?id={{d.id}}',{h:800,w:800})">
  124. 转为订单
  125. </button>
  126. <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
  127. 删除
  128. </button>
  129. </script>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. <!--end-->
  135. </div>
  136. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  137. {/block}
  138. {block name="script"}
  139. <script>
  140. var uid = {$uid};
  141. layList.tableList('List', "{:Url('list')}?uid="+uid, function () {
  142. return [
  143. {type: 'checkbox'},
  144. {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
  145. {field: 'nickname', title: '用户昵称', align: 'center'},
  146. {field: 'long', title: '水箱长', align: 'center'},
  147. {field: 'wide', title: '水箱宽', align: 'center'},
  148. {field: 'high', title: '水箱高', align: 'center'},
  149. {field: 'is_warm', title: '是否保温', align: 'center',templet: '#is_warm'},
  150. {field: 'is_channel', title: '槽钢', align: 'center',templet: '#is_channel'},
  151. {field: 'is_ladder', title: '人梯', align: 'center',templet: '#is_ladder'},
  152. {field: 'is_gc', title: '公差', align: 'center',templet: '#is_gc', width: '8%'},
  153. {field: 'price', title: '总价', align: 'center', width: '8%'},
  154. {field: 'weight', title: '重量', align: 'center', width: '8%'},
  155. {field: 'create_time', title: '查询时间', align: 'center', width: '8%'},
  156. {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
  157. ];
  158. });
  159. //查询
  160. layList.search('search',function(where){
  161. layList.reload(where,true);
  162. });
  163. //点击事件绑定
  164. layList.tool(function (event,data,obj) {
  165. switch (event) {
  166. case 'delete':
  167. var url=layList.U({c:'water.water_query',a:'delete',q:{id:data.id}});
  168. var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
  169. $eb.$swal('delete',function(){
  170. $eb.axios.get(url).then(function(res){
  171. if(res.status == 200 && res.data.code == 200) {
  172. $eb.$swal('success',res.data.msg);
  173. obj.del();
  174. location.reload();
  175. }else
  176. return Promise.reject(res.data.msg || '删除失败')
  177. }).catch(function(err){
  178. $eb.$swal('error',err);
  179. });
  180. },code)
  181. break;
  182. case 'excel':
  183. location.href = layList.U({c: 'water.water_query', a: 'excel', q: {id:data.id}});
  184. break;
  185. case 'open_image':
  186. $eb.openImage(data.image);
  187. break;
  188. case 'edit':
  189. location.href = layList.U({a:'edit',q:{id:data.id}});
  190. break;
  191. }
  192. })
  193. //改状态
  194. layList.switch('status',function (odj,value) {
  195. if(odj.elem.checked==true){
  196. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
  197. layList.msg(res.msg, function () {
  198. layList.reload();
  199. });
  200. });
  201. }else{
  202. layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
  203. layList.msg(res.msg, function () {
  204. layList.reload();
  205. });
  206. });
  207. }
  208. });
  209. require(['vue'], function (Vue) {
  210. new Vue({
  211. el: "#app1",
  212. data: {
  213. badge: [],
  214. where: {
  215. nickname: '',
  216. group: '',
  217. excel: 0,
  218. },
  219. showtime: false,
  220. },
  221. watch: {
  222. 'where.status': function () {
  223. this.where.excel = 0;
  224. this.getBadge();
  225. layList.reload(this.where, true);
  226. },
  227. 'where.data': function () {
  228. this.where.excel = 0;
  229. this.getBadge();
  230. layList.reload(this.where, true);
  231. },
  232. 'where.type': function () {
  233. this.where.excel = 0;
  234. this.getBadge();
  235. layList.reload(this.where, true);
  236. },
  237. 'where.pay_type': function () {
  238. this.where.excel = 0;
  239. this.getBadge();
  240. layList.reload(this.where, true);
  241. }
  242. },
  243. methods: {
  244. setData: function (item) {
  245. var that = this;
  246. if (item.is_zd == true) {
  247. that.showtime = true;
  248. this.where.data = this.$refs.date_time.innerText;
  249. } else {
  250. this.showtime = false;
  251. this.where.data = item.value;
  252. }
  253. },
  254. getBadge: function () {
  255. var that = this;
  256. layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
  257. that.badge = rem.data;
  258. });
  259. },
  260. search: function () {
  261. this.where.excel = 0;
  262. this.getBadge();
  263. layList.reload(this.where, true);
  264. },
  265. refresh: function () {
  266. layList.reload();
  267. this.getBadge();
  268. },
  269. excel: function () {
  270. var name = $('#name').val();
  271. this.where['name'] = name;
  272. this.where.excel = 1;
  273. location.href = layList.U({c: 'water.water_query', a: 'list', q: this.where});
  274. this.where.excel = 0;
  275. }
  276. },
  277. mounted: function () {
  278. var that = this;
  279. that.getBadge();
  280. window.formReload = this.search;
  281. layList.laydate.render({
  282. elem: this.$refs.date_time,
  283. trigger: 'click',
  284. eventElem: this.$refs.time,
  285. range: true,
  286. change: function (value) {
  287. that.where.data = value;
  288. }
  289. });
  290. }
  291. })
  292. });
  293. </script>
  294. {/block}