index.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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"
  34. lay-arrow="none" style="background:none">
  35. <div class="layui-card-body">
  36. <div class="layui-row layui-col-space10 layui-form-item">
  37. <div class="layui-col-lg12">
  38. <label class="layui-form-label">核销日期:</label>
  39. <div class="layui-input-block" data-type="data" v-cloak="">
  40. <button class="layui-btn layui-btn-sm" type="button" v-for="item in dataList"
  41. @click="setData(item)"
  42. :class="{'layui-btn-primary':where.data!=item.value}">{{item.name}}
  43. </button>
  44. <button class="layui-btn layui-btn-sm" type="button" ref="time"
  45. @click="setData({value:'zd',is_zd:true})"
  46. :class="{'layui-btn-primary':where.data!='zd'}">自定义
  47. </button>
  48. <button type="button" class="layui-btn layui-btn-sm layui-btn-primary"
  49. v-show="showtime==true" ref="date_time">{$year.0} - {$year.1}
  50. </button>
  51. </div>
  52. </div>
  53. <div class="layui-col-lg12">
  54. <label class="layui-form-label">筛选条件:</label>
  55. <div class="layui-input-block">
  56. <input type="text" name="real_name" style="width: 25%" v-model="where.real_name"
  57. placeholder="请输入姓名、电话、订单编号" class="layui-input">
  58. </div>
  59. </div>
  60. <div class="layui-col-lg12">
  61. <label class="layui-form-label">选择门店:</label>
  62. <div class="layui-input-block">
  63. <select name="store_id" class="form-control input-sm" style="width: 50%"v-model="where.store_id">
  64. <option value="">--请选择--</option>
  65. {volist name="store_list" id="vo"}
  66. <option value="{$vo.id}">{$vo.name}</option>
  67. {/volist}
  68. </select>
  69. </div>
  70. </div>
  71. <div class="layui-col-lg12">
  72. <div class="layui-input-block">
  73. <button @click="search" type="button"
  74. class="layui-btn layui-btn-sm layui-btn-normal">
  75. <i class="layui-icon layui-icon-search"></i>搜索
  76. </button>
  77. <button @click="refresh" type="reset"
  78. class="layui-btn layui-btn-primary layui-btn-sm">
  79. <i class="layui-icon layui-icon-refresh"></i>刷新
  80. </button>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <!--end-->
  90. <!-- 中间详细信息-->
  91. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  92. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  93. <div class="layui-card">
  94. <div class="layui-card-header">
  95. {{item.name}}
  96. <span class="layui-badge layuiadmin-badge" :class="item.background_color">{{item.field}}</span>
  97. </div>
  98. <div class="layui-card-body">
  99. <p class="layuiadmin-big-font">{{item.count}}</p>
  100. <p v-show="item.content!=undefined">
  101. {{item.content}}
  102. <span class="layuiadmin-span-color">{{item.sum}}<i :class="item.class"></i></span>
  103. </p>
  104. </div>
  105. </div>
  106. </div>
  107. <!--enb-->
  108. </div>
  109. <!--列表-->
  110. <div class="layui-row layui-col-space15">
  111. <div class="layui-col-md12">
  112. <div class="layui-card">
  113. <div class="layui-card-header">订单列表</div>
  114. <div class="layui-card-body">
  115. <table class="layui-hide" id="List" lay-filter="List"></table>
  116. <!--订单-->
  117. <script type="text/html" id="order_id">
  118. {{d.order_id}}<br/>
  119. </script>
  120. <!--用户信息-->
  121. <script type="text/html" id="userinfo">
  122. {{d.nickname==null ? '暂无信息':d.nickname}}/{{d.uid}}
  123. </script>
  124. <!--分销员信息-->
  125. <script type="text/html" id="spread_uid">
  126. {{# if(d.spread_uid != 0){ }}
  127. <button class="btn btn-default btn-xs btn-outline" type="button"
  128. onclick="$eb.createModalFrame('推荐人信息','{:Url('order.StoreOrder/order_spread_user')}?uid={{d.spread_uid}}',{w:600,h:400})">
  129. {{d.spread_nickname}}
  130. </button>
  131. {{# }else{ }}无{{# } }}
  132. </script>
  133. <!--支付状态-->
  134. <script type="text/html" id="paid">
  135. {{# if(d.pay_type==1){ }}
  136. <p>{{d.pay_type_name}}</p>
  137. {{# }else{ }}
  138. {{# if(d.pay_type_info!=undefined){ }}
  139. <p><span>线下支付</span></p>
  140. {{# }else{ }}
  141. <p>{{d.pay_type_name}}</p>
  142. {{# } }}
  143. {{# }; }}
  144. </script>
  145. <!--订单状态-->
  146. <script type="text/html" id="status">
  147. {{d.status_name}}
  148. </script>
  149. <!--商品信息-->
  150. <script type="text/html" id="info">
  151. {{# layui.each(d._info, function(index, item){ }}
  152. {{# if(item.cart_info.productInfo.attrInfo!=undefined){ }}
  153. <div>
  154. <span>
  155. <img style="width: 30px;height: 30px;margin:0;cursor: pointer;"
  156. src="{{item.cart_info.productInfo.attrInfo.image}}">
  157. </span>
  158. <span>{{item.cart_info.productInfo.store_name}}&nbsp;{{item.cart_info.productInfo.attrInfo.suk}}</span>
  159. <span> | ¥{{item.cart_info.truePrice}}×{{item.cart_info.cart_num}}</span>
  160. </div>
  161. {{# }else{ }}
  162. <div>
  163. <span><img style="width: 30px;height: 30px;margin:0;cursor: pointer;"
  164. src="{{item.cart_info.productInfo.image}}"></span>
  165. <span>{{item.cart_info.productInfo.store_name}}</span><span> | ¥{{item.cart_info.truePrice}}×{{item.cart_info.cart_num}}</span>
  166. </div>
  167. {{# } }}
  168. {{# }); }}
  169. </script>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <!--end-->
  175. </div>
  176. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  177. {/block}
  178. {block name="script"}
  179. <script>
  180. layList.tableList('List', "{:Url('order_list',['real_name'=>$real_name])}", function () {
  181. return [
  182. {type: 'checkbox'},
  183. {field: 'order_id', title: '订单号', sort: true, event: 'order_id', width: '14%', templet: '#order_id'},
  184. {field: 'nickname', title: '用户信息', templet: '#userinfo', width: '10%', align: 'center'},
  185. {field: 'spread_uid', title: '推荐人信息', templet: '#spread_uid', width: '10%', align: 'center'},
  186. {field: 'info', title: '商品信息', templet: "#info", height: 'full-20'},
  187. {field: 'pay_price', title: '实际支付', width: '8%', align: 'center'},
  188. {field: 'clerk_name', title: '核销员', width: '8%', align: 'center'},
  189. {field: 'paid', title: '支付状态', templet: '#paid', width: '8%', align: 'center'},
  190. {field: 'status', title: '订单状态', templet: '#status', width: '8%', align: 'center'},
  191. {field: 'add_time', title: '下单时间', width: '10%', sort: true, align: 'center'},
  192. ];
  193. });
  194. layList.tool(function (event, data, obj) {
  195. switch (event) {
  196. case 'order_paid':
  197. var url = layList.U({c: 'order.store_order', a: 'offline', p: {id: data.id}});
  198. $eb.$swal('delete', function () {
  199. $eb.axios.get(url).then(function (res) {
  200. if (res.status == 200 && res.data.code == 200) {
  201. $eb.$swal('success', res.data.msg);
  202. } else
  203. return Promise.reject(res.data.msg || '修改失败')
  204. }).catch(function (err) {
  205. $eb.$swal('error', err);
  206. });
  207. }, {'title': '您确定要修改支付状态吗?', 'text': '修改后将无法恢复,请谨慎操作!', 'confirm': '是的,我要修改'})
  208. break;
  209. case 'marke':
  210. var url = layList.U({c: 'order.store_order', a: 'remark'}),
  211. id = data.id,
  212. make = data.remark;
  213. $eb.$alert('textarea', {title: '请修改内容', value: make}, function (result) {
  214. if (result) {
  215. $.ajax({
  216. url: url,
  217. data: 'remark=' + result + '&id=' + id,
  218. type: 'post',
  219. dataType: 'json',
  220. success: function (res) {
  221. if (res.code == 200) {
  222. $eb.$swal('success', res.msg);
  223. } else
  224. $eb.$swal('error', res.msg);
  225. }
  226. })
  227. } else {
  228. $eb.$swal('error', '请输入要备注的内容');
  229. }
  230. });
  231. break;
  232. case 'danger':
  233. var url = layList.U({c: 'order.store_order', a: 'take_delivery', p: {id: data.id}});
  234. $eb.$swal('delete', function () {
  235. $eb.axios.get(url).then(function (res) {
  236. if (res.status == 200 && res.data.code == 200) {
  237. $eb.$swal('success', res.data.msg);
  238. } else
  239. return Promise.reject(res.data.msg || '收货失败')
  240. }).catch(function (err) {
  241. $eb.$swal('error', err);
  242. });
  243. }, {'title': '您确定要修改收货状态吗?', 'text': '修改后将无法恢复,请谨慎操作!', 'confirm': '是的,我要修改'})
  244. break;
  245. case 'order_info':
  246. $eb.createModalFrame(data.nickname + '订单详情', layList.U({a: 'order_info', q: {oid: data.id}}));
  247. break;
  248. }
  249. })
  250. var action = {
  251. del_order: function () {
  252. var ids = layList.getCheckData().getIds('id');
  253. if (ids.length) {
  254. var url = layList.U({c: 'order.store_order', a: 'del_order'});
  255. $eb.$swal('delete', function () {
  256. $eb.axios.post(url, {ids: ids}).then(function (res) {
  257. if (res.status == 200 && res.data.code == 200) {
  258. $eb.$swal('success', res.data.msg);
  259. } else
  260. return Promise.reject(res.data.msg || '删除失败')
  261. }).catch(function (err) {
  262. $eb.$swal('error', err);
  263. });
  264. }, {'title': '您确定要修删除订单吗?', 'text': '删除后将无法恢复,请谨慎操作!', 'confirm': '是的,我要删除'})
  265. } else {
  266. layList.msg('请选择要删除的订单');
  267. }
  268. },
  269. write_order: function () {
  270. return $eb.createModalFrame('订单核销', layList.U({a: 'write_order'}), {w: 500, h: 400});
  271. },
  272. };
  273. $('#container-action').find('button').each(function () {
  274. $(this).on('click', function () {
  275. var act = $(this).data('type');
  276. action[act] && action[act]();
  277. });
  278. })
  279. //下拉框
  280. $(document).click(function (e) {
  281. $('.layui-nav-child').hide();
  282. })
  283. function dropdown(that) {
  284. var oEvent = arguments.callee.caller.arguments[0] || event;
  285. oEvent.stopPropagation();
  286. var offset = $(that).offset();
  287. var top = offset.top - $(window).scrollTop();
  288. var index = $(that).parents('tr').data('index');
  289. $('.layui-nav-child').each(function (key) {
  290. if (key != index) {
  291. $(this).hide();
  292. }
  293. })
  294. if ($(document).height() < top + $(that).next('ul').height()) {
  295. $(that).next('ul').css({
  296. 'padding': 10,
  297. 'top': -($(that).parents('td').height() / 2 + $(that).height() + $(that).next('ul').height() / 2),
  298. 'min-width': 'inherit',
  299. 'position': 'absolute'
  300. }).toggle();
  301. } else {
  302. $(that).next('ul').css({
  303. 'padding': 10,
  304. 'top': $(that).parents('td').height() / 2 + $(that).height(),
  305. 'min-width': 'inherit',
  306. 'position': 'absolute'
  307. }).toggle();
  308. }
  309. }
  310. var real_name = '<?=$real_name?>';
  311. require(['vue'], function (Vue) {
  312. new Vue({
  313. el: "#app",
  314. data: {
  315. badge: [],
  316. dataList: [
  317. {name: '全部', value: ''},
  318. {name: '今天', value: 'today'},
  319. {name: '昨天', value: 'yesterday'},
  320. {name: '最近7天', value: 'lately7'},
  321. {name: '最近30天', value: 'lately30'},
  322. {name: '本月', value: 'month'},
  323. {name: '本年', value: 'year'},
  324. ],
  325. where: {
  326. data: '',
  327. real_name: real_name || '',
  328. store_id:''
  329. },
  330. showtime: false,
  331. },
  332. watch: {
  333. 'where.data': function () {
  334. this.getBadge();
  335. layList.reload(this.where, true);
  336. },
  337. },
  338. methods: {
  339. setData: function (item) {
  340. var that = this;
  341. if (item.is_zd == true) {
  342. that.showtime = true;
  343. this.where.data = this.$refs.date_time.innerText;
  344. } else {
  345. this.showtime = false;
  346. this.where.data = item.value;
  347. }
  348. },
  349. getBadge: function () {
  350. var that = this;
  351. layList.basePost(layList.Url({c: 'system.SystemVerifyOrder', a: 'getBadge'}), this.where, function (rem) {
  352. that.badge = rem.data;
  353. });
  354. },
  355. search: function () {
  356. this.where.excel = 0;
  357. this.getBadge();
  358. layList.reload(this.where, true);
  359. },
  360. refresh: function () {
  361. layList.reload();
  362. this.getBadge();
  363. },
  364. },
  365. mounted: function () {
  366. var that = this;
  367. that.getBadge();
  368. window.formReload = this.search;
  369. layList.form.render();
  370. layList.laydate.render({
  371. elem: this.$refs.date_time,
  372. trigger: 'click',
  373. eventElem: this.$refs.time,
  374. range: true,
  375. change: function (value) {
  376. that.where.data = value;
  377. }
  378. });
  379. }
  380. })
  381. });
  382. </script>
  383. {/block}