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

125 lines
5.0 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
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. $orders = ImsCjdcOrder::getOrdersData($order['global_order_id']);
  22. //拒绝退款理由
  23. //退款总备注原因,单个商品或者单个子订单
  24. Admin::script(
  25. <<<JS
  26. var orders = JSON.stringify($orders)
  27. var app = new Vue({
  28. el:"#detail",
  29. data:{
  30. dialogFormVisible: false,
  31. order_num: "{$order['order_num']}",
  32. name: "{$order['name']}",
  33. state: "{$order['state']}",
  34. created_at: "{$order['created_at']}",
  35. updated_at: "{$order['updated_at']}",
  36. pay_type: "{$order['pay_type']}",
  37. shipping_type: "{$order['shipping_type']}",
  38. tel: "{$order['tel']}",
  39. delivery_time_note: "{$order['delivery_time_note']}",
  40. refuse_refund_note: "{$order['refuse_refund_note']}",
  41. total_refund_note: "{$order['total_refund_note']}",
  42. address: "{$order['address']}",
  43. note: "{$order['note']}",
  44. money: "{$order['money']}",
  45. total_money: "{$order['total_money']}",
  46. services_money: "{$order['services_money']}",
  47. coupon_money: "{$order['coupon_money']}",
  48. delivery_money: "{$order['delivery_money']}",
  49. horseman_name: "{$order['horseman_name']}",
  50. distance: "{$order['distance']}",
  51. orders: JSON.parse(orders),
  52. refund_2:"退款",
  53. refund_3:"已同意退款",
  54. refund_goods_name:"",
  55. global_order_id:"{$order['global_order_id']}",
  56. user_id:"{$order['user_id']}",
  57. order_goods_id:null,
  58. order_child_id:null,
  59. show_refund_2:true,
  60. show_refund_3:false,
  61. },
  62. methods: {
  63. refundNote(name,order_goods_id,order_child_id) {
  64. this.dialogFormVisible = true;
  65. this.order_goods_id=order_goods_id;
  66. this.order_child_id=order_child_id;
  67. this.refund_goods_name ="退款备注商品 ["+name+"]" ;
  68. },
  69. refundConfirm() {
  70. this.\$confirm('是否同意该商品退款?', '提示', {
  71. confirmButtonText: '同意',
  72. cancelButtonText: '取消',
  73. type: 'warning'
  74. }).then(() => {
  75. that = this;
  76. $.ajax({
  77. url: "order_goods_refund",
  78. type: "get",
  79. contentType: "text/html; charset=utf-8",
  80. dataType: "json",
  81. data: {
  82. user_id:that.user_id,
  83. note:that.total_refund_note,
  84. global_order_id:that.global_order_id,
  85. order_child_id:that.order_child_id,
  86. order_goods_id:that.order_goods_id
  87. },
  88. success: function (res) {
  89. if (1){
  90. that.\$message({
  91. message: '退款成功',
  92. type: 'success'
  93. })
  94. that.show_refund_2=false
  95. that.show_refund_3=true
  96. }
  97. that.dialogFormVisible = false;
  98. },
  99. error: function (xhr, err) {
  100. console.log("错误", err)
  101. }
  102. });
  103. }).catch(() => {
  104. });
  105. }
  106. }
  107. });
  108. JS
  109. );
  110. }
  111. return view('orderdetail');
  112. }
  113. }