Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  1. {include file="public/layout" /}
  2. <script type="text/javascript" src="__SKIN__/js/clipboard.min.js"></script>
  3. <body class="bodystyle" style="cursor: default; -moz-user-select: inherit;min-width:auto;">
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. {include file="order/left" /}
  7. <div class="page" style="min-width:auto;margin-left:100px;padding-bottom: 0px;">
  8. <div class="flexigrid flexigrid-xin">
  9. <div class="header-bar">
  10. <div class="more">
  11. <div class="search">
  12. <div class="content">
  13. <form id="postForm" action="{:url('Shop/index')}" method="get" onsubmit="layer_loading('正在处理');" style="display: unset;">
  14. {$searchform.hidden|default=''}
  15. <input type="hidden" name="order_status" value="{$Request.param.order_status}">
  16. <div class="ey-form-item"><label class="users-form-item-label">关键词:</label>
  17. <div class="users-form-item-content">
  18. <div class="users-select">
  19. <div tabindex="0" class="users-select-selection">
  20. <!-- 订单号查询 -->
  21. <div class="sDiv2">
  22. <input type="text" size="50" name="order_code" id="order_code" value="{$Request.param.order_code}" class="qsbox" style="width: 170px;" placeholder="订单号或商品名称...">
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="ey-form-item"><label class="users-form-item-label">支付方式:</label>
  29. <div class="users-form-item-content">
  30. <div class="users-select">
  31. <div tabindex="0" class="users-select-selection">
  32. <div class="">
  33. <select name="pay_name" id="pay_name">
  34. <option value="" {empty name="$pay_name"}selected{/empty}>全部</option>
  35. <option value="admin_pay" {eq name="$pay_name" value="admin_pay"}selected{/eq}>后台支付</option>
  36. <option value="balance" {eq name="$pay_name" value="balance"}selected{/eq}>余额支付</option>
  37. {eq name="$shopOpenOffline" value="0"}
  38. <option value="delivery_pay" {eq name="$pay_name" value="delivery_pay"}selected{/eq}>货到付款</option>
  39. {/eq}
  40. {eq name="$openWeChat" value="0"}
  41. <option value="wechat" {eq name="$pay_name" value="wechat"}selected{/eq}>微信支付</option>
  42. {/eq}
  43. {eq name="$openAliPay" value="0"}
  44. <option value="alipay" {eq name="$pay_name" value="alipay"}selected{/eq}>支付宝支付</option>
  45. {/eq}
  46. <option value="noNeedPay" {eq name="$pay_name" value="noNeedPay"}selected{/eq}>无需支付</option>
  47. </select>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="ey-form-item"><label class="users-form-item-label">订单来源:</label>
  54. <div class="users-form-item-content">
  55. <div class="users-select">
  56. <div tabindex="0" class="users-select-selection">
  57. <div class="">
  58. <select name="order_terminal" id="order_terminal">
  59. <option value="0" {empty name="$order_terminal"}selected{/empty}>全部</option>
  60. <option value="1" {eq name="$order_terminal" value="1"}selected{/eq}>电脑端</option>
  61. <option value="2" {eq name="$order_terminal" value="2"}selected{/eq}>手机端</option>
  62. {eq name="$openMall" value="1"}
  63. <option value="3" {eq name="$order_terminal" value="3"}selected{/eq}>微信小程序</option>
  64. {/eq}
  65. </select>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="ey-form-item"><label class="users-form-item-label">商品类型:</label>
  72. <div class="users-form-item-content">
  73. <div class="users-select">
  74. <div tabindex="0" class="users-select-selection">
  75. <div class="">
  76. <select name="contains_virtual" id="contains_virtual">
  77. <option value="0" {empty name="$contains_virtual"}selected{/empty}>全部</option>
  78. {if condition="in_array($shopType, [0, 2])"}
  79. <option value="1" {eq name="$contains_virtual" value="1"}selected{/eq}>实体商品</option>
  80. {/if}
  81. {if condition="in_array($shopType, [1, 2])"}
  82. <option value="2" {eq name="$contains_virtual" value="2"}selected{/eq}>虚拟商品</option>
  83. {/if}
  84. </select>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="ey-form-item"><label class="users-form-item-label">下单时间:</label>
  91. <div class="users-form-item-content">
  92. <div class="users-select">
  93. <div tabindex="0" class="users-select-selection">
  94. <div class="sDiv2">
  95. <input type="text" name="add_time_begin" id="add_time_begin" autocomplete="off" value="{$Request.param.add_time_begin}" class="qsbox" placeholder="起始日期">
  96. </div>
  97. &nbsp;至&nbsp;
  98. <div class="sDiv2">
  99. <input type="text" name="add_time_end" id="add_time_end" autocomplete="off" value="{$Request.param.add_time_end}" class="qsbox" placeholder="结束日期">
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="ey-form-item"><label class="users-form-item-label">活动订单:</label>
  106. <div class="users-form-item-content">
  107. <div class="users-select">
  108. <div tabindex="0" class="users-select-selection">
  109. <div class="">
  110. <select name="act_type">
  111. <option value="0" {if condition="!$Request.param.act_type"}selected{/if}>全部</option>
  112. <option value="1" {eq name="$Request.param.act_type" value="1"} selected {/eq}>普通订单</option>
  113. {notempty name="$seckill"}
  114. <option value="2" {eq name="$Request.param.act_type" value="2"} selected {/eq}>秒杀订单</option>
  115. {/notempty}
  116. {notempty name="$pointsShop"}
  117. <option value="3" {eq name="$Request.param.act_type" value="3"} selected {/eq}>积分订单</option>
  118. {/notempty}
  119. </select>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </form>
  126. <div class="ey-form-item">
  127. <div class="users-form-item-content">
  128. <span class="bt-xin" onclick="OrderQuery();">查询</span>
  129. <span class="bt-xin-no" onclick="OrderQuery('reset');">重置</span>
  130. <div class="fbutton">
  131. <a href="javascript:void(0);" onclick="OrderExcelExport(this);" data-url="{:url('Order/ajax_order_excel_export')}" class="bt-xin-xia"><i class="iconfont e-xiazai"></i>导出</a>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="page" style="min-width:auto;margin-left:100px;">
  142. <div class="flexigrid flexigrid-xin" style=" padding-right: 1px; ">
  143. <div class="tableDiv bubbleInfo">
  144. <table cellspacing="0" cellpadding="0" style="width: 100%;">
  145. <thead>
  146. <tr>
  147. <th> <div class="">商品信息</div> </th>
  148. <th class="w240"> <div class="">单价/数量</div> </th>
  149. <th class="w240"> <div class="">实付款</div> </th>
  150. <th class="w240"> <div class="">收货人</div> </th>
  151. <th class="w160"> <div class="">配送方式</div> </th>
  152. <th class="w160"> <div class="">支付方式</div> </th>
  153. <th class="w160"> <div class="">状态</div> </th>
  154. <th class="w180"> <div class="">操作</div> </th>
  155. </tr>
  156. </thead>
  157. <tbody>
  158. {empty name="list"}
  159. <tr>
  160. <td class="no-data" align="center" axis="col0" colspan="50">
  161. <div class="">
  162. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  163. </div>
  164. </td>
  165. </tr>
  166. {else/}
  167. {volist name="list" id="vo"}
  168. <tr class="order-empty"><td colspan="8"></td></tr>
  169. <tr>
  170. <td class="biaotou" colspan="8">
  171. <span class="mr15" style=" display: flex; flex-direction: row; align-items: center;">
  172. <!-- <i class="iconfont e-pintuan1 f-18 orange mr5"></i> -->
  173. {notempty name="$seckill"}
  174. {notempty name="$vo.is_seckill_order" value="0"}
  175. <i class="iconfont e-miaoshashangpin f-18 orange mr5"></i>
  176. {/notempty}
  177. {/notempty}
  178. {notempty name="$vo.points_shop_order"}<i class="iconfont e-wodejifen f-18 orange mr5"></i>{/notempty}
  179. <i class="iconfont e-shijian"></i>
  180. <span class="mr15">{$vo.add_time}</span>
  181. <span class="mr15">
  182. 订单号:{$vo.order_code} <a class="copy order_code" onclick="OrderCopy();" data-clipboard-text="{$vo.order_code}"><i class="iconfont e-fuzhi f-16"></i></a>
  183. </span>
  184. </span>
  185. </td>
  186. </tr>
  187. <tr>
  188. {volist name="$vo.Details" id="do"}
  189. {eq name="$i" value="1"}
  190. <td>
  191. <div class="goods-detail">
  192. <div class="goods-image">
  193. <a href="{$do.arcurl}" target="_blank"><img src="{$do.litpic}"></a>
  194. </div>
  195. <div class="goods-info">
  196. <p class="goods-title">{eq name="$do.prom_type" value="0"}<span class="shi">实</span>{else/}<span>虚</span>{/eq}{$do.product_name}</p>
  197. <p class="goods-spec">{$do.data}</p>
  198. {if condition="!empty($do.apply_service) && !empty($do.service_id)"}
  199. <p class="after-sale"><span>售后-{$do.status_name}</span><a data-href="{:url('ShopService/after_service_details', array('service_id' => $do['service_id'], 'iframe' => 1))}" onclick="openFullframe(this, '售后详情', '99%', '99%');">售后详情</a></p>
  200. {/if}
  201. </div>
  202. </div>
  203. </td>
  204. <td class=""><p>{empty name="$vo.points_shop_order"}¥{/empty}{$do.product_price} X {$do.num}</p></td>
  205. {/eq}
  206. {/volist}
  207. <td class="" rowspan="{$vo.rowspan}">
  208. <p style="color: #636669; font-weight: 600;">{empty name="$vo.points_shop_order"}¥{/empty}{$vo.order_amount} <span style="font-weight: 400;">(含运费:¥{$vo.shipping_fee})</span></p>
  209. </td>
  210. <td class="" rowspan="{$vo.rowspan}">
  211. {eq name="$vo.prom_type" value="0"}
  212. <p>{$vo.consignee}</p><p class="am-link-muted">{$vo.mobile}</p>
  213. {else/}
  214. <p>{$vo.u_nickname}</p><p class="am-link-muted">{$vo.u_mobile}</p>
  215. {/eq}
  216. </td>
  217. <td class="" rowspan="{$vo.rowspan}">
  218. {if condition="$vo.prom_type == 0"}{eq name="$vo.logistics_type" value="1"}物流配送{else/}到店自提{/eq}{elseif condition="$vo.prom_type == 1"}无需物流{/if}
  219. </td>
  220. <td class="" rowspan="{$vo.rowspan}">
  221. <span class="am-badge am-badge-secondary">{$pay_method_arr[$vo.pay_name]|default='未付款'}</span>
  222. </td>
  223. <td class="" rowspan="{$vo.rowspan}">
  224. <p>
  225. <span class="zt {eq name='$vo.order_status' value='0'}show{else/}none{/eq}" style="color: #ff1f2c">待付款</span>
  226. {eq name="$vo.logistics_type" value="2"}
  227. <span class="zt {eq name='$vo.order_status' value='1'}show{else/}none{/eq}" style="color: #2d8cf0;">待核销</span>
  228. {else /}
  229. <span class="zt {eq name='$vo.order_status' value='1'}show{else/}none{/eq}" style="color: #ff9900">待发货</span>
  230. {/eq}
  231. <span class="zt {eq name='$vo.order_status' value='2'}show{else/}none{/eq}" style="color: #2d8cf0;">已发货</span>
  232. <span class="zt {eq name='$vo.order_status' value='3'}show{else/}none{/eq}" style="color: #19be6b;">已完成</span>
  233. <span class="zt {eq name='$vo.order_status' value='-1'}show{else/}none{/eq}" style="color: #939799;">已关闭</span>
  234. </p>
  235. </td>
  236. <td rowspan="{$vo.rowspan}">
  237. <div class="operation">
  238. {eq name="$vo.order_status" value='0'}
  239. <!-- 订单未付款时出现 -->
  240. <a href="JavaScript:void(0);" onclick="OrderMark('yfk', '{$vo.order_id}', '{$vo.users_id}');" class="bt">确认付款</a>
  241. <a href="JavaScript:void(0);" onclick="PromptChangePrice('{$vo.order_id}', '{$vo.order_amount}');" class="bt">订单改价</a>
  242. <script type="text/javascript">
  243. // 弹出改价输入框
  244. function PromptChangePrice(order_id, order_amount) {
  245. layer.prompt({
  246. formType: 3,
  247. shade: layer_shade,
  248. move: false,
  249. title: '提示',
  250. id: 'BulkSetPrice',
  251. btnAlign:'r',
  252. closeBtn: 3,
  253. btn: ['确定', '关闭'],
  254. success: function(layero, index) {
  255. $("#BulkSetPrice").find('input').attr('placeholder', '请输入应付金额');
  256. $("#BulkSetPrice").find('input').attr('value', order_amount);
  257. $("#BulkSetPrice").find('input').attr('onkeyup', "this.value=this.value.replace(/[^\\d.]/g,'')");
  258. $("#BulkSetPrice").find('input').attr('onpaste', "this.value=this.value.replace(/[^\\d.]/g,'')");
  259. var msg = '<span style="color: red;">改价后让用户重新进入订单列表点击支付</span>';
  260. $("#BulkSetPrice").append(msg);
  261. // 修改订单金额后为保证支付金额准确有效<br/>请让用户刷新订单列表页后重新点击支付
  262. }
  263. }, function(price, index) {
  264. if (0 < price) {
  265. layer.close(index);
  266. OrderChangePrice(order_id, order_amount, price);
  267. } else {
  268. layer.msg('应付金额不允许为0', {time: 1500});
  269. }
  270. });
  271. }
  272. // 提交改价数据并追加一条订单操作记录
  273. function OrderChangePrice(OrderID, OrderAmount, Price) {
  274. if (0 >= Price) layer.msg('应付金额不允许为0', {time: 1500});
  275. layer_loading('正在处理');
  276. $.ajax({
  277. type : 'post',
  278. url : "{:url('Shop/order_change_price')}",
  279. data : {
  280. order_id: OrderID,
  281. order_amount_old: OrderAmount,
  282. order_amount: Price,
  283. _ajax: 1
  284. },
  285. dataType : 'json',
  286. success : function(res) {
  287. layer.closeAll();
  288. if (1 == res.code) {
  289. layer.msg(res.msg, {time: 1500}, function() {
  290. window.location.reload();
  291. });
  292. } else {
  293. layer.alert(res.msg, {title: false, closeBtn: 0}, function() {
  294. window.location.reload();
  295. });
  296. }
  297. }
  298. });
  299. }
  300. </script>
  301. <a href="JavaScript:void(0);" onclick="OrderMark('gbdd', '{$vo.order_id}', '{$vo.users_id}');" class="bt">关闭订单</a>
  302. <!-- END -->
  303. {/eq}
  304. {if condition="1 == $vo.order_status"}
  305. {eq name="$vo.logistics_type" value="2"}
  306. <a href="JavaScript:void(0);" onclick="OrderVerify('{$vo.order_id}','{$vo.users_id}');" class="bt">确认核销</a>
  307. {else /}
  308. <a href="JavaScript:void(0);" data-url="{:url('Shop/order_send', ['order_id'=>$vo.order_id])}" onclick="OrderSend(this);" class="bt">确认发货</a>
  309. {notempty name="$LogData[$vo.order_id]['action_count']"}
  310. <span class="bt">发货提醒<em class="num">{$LogData[$vo.order_id]['action_count']}</em></span>
  311. {/notempty}
  312. {/eq}
  313. <!-- 订单待发货时出现 -->
  314. <a class="bt" href="javascript:void(0);" onclick="OrderMark('sdtk', '{$vo.order_id}');">手动退款</a>
  315. {/if}
  316. {if condition="2 == $vo.order_status"}
  317. <!-- 订单已发货时出现 -->
  318. <a class="bt" href="javascript:void(0);" onclick="OrderMark('sdtk', '{$vo.order_id}');">手动退款</a>
  319. <a href="JavaScript:void(0);" onclick="OrderMark('ysh','{$vo.order_id}','{$vo.users_id}');" class="bt">确认收货</a>
  320. <input type="hidden" id="beizhu-url" value="{:url('Shop/update_note')}">
  321. <a class="bt" href="javascript:void(0);" data-href="{:url('shop/order_remarks', ['order_id'=>$vo.order_id])}" onclick="openFullframe(this, '商家备注', '600px', '55%');" title="订单备注">订单备注</a>
  322. {/if}
  323. {if condition="-1 == $vo.order_status or 3 == $vo.order_status"}
  324. <a class="bt" href="javascript:void(0);" data-href="{:url('shop/order_remarks', ['order_id'=>$vo.order_id])}" onclick="openFullframe(this, '商家备注', '600px', '55%');" title="订单备注">订单备注</a>
  325. <input type="hidden" id="beizhu-url" value="{:url('Shop/update_note')}">
  326. <a class="bt" href="JavaScript:void(0);" onclick="OrderMark('ddsc','{$vo.order_id}','{$vo.users_id}');">订单删除</a>
  327. {/if}
  328. {if condition="-1 == $vo.order_status and 1 == $vo.manual_refund"}
  329. <!-- 订单已发货时出现 -->
  330. <a href="JavaScript:void(0);" onclick="BrowseRefundNote('{$vo.refund_note}');" class="bt">退款备注</a>
  331. {/if}
  332. <a class="bt" href="{:url('Shop/order_details',array('order_id'=>$vo['order_id']))}">订单详情</a>
  333. </div>
  334. </td>
  335. </tr>
  336. {volist name="$vo.Details" id="do"}
  337. {gt name="$i" value="1"}
  338. <tr>
  339. <td>
  340. <div class="goods-detail">
  341. <div class="goods-image">
  342. <a href="{$do.arcurl}" target="_blank"><img src="{$do.litpic}"></a>
  343. </div>
  344. <div class="goods-info">
  345. <p class="goods-title">{eq name="$do.prom_type" value="0"}<span class="shi">实</span>{else/}<span>虚</span>{/eq}{$do.product_name}</p>
  346. <p class="goods-spec">{$do.data}</p>
  347. {if condition="!empty($do.apply_service) && !empty($do.service_id)"}
  348. <p class="after-sale"><span>售后-{$do.status_name}</span><a data-href="{:url('ShopService/after_service_details', array('service_id' => $do['service_id'], 'iframe' => 1))}" onclick="openFullframe(this, '售后详情', '99%', '99%');">售后详情</a></p>
  349. {/if}
  350. </div>
  351. </div>
  352. </td>
  353. <td class=""><p>¥{$do.product_price} X {$do.num}</p></td>
  354. </tr>
  355. {/gt}
  356. {/volist}
  357. {/volist}
  358. {/empty}
  359. </tbody>
  360. </table>
  361. </div>
  362. {notempty name="list"}
  363. <div class="tDiv">
  364. <div class="tDiv2">
  365. <!-- <div class="fbutton checkboxall">
  366. <input type="checkbox" autocomplete="off" class="checkAll">
  367. </div>
  368. <div class="fbutton">
  369. <a onclick="batch_del(this, 'ids');" data-url="{:url('Shop/order_del')}" class="layui-btn layui-btn-primary">
  370. <span>批量删除</span>
  371. </a>
  372. </div> -->
  373. {include file="public/page" /}
  374. </div>
  375. <div style="clear:both"></div>
  376. </div>
  377. {/notempty}
  378. </div>
  379. </div>
  380. <script type="text/javascript">
  381. $(function() {
  382. $('input[name*=ids]').click(function() {
  383. if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
  384. $('.checkAll').prop('checked','checked');
  385. } else {
  386. $('.checkAll').prop('checked', false);
  387. }
  388. });
  389. $('input[type=checkbox].checkAll').click(function(){
  390. $('input[type=checkbox]').prop('checked',this.checked);
  391. });
  392. });
  393. layui.use('laydate', function() {
  394. var laydate = layui.laydate;
  395. //执行一个laydate实例
  396. laydate.render({
  397. elem: '#add_time_begin' //指定元素
  398. });
  399. laydate.render({
  400. elem: '#add_time_end' //指定元素
  401. });
  402. });
  403. $(document).ready(function() {
  404. // 表格行点击选中切换
  405. $('#flexigrid > table>tbody >tr').click(function() {
  406. $(this).toggleClass('trSelected');
  407. });
  408. });
  409. // AJAX调用下载
  410. function OrderExcelExport(obj) {
  411. layer_loading('订单导出中');
  412. $.ajax({
  413. type: 'post',
  414. url : $(obj).attr('data-url'),
  415. data: {
  416. _ajax: 1,
  417. // 导出类型,商城订单固定值1
  418. export_type: 1,
  419. // 搜索条件信息,可为空
  420. pay_name: "{$pay_name}",
  421. order_code: "{$Request.param.order_code}",
  422. end_time: "{$Request.param.add_time_end}",
  423. start_time: "{$Request.param.add_time_begin}",
  424. order_status: "{$Request.param.order_status}",
  425. order_terminal: "{$order_terminal}",
  426. contains_virtual: "{$contains_virtual}",
  427. },
  428. dataType: 'json',
  429. success: function(res) {
  430. layer.closeAll();
  431. if (1 == res.code) {
  432. window.location.href = res.url;
  433. } else {
  434. showErrorAlert(res.msg);
  435. }
  436. },
  437. error: function(e) {
  438. layer.closeAll();
  439. showErrorAlert(e.responseText);
  440. }
  441. });
  442. }
  443. // 订单号复制
  444. function OrderCopy() {
  445. var clipboard1 = new Clipboard(".order_code");
  446. clipboard1.on("success", function(e) {
  447. layer.msg("复制成功");
  448. });
  449. clipboard1.on("error", function(e) {
  450. layer.msg("复制失败!请手动复制", {icon: 5});
  451. });
  452. }
  453. // 订单查询
  454. function OrderQuery(isReset) {
  455. if (isReset && 'reset' == isReset) {
  456. window.location.href = "{:url('Shop/index', ['order_status'=>$Request.param.order_status])}";
  457. } else {
  458. $('#postForm').submit();
  459. }
  460. }
  461. // 订单发货
  462. function OrderSend(obj) {
  463. var url = $(obj).attr('data-url');
  464. // iframe窗
  465. var iframes = layer.open({
  466. type: 2,
  467. title: '订单发货详情',
  468. fixed: true, //不固定
  469. shadeClose: false,
  470. shade: layer_shade,
  471. area: ['694px', '600px'],
  472. content: url
  473. });
  474. // layer.full(iframes);
  475. }
  476. // 订单操作
  477. function OrderMark(status_name, order_id, users_id, admin_note, update_time) {
  478. if('yfk' == status_name) {
  479. var msg = '确认订单已付款?';
  480. } else if ('ysh' == status_name) {
  481. var msg = '确认订单已收货?';
  482. } else if ('gbdd' == status_name) {
  483. var msg = '确认关闭订单?';
  484. } else if ('ddbz' == status_name) {
  485. layer.prompt({
  486. formType: 2,
  487. shade: layer_shade,
  488. value: admin_note,
  489. title: '提示',
  490. closeBtn: 3,
  491. id: 'AdminNote',
  492. area: ['300px', '100px'],
  493. success: function(layero, index) {
  494. if (admin_note) {
  495. var msg = '<br/><span style="color: #999; font-size: 12px;">最后更新:'+update_time+'</span>';
  496. $("#AdminNote").append(msg);
  497. $(".layui-layer-content").css('text-align', 'left');
  498. }
  499. }
  500. }, function(value, index, elem) {
  501. OrderNote(order_id,value);
  502. layer.close(index);
  503. });
  504. return false;
  505. } else if ('sdtk' == status_name) {
  506. layer.prompt({
  507. formType: 2,
  508. shade: layer_shade,
  509. value: '',
  510. title: '提示',
  511. closeBtn: 3,
  512. id: 'manualRefund',
  513. btnAlign:'r',
  514. btn: ['关闭并退款', '取消'],
  515. area: ['300px', '120px'],
  516. success: function(layero, index) {
  517. $("#manualRefund").find('textarea').attr('placeholder', '请填写关闭订单原因(非必填)');
  518. var msg = '<span class="f-16 mb5" style="display: block;">是否关闭订单并自行手动退款</span><span class="red f-12">此操作系统不会自动退款,需手动线下退款</span><br/><br/>';
  519. $("#manualRefund").prepend(msg);
  520. $(".layui-layer-content").css('text-align', 'left');
  521. },
  522. yes: function(index, layero) {
  523. // 手动关闭订单并退款
  524. var value = $("#manualRefund").find("textarea").val();
  525. ManualRefund(order_id, value);
  526. layer.close(index);
  527. }
  528. });
  529. return false;
  530. } else if ('ddsc' == status_name) {
  531. var msg = '确认删除订单?';
  532. }
  533. layer.confirm(msg, {
  534. shade: layer_shade,
  535. title: '提示',
  536. closeBtn: 3,
  537. btnAlign:'r',
  538. btn: ['确定','取消'],
  539. success: function () {
  540. $(".layui-layer-content").css('text-align', 'left');
  541. }
  542. }, function() {
  543. $.ajax({
  544. url: "{:url('Shop/order_mark_status')}",
  545. data: {order_id:order_id,status_name:status_name,users_id:users_id, _ajax:1},
  546. type:'post',
  547. dataType:'json',
  548. success:function(res) {
  549. layer.closeAll();
  550. if (1 == res.code) {
  551. layer.msg(res.msg, {time: 1500},function(){
  552. window.location.reload();
  553. });
  554. } else {
  555. layer.msg(res.msg, {time: 1500});
  556. }
  557. }
  558. });
  559. },function(index) {
  560. layer.closeAll(index);
  561. });
  562. }
  563. // 订单备注
  564. function OrderNote(order_id, admin_note) {
  565. $.ajax({
  566. url: "{:url('Shop/update_note')}",
  567. data: {order_id:order_id,admin_note:admin_note, _ajax:1},
  568. type:'post',
  569. dataType:'json',
  570. success:function(res){
  571. layer.closeAll();
  572. if (1 == res.code) {
  573. layer.msg(res.msg, {time: 1500},function(){
  574. window.location.reload();
  575. });
  576. } else {
  577. layer.msg(res.msg, {time: 1500});
  578. }
  579. }
  580. });
  581. }
  582. // 手动关闭订单并退款
  583. function ManualRefund(order_id, refund_note) {
  584. $.ajax({
  585. url: "{:url('Shop/order_manual_refund')}",
  586. data: {order_id: order_id, refund_note: refund_note, _ajax: 1},
  587. type:'post',
  588. dataType:'json',
  589. success:function(res) {
  590. layer.closeAll();
  591. if (1 == res.code) {
  592. layer.msg(res.msg, {time: 1500}, function() {
  593. window.location.reload();
  594. });
  595. } else {
  596. layer.msg(res.msg, {time: 1500});
  597. }
  598. }
  599. });
  600. }
  601. // 查看手动退款原因
  602. function BrowseRefundNote(layer_str) {
  603. if (!layer_str) layer_str = '未填写备注信息';
  604. layer.confirm(layer_str, {title: '提示', shade: layer_shade, closeBtn: 3, btn: ['关闭'], btnAlign:'r', area: ['25%', '25%'],
  605. success: function () {
  606. $(".layui-layer-content").css('text-align', 'left');
  607. }});
  608. }
  609. function OrderVerify(order_id, users_id) {
  610. // 是否开启核销功能
  611. var openVerify = "{$weappInfo['data']['openVerify']|default=0}";
  612. if (0 === parseInt(openVerify)) {
  613. layer.alert('已关闭核销功能,核销订单将无法操作', {
  614. shade: layer_shade,
  615. area: ['480px', '190px'],
  616. move: false,
  617. title: '提示',
  618. btnAlign:'r',
  619. closeBtn: 3,
  620. success: function () {
  621. $(".layui-layer-content").css('text-align', 'left');
  622. }
  623. });
  624. return false;
  625. }
  626. // 是否开启后台二次核销
  627. var openSecondVerify = "{$weappInfo['data']['openSecondVerify']|default=0}";
  628. layer.confirm('核销后用户的核销凭证将失效,确认核销此单?', {
  629. shade: layer_shade,
  630. title: '提示',
  631. closeBtn: 3,
  632. btnAlign:'r',
  633. btn: ['确定','取消'],
  634. success: function () {
  635. $(".layui-layer-content").css('text-align', 'left');
  636. if (1 === parseInt(openSecondVerify)) {
  637. var html = '<div style="padding: 0 0 10px 20px; color: red;">请输入核销码二次验证:</div><input type="text" id="verify_code" style="margin-left: 20px; margin-bottom: 5px;" placeholder="请输入订单核销码"/></div>';
  638. $(".layui-layer-content").after(html);
  639. }
  640. }
  641. }, function() {
  642. var verify_code = 1 === parseInt(openSecondVerify) ? $("#verify_code").val() : '';
  643. if ('' == verify_code && 1 === parseInt(openSecondVerify)) {
  644. $('#verify_code').focus();
  645. return false;
  646. }
  647. layer_loading('正在处理');
  648. $.ajax({
  649. url: "{:url('Shop/verify')}",
  650. data: {order_id: order_id, verify_code: verify_code, users_id: users_id, _ajax: 1},
  651. type:'post',
  652. dataType:'json',
  653. success:function(res) {
  654. layer.closeAll();
  655. if (1 == res.code) {
  656. layer.msg(res.msg, {time: 1500},function(){
  657. window.location.reload();
  658. });
  659. } else {
  660. layer.msg(res.msg, {time: 1500});
  661. }
  662. }
  663. });
  664. },function(index) {
  665. layer.closeAll(index);
  666. });
  667. }
  668. </script>
  669. {include file="public/footer" /}