index.php 46 KB

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