modals.blade.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <style>
  2. .bootstrap-select{width:0;padding:0;margin:0;}
  3. .dropdown-toggle .pull-left{margin:0;line-height: 20px;height:20px;}
  4. .main .form-horizontal .form-group {
  5. margin-bottom: 15px !important;
  6. }
  7. </style>
  8. <!-- 关闭订单 -->
  9. <div id="modal-close" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" style="width:600px;margin:0px auto;">
  10. <form class="form-horizontal form" action="{!! yzWebUrl('order.operation.close') !!}" method="post" enctype="multipart/form-data">
  11. <input type="hidden" name="route" value="order.operation.close">
  12. <input type='hidden' name='order_id' value=''/>
  13. <div class="modal-dialog">
  14. <div class="modal-content">
  15. <div class="modal-header">
  16. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
  17. <h3>关闭订单</h3>
  18. </div>
  19. <div class="modal-body">
  20. <label>关闭订单原因</label>
  21. <textarea style="height:150px;" class="form-control" name="reson" autocomplete="off"></textarea>
  22. <div id="module-menus"></div>
  23. </div>
  24. <div class="modal-footer">
  25. <button type="submit" class="btn btn-primary" name="close" value="yes">关闭订单</button>
  26. <a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
  27. </div>
  28. </div>
  29. </div>
  30. </form>
  31. </div>
  32. <!-- 确认发货 -->
  33. <div id="modal-confirmsend" class="modal fade" tabindex="-1" role="dialog" style="width:600px;margin:0px auto;">
  34. <form class="form-horizontal form" action="" method="get"
  35. enctype="multipart/form-data">
  36. <input type='hidden' name='c' value='site'/>
  37. <input type='hidden' name='a' value='entry'/>
  38. <input type='hidden' name='m' value='yun_shop'/>
  39. <input type='hidden' name='do' value='{{YunShop::request()->do}}'/>
  40. <input type='hidden' name='order_id' value=''/>
  41. <input type='hidden' name='route' value='order.operation.send' id="send_form"/>
  42. <div class="modal-dialog">
  43. <div class="modal-content">
  44. <div class="modal-header">
  45. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
  46. <h3>快递信息</h3>
  47. </div>
  48. <div class="modal-body">
  49. <div class="form-group">
  50. <label class="col-xs-10 col-sm-3 col-md-3 control-label">收件人信息</label>
  51. <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
  52. <div class="form-control-static">
  53. 收 件 人: <span class="realname">{{$order['belongs_to_member']['realname']}}</span> / <span class="mobile">{{$order['belongs_to_member']['mobile']}}</span><br>
  54. 收货地址: <span class="address"></span>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="form-group">
  59. <label class="col-xs-10 col-sm-3 col-md-3 control-label">快递公司</label>
  60. <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
  61. <select class="form-control selectpicker" name="express_code" id="express_company">
  62. <option value="" data-name="">其他快递</option>
  63. @include('express.companies')
  64. </select>
  65. <input type='hidden' name='express_company_name' id='expresscom'/>
  66. </div>
  67. </div>
  68. <div class="form-group">
  69. <label class="col-xs-10 col-sm-3 col-md-3 control-label">快递单号</label>
  70. <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
  71. <input type="text" id="express_sn" name="express_sn" class="form-control"/>
  72. </div>
  73. </div>
  74. <div id="module-menus"></div>
  75. </div>
  76. <div class="modal-footer">
  77. <button type="submit" class="btn btn-primary span2" name="confirmsend" onclick="confirmSend()"
  78. value="yes">确认发货
  79. </button>
  80. <a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
  81. </div>
  82. </div>
  83. </div>
  84. </form>
  85. </div>
  86. <!-- 手动退款 -->
  87. <div id="modal-manual-refund" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" style="width:600px;margin:0px auto;">
  88. <form class="form-horizontal form" action="{!! yzWebUrl('order.vue-operation.manualRefund') !!}" method="post" enctype="multipart/form-data">
  89. <input type="hidden" name="route" value="order.operation.manualRefund">
  90. <input type='hidden' name='order_id' value=''/>
  91. <div class="modal-dialog">
  92. <div class="modal-content">
  93. <div class="modal-header">
  94. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
  95. <h3>退款并关闭订单(请先在选品平台确认该订单是否生成,如已生成请先申请售后)</h3>
  96. </div>
  97. <div class="modal-body">
  98. <label>退款原因</label>
  99. <textarea style="height:150px;" class="form-control" name="reson" autocomplete="off"></textarea>
  100. <div id="module-menus"></div>
  101. </div>
  102. <div class="modal-footer">
  103. <button type="submit" class="btn btn-primary" name="close" value="yes">退款</button>
  104. <a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
  105. </div>
  106. </div>
  107. </div>
  108. </form>
  109. </div>
  110. <!-- 取消发货 -->
  111. <div id="modal-cancelsend" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"
  112. style="width:600px;margin:0px auto;">
  113. <form class="form-horizontal form" action="{!! yzWebUrl('order.operation.cancel-send') !!}" method="post"
  114. enctype="multipart/form-data">
  115. <input type='hidden' name='order_id' value=''/>
  116. <div class="modal-dialog">
  117. <div class="modal-content">
  118. <div class="modal-header">
  119. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
  120. <h3>取消发货</h3>
  121. </div>
  122. <div class="modal-body">
  123. <label>取消发货原因</label>
  124. <textarea style="height:150px;" class="form-control" name="cancelreson" autocomplete="off"></textarea>
  125. <div id="module-menus"></div>
  126. </div>
  127. <div class="modal-footer">
  128. <button type="submit" class="btn btn-primary span2" name="cancelsend" value="yes">取消发货</button>
  129. <a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
  130. </div>
  131. </div>
  132. </div>
  133. </form>
  134. </div>
  135. </form>
  136. </div>
  137. <div id='changeprice_container'>
  138. </div>
  139. @include('refund.modal')
  140. <script language='javascript'>
  141. function changePrice(orderid) {
  142. $.post("{!! yzWebUrl('order.change-order-price') !!}", {order_id: orderid}, function (html) {
  143. if (html == -1) {
  144. alert('订单不能改价!');
  145. return;
  146. }
  147. $('#changeprice_container').html(html);
  148. $('#modal-changeprice').modal().on('shown.bs.modal', function () {
  149. mc_init();
  150. })
  151. });
  152. }
  153. var order_price = 0;
  154. var dispatch_price = 0;
  155. function mc_init() {
  156. order_price = parseFloat($('#changeprice-orderprice').val());
  157. dispatch_price = parseFloat($('#changeprice-dispatchprice').val());
  158. $('input', $('#modal-changeprice')).blur(function () {
  159. if ($.isNumber($(this).val())) {
  160. mc_calc();
  161. }
  162. });
  163. }
  164. function mc_calc() {
  165. var change_dispatchprice = parseFloat($('#changeprice_dispatchprice').val());
  166. if (!$.isNumber($('#changeprice_dispatchprice').val())) {
  167. change_dispatchprice = dispatch_price;
  168. }
  169. var dprice = change_dispatchprice;
  170. if (dprice <= 0) {
  171. dprice = 0;
  172. }
  173. $('#dispatchprice').html(dprice.toFixed(2));
  174. var oprice = 0;
  175. $('.changeprice_orderprice').each(function () {
  176. var p = 0;
  177. if ($.trim($(this).val()) != '') {
  178. p = parseFloat($.trim($(this).val()));
  179. }
  180. oprice += p;
  181. });
  182. if (Math.abs(oprice) > 0) {
  183. if (oprice < 0) {
  184. $('#changeprice').css('color', 'red');
  185. $('#changeprice').html(" - " + Math.abs(oprice));
  186. } else {
  187. $('#changeprice').css('color', 'green');
  188. $('#changeprice').html(" + " + Math.abs(oprice));
  189. }
  190. }
  191. var lastprice = order_price + dprice + oprice;
  192. $('#lastprice').html(lastprice.toFixed(2));
  193. }
  194. function mc_check() {
  195. var can = true;
  196. var lastprice = 0;
  197. $('.changeprice').each(function () {
  198. if ($.trim($(this).val()) == '') {
  199. return true;
  200. }
  201. var p = 0;
  202. if (!$.isNumber($(this).val())) {
  203. $(this).select();
  204. alert('请输入数字!');
  205. can = false;
  206. return false;
  207. }
  208. var val = parseFloat($(this).val());
  209. if (val <= 0 && Math.abs(val) > parseFloat($(this).parent().prev().html())) {
  210. $(this).select();
  211. alert('单个商品价格不能优惠到负数!');
  212. can = false;
  213. return false;
  214. }
  215. lastprice += val;
  216. });
  217. var op = order_price + dispatch_price + lastprice;
  218. if (op < 0) {
  219. alert('订单价格不能小于0元!');
  220. return false;
  221. }
  222. if (!can) {
  223. return false;
  224. }
  225. return true;
  226. }
  227. </script>
  228. <script language="javascript">
  229. function confirmSend() {
  230. var numerictype = /^[a-zA-Z0-9]+$/;;
  231. if ($('#express_sn').val() == '' && $('#express_company').val() != '') {
  232. $('#send_form').val("order.list");
  233. return confirm('请填写快递单号!');
  234. }
  235. $('#expresscom').val($('#express_company option:selected').attr('data-name'));
  236. if ($('#express_sn').val() != '') {
  237. if (!numerictype.test($('#express_sn').val())) {
  238. $('#send_form').val("order.list");
  239. return confirm('快递单号格式不正确!');
  240. }
  241. }
  242. //todo 当未选择其他快递的时候,不允许提交
  243. }
  244. function send(btn) {
  245. var modal = $('#modal-confirmsend');
  246. var itemid = $(btn).parent().find('.itemid').val();
  247. $(".id").val(itemid);
  248. modal.find(':input[name=order_id]').val(itemid);
  249. if ($(btn).parent().find('.addressdata').val()) {
  250. var addressdata = JSON.parse($(btn).parent().find('.addressdata').val());
  251. if (addressdata) {
  252. modal.find('.realname').html(addressdata.realname);
  253. modal.find('.mobile').html(addressdata.mobile);
  254. modal.find('.address').html(addressdata.address);
  255. }
  256. }
  257. }
  258. </script>
  259. <!-- 查看物流 -->
  260. <div id="modal-express" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"
  261. style="width:620px;margin:0px auto;">
  262. <div class="modal-dialog">
  263. <div class="modal-content">
  264. <div class="modal-header">
  265. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
  266. <h3>查看物流</h3></div>
  267. <div class="modal-body" style='max-height:500px;overflow: auto;'>
  268. <div class="form-group" id="module-menus-express"></div>
  269. </div>
  270. <div class="modal-footer"><a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
  271. </div>
  272. </div>
  273. </div>
  274. </div>
  275. <script language='javascript'>
  276. function express_find(btn, orderid) {
  277. $(btn).button('loading');
  278. $.ajax({
  279. url: "{!! yzWebUrl('order.detail.ajax') !!}" +"&id="+orderid,
  280. cache: false,
  281. success: function (html) {
  282. if (html.data.data != null && html.data.data.length > 0){
  283. html.data.data.forEach(v=>{
  284. $('#module-menus-express').append(` <p style="white-space:normal; width:100%">[`+v.time+`] ]`+ v.context+`]</p>`);
  285. });
  286. }
  287. // $('#module-menus-express').html(html);
  288. $('#modal-express').modal();
  289. $(btn).button('reset');
  290. }
  291. })
  292. }
  293. function refundexpress_find(btn, orderid, flag) {
  294. let refund_value = (flag == 2) ? 30 : 20;
  295. $(btn).button('loading');
  296. $.ajax({
  297. url: "{!! yzWebUrl('order.detail.refund-express') !!}" +"&order_id="+orderid +"&refund_value="+refund_value, //"{php echo $this->createWebUrl('order/list',array('op'=>'deal','to'=>'refundexpress'))}&id=" + orderid + "&flag=" + flag,
  298. cache: false,
  299. success: function (html) {
  300. console.log(html.data.data)
  301. if (html.data.data != null && html.data.data.length > 0){
  302. html.data.data.forEach(v=>{
  303. $('#data').append(` <p style="white-space:normal; width:100%">[`+v.time+`] ]`+ v.context+`]</p>`);
  304. });
  305. }
  306. // $('#module-menus-express').html(html);
  307. $('#modal-express').modal();
  308. $(btn).button('reset');
  309. }
  310. })
  311. }
  312. </script>