index.php 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  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" v-cloak="">
  40. <button class="layui-btn layui-btn-sm"
  41. :class="{'layui-btn-primary':where.status!==item.value}"
  42. @click="where.status = item.value" type="button"
  43. v-for="item in orderStatus">{{item.name}}
  44. <span v-if="item.count!=undefined"
  45. :class="item.class!=undefined ? 'layui-badge': 'layui-badge layui-bg-gray' ">{{item.count}}</span>
  46. </button>
  47. </div>
  48. </div>
  49. <div class="layui-col-lg12">
  50. <label class="layui-form-label">订单类型:</label>
  51. <div class="layui-input-block" v-cloak="">
  52. <button class="layui-btn layui-btn-sm"
  53. :class="{'layui-btn-primary':where.type!=item.value}"
  54. @click="where.type = item.value" type="button"
  55. v-for="item in orderType">{{item.name}}
  56. <span v-if="item.count!=undefined" class="layui-badge layui-bg-gray">{{item.count}}</span>
  57. </button>
  58. </div>
  59. </div>
  60. <div class="layui-col-lg12">
  61. <label class="layui-form-label">支付方式:</label>
  62. <div class="layui-input-block" v-cloak="">
  63. <button class="layui-btn layui-btn-sm"
  64. :class="{'layui-btn-primary':where.pay_type!=item.value}"
  65. @click="where.pay_type = item.value" type="button"
  66. v-for="item in payType">{{item.name}}
  67. <span v-if="item.count!=undefined" class="layui-badge layui-bg-gray">{{item.count}}</span>
  68. </button>
  69. </div>
  70. </div>
  71. <div class="layui-col-lg12">
  72. <label class="layui-form-label">创建时间:</label>
  73. <div class="layui-input-block" data-type="data" v-cloak="">
  74. <button class="layui-btn layui-btn-sm" type="button" v-for="item in dataList"
  75. @click="setData(item)"
  76. :class="{'layui-btn-primary':where.data!=item.value}">{{item.name}}
  77. </button>
  78. <button class="layui-btn layui-btn-sm" type="button" ref="time"
  79. @click="setData({value:'zd',is_zd:true})"
  80. :class="{'layui-btn-primary':where.data!='zd'}">自定义
  81. </button>
  82. <button type="button" class="layui-btn layui-btn-sm layui-btn-primary"
  83. v-show="showtime==true" ref="date_time">{$year.0} - {$year.1}
  84. </button>
  85. </div>
  86. </div>
  87. <div class="layui-col-lg12">
  88. <label class="layui-form-label">订单号:</label>
  89. <div class="layui-input-block">
  90. <input type="text" name="real_name" style="width: 50%" v-model="where.real_name"
  91. placeholder="请输入姓名、电话、订单编号" class="layui-input">
  92. </div>
  93. </div>
  94. <div class="layui-col-lg12">
  95. <div class="layui-input-block">
  96. <button @click="search" type="button"
  97. class="layui-btn layui-btn-sm layui-btn-normal">
  98. <i class="layui-icon layui-icon-search"></i>搜索
  99. </button>
  100. <button @click="excel" type="button"
  101. class="layui-btn layui-btn-warm layui-btn-sm export" type="button">
  102. <i class="fa fa-floppy-o" style="margin-right: 3px;"></i>导出
  103. </button>
  104. <button @click="refresh" type="reset"
  105. class="layui-btn layui-btn-primary layui-btn-sm">
  106. <i class="layui-icon layui-icon-refresh"></i>刷新
  107. </button>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <!--end-->
  117. <!-- 中间详细信息-->
  118. <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
  119. v-for="item in badge" v-cloak="" v-if="item.count > 0">
  120. <div class="layui-card">
  121. <div class="layui-card-header">
  122. {{item.name}}
  123. <span class="layui-badge layuiadmin-badge" :class="item.background_color">{{item.field}}</span>
  124. </div>
  125. <div class="layui-card-body">
  126. <p class="layuiadmin-big-font">{{item.count}}</p>
  127. <p v-show="item.content!=undefined">
  128. {{item.content}}
  129. <span class="layuiadmin-span-color">{{item.sum}}<i :class="item.class"></i></span>
  130. </p>
  131. </div>
  132. </div>
  133. </div>
  134. <!--enb-->
  135. </div>
  136. <!--列表-->
  137. <div class="layui-row layui-col-space15">
  138. <div class="layui-col-md12">
  139. <div class="layui-card">
  140. <div class="layui-card-header">订单列表</div>
  141. <div class="layui-card-body">
  142. <div class="layui-btn-container" id="container-action">
  143. <button class="layui-btn layui-btn-sm" data-type="del_order">批量删除订单</button>
  144. <button class="layui-btn layui-btn-sm layui-btn-warm" data-type="write_order">订单核销</button>
  145. </div>
  146. <table class="layui-hide" id="List" lay-filter="List"></table>
  147. <!--订单-->
  148. <script type="text/html" id="order_id">
  149. {{d.order_id}}<br/>
  150. {{# if(d.store_name){ }}
  151. {{d.store_name}}<br/>
  152. {{# } }}
  153. <span style="color: {{d.color}};">{{d.pink_name}}</span><br/> 
  154. {{# if(d.is_del == 1){ }}<span style="color: {{d.color}};">用户已删除</span>{{# } }} 
  155. </script>
  156. <!--用户信息-->
  157. <script type="text/html" id="userinfo">
  158. {{d.nickname==null ? '暂无信息':d.nickname}}/{{d.uid}}
  159. </script>
  160. <!--分销员信息-->
  161. <script type="text/html" id="spread_uid">
  162. {{# if(d.spread_uid != 0){ }}
  163. <button class="btn-xs btn-outline" type="button"
  164. onclick="$eb.createModalFrame('推荐人信息','{:Url('order_spread_user')}?uid={{d.spread_uid}}',{w:600,h:400})">
  165. {{d.spread_nickname}}
  166. </button>
  167. {{# }else{ }}无{{# } }}
  168. </script>
  169. <!--支付状态-->
  170. <script type="text/html" id="paid">
  171. {{# if(d.pay_type==1){ }}
  172. <p>{{d.pay_type_name}}</p>
  173. {{# }else{ }}
  174. {{# if(d.pay_type_info!=undefined){ }}
  175. <p><span>线下支付</span></p>
  176. {{# }else{ }}
  177. <p>{{d.pay_type_name}}</p>
  178. {{# } }}
  179. {{# }; }}
  180. </script>
  181. <!--订单状态-->
  182. <script type="text/html" id="status">
  183. {{d.status_name}}
  184. </script>
  185. <!--商品信息-->
  186. <script type="text/html" id="info">
  187. {{# layui.each(d._info, function(index, item){ }}
  188. {{# if(item.cart_info.productInfo.attrInfo!=undefined){ }}
  189. <div>
  190. <span>
  191. <img style="width: 30px;height: 30px;margin:0;cursor: pointer;"
  192. src="{{item.cart_info.productInfo.attrInfo.image}}">
  193. </span>
  194. <span>{{item.cart_info.productInfo.store_name}}&nbsp;{{item.cart_info.productInfo.attrInfo.suk}}</span>
  195. <span> | ¥{{item.cart_info.truePrice}}×{{item.cart_info.cart_num}}</span>
  196. </div>
  197. {{# }else{ }}
  198. <div>
  199. <span><img style="width: 30px;height: 30px;margin:0;cursor: pointer;"
  200. src="{{item.cart_info.productInfo.image}}"></span>
  201. <span>{{item.cart_info.productInfo.store_name}}</span><span> | ¥{{item.cart_info.truePrice}}×{{item.cart_info.cart_num}}</span>
  202. </div>
  203. {{# } }}
  204. {{# }); }}
  205. </script>
  206. <script type="text/html" id="act">
  207. {{# if(d._status==0){ }}
  208. <button class="layui-btn layui-btn-xs" type="button" lay-event="verify">
  209. <i class="fa fa-calendar"></i> 立即核销
  210. </button>
  211. <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span
  212. class="caret"></span></button>
  213. <ul class="layui-nav-child layui-anim layui-anim-upbit">
  214. <li>
  215. <a href="javascript:void(0);" lay-event='order_info'>
  216. <i class="fa fa-file-text"></i> 订单详情
  217. </a>
  218. </li>
  219. <li>
  220. <a href="javascript:void(0);"
  221. onclick="$eb.createModalFrame('修改订单','{:Url('edit')}?id={{d.id}}')">
  222. <i class="fa fa-edit"></i> 修改订单
  223. </a>
  224. </li>
  225. {{# if(d.refund_status ==1){ }}
  226. {{# if(parseFloat(d.pay_price) > parseFloat(d.refund_price)){ }}
  227. <li>
  228. <a href="javascript:void(0);"
  229. onclick="$eb.createModalFrame('退款','{:Url('refund_y')}?id={{d.id}}',{w:400,h:300})">
  230. <i class="fa fa-history"></i>立即退款
  231. </a>
  232. </li>
  233. {{# } ;}}
  234. <li>
  235. <a href="javascript:void(0);"
  236. onclick="$eb.createModalFrame('不退款','{:Url('refund_n')}?id={{d.id}}',{w:400,h:300})">
  237. <i class="fa fa-openid"></i> 不退款
  238. </a>
  239. </li>
  240. {{# } ;}}
  241. <li>
  242. <a lay-event='marke' href="javascript:void(0);">
  243. <i class="fa fa-edit"></i> 订单备注
  244. </a>
  245. </li>
  246. <li>
  247. <a href="javascript:void(0);"
  248. onclick="$eb.createModalFrame('订单记录','{:Url('order_status')}?oid={{d.id}}')">
  249. <i class="fa fa-newspaper-o"></i> 订单记录
  250. </a>
  251. </li>
  252. </ul>
  253. {{# }else if(d._status==1){ }}
  254. {{# if(d.paid == 0 && d.pay_type == 'offline' && d.is_del == 0){ }}
  255. <button class="btn btn-danger btn-xs" type="button" lay-event="order_paid">
  256. <i class="fa fa-calendar"></i> 立即支付
  257. </button>
  258. {{# } ;}}
  259. <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span
  260. class="caret"></span></button>
  261. <ul class="layui-nav-child layui-anim layui-anim-upbit">
  262. <li>
  263. <a href="javascript:void(0);" lay-event='order_info'>
  264. <i class="fa fa-file-text"></i> 订单详情
  265. </a>
  266. </li>
  267. <li>
  268. <a href="javascript:void(0);"
  269. onclick="$eb.createModalFrame('修改订单','{:Url('edit')}?id={{d.id}}')">
  270. <i class="fa fa-edit"></i> 修改订单
  271. </a>
  272. </li>
  273. <li>
  274. <a lay-event='marke' href="javascript:void(0);">
  275. <i class="fa fa-edit"></i> 订单备注
  276. </a>
  277. </li>
  278. <li>
  279. <a href="javascript:void(0);"
  280. onclick="$eb.createModalFrame('订单记录','{:Url('order_status')}?oid={{d.id}}')">
  281. <i class="fa fa-newspaper-o"></i> 订单记录
  282. </a>
  283. </li>
  284. </ul>
  285. {{# }else if(d._status==2){ }}
  286. {{# if(d.shipping_type==1){ }}
  287. <button class="btn btn-primary btn-xs" type="button"
  288. onclick="$eb.createModalFrame('发送货','{:Url('order_goods')}?id={{d.id}}',{w:400,h:250})">
  289. <i class="fa fa-cart-plus"></i> 发送货
  290. </button>
  291. {{# } }}
  292. <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span
  293. class="caret"></span></button>
  294. <ul class="layui-nav-child layui-anim layui-anim-upbit">
  295. <li>
  296. <a href="javascript:void(0);" lay-event='order_print'>
  297. <i class="fa fa-file-text"></i> 打印订单
  298. </a>
  299. </li>
  300. <li>
  301. <a href="javascript:void(0);" lay-event='order_info'>
  302. <i class="fa fa-file-text"></i> 订单详情
  303. </a>
  304. </li>
  305. <li>
  306. <a lay-event='marke' href="javascript:void(0);">
  307. <i class="fa fa-paste"></i> 订单备注
  308. </a>
  309. </li>
  310. {{# if(parseFloat(d.pay_price) > parseFloat(d.refund_price)){ }}
  311. <li>
  312. <a href="javascript:void(0);"
  313. onclick="$eb.createModalFrame('退款','{:Url('refund_y')}?id={{d.id}}',{w:400,h:300})">
  314. <i class="fa fa-history"></i> 立即退款
  315. </a>
  316. </li>
  317. {{# }else if(d.use_integral > 0 && d.use_integral >= d.back_integral){ }}
  318. <li>
  319. <a href="javascript:void(0);"
  320. onclick="$eb.createModalFrame('退积分','{:Url('integral_back')}?id={{d.id}}')">
  321. <i class="fa fa-history"></i> 退积分
  322. </a>
  323. </li>
  324. {{# } ;}}
  325. <li>
  326. <a href="javascript:void(0);"
  327. onclick="$eb.createModalFrame('订单记录','{:Url('order_status')}?oid={{d.id}}')">
  328. <i class="fa fa-newspaper-o"></i> 订单记录
  329. </a>
  330. </li>
  331. </ul>
  332. {{# }else if(d._status==3){ }}
  333. <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span
  334. class="caret"></span></button>
  335. <ul class="layui-nav-child layui-anim layui-anim-upbit">
  336. <li>
  337. <a href="javascript:void(0);" lay-event='order_print'>
  338. <i class="fa fa-file-text"></i> 打印订单
  339. </a>
  340. </li>
  341. <li>
  342. <a href="javascript:void(0);" lay-event='order_info'>
  343. <i class="fa fa-file-text"></i> 订单详情
  344. </a>
  345. </li>
  346. <li>
  347. <a href="javascript:void(0);"
  348. onclick="$eb.createModalFrame('去送货','{:Url('delivery')}?id={{d.id}}',{w:400,h:300})">
  349. <i class="fa fa-motorcycle"></i> 去送货
  350. </a>
  351. </li>
  352. {{# if(parseFloat(d.use_integral) > 0 && parseFloat(d.use_integral) >
  353. parseFloat(d.back_integral)){ }}
  354. <li>
  355. <a lay-event='marke' href="javascript:void(0);">
  356. <i class="fa fa-paste"></i> 订单备注
  357. </a>
  358. </li>
  359. <li>
  360. <a href="javascript:void(0);"
  361. onclick="$eb.createModalFrame('退积分','{:Url('integral_back')}?id={{d.id}}',{w:400,h:300})">
  362. <i class="fa fa-history"></i> 退积分
  363. </a>
  364. </li>
  365. {{# };}}
  366. {{# if(parseFloat(d.pay_price) > parseFloat(d.refund_price)){ }}
  367. <li>
  368. <a href="javascript:void(0);"
  369. onclick="$eb.createModalFrame('退款','{:Url('refund_y')}?id={{d.id}}',{w:400,h:300})">
  370. <i class="fa fa-history"></i>立即退款
  371. </a>
  372. </li>
  373. {{# } ;}}
  374. <li>
  375. <a href="javascript:void(0);"
  376. onclick="$eb.createModalFrame('不退款','{:Url('refund_n')}?id={{d.id}}',{w:400,h:300})">
  377. <i class="fa fa-openid"></i> 不退款
  378. </a>
  379. </li>
  380. <li>
  381. <a href="javascript:void(0);"
  382. onclick="$eb.createModalFrame('订单记录','{:Url('order_status')}?oid={{d.id}}')">
  383. <i class="fa fa-newspaper-o"></i> 订单记录
  384. </a>
  385. </li>
  386. </ul>
  387. {{# }else if(d._status==4){ }}
  388. <button class="btn btn-default btn-xs" type="button"
  389. onclick="$eb.createModalFrame('配送信息','{:Url('distribution')}?id={{d.id}}')">
  390. <i class="fa fa-cart-arrow-down"></i> 配送信息
  391. </button>
  392. <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span
  393. class="caret"></span></button>
  394. <ul class="layui-nav-child layui-anim layui-anim-upbit">
  395. <li>
  396. <a href="javascript:void(0);" lay-event='order_print'>
  397. <i class="fa fa-file-text"></i> 打印订单
  398. </a>
  399. </li>
  400. <li>
  401. <a href="javascript:void(0);" lay-event='order_info'>
  402. <i class="fa fa-file-text"></i> 订单详情
  403. </a>
  404. </li>
  405. <li>
  406. <a lay-event='marke' href="javascript:void(0);">
  407. <i class="fa fa-paste"></i> 订单备注
  408. </a>
  409. </li>
  410. <li>
  411. <a lay-event='danger' href="javascript:void(0);">
  412. <i class="fa fa-cart-arrow-down"></i> 已收货
  413. </a>
  414. </li>
  415. {{# if(parseFloat(d.pay_price) > parseFloat(d.refund_price)){ }}
  416. <li>
  417. <a href="javascript:void(0);"
  418. onclick="$eb.createModalFrame('退款','{:Url('refund_y')}?id={{d.id}}')">
  419. <i class="fa fa-history"></i> 立即退款
  420. </a>
  421. </li>
  422. {{# }else if(parseFloat(d.use_integral) > 0 && parseFloat(d.use_integral) >
  423. parseFloat(d.back_integral)){ }}
  424. <li>
  425. <a href="javascript:void(0);"
  426. onclick="$eb.createModalFrame('退积分','{:Url('integral_back')}?id={{d.id}}')">
  427. <i class="fa fa-history"></i> 退积分
  428. </a>
  429. </li>
  430. {{# } }}
  431. <li>
  432. <a href="javascript:void(0);"
  433. onclick="$eb.createModalFrame('订单记录','{:Url('order_status')}?oid={{d.id}}')">
  434. <i class="fa fa-newspaper-o"></i> 订单记录
  435. </a>
  436. </li>
  437. </ul>
  438. {{# }else if(d._status==5 || d._status==6){ }}
  439. <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span
  440. class="caret"></span></button>
  441. <ul class="layui-nav-child layui-anim layui-anim-upbit">
  442. <li>
  443. <a href="javascript:void(0);" lay-event='order_print'>
  444. <i class="fa fa-file-text"></i> 打印订单
  445. </a>
  446. </li>
  447. <li>
  448. <a href="javascript:void(0);" lay-event='order_info'>
  449. <i class="fa fa-file-text"></i> 订单详情
  450. </a>
  451. </li>
  452. <li>
  453. <a lay-event='marke' href="javascript:void(0);">
  454. <i class="fa fa-paste"></i> 订单备注
  455. </a>
  456. </li>
  457. {{# if(parseFloat(d.pay_price) > parseFloat(d.refund_price)){ }}
  458. <li>
  459. <a href="javascript:void(0);"
  460. onclick="$eb.createModalFrame('退款','{:Url('refund_y')}?id={{d.id}}')">
  461. <i class="fa fa-history"></i> 立即退款
  462. </a>
  463. </li>
  464. {{# };}}
  465. {{# if(parseFloat(d.use_integral) > 0 && parseFloat(d.use_integral) >
  466. parseFloat(d.back_integral)){ }}
  467. <li>
  468. <a href="javascript:void(0);"
  469. onclick="$eb.createModalFrame('退积分','{:Url('integral_back')}?id={{d.id}}')">
  470. <i class="fa fa-history"></i> 退积分
  471. </a>
  472. </li>
  473. {{# } }}
  474. <li>
  475. <a href="javascript:void(0);"
  476. onclick="$eb.createModalFrame('订单记录','{:Url('order_status')}?oid={{d.id}}')">
  477. <i class="fa fa-newspaper-o"></i> 订单记录
  478. </a>
  479. </li>
  480. </ul>
  481. {{# }else if(d._status==7){ }}
  482. <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span
  483. class="caret"></span></button>
  484. <ul class="layui-nav-child layui-anim layui-anim-upbit">
  485. <li>
  486. <a href="javascript:void(0);" lay-event='order_print'>
  487. <i class="fa fa-file-text"></i> 打印订单
  488. </a>
  489. </li>
  490. <li>
  491. <a href="javascript:void(0);" lay-event='order_info'>
  492. <i class="fa fa-file-text"></i> 订单详情
  493. </a>
  494. </li>
  495. <li>
  496. <a lay-event='marke' href="javascript:void(0);">
  497. <i class="fa fa-paste"></i> 订单备注
  498. </a>
  499. </li>
  500. {{# if(parseFloat(d.pay_price) > parseFloat(d.refund_price)){ }}
  501. <li>
  502. <a href="javascript:void(0);"
  503. onclick="$eb.createModalFrame('退款','{:Url('refund_y')}?id={{d.id}}')">
  504. <i class="fa fa-history"></i> 立即退款
  505. </a>
  506. </li>
  507. {{# } }}
  508. {{# if(parseFloat(d.use_integral) > 0 && parseFloat(d.use_integral) >=
  509. parseFloat(d.back_integral)){ }}
  510. <li>
  511. <a href="javascript:void(0);"
  512. onclick="$eb.createModalFrame('退积分','{:Url('integral_back')}?id={{d.id}}')">
  513. <i class="fa fa-history"></i> 退积分
  514. </a>
  515. </li>
  516. {{# } }}
  517. <li>
  518. <a href="javascript:void(0);"
  519. onclick="$eb.createModalFrame('订单记录','{:Url('order_status')}?oid={{d.id}}')">
  520. <i class="fa fa-newspaper-o"></i> 订单记录
  521. </a>
  522. </li>
  523. </ul>
  524. {{# }; }}
  525. </script>
  526. </div>
  527. </div>
  528. </div>
  529. </div>
  530. <!--end-->
  531. </div>
  532. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  533. {/block}
  534. {block name="script"}
  535. <script>
  536. layList.tableList('List', "{:Url('order_list',['real_name'=>$real_name])}", function () {
  537. return [
  538. {type: 'checkbox'},
  539. {field: 'order_id', title: '订单号', sort: true, event: 'order_id', width: '14%', templet: '#order_id'},
  540. {field: 'nickname', title: '用户信息', templet: '#userinfo', width: '10%', align: 'center'},
  541. {field: 'spread_uid', title: '推荐人信息', templet: '#spread_uid', width: '10%', align: 'center'},
  542. {field: 'info', title: '商品信息', templet: "#info", height: 'full-20'},
  543. {field: 'pay_price', title: '实际支付', width: '8%', align: 'center'},
  544. {field: 'paid', title: '支付状态', templet: '#paid', width: '8%', align: 'center'},
  545. {field: 'status', title: '订单状态', templet: '#status', width: '8%', align: 'center'},
  546. {field: 'add_time', title: '下单时间', width: '10%', sort: true, align: 'center'},
  547. {field: 'right', title: '操作', align: 'center', toolbar: '#act', width: '10%'},
  548. ];
  549. });
  550. layList.tool(function (event, data, obj) {
  551. switch (event) {
  552. case 'order_paid':
  553. var url = layList.U({c: 'order.store_order', a: 'offline', p: {id: data.id}});
  554. $eb.$swal('delete', function () {
  555. $eb.axios.get(url).then(function (res) {
  556. if (res.status == 200 && res.data.code == 200) {
  557. $eb.$swal('success', res.data.msg);
  558. } else
  559. return Promise.reject(res.data.msg || '修改失败')
  560. }).catch(function (err) {
  561. $eb.$swal('error', err);
  562. });
  563. }, {'title': '您确定要修改支付状态吗?', 'text': '修改后将无法恢复,请谨慎操作!', 'confirm': '是的,我要修改'})
  564. break;
  565. case 'verify':
  566. var url = layList.U({c: 'order.store_order', a: 'verify', p: {id: data.id}});
  567. $eb.$swal('delete', function () {
  568. $eb.axios.get(url).then(function (res) {
  569. if (res.status == 200 && res.data.code == 200) {
  570. $eb.$swal('success', res.data.msg);
  571. } else
  572. return Promise.reject(res.data.msg || '核销失败')
  573. }).catch(function (err) {
  574. $eb.$swal('error', err);
  575. });
  576. }, {'title': '您确定核销该订单吗?', 'text': '修改后将无法恢复,请谨慎操作!', 'confirm': '是的,我要核销'})
  577. break;
  578. case 'marke':
  579. var url = layList.U({c: 'order.store_order', a: 'remark'}),
  580. id = data.id,
  581. make = data.remark;
  582. $eb.$alert('textarea', {title: '请修改内容', value: make}, function (result) {
  583. if (result) {
  584. $.ajax({
  585. url: url,
  586. data: 'remark=' + result + '&id=' + id,
  587. type: 'post',
  588. dataType: 'json',
  589. success: function (res) {
  590. if (res.code == 200) {
  591. $eb.$swal('success', res.msg);
  592. } else
  593. $eb.$swal('error', res.msg);
  594. }
  595. })
  596. } else {
  597. $eb.$swal('error', '请输入要备注的内容');
  598. }
  599. });
  600. break;
  601. case 'danger':
  602. var url = layList.U({c: 'order.store_order', a: 'take_delivery', p: {id: data.id}});
  603. $eb.$swal('delete', function () {
  604. $eb.axios.get(url).then(function (res) {
  605. if (res.status == 200 && res.data.code == 200) {
  606. $eb.$swal('success', res.data.msg);
  607. } else
  608. return Promise.reject(res.data.msg || '收货失败')
  609. parent.window.frames[parent.$(".page-tabs-content .active").index()].location.reload();
  610. }).catch(function (err) {
  611. $eb.$swal('error', err);
  612. });
  613. }, {'title': '您确定要修改收货状态吗?', 'text': '修改后将无法恢复,请谨慎操作!', 'confirm': '是的,我要修改'})
  614. break;
  615. case 'order_info':
  616. $eb.createModalFrame(data.nickname + '订单详情', layList.U({a: 'order_info', q: {oid: data.id}}));
  617. break;
  618. case 'order_print':
  619. var url = layList.U({c: 'order.store_order', a: 'order_print', p: {id: data.id}});
  620. $eb.$swal('delete', function () {
  621. $eb.axios.get(url).then(function (res) {
  622. if (res.status == 200 && res.data.code == 200) {
  623. $eb.$swal('success', res.data.msg);
  624. } else
  625. return Promise.reject(res.data.msg || '核销失败')
  626. }).catch(function (err) {
  627. $eb.$swal('error', err);
  628. });
  629. }, {'title': '确认打印订单?', 'text': '是否确认打印!', 'confirm': '确定'})
  630. break;
  631. }
  632. })
  633. var action = {
  634. del_order: function () {
  635. var ids = layList.getCheckData().getIds('id');
  636. if (ids.length) {
  637. var url = layList.U({c: 'order.store_order', a: 'del_order'});
  638. $eb.$swal('delete', function () {
  639. $eb.axios.post(url, {ids: ids}).then(function (res) {
  640. if (res.status == 200 && res.data.code == 200) {
  641. $eb.$swal('success', res.data.msg);
  642. } else
  643. return Promise.reject(res.data.msg || '删除失败')
  644. }).catch(function (err) {
  645. $eb.$swal('error', err);
  646. });
  647. }, {'title': '您确定要修删除订单吗?', 'text': '删除后将无法恢复,请谨慎操作!', 'confirm': '是的,我要删除'})
  648. } else {
  649. layList.msg('请选择要删除的订单');
  650. }
  651. },
  652. write_order: function () {
  653. return $eb.createModalFrame('订单核销', layList.U({a: 'write_order'}), {w: 500, h: 400});
  654. },
  655. };
  656. $('#container-action').find('button').each(function () {
  657. $(this).on('click', function () {
  658. var act = $(this).data('type');
  659. action[act] && action[act]();
  660. });
  661. })
  662. //下拉框
  663. $(document).click(function (e) {
  664. $('.layui-nav-child').hide();
  665. })
  666. function dropdown(that) {
  667. var oEvent = arguments.callee.caller.arguments[0] || event;
  668. oEvent.stopPropagation();
  669. var offset = $(that).offset();
  670. var top = offset.top - $(window).scrollTop();
  671. var index = $(that).parents('tr').data('index');
  672. $('.layui-nav-child').each(function (key) {
  673. if (key != index) {
  674. $(this).hide();
  675. }
  676. })
  677. if ($(document).height() < top + $(that).next('ul').height()) {
  678. $(that).next('ul').css({
  679. 'padding': 10,
  680. 'top': -($(that).parents('td').height() / 2 + $(that).height() + $(that).next('ul').height() / 2),
  681. 'min-width': 'inherit',
  682. 'position': 'absolute'
  683. }).toggle();
  684. } else {
  685. $(that).next('ul').css({
  686. 'padding': 10,
  687. 'top': $(that).parents('td').height() / 2 + $(that).height(),
  688. 'min-width': 'inherit',
  689. 'position': 'absolute'
  690. }).toggle();
  691. }
  692. }
  693. var real_name = '<?=$real_name?>';
  694. var orderCount =<?=json_encode($orderCount)?>, payTypeCount =<?=json_encode($payTypeCount)?>,
  695. status =<?=$status ? $status : "''"?>;
  696. require(['vue'], function (Vue) {
  697. new Vue({
  698. el: "#app",
  699. data: {
  700. badge: [],
  701. payType: [
  702. {name: '全部', value: ''},
  703. {name: '微信支付', value: 1, count: payTypeCount.weixin},
  704. {name: '余额支付', value: 2, count: payTypeCount.yue},
  705. {name: '线下支付', value: 3, count: payTypeCount.offline},
  706. ],
  707. orderType: [
  708. {name: '全部', value: ''},
  709. {name: '普通订单', value: 1, count: orderCount.general},
  710. {name: '拼团订单', value: 2, count: orderCount.pink},
  711. {name: '秒杀订单', value: 3, count: orderCount.seckill},
  712. {name: '砍价订单', value: 4, count: orderCount.bargain},
  713. ],
  714. orderStatus: [
  715. {name: '全部', value: ''},
  716. {name: '已卖出', value: 9, count: orderCount.ys},
  717. {name: '未发货', value: 1, count: orderCount.wf, class: true},
  718. {name: '待核销', value: 5, count: orderCount.write_off, class: true},
  719. {name: '未支付', value: 0, count: orderCount.wz},
  720. {name: '待收货', value: 2, count: orderCount.ds},
  721. {name: '待评价', value: 3, count: orderCount.dp},
  722. {name: '交易完成', value: 4, count: orderCount.jy},
  723. {name: '退款中', value: -1, count: orderCount.tk, class: true},
  724. {name: '已退款', value: -2, count: orderCount.yt},
  725. {name: '已删除', value: -4, count: orderCount.del},
  726. ],
  727. dataList: [
  728. {name: '全部', value: ''},
  729. {name: '今天', value: 'today'},
  730. {name: '昨天', value: 'yesterday'},
  731. {name: '最近7天', value: 'lately7'},
  732. {name: '最近30天', value: 'lately30'},
  733. {name: '本月', value: 'month'},
  734. {name: '本年', value: 'year'},
  735. ],
  736. where: {
  737. data: '',
  738. status: status,
  739. type: '',
  740. pay_type: '',
  741. real_name: real_name || '',
  742. excel: 0,
  743. },
  744. showtime: false,
  745. },
  746. watch: {
  747. 'where.status': function () {
  748. this.where.excel = 0;
  749. this.getBadge();
  750. layList.reload(this.where, true);
  751. },
  752. 'where.data': function () {
  753. this.where.excel = 0;
  754. this.getBadge();
  755. layList.reload(this.where, true);
  756. },
  757. 'where.type': function () {
  758. this.where.excel = 0;
  759. this.getBadge();
  760. layList.reload(this.where, true);
  761. },
  762. 'where.pay_type': function () {
  763. this.where.excel = 0;
  764. this.getBadge();
  765. layList.reload(this.where, true);
  766. }
  767. },
  768. methods: {
  769. setData: function (item) {
  770. var that = this;
  771. if (item.is_zd == true) {
  772. that.showtime = true;
  773. this.where.data = this.$refs.date_time.innerText;
  774. } else {
  775. this.showtime = false;
  776. this.where.data = item.value;
  777. }
  778. },
  779. getBadge: function () {
  780. var that = this;
  781. layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
  782. that.badge = rem.data;
  783. });
  784. },
  785. search: function () {
  786. this.where.excel = 0;
  787. this.getBadge();
  788. layList.reload(this.where, true);
  789. },
  790. refresh: function () {
  791. layList.reload();
  792. this.getBadge();
  793. },
  794. excel: function () {
  795. this.where.excel = 1;
  796. location.href = layList.U({c: 'order.store_order', a: 'order_list', q: this.where});
  797. this.where.excel = 0;
  798. }
  799. },
  800. mounted: function () {
  801. var that = this;
  802. that.getBadge();
  803. window.formReload = this.search;
  804. layList.laydate.render({
  805. elem: this.$refs.date_time,
  806. trigger: 'click',
  807. eventElem: this.$refs.time,
  808. range: true,
  809. change: function (value) {
  810. that.where.data = value;
  811. }
  812. });
  813. }
  814. })
  815. });
  816. </script>
  817. {/block}