detail.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <div class="row-content am-cf">
  2. <div class="row">
  3. <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
  4. <div class="widget am-cf">
  5. <div class="widget__order-detail widget-body am-margin-bottom-lg">
  6. <div class="widget-head am-cf">
  7. <div class="widget-title am-fl">售后单信息</div>
  8. </div>
  9. <div class="am-scrollable-horizontal">
  10. <table class="regional-table am-table am-table-bordered am-table-centered
  11. am-text-nowrap am-margin-bottom-xs">
  12. <tbody>
  13. <tr>
  14. <th>订单号</th>
  15. <th>买家</th>
  16. <th>售后类型</th>
  17. <th>处理状态</th>
  18. <th>操作</th>
  19. </tr>
  20. <tr>
  21. <td><?= $order['order_no'] ?></td>
  22. <td>
  23. <p><?= $order['user']['nickName'] ?></p>
  24. <p class="am-link-muted">(用户id:<?= $order['user']['user_id'] ?>)</p>
  25. </td>
  26. <td class="">
  27. <span class="am-badge am-badge-secondary"> <?= $detail['type']['text'] ?> </span>
  28. </td>
  29. <td>
  30. <?php if ($detail['status']['value'] == 0): ?>
  31. <!-- 审核状态-->
  32. <p>
  33. <span>商家审核:</span>
  34. <?php if ($detail['is_agree']['value'] == 0): ?>
  35. <span class="am-badge"> <?= $detail['is_agree']['text'] ?> </span>
  36. <?php elseif ($detail['is_agree']['value'] == 10): ?>
  37. <span class="am-badge am-badge-success"> <?= $detail['is_agree']['text'] ?> </span>
  38. <?php elseif ($detail['is_agree']['value'] == 20): ?>
  39. <span class="am-badge am-badge-warning"> <?= $detail['is_agree']['text'] ?> </span>
  40. <?php endif; ?>
  41. </p>
  42. <!-- 发货状态-->
  43. <?php if ($detail['type']['value'] == 10 && $detail['is_agree']['value'] == 10): ?>
  44. <p>
  45. <span>用户发货:</span>
  46. <?php if ($detail['is_user_send'] == 0): ?>
  47. <span class="am-badge"> 待发货 </span>
  48. <?php else: ?>
  49. <span class="am-badge am-badge-success"> 已发货 </span>
  50. <?php endif; ?>
  51. </p>
  52. <?php endif; ?>
  53. <!-- 商家收货状态-->
  54. <?php if (
  55. $detail['type']['value'] == 10
  56. && $detail['is_agree']['value'] == 10
  57. && $detail['is_user_send'] == 1
  58. && $detail['is_receipt'] == 0
  59. ): ?>
  60. <p><span>商家收货:</span> <span class="am-badge">待收货</span></p>
  61. <?php endif; ?>
  62. <?php elseif ($detail['status']['value'] == 20): ?>
  63. <span class="am-badge am-badge-success"> <?= $detail['status']['text'] ?> </span>
  64. <?php elseif ($detail['status']['value'] == 10 || $detail['status']['value'] == 30): ?>
  65. <span class="am-badge am-badge-warning"> <?= $detail['status']['text'] ?> </span>
  66. <?php endif; ?>
  67. </td>
  68. <td>
  69. <?php if (checkPrivilege('order/detail')): ?>
  70. <a class="x-f-13" target="_blank"
  71. href="<?= url('order/detail', ['order_id' => $detail['order_id']]) ?>">订单详情</a>
  72. <?php endif; ?>
  73. </td>
  74. </tr>
  75. </tbody>
  76. </table>
  77. </div>
  78. <div class="widget-head am-cf">
  79. <div class="widget-title am-fl">售后商品信息</div>
  80. </div>
  81. <div class="am-scrollable-horizontal">
  82. <table class="regional-table am-table am-table-bordered am-table-centered
  83. am-text-nowrap am-margin-bottom-xs">
  84. <tbody>
  85. <tr>
  86. <th width="25%">商品名称</th>
  87. <th>商品编码</th>
  88. <th>重量(Kg)</th>
  89. <th>单价</th>
  90. <th>购买数量</th>
  91. <th>付款价</th>
  92. </tr>
  93. <tr>
  94. <td class="goods-detail am-text-middle">
  95. <div class="goods-image">
  96. <img src="<?= $detail['order_goods']['image']['file_path'] ?>" alt="">
  97. </div>
  98. <div class="goods-info">
  99. <p class="goods-title"><?= $detail['order_goods']['goods_name'] ?></p>
  100. <p class="goods-spec am-link-muted">
  101. <?= $detail['order_goods']['goods_attr'] ?>
  102. </p>
  103. </div>
  104. </td>
  105. <td><?= $detail['order_goods']['goods_no'] ?: '--' ?></td>
  106. <td><?= $detail['order_goods']['goods_weight'] ?: '--' ?></td>
  107. <td>¥<?= $detail['order_goods']['goods_price'] ?></td>
  108. <td>×<?= $detail['order_goods']['total_num'] ?></td>
  109. <td><span class="x-color-red">¥<?= $detail['order_goods']['total_pay_price'] ?></span>
  110. </td>
  111. </tr>
  112. </tbody>
  113. </table>
  114. </div>
  115. <div class="widget-head am-cf">
  116. <div class="widget-title am-fl">用户申请原因</div>
  117. </div>
  118. <div class="apply_desc am-padding-left">
  119. <div class="content x-f-13">
  120. <span><?= $detail['apply_desc'] ?></span>
  121. </div>
  122. <div class="images">
  123. <div class="uploader-list am-cf">
  124. <?php if (!empty($detail['image'])): foreach ($detail['image'] as $image): ?>
  125. <div class="file-item x-mt-10">
  126. <a href="<?= $image['file_path'] ?>"
  127. title="点击查看大图" target="_blank">
  128. <img src="<?= $image['file_path'] ?>">
  129. </a>
  130. </div>
  131. <?php endforeach; endif; ?>
  132. </div>
  133. </div>
  134. </div>
  135. <!-- 商家审核 -->
  136. <?php if (checkPrivilege('order.refund/audit')): ?>
  137. <?php if ($detail['is_agree']['value'] == 0): ?>
  138. <div class="widget-head am-cf">
  139. <div class="widget-title am-fl">商家审核</div>
  140. </div>
  141. <!-- 去审核 -->
  142. <form id="audit" class="my-form am-form tpl-form-line-form" method="post"
  143. action="<?= url('order.refund/audit', ['order_refund_id' => $detail['order_refund_id']]) ?>">
  144. <div class="am-form-group">
  145. <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">售后类型 </label>
  146. <div class="am-u-sm-9 am-u-end am-padding-top-xs">
  147. <span class="am-badge am-badge-secondary"> <?= $detail['type']['text'] ?> </span>
  148. </div>
  149. </div>
  150. <div class="am-form-group">
  151. <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">审核状态 </label>
  152. <div class="am-u-sm-9 am-u-end">
  153. <label class="am-radio-inline">
  154. <input type="radio" name="refund[is_agree]"
  155. value="10"
  156. data-am-ucheck
  157. checked
  158. required>
  159. 同意
  160. </label>
  161. <label class="am-radio-inline">
  162. <input type="radio" name="refund[is_agree]"
  163. value="20"
  164. data-am-ucheck>
  165. 拒绝
  166. </label>
  167. </div>
  168. </div>
  169. <div class="item-agree-10 form-tab-group am-form-group active">
  170. <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">退货地址 </label>
  171. <div class="am-u-sm-9 am-u-end">
  172. <select name="refund[address_id]"
  173. data-am-selected="{btnSize: 'sm', placeholder:'请选择退货地址', maxHeight: 400}">
  174. <option value=""></option>
  175. <?php if (!empty($address)): foreach ($address as $item): ?>
  176. <option value="<?= $item['address_id'] ?>"><?= $item['name'] ?> <?= $item['phone'] ?> <?= $item['detail'] ?></option>
  177. <?php endforeach; endif; ?>
  178. </select>
  179. <small class="am-margin-left-xs">
  180. <a href="<?= url('setting.address/index') ?>" target="_blank">去添加</a>
  181. </small>
  182. </div>
  183. </div>
  184. <div class="item-agree-20 form-tab-group am-form-group">
  185. <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">拒绝原因 </label>
  186. <div class="am-u-sm-9 am-u-end">
  187. <textarea class="am-field-valid" rows="4" placeholder="请输入拒绝原因"
  188. name="refund[refuse_desc]"></textarea>
  189. <small>如审核状态为拒绝,则需要输入拒绝原因</small>
  190. </div>
  191. </div>
  192. <div class="am-form-group">
  193. <div class="am-u-sm-10 am-u-sm-push-2 am-margin-top-lg">
  194. <button type="submit" class="j-submit am-btn am-btn-sm am-btn-secondary">
  195. 确认审核
  196. </button>
  197. </div>
  198. </div>
  199. </form>
  200. <?php endif; ?>
  201. <?php endif; ?>
  202. <!-- 退货地址 -->
  203. <?php if ($detail['is_agree']['value'] == 10): ?>
  204. <div class="widget-head am-cf">
  205. <div class="widget-title am-fl">退货地址</div>
  206. </div>
  207. <div class="am-scrollable-horizontal">
  208. <table class="regional-table am-table am-table-bordered am-table-centered
  209. am-text-nowrap am-margin-bottom-xs">
  210. <tbody>
  211. <tr>
  212. <th>收货人</th>
  213. <th>收货电话</th>
  214. <th>收货地址</th>
  215. </tr>
  216. <tr>
  217. <td><?= $detail['address']['name'] ?></td>
  218. <td><?= $detail['address']['phone'] ?></td>
  219. <td><?= $detail['address']['detail'] ?></td>
  220. </tr>
  221. </tbody>
  222. </table>
  223. </div>
  224. <?php endif; ?>
  225. <!-- 商家拒绝原因 -->
  226. <?php if ($detail['is_agree']['value'] == 20): ?>
  227. <div class="widget-head am-cf">
  228. <div class="widget-title am-fl">商家拒绝原因</div>
  229. </div>
  230. <div class="apply_desc am-padding-left">
  231. <div class="content x-f-13">
  232. <span><?= $detail['refuse_desc'] ?></span>
  233. </div>
  234. </div>
  235. <?php endif; ?>
  236. <!-- 用户发货信息 -->
  237. <?php if (
  238. $detail['type']['value'] == 10
  239. && $detail['is_agree']['value'] == 10
  240. && $detail['is_user_send'] == 1
  241. ): ?>
  242. <div class="widget-head am-cf">
  243. <div class="widget-title am-fl">用户发货信息</div>
  244. </div>
  245. <div class="am-scrollable-horizontal">
  246. <table class="am-table am-table-bordered am-table-centered
  247. am-text-nowrap am-margin-bottom-xs">
  248. <tbody>
  249. <tr>
  250. <th>物流公司</th>
  251. <th>物流单号</th>
  252. <th>用户发货状态</th>
  253. <th>发货时间</th>
  254. <th>商家收货状态</th>
  255. </tr>
  256. <tr>
  257. <td><?= $detail['express']['express_name'] ?></td>
  258. <td><?= $detail['express_no'] ?></td>
  259. <td>
  260. <span class="am-badge am-badge-success">已发货</span>
  261. </td>
  262. <td><?= date('Y-m-d H:i:s', $detail['send_time']) ?></td>
  263. <td>
  264. <?php if ($detail['is_receipt'] == 1): ?>
  265. <span class="am-badge am-badge-success">已收货</span>
  266. <?php else: ?>
  267. <span class="am-badge">待收货</span>
  268. <?php endif; ?>
  269. </td>
  270. </tr>
  271. </tbody>
  272. </table>
  273. </div>
  274. <?php endif; ?>
  275. <!-- 确认收货并退款 -->
  276. <?php if (checkPrivilege('order.refund/receipt')): ?>
  277. <?php if (
  278. $detail['type']['value'] == 10
  279. && $detail['is_agree']['value'] == 10
  280. && $detail['is_user_send'] == 1
  281. && $detail['is_receipt'] == 0
  282. ): ?>
  283. <div class="widget-head am-cf">
  284. <div class="widget-title am-fl">确认收货并退款</div>
  285. </div>
  286. <div class="tips am-margin-bottom-sm am-u-sm-12">
  287. <div class="pre">
  288. <p class="">注:该操作将执行订单原路退款 并关闭当前售后单,请确认并填写退款的金额(不能大于订单实付款)</p>
  289. <?php if ($order['update_price']['value'] != 0): ?>
  290. <p class="x-color-red">
  291. 注:当前订单存在后台改价记录,退款金额请参考订单实付款金额</p>
  292. <?php endif; ?>
  293. </div>
  294. </div>
  295. <form id="receipt" class="my-form am-form tpl-form-line-form" method="post"
  296. action="<?= url('order.refund/receipt', ['order_refund_id' => $detail['order_refund_id']]) ?>">
  297. <div class="am-form-group">
  298. <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">售后类型 </label>
  299. <div class="am-u-sm-9 am-u-end am-padding-top-xs">
  300. <span class="am-badge am-badge-secondary"> <?= $detail['type']['text'] ?> </span>
  301. </div>
  302. </div>
  303. <div class="am-form-group">
  304. <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">退款金额 </label>
  305. <div class="am-u-sm-9 am-u-end">
  306. <input type="number" min="0.01" class="tpl-form-input"
  307. name="refund[refund_money]"
  308. value="<?= min($order['pay_price'], $detail['order_goods']['total_pay_price']) ?>"
  309. required>
  310. <small>
  311. 请输入退款金额,最多<?= min($order['pay_price'], $detail['order_goods']['total_pay_price']) ?>
  312. </small>
  313. </div>
  314. </div>
  315. <div class="am-form-group">
  316. <div class="am-u-sm-10 am-u-sm-push-2 am-margin-top-lg">
  317. <button type="submit" class="j-submit am-btn am-btn-sm am-btn-secondary">
  318. 确认收货并退款
  319. </button>
  320. </div>
  321. </div>
  322. </form>
  323. <?php endif; ?>
  324. <?php endif; ?>
  325. </div>
  326. </div>
  327. </div>
  328. </div>
  329. </div>
  330. <script>
  331. $(function () {
  332. // 切换审核状态
  333. $("input:radio[name='refund[is_agree]']").change(function (e) {
  334. $('.form-tab-group')
  335. .removeClass('active')
  336. .filter('.item-agree-' + e.currentTarget.value)
  337. .addClass('active');
  338. });
  339. /**
  340. * 表单验证提交
  341. * @type {*}
  342. */
  343. $('.my-form').superForm();
  344. });
  345. </script>