third_cancel_reason.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <!DOCTYPE html>
  2. <?php
  3. $delviery_name = "";
  4. if($third_distribution_type == 'imdada'){
  5. $delviery_name = "达达配送";
  6. }else if($third_distribution_type == 'sf'){
  7. $delviery_name = "顺丰同城";
  8. }else if($third_distribution_type == 'uupt'){
  9. $delviery_name = "UU跑腿";
  10. }else if($third_distribution_type == 'dianwoda'){
  11. $delviery_name = "点我达";
  12. }
  13. ?>
  14. <head>
  15. <meta charset="utf-8">
  16. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  17. <title><?php $delviery_name;?>配送取消原因</title>
  18. </head>
  19. <body style="width:100%;margin:0 auto;text-align: center;">
  20. <input type="hidden" id="order_id" name="order_id" value="{$order_id}"/>
  21. <input type="hidden" id="third_distribution_type" name="third_distribution_type" value="{$third_distribution_type}"/>
  22. <div class="layui-card-body" style="padding:15px 0 0 15px;">
  23. <?php if($third_distribution_type == 'imdada'){ ?>
  24. <div class="layui-form-item">
  25. <label class="layui-form-label">取消原因</label>
  26. <div class="layui-input-block">
  27. <select id="cancel_reason_id_imdada" name="cancel_reason_id">
  28. <option value="1">没有配送员接单</option>
  29. <option value="2">配送员没来取货</option>
  30. <option value="3">配送员态度太差</option>
  31. <option value="4">顾客取消订单</option>
  32. <option value="5">订单填写错误</option>
  33. <option value="34">配送员让我取消此单</option>
  34. <option value="35">配送员不愿上门取货</option>
  35. <option value="36">我不需要配送了</option>
  36. <option value="37">配送员以各种理由表示无法完成订单</option>
  37. <option value="1000">其他</option>
  38. </select>
  39. </div>
  40. </div>
  41. <div class="layui-form-item" style="display: none;" id="cancel_reason_div">
  42. <label class="layui-form-label">取消具体原因</label>
  43. <div class="layui-input-block">
  44. <input type="text" name="cancel_reason" id="cancel_reason_imdada" class="form-control" value="" style="width: 80%;">
  45. </div>
  46. </div>
  47. <?php }else if($third_distribution_type == 'sf'){?>
  48. <div class="layui-form-item">
  49. <label class="layui-form-label">取消原因</label>
  50. <div class="layui-input-block">
  51. <input type="text" name="cancel_reason" id="cancel_reason_sf" class="form-control" value="" style="width: 80%;">
  52. </div>
  53. </div>
  54. <?php }else if($third_distribution_type == 'make'){?>
  55. <div class="layui-form-item">
  56. <label class="layui-form-label">取消原因</label>
  57. <div class="layui-input-block">
  58. <input type="text" name="cancel_reason" id="cancel_reason_make" class="form-control" value="" style="width: 80%;">
  59. </div>
  60. </div>
  61. <?php }else if($third_distribution_type == 'ele'){ ?>
  62. <div class="layui-form-item">
  63. <label class="layui-form-label">取消原因</label>
  64. <div class="layui-input-block">
  65. <select id="cancel_reason_id_ele" name="cancel_reason_id">
  66. <option value="1">物流原因:订单长时间未分配骑手</option>
  67. <option value="2">物流原因:分配骑手后,骑手长时间未取件</option>
  68. <option value="3">物流原因:骑手告知不配送,让取消订单</option>
  69. <option value="4">商品缺货/无法出货/已售完</option>
  70. <option value="5">商户联系不上门店/门店关门了</option>
  71. <option value="6">商户发错单</option>
  72. <option value="7">商户/顾客自身定位错误</option>
  73. <option value="8">商户改其他第三方配送</option>
  74. <option value="9">顾客下错单/临时不想要了</option>
  75. <option value="10">顾客自取/不在家/要求另改时间配送</option>
  76. </select>
  77. </div>
  78. </div>
  79. <div class="layui-form-item" style="display: none;" id="cancel_reason_div_ele">
  80. <label class="layui-form-label">取消原因</label>
  81. <div class="layui-input-block">
  82. <input type="text" name="cancel_reason" id="cancel_reason_ele" class="form-control" value="" style="width: 80%;">
  83. </div>
  84. </div>
  85. <?php } ?>
  86. <div class="layui-form-item">
  87. <label class="layui-form-label"></label>
  88. <div class="layui-input-block">
  89. <a href="javascript:;" class="layui-btn layui-btn-sm cancelBtn">确认取消</a>
  90. </div>
  91. </div>
  92. </div>
  93. </body>
  94. <script>
  95. $(function(){
  96. $('#cancel_reason_id_imdada').change(function(){
  97. if($(this).val() == '1000'){
  98. $('#cancel_reason_div').show();
  99. }else{
  100. $('#cancel_reason_div').hide();
  101. }
  102. });
  103. $('.cancelBtn').click(function(){
  104. cancel_delivery();
  105. });
  106. })
  107. function cancel_delivery(){
  108. var order_id = $('#order_id').val();
  109. var third_distribution_type = $('#third_distribution_type').val();
  110. var cancel_reason_id = "";
  111. var cancel_reason = "";
  112. if(third_distribution_type == 'imdada'){
  113. cancel_reason_id = $('#cancel_reason_id_imdada').val();
  114. cancel_reason = $('#cancel_reason_imdada').val();
  115. if(cancel_reason_id == '1000' && cancel_reason == ''){
  116. layer.msg("取消原因为其他时,取消具体原因必填",{icon: 2,time: 2000});
  117. return false;
  118. }
  119. if(cancel_reason_id != '1000'){
  120. cancel_reason = $('#cancel_reason_id_imdada').find('option:selected').text();
  121. }
  122. }else if(third_distribution_type == 'sf'){
  123. cancel_reason = $('#cancel_reason_sf').val();
  124. }else if(third_distribution_type == 'make'){
  125. cancel_reason = $('#cancel_reason_make').val();
  126. }else if(third_distribution_type == 'ele'){
  127. cancel_reason_id = $('#cancel_reason_id_ele').val();
  128. cancel_reason = $('#cancel_reason_ele').val();
  129. }
  130. layer.confirm('订单在“第三方配送平台”处于 待接单 或 待取货 情况下,取消订单可能会产生违约金,确认取消配送订单吗?', function(index){
  131. $.ajax({
  132. url:"{:U('order/thirth_cancel_delivery_order')}",
  133. type:'post',
  134. dataType:'json',
  135. data: {order_id:order_id,cancel_reason_id:cancel_reason_id,cancel_reason:cancel_reason},
  136. success:function(res){
  137. if(res.status == 0)
  138. {
  139. layer.msg(res.result.msg,{icon: 2,time: 2000});
  140. return false;
  141. }else if(res.status == 1){
  142. var go_url = location.href;
  143. layer.msg('取消配送订单成功',{time: 1000,
  144. end:function(){
  145. layer.closeAll();
  146. location.reload();
  147. }
  148. });
  149. }
  150. }
  151. })
  152. });
  153. }
  154. </script>
  155. </html>