Няма описание
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.

after_service.htm 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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: 0;">
  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('ShopService/after_service')}" 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="" {if condition="!$Request.param.pay_name"}selected{/if}>全部</option>
  35. <option value="admin_pay" {eq name="$Request.param.pay_name" value="admin_pay"}selected{/eq}>后台支付</option>
  36. <option value="balance" {eq name="$Request.param.pay_name" value="balance"}selected{/eq}>余额支付</option>
  37. {eq name="$shopOpenOffline" value="0"}
  38. <option value="delivery_pay" {eq name="$Request.param.pay_name" value="delivery_pay"}selected{/eq}>货到付款</option>
  39. {/eq}
  40. {eq name="$openWeChat" value="0"}
  41. <option value="wechat" {eq name="$Request.param.pay_name" value="wechat"}selected{/eq}>微信支付</option>
  42. {/eq}
  43. {eq name="$openAliPay" value="0"}
  44. <option value="alipay" {eq name="$Request.param.pay_name" value="alipay"}selected{/eq}>支付宝支付</option>
  45. {/eq}
  46. </select>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="ey-form-item"><label class="users-form-item-label">订单来源:</label>
  53. <div class="users-form-item-content">
  54. <div class="users-select">
  55. <div tabindex="0" class="users-select-selection">
  56. <div class="">
  57. <select name="order_terminal" id="order_terminal">
  58. <option value="0" {if condition="!$Request.param.order_terminal"}selected{/if}>全部</option>
  59. <option value="1" {eq name="$Request.param.order_terminal" value="1"}selected{/eq}>电脑端</option>
  60. <option value="2" {eq name="$Request.param.order_terminal" value="2"}selected{/eq}>手机端</option>
  61. {eq name="$openMall" value="1"}
  62. <option value="3" {eq name="$Request.param.order_terminal" value="3"}selected{/eq}>微信小程序</option>
  63. {/eq}
  64. </select>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="ey-form-item"><label class="users-form-item-label">申请时间:</label>
  71. <div class="users-form-item-content">
  72. <div class="users-select">
  73. <div tabindex="0" class="users-select-selection">
  74. <div class="sDiv2">
  75. <input type="text" name="add_time_begin" id="add_time_begin" autocomplete="off" value="{$Request.param.add_time_begin}" class="qsbox" placeholder="起始日期">
  76. </div>
  77. &nbsp;至&nbsp;
  78. <div class="sDiv2">
  79. <input type="text" name="add_time_end" id="add_time_end" autocomplete="off" value="{$Request.param.add_time_end}" class="qsbox" placeholder="结束日期">
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </form>
  86. <div class="ey-form-item">
  87. <div class="users-form-item-content">
  88. <span class="bt-xin" onclick="OrderQuery();">查询</span>
  89. <span class="bt-xin-no" onclick="OrderQuery('reset');">重置</span>
  90. <div class="fbutton">
  91. <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>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="page" style="min-width:auto;margin-left:100px;">
  102. <div class="flexigrid flexigrid-xin" style=" padding-right: 1px; ">
  103. <div class="tableDiv bubbleInfo">
  104. <table cellspacing="0" cellpadding="0" style="width: 100%;">
  105. <thead>
  106. <tr>
  107. <th align="center" abbr="article_title" axis="col3"> <div class="">商品信息</div> </th>
  108. <th abbr="article_time" axis="col6" class="w200"> <div class="">单价/数量</div> </th>
  109. <th abbr="article_time" axis="col6" class="w240"> <div class="">退还金额</div> </th>
  110. <th abbr="article_time" axis="col6" class="w240"> <div class="">收货人</div> </th>
  111. <th abbr="article_time" axis="col6" class="w160"> <div class="">售后类型</div> </th>
  112. <th abbr="article_time" axis="col6" class="w160"> <div class="">处理状态</div> </th>
  113. <th axis="col1" class="w180"> <div class="">操作</div> </th>
  114. </tr>
  115. </thead>
  116. <tbody>
  117. {empty name="Service"}
  118. <tr>
  119. <td class="no-data" align="center" axis="col0" colspan="50">
  120. <div class="no_row">
  121. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  122. </div>
  123. </td>
  124. </tr>
  125. {else/}
  126. {volist name="Service" id="vo"}
  127. <tr class="order-empty"> <td colspan="8"></td> </tr>
  128. <tr>
  129. <td class="biaotou" colspan="8">
  130. <span class="mr15" style=" display: flex; flex-direction: row; align-items: center; ">
  131. {notempty name="$vo.points_shop_order"}<i class="iconfont e-wodejifen f-18 orange mr5"></i>{/notempty}
  132. <i class="iconfont e-shijian"></i><span class="mr15">{$vo.add_time}</span>
  133. <span class="mr15">订单号:{$vo.order_code} <a class="copy order_code" onclick="OrderCopy('order_code');" data-clipboard-text="{$vo.order_code}">复制</a></span>
  134. <span class="mr15">服务单号:{$vo.refund_code} <a class="copy refund_code" onclick="OrderCopy('refund_code');" data-clipboard-text="{$vo.refund_code}">复制</a></span>
  135. </span>
  136. </td>
  137. </tr>
  138. <tr>
  139. <td>
  140. <div class="goods-detail">
  141. <div class="goods-image">
  142. <a href="{$vo.arcurl}" target="_blank"><img src="{$vo.product_img}"></a>
  143. </div>
  144. <div class="goods-info">
  145. <p class="goods-title"><!-- <span class="shi">实</span> -->{$vo.product_name}</p>
  146. <p class="goods-spec">{$vo.product_spec}</p>
  147. </div>
  148. </div>
  149. </td>
  150. <td class=""><p style="font-weight: 600;">{empty name="$vo.points_shop_order"}¥{/empty}{$vo.product_price} X {$vo.num}</p></td>
  151. <td class="" rowspan="1"><p>{empty name="$vo.points_shop_order"}¥{/empty}{$vo.refund_price}</p></td>
  152. <td class="" rowspan="1"><p>{$vo.consignee}</p><p class="am-link-muted">{$vo.mobile}</p></td>
  153. <td class="" rowspan="1">
  154. <span class="am-badge am-badge-secondary">
  155. {eq name="$vo.service_type" value="1"}<div class="w100 blue">换货</div>{/eq}
  156. {eq name="$vo.service_type" value="2"}<div class="w100 red">退货</div>{/eq}
  157. {eq name="$vo.service_type" value="3"}<div class="w100">维修</div>{/eq}
  158. </span>
  159. </td>
  160. <td class="" rowspan="1">
  161. <p>
  162. {if condition="1 == $vo.status"}
  163. <span class="zt" style="color: #ff9900;">{$ServiceStatus[$vo.status]|default=''}</span>
  164. {elseif condition="in_array($vo.status, [2, 4, 5, 6, 7])"}
  165. <span class="zt" style="color: #19be6b;">{$ServiceStatus[$vo.status]|default=''}</span>
  166. {else}
  167. <span class="zt" style="color: #939799;">{$ServiceStatus[$vo.status]|default=''}</span>
  168. {/if}
  169. </p>
  170. </td>
  171. <td class="" rowspan="1">
  172. <div class="operation">
  173. <a class="bt" href="{:url('ShopService/after_service_details', array('service_id' => $vo['service_id']))}">售后详情</a>
  174. {eq name="$vo.status" value="1"}
  175. <a href="javascript:void(0);" onclick="ManualRefund('{$vo.service_id}', '{$vo.users_id}', '{$vo.order_id}', '{$vo.service_type}');" class="bt"> 手动退款 </a>
  176. <a href="JavaScript:void(0);" onclick="AuditOpinion('{$vo.service_id}', '{$vo.users_id}', '{$vo.order_id}', '{$vo.service_type}', 2);" class="bt"> 通过审核 </a>
  177. <a href="JavaScript:void(0);" onclick="AuditOpinion('{$vo.service_id}', '{$vo.users_id}', '{$vo.order_id}', '{$vo.service_type}', 3);" class="bt"> 驳回申请 </a>
  178. {/eq}
  179. {if $vo.service_type == 1 && in_array($vo.status, [2, 4, 5])}
  180. {eq name="$vo.status" value="4"}
  181. <a href="javascript:void(0);" onclick="ConfirmReceipt('{$vo.service_id}', '{$vo.users_id}', '{$vo.order_id}', 5);" class="bt"> 确认收货 </a>
  182. {/eq}
  183. {eq name="$vo.status" value="5"}
  184. <a href="javascript:void(0);" onclick="ConfirmSend('{$vo.service_id}', '{$vo.users_id}', '{$vo.order_id}', 6);" class="bt"> 确认发货 </a>
  185. {/eq}
  186. <a href="javascript:void(0);" onclick="ManualRefund('{$vo.service_id}', '{$vo.users_id}', '{$vo.order_id}', '{$vo.service_type}');" class="bt"> 手动退款 </a>
  187. <a href="JavaScript:void(0);" onclick="CarryOut('{$vo.service_id}', '{$vo.users_id}', '{$vo.order_id}', '{$vo.status}');" class="bt"> 完成换货 </a>
  188. {/if}
  189. {if $vo.service_type == 2 && in_array($vo.status, [2, 4, 5])}
  190. {eq name="$vo.status" value="4"}
  191. <a href="javascript:void(0);" onclick="ConfirmReceipt('{$vo.service_id}', '{$vo.users_id}', '{$vo.order_id}', 5);" class="bt"> 确认收货 </a>
  192. {/eq}
  193. <a href="javascript:void(0);" onclick="ManualRefund('{$vo.service_id}', '{$vo.users_id}', '{$vo.order_id}', '{$vo.service_type}');" class="bt"> 手动退款 </a>
  194. <a href="JavaScript:void(0);" onclick="Refund('{$vo.service_id}', '{$vo.users_id}', '{$vo.order_id}', '{$vo.status}', '{$vo.refund_price}');" class="bt"> 退款到余额 </a>
  195. {/if}
  196. {eq name="$vo.manual_refund" value="1"}
  197. <a href="JavaScript:void(0);" onclick="BrowseRefundNote('{$vo.refund_note}');" class="bt">手动退款原因</a>
  198. {/eq}
  199. </div>
  200. </td>
  201. </tr>
  202. {/volist}
  203. {/empty}
  204. </tbody>
  205. </table>
  206. </div>
  207. {notempty name="list"}
  208. <div class="tDiv"> <div class="tDiv2"> {include file="public/page" /} </div> <div style="clear:both"></div> </div>
  209. {/notempty}
  210. </div>
  211. </div>
  212. <script type="text/javascript">
  213. $(function() {
  214. $('input[name*=ids]').click(function(){
  215. if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
  216. $('.checkAll').prop('checked','checked');
  217. } else {
  218. $('.checkAll').prop('checked', false);
  219. }
  220. });
  221. $('input[type=checkbox].checkAll').click(function(){
  222. $('input[type=checkbox]').prop('checked',this.checked);
  223. });
  224. });
  225. layui.use('laydate', function(){
  226. var laydate = layui.laydate;
  227. //执行一个laydate实例
  228. laydate.render({
  229. elem: '#add_time_begin' //指定元素
  230. });
  231. laydate.render({
  232. elem: '#add_time_end' //指定元素
  233. });
  234. });
  235. $(document).ready(function() {
  236. // 表格行点击选中切换
  237. $('#flexigrid > table>tbody >tr').click(function(){
  238. $(this).toggleClass('trSelected');
  239. });
  240. // 点击刷新数据
  241. $('.fa-refresh').click(function(){
  242. location.href = location.href;
  243. });
  244. });
  245. // 订单查询
  246. function OrderQuery(isReset) {
  247. if (isReset && 'reset' == isReset) {
  248. window.location.href = "{:url('ShopService/after_service')}";
  249. } else {
  250. $('#postForm').submit();
  251. }
  252. }
  253. // 订单号复制
  254. function OrderCopy(copyClass) {
  255. var clipboard1 = new Clipboard("." + copyClass);
  256. clipboard1.on("success", function(e) {
  257. layer.msg("复制成功");
  258. });
  259. clipboard1.on("error", function(e) {
  260. layer.msg("复制失败!请手动复制", {icon: 5});
  261. });
  262. }
  263. // AJAX调用下载
  264. function OrderExcelExport(obj) {
  265. layer_loading('订单导出中');
  266. $.ajax({
  267. type: 'post',
  268. url : $(obj).attr('data-url'),
  269. data: {
  270. _ajax: 1,
  271. // 导出类型,售后订单固定值6
  272. export_type: 6,
  273. // 搜索条件信息,可为空
  274. pay_name: "{$Request.param.pay_name}",
  275. order_code: "{$Request.param.order_code}",
  276. end_time: "{$Request.param.add_time_end}",
  277. start_time: "{$Request.param.add_time_begin}",
  278. order_terminal: "{$Request.param.order_terminal}",
  279. },
  280. dataType: 'json',
  281. success: function(res) {
  282. layer.closeAll();
  283. if (1 == res.code) {
  284. window.location.href = res.url;
  285. } else {
  286. showErrorAlert(res.msg);
  287. }
  288. },
  289. error: function(e) {
  290. layer.closeAll();
  291. showErrorAlert(e.responseText);
  292. }
  293. });
  294. }
  295. // 确认收货
  296. function ConfirmReceipt(service_id, users_id, order_id, status) {
  297. // 需要二次确认
  298. layer.confirm('确认收到货物?', {
  299. title: false,
  300. closeBtn: 0
  301. }, function() {
  302. PerformOperation(service_id, users_id, order_id, status, 0, 0, 0, '');
  303. }, function(index) {
  304. layer.closeAll(index);
  305. });
  306. }
  307. // 确认发货
  308. function ConfirmSend(service_id, users_id, order_id, status) {
  309. var confirmTitle = '快递公司:<input type="text" id="deliveryName"><br/><br/>';
  310. confirmTitle += '快递单号:<input type="text" id="deliveryCode">';
  311. layer.confirm(confirmTitle, {
  312. title: false,
  313. closeBtn: 0
  314. }, function() {
  315. var deliveryName = $('#deliveryName').val();
  316. var deliveryCode = $('#deliveryCode').val();
  317. var delivery = {name: deliveryName,code: deliveryCode};
  318. PerformOperation(service_id, users_id, order_id, status, 0, 0, 0, '', delivery);
  319. }, function(index) {
  320. layer.closeAll(index);
  321. });
  322. }
  323. // 售后服务手动完成服务单并自行退款
  324. function ManualRefund(service_id, users_id, order_id, service_type) {
  325. layer.prompt({
  326. formType: 2,
  327. shade: layer_shade,
  328. value: '',
  329. title: '提示',
  330. btnAlign:'r',
  331. closeBtn: 3,
  332. id: 'manualRefund',
  333. btn: ['完成并退款', '取消'],
  334. area: ['300px', '100px'],
  335. success: function(layero, index) {
  336. $("#manualRefund").find('textarea').attr('placeholder', '请填写手动完成服务单原因(非必填)');
  337. var msg = '<span style="color: red; font-size: 16px;">是否确认手动完成服务单并自行退款?</span><br/><br/>';
  338. $("#manualRefund").prepend(msg);
  339. $(".layui-layer-content").css('text-align', 'left');
  340. },
  341. yes: function(index, layero) {
  342. var status = 1 == service_type ? 6 : 7;
  343. var value = $("#manualRefund").find("textarea").val();
  344. PerformOperation(service_id, users_id, order_id, status, 0, 0, 1, value);
  345. layer.close(index);
  346. }
  347. });
  348. }
  349. // 查看手动退款原因
  350. function BrowseRefundNote(layer_str) {
  351. layer.confirm(layer_str, {title: false, closeBtn: 0, btn: ['关闭'], area: ['25%', '25%']});
  352. }
  353. // 确认审核意见
  354. function AuditOpinion(service_id, users_id, order_id, service_type, status) {
  355. var type = 1 == service_type ? "<span style='color: blue;'> 换货 </span>" : "<span style='color: red;'> 退货 </span>";
  356. if (2 == status) {
  357. var confirmMsg = '确认通过'+type+'申请?';
  358. var confirmBtn = ['通过审核', '取消'];
  359. } else if (3 == status) {
  360. var confirmMsg = '确认驳回'+type+'申请?';
  361. var confirmBtn = ['驳回申请', '取消'];
  362. } else {
  363. layer.msg('类型错误,刷新重试', {time: 1500}, function() {window.location.reload();});
  364. }
  365. layer.confirm(confirmMsg, {
  366. shade: layer_shade,
  367. area: ['480px', '190px'],
  368. move: false,
  369. title: '提示',
  370. btnAlign:'r',
  371. closeBtn: 3,
  372. btn: confirmBtn,
  373. success: function () {
  374. $(".layui-layer-content").css('text-align', 'left');
  375. },
  376. }, function() {
  377. // 确认执行
  378. PerformOperation(service_id, users_id, order_id, status, 0, 0);
  379. });
  380. }
  381. // 确认完成服务
  382. function CarryOut(service_id, users_id, order_id, status) {
  383. var confirmMsg = '';
  384. if (2 == status) {
  385. confirmMsg = "目前处于<span style='color: blue;'>等待会员发货</span>阶段,";
  386. } else if (4 == status) {
  387. confirmMsg = "目前处于<span style='color: blue;'>等待商家收货</span>阶段,";
  388. } else if (5 == status) {
  389. confirmMsg = "目前处于<span style='color: blue;'>等待商家发货</span>阶段,";
  390. }
  391. layer.confirm(confirmMsg + "确认完成<span style='color: blue;'>换货</span>服务?", {
  392. shade: layer_shade,
  393. area: ['480px', '190px'],
  394. move: false,
  395. title: '提示',
  396. btnAlign:'r',
  397. closeBtn: 3,
  398. btn: ['完成换货', '取消'],
  399. success: function () {
  400. $(".layui-layer-content").css('text-align', 'left');
  401. },
  402. }, function() {
  403. // 确认换货结束
  404. PerformOperation(service_id, users_id, order_id, 6, 0, 0);
  405. });
  406. }
  407. // 确认退款操作
  408. function Refund(service_id, users_id, order_id, status, refund_price) {
  409. var confirmMsg = '';
  410. if (2 == status) {
  411. confirmMsg = "目前处于<span style='color: red;'>等待会员发货</span>阶段,";
  412. } else if (4 == status) {
  413. confirmMsg = "目前处于<span style='color: red;'>等待商家收货</span>阶段,";
  414. } else if (5 == status) {
  415. confirmMsg = "商家已收货,";
  416. }
  417. layer.confirm(confirmMsg + "确认完成<span style='color: red;'>退货</span>服务并<span style='color: red;'>退款到余额</span>?", {
  418. shade: layer_shade,
  419. area: ['480px', '190px'],
  420. move: false,
  421. title: '提示',
  422. btnAlign:'r',
  423. closeBtn: 3,
  424. btn: ['确定', '取消'] ,//按钮
  425. success: function () {
  426. $(".layui-layer-content").css('text-align', 'left');
  427. }
  428. }, function() {
  429. // 确认
  430. PerformOperation(service_id, users_id, order_id, 7, 1, refund_price);
  431. });
  432. }
  433. // 执行审核操作
  434. function PerformOperation(service_id, users_id, order_id, status, is_refund, refund_price, manual_refund, refund_note, delivery) {
  435. layer_loading('正在处理');
  436. $.ajax({
  437. url: "{:url('ShopService/after_service_deal_with')}",
  438. data: {
  439. service_id: service_id,
  440. users_id: users_id,
  441. order_id: order_id,
  442. status: status,
  443. is_refund: is_refund,
  444. refund_price: refund_price,
  445. manual_refund: manual_refund,
  446. refund_note: refund_note,
  447. delivery: delivery,
  448. _ajax: 1
  449. },
  450. type: 'post',
  451. dataType: 'json',
  452. success:function(res) {
  453. layer.closeAll();
  454. if (1 == res.code) {
  455. layer.msg(res.msg, {time: 1500}, function() {
  456. window.location.reload();
  457. });
  458. } else {
  459. layer.msg(res.msg, {time: 1500});
  460. }
  461. }
  462. });
  463. }
  464. </script>
  465. {include file="public/footer" /}