链街Dcat后台
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.

129 lines
5.4 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Admin\Extensions;
  3. use App\Admin\Common\LinkUrl;
  4. use App\Models\ImsCjdcOrder;
  5. use App\Models\ImsCjdcOrderMain;
  6. use App\Models\LanzuOrderGoods;
  7. use App\Models\LanzuServiceHorseman;
  8. use Dcat\Admin\Admin;
  9. use Dcat\Admin\Support\LazyRenderable;
  10. use Endroid\QrCode\Exceptions\DataDoesntExistsException;
  11. class MyDetailPage extends LazyRenderable
  12. {
  13. protected static $js = [LinkUrl::VUE_JS, LinkUrl::ELEMENT_UI_JS];
  14. protected static $css = [LinkUrl::DETAIL_CSS, LinkUrl::ELEMENT_UI_CSS];
  15. public function render()
  16. {
  17. //>>1.主订单数据
  18. $order = ImsCjdcOrderMain::getOrderData($this->order_id);
  19. if ($order) {
  20. //>>2.获取子订单
  21. $result = ImsCjdcOrder::getOrdersData($order['global_order_id']);
  22. $orders = json_encode($result['orders']);
  23. $showRefund = json_encode($result['show_refund']);
  24. Admin::script(
  25. <<<JS
  26. var orders = JSON.stringify($orders)
  27. var show_refund = JSON.stringify($showRefund)
  28. var app = new Vue({
  29. el:"#detail",
  30. data:{
  31. dialogFormVisible: false,
  32. order_num: "{$order['order_num']}",
  33. name: "{$order['name']}",
  34. state: "{$order['state']}",
  35. created_at: "{$order['created_at']}",
  36. updated_at: "{$order['updated_at']}",
  37. pay_type: "{$order['pay_type']}",
  38. shipping_type: "{$order['shipping_type']}",
  39. tel: "{$order['tel']}",
  40. delivery_time_note: "{$order['delivery_time_note']}",
  41. refuse_refund_note: "{$order['refuse_refund_note']}",
  42. total_refund_note: "{$order['total_refund_note']}",
  43. address: "{$order['address']}",
  44. note: "{$order['note']}",
  45. money: "{$order['money']}",
  46. total_money: "{$order['total_money']}",
  47. services_money: "{$order['services_money']}",
  48. coupon_money: "{$order['coupon_money']}",
  49. delivery_money: "{$order['delivery_money']}",
  50. horseman_name: "{$order['horseman_name']}",
  51. distance: "{$order['distance']}",
  52. orders: JSON.parse(orders),
  53. show_refund: JSON.parse(show_refund),
  54. refund_2:"退款",
  55. refund_3:"已同意退款",
  56. refund_goods_name:"",
  57. global_order_id:"{$order['global_order_id']}",
  58. user_id:"{$order['user_id']}",
  59. order_goods_id:null,
  60. order_child_id:null,
  61. show_refund_2:true,
  62. show_refund_3:false,
  63. },
  64. methods: {
  65. refundNote(name,order_goods_id,order_child_id) {
  66. this.dialogFormVisible = true;
  67. this.order_goods_id=order_goods_id;
  68. this.order_child_id=order_child_id;
  69. this.refund_goods_name ="退款备注商品 ["+name+"]" ;
  70. },
  71. refundConfirm() {
  72. if (this.total_refund_note==''){
  73. this.\$message({message: '请备注退款原因!',type: 'warning'})
  74. return false;
  75. }
  76. this.\$confirm('是否同意该商品退款?', '提示', {
  77. confirmButtonText: '同意',
  78. cancelButtonText: '取消',
  79. type: 'warning'
  80. }).then(() => {
  81. that = this;
  82. $.ajax({
  83. url: "order_goods_refund",
  84. type: "get",
  85. contentType: "text/html; charset=utf-8",
  86. dataType: "json",
  87. data: {
  88. user_id:that.user_id,
  89. note:that.total_refund_note,
  90. global_order_id:that.global_order_id,
  91. order_child_id:that.order_child_id,
  92. order_goods_id:that.order_goods_id
  93. },
  94. success: function (res) {
  95. if (1){
  96. that.\$message({
  97. message: '退款成功',
  98. type: 'success'
  99. })
  100. that.show_refund[that.order_goods_id].show_refund_2=false
  101. that.show_refund[that.order_goods_id].show_refund_3=true
  102. }
  103. that.dialogFormVisible = false;
  104. },
  105. error: function (xhr, err) {
  106. console.log("错误", err)
  107. }
  108. });
  109. }).catch(() => {
  110. });
  111. }
  112. }
  113. });
  114. JS
  115. );
  116. }
  117. return view('orderdetail');
  118. }
  119. }