链街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.

130 lines
5.2 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 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. this.\$confirm('是否同意该商品退款?', '提示', {
  73. confirmButtonText: '同意',
  74. cancelButtonText: '取消',
  75. type: 'warning'
  76. }).then(() => {
  77. that = this;
  78. $.ajax({
  79. url: "order_goods_refund",
  80. type: "get",
  81. contentType: "text/html; charset=utf-8",
  82. dataType: "json",
  83. data: {
  84. user_id:that.user_id,
  85. note:that.total_refund_note,
  86. global_order_id:that.global_order_id,
  87. order_child_id:that.order_child_id,
  88. order_goods_id:that.order_goods_id
  89. },
  90. success: function (res) {
  91. if (1){
  92. that.\$message({
  93. message: '退款成功',
  94. type: 'success'
  95. })
  96. that.show_refund[that.order_goods_id].show_refund_2=false
  97. that.show_refund[that.order_goods_id].show_refund_3=true
  98. }
  99. that.dialogFormVisible = false;
  100. },
  101. error: function (xhr, err) {
  102. console.log("错误", err)
  103. }
  104. });
  105. }).catch(() => {
  106. });
  107. }
  108. }
  109. });
  110. JS
  111. );
  112. }
  113. return view('orderdetail');
  114. }
  115. }