index.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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: 'store_name', title: '核销门店', width: '8%', align: 'center'},
  190. {field: 'paid', title: '支付状态', templet: '#paid', width: '8%', align: 'center'},
  191. {field: 'status', title: '订单状态', templet: '#status', width: '8%', align: 'center'},
  192. {field: 'add_time', title: '下单时间', width: '10%', sort: true, align: 'center'},
  193. ];
  194. });
  195. layList.tool(function (event, data, obj) {
  196. switch (event) {
  197. case 'order_paid':
  198. var url = layList.U({c: 'order.store_order', a: 'offline', p: {id: data.id}});
  199. $eb.$swal('delete', function () {
  200. $eb.axios.get(url).then(function (res) {
  201. if (res.status == 200 && res.data.code == 200) {
  202. $eb.$swal('success', res.data.msg);
  203. } else
  204. return Promise.reject(res.data.msg || '修改失败')
  205. }).catch(function (err) {
  206. $eb.$swal('error', err);
  207. });
  208. }, {'title': '您确定要修改支付状态吗?', 'text': '修改后将无法恢复,请谨慎操作!', 'confirm': '是的,我要修改'})
  209. break;
  210. case 'marke':
  211. var url = layList.U({c: 'order.store_order', a: 'remark'}),
  212. id = data.id,
  213. make = data.remark;
  214. $eb.$alert('textarea', {title: '请修改内容', value: make}, function (result) {
  215. if (result) {
  216. $.ajax({
  217. url: url,
  218. data: 'remark=' + result + '&id=' + id,
  219. type: 'post',
  220. dataType: 'json',
  221. success: function (res) {
  222. if (res.code == 200) {
  223. $eb.$swal('success', res.msg);
  224. } else
  225. $eb.$swal('error', res.msg);
  226. }
  227. })
  228. } else {
  229. $eb.$swal('error', '请输入要备注的内容');
  230. }
  231. });
  232. break;
  233. case 'danger':
  234. var url = layList.U({c: 'order.store_order', a: 'take_delivery', p: {id: data.id}});
  235. $eb.$swal('delete', function () {
  236. $eb.axios.get(url).then(function (res) {
  237. if (res.status == 200 && res.data.code == 200) {
  238. $eb.$swal('success', res.data.msg);
  239. } else
  240. return Promise.reject(res.data.msg || '收货失败')
  241. }).catch(function (err) {
  242. $eb.$swal('error', err);
  243. });
  244. }, {'title': '您确定要修改收货状态吗?', 'text': '修改后将无法恢复,请谨慎操作!', 'confirm': '是的,我要修改'})
  245. break;
  246. case 'order_info':
  247. $eb.createModalFrame(data.nickname + '订单详情', layList.U({a: 'order_info', q: {oid: data.id}}));
  248. break;
  249. }
  250. })
  251. var action = {
  252. del_order: function () {
  253. var ids = layList.getCheckData().getIds('id');
  254. if (ids.length) {
  255. var url = layList.U({c: 'order.store_order', a: 'del_order'});
  256. $eb.$swal('delete', function () {
  257. $eb.axios.post(url, {ids: ids}).then(function (res) {
  258. if (res.status == 200 && res.data.code == 200) {
  259. $eb.$swal('success', res.data.msg);
  260. } else
  261. return Promise.reject(res.data.msg || '删除失败')
  262. }).catch(function (err) {
  263. $eb.$swal('error', err);
  264. });
  265. }, {'title': '您确定要修删除订单吗?', 'text': '删除后将无法恢复,请谨慎操作!', 'confirm': '是的,我要删除'})
  266. } else {
  267. layList.msg('请选择要删除的订单');
  268. }
  269. },
  270. write_order: function () {
  271. return $eb.createModalFrame('订单核销', layList.U({a: 'write_order'}), {w: 500, h: 400});
  272. },
  273. };
  274. $('#container-action').find('button').each(function () {
  275. $(this).on('click', function () {
  276. var act = $(this).data('type');
  277. action[act] && action[act]();
  278. });
  279. })
  280. //下拉框
  281. $(document).click(function (e) {
  282. $('.layui-nav-child').hide();
  283. })
  284. function dropdown(that) {
  285. var oEvent = arguments.callee.caller.arguments[0] || event;
  286. oEvent.stopPropagation();
  287. var offset = $(that).offset();
  288. var top = offset.top - $(window).scrollTop();
  289. var index = $(that).parents('tr').data('index');
  290. $('.layui-nav-child').each(function (key) {
  291. if (key != index) {
  292. $(this).hide();
  293. }
  294. })
  295. if ($(document).height() < top + $(that).next('ul').height()) {
  296. $(that).next('ul').css({
  297. 'padding': 10,
  298. 'top': -($(that).parents('td').height() / 2 + $(that).height() + $(that).next('ul').height() / 2),
  299. 'min-width': 'inherit',
  300. 'position': 'absolute'
  301. }).toggle();
  302. } else {
  303. $(that).next('ul').css({
  304. 'padding': 10,
  305. 'top': $(that).parents('td').height() / 2 + $(that).height(),
  306. 'min-width': 'inherit',
  307. 'position': 'absolute'
  308. }).toggle();
  309. }
  310. }
  311. var real_name = '<?=$real_name?>';
  312. require(['vue'], function (Vue) {
  313. new Vue({
  314. el: "#app",
  315. data: {
  316. badge: [],
  317. dataList: [
  318. {name: '全部', value: ''},
  319. {name: '今天', value: 'today'},
  320. {name: '昨天', value: 'yesterday'},
  321. {name: '最近7天', value: 'lately7'},
  322. {name: '最近30天', value: 'lately30'},
  323. {name: '本月', value: 'month'},
  324. {name: '本年', value: 'year'},
  325. ],
  326. where: {
  327. data: '',
  328. real_name: real_name || '',
  329. store_id:''
  330. },
  331. showtime: false,
  332. },
  333. watch: {
  334. 'where.data': function () {
  335. this.getBadge();
  336. layList.reload(this.where, true);
  337. },
  338. },
  339. methods: {
  340. setData: function (item) {
  341. var that = this;
  342. if (item.is_zd == true) {
  343. that.showtime = true;
  344. this.where.data = this.$refs.date_time.innerText;
  345. } else {
  346. this.showtime = false;
  347. this.where.data = item.value;
  348. }
  349. },
  350. getBadge: function () {
  351. var that = this;
  352. layList.basePost(layList.Url({c: 'system.SystemVerifyOrder', a: 'getBadge'}), this.where, function (rem) {
  353. that.badge = rem.data;
  354. });
  355. },
  356. search: function () {
  357. this.where.excel = 0;
  358. this.getBadge();
  359. layList.reload(this.where, true);
  360. },
  361. refresh: function () {
  362. layList.reload();
  363. this.getBadge();
  364. },
  365. },
  366. mounted: function () {
  367. var that = this;
  368. that.getBadge();
  369. window.formReload = this.search;
  370. layList.form.render();
  371. layList.laydate.render({
  372. elem: this.$refs.date_time,
  373. trigger: 'click',
  374. eventElem: this.$refs.time,
  375. range: true,
  376. change: function (value) {
  377. that.where.data = value;
  378. }
  379. });
  380. }
  381. })
  382. });
  383. </script>
  384. {/block}