modals.blade.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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-manual-refund" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" style="width:600px;margin:0px auto;">
  34. <form class="form-horizontal form" action="{!! yzWebUrl('order.operation.manualRefund') !!}" method="post" enctype="multipart/form-data">
  35. <input type="hidden" name="route" value="order.operation.manualRefund">
  36. <input type='hidden' name='order_id' value=''/>
  37. <div class="modal-dialog">
  38. <div class="modal-content">
  39. <div class="modal-header">
  40. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
  41. <h3>退款并关闭订单</h3>
  42. </div>
  43. <div class="modal-body">
  44. <label>退款原因</label>
  45. <textarea style="height:150px;" class="form-control" name="reson" autocomplete="off"></textarea>
  46. <div id="module-menus"></div>
  47. </div>
  48. <div class="modal-footer">
  49. <button type="submit" class="btn btn-primary" name="close" value="yes">退款</button>
  50. <a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
  51. </div>
  52. </div>
  53. </div>
  54. </form>
  55. </div>
  56. <!-- 确认发货 -->
  57. <div id="modal-confirmsend" class="modal fade" role="dialog" style="width:600px;margin:0px auto;">
  58. <form class="form-horizontal form" action="" method="get"
  59. enctype="multipart/form-data">
  60. <input type='hidden' name='c' value='site'/>
  61. <input type='hidden' name='a' value='entry'/>
  62. <input type='hidden' name='m' value='yun_shop'/>
  63. <input type='hidden' name='do' value='{{YunShop::request()->do}}'/>
  64. <input type='hidden' name='order_id' value=''/>
  65. <input type='hidden' name='route' value='order.operation.send' id="send_form"/>
  66. <div class="modal-dialog">
  67. <div class="modal-content">
  68. <div class="modal-header">
  69. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
  70. <h3>快递信息</h3>
  71. </div>
  72. <div class="modal-body">
  73. <div class="form-group">
  74. <label class="col-xs-10 col-sm-3 col-md-3 control-label">收件人信息</label>
  75. <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
  76. <div class="form-control-static">
  77. 收 件 人: <span class="realname">{{$order['belongs_to_member']['realname']}}</span> / <span class="mobile">{{$order['belongs_to_member']['mobile']}}</span><br>
  78. 收货地址: <span class="address"></span>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="form-group" style="overflow: visible !important;">
  83. <label class="col-xs-10 col-sm-3 col-md-3 control-label">快递公司</label>
  84. <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
  85. <select class="form-control selectpicker" data-live-search="true" name="express_code" id="express_company" >
  86. <option value="" data-name="">其他快递</option>
  87. @include('express.companies')
  88. </select>
  89. <input type='hidden' name='express_company_name' id='expresscom'/>
  90. </div>
  91. </div>
  92. <div class="form-group">
  93. <label class="col-xs-10 col-sm-3 col-md-3 control-label">快递单号</label>
  94. <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
  95. <input type="text" id="express_sn" name="express_sn" class="form-control" style="margin:0;width:100%;"/>
  96. </div>
  97. </div>
  98. <div id="module-menus"></div>
  99. </div>
  100. <div class="modal-footer">
  101. <button type="submit" class="btn btn-primary span2" name="confirmsend" onclick="confirmSend()"
  102. value="yes">确认发货
  103. </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"
  125. autocomplete="off"></textarea>
  126. <div id="module-menus"></div>
  127. </div>
  128. <div class="modal-footer">
  129. <button type="submit" class="btn btn-primary span2" name="cancelsend" value="yes">取消发货</button>
  130. <a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
  131. </div>
  132. </div>
  133. </div>
  134. </form>
  135. </div>
  136. </form>
  137. </div>
  138. <div id='changeprice_container'>
  139. </div>
  140. @include('refund.modal')
  141. <script language='javascript'>
  142. function changePrice(orderid) {
  143. $.post("{!! yzWebUrl('order.change-order-price') !!}", {order_id: orderid}, function (html) {
  144. if (html == -1) {
  145. alert('订单不能改价!');
  146. return;
  147. }
  148. $('#changeprice_container').html(html);
  149. $('#modal-changeprice').modal().on('shown.bs.modal', function () {
  150. mc_init();
  151. })
  152. });
  153. }
  154. var order_price = 0;
  155. var dispatch_price = 0;
  156. function mc_init() {
  157. order_price = parseFloat($('#changeprice-orderprice').val());
  158. dispatch_price = parseFloat($('#changeprice-dispatchprice').val());
  159. $('input', $('#modal-changeprice')).blur(function () {
  160. if ($.isNumber($(this).val())) {
  161. mc_calc();
  162. }
  163. });
  164. }
  165. function mc_calc() {
  166. var change_dispatchprice = parseFloat($('#changeprice_dispatchprice').val());
  167. if (!$.isNumber($('#changeprice_dispatchprice').val())) {
  168. change_dispatchprice = dispatch_price;
  169. }
  170. var dprice = change_dispatchprice;
  171. if (dprice <= 0) {
  172. dprice = 0;
  173. }
  174. $('#dispatchprice').html(dprice.toFixed(2));
  175. var oprice = 0;
  176. $('.changeprice_orderprice').each(function () {
  177. var p = 0;
  178. if ($.trim($(this).val()) != '') {
  179. p = parseFloat($.trim($(this).val()));
  180. }
  181. oprice += p;
  182. });
  183. if (Math.abs(oprice) > 0) {
  184. if (oprice < 0) {
  185. $('#changeprice').css('color', 'red');
  186. $('#changeprice').html(" - " + Math.abs(oprice));
  187. } else {
  188. $('#changeprice').css('color', 'green');
  189. $('#changeprice').html(" + " + Math.abs(oprice));
  190. }
  191. }
  192. var lastprice = order_price + dprice + oprice;
  193. $('#lastprice').html(lastprice.toFixed(2));
  194. }
  195. function mc_check() {
  196. var can = true;
  197. var lastprice = 0;
  198. $('.changeprice').each(function () {
  199. if ($.trim($(this).val()) == '') {
  200. return true;
  201. }
  202. var p = 0;
  203. if (!$.isNumber($(this).val())) {
  204. $(this).select();
  205. alert('请输入数字!');
  206. can = false;
  207. return false;
  208. }
  209. var val = parseFloat($(this).val());
  210. if (val <= 0 && Math.abs(val) > parseFloat($(this).parent().prev().html())) {
  211. $(this).select();
  212. alert('单个商品价格不能优惠到负数!');
  213. can = false;
  214. return false;
  215. }
  216. lastprice += val;
  217. });
  218. var op = order_price + dispatch_price + lastprice;
  219. if (op < 0) {
  220. alert('订单价格不能小于0元!');
  221. return false;
  222. }
  223. if (!can) {
  224. return false;
  225. }
  226. return true;
  227. }
  228. </script>
  229. <script language="javascript">
  230. function confirmSend() {
  231. var numerictype = /^[a-zA-Z0-9]+$/;;
  232. if ($('#express_sn').val() == '' && $('#express_company').val() != '') {
  233. $('#send_form').val("order.list");
  234. return confirm('请填写快递单号!');
  235. }
  236. $('#expresscom').val($('#express_company option:selected').attr('data-name'));
  237. if ($('#express_sn').val() != '') {
  238. if (!numerictype.test($('#express_sn').val())) {
  239. $('#send_form').val("order.list");
  240. return confirm('快递单号格式不正确!');
  241. }
  242. }
  243. //todo 当未选择其他快递的时候,不允许提交
  244. }
  245. function send(btn) {
  246. var modal = $('#modal-confirmsend');
  247. var itemid = $(btn).parent().find('.itemid').val();
  248. $(".id").val(itemid);
  249. modal.find(':input[name=order_id]').val(itemid);
  250. if ($(btn).parent().find('.addressdata').val()) {
  251. var addressdata = JSON.parse($(btn).parent().find('.addressdata').val());
  252. if (addressdata) {
  253. modal.find('.realname').html(addressdata.realname);
  254. modal.find('.mobile').html(addressdata.mobile);
  255. modal.find('.address').html(addressdata.address);
  256. }
  257. }
  258. }
  259. </script>
  260. <!-- 查看物流 -->
  261. <div id="modal-express" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"
  262. style="margin:0px auto; width:100%">
  263. <div class="modal-dialog" style="width: 60%">
  264. <div class="modal-content" style="">
  265. <div class="modal-header">
  266. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
  267. <h3>查看物流</h3>
  268. </div>
  269. <div class="modal-body" style='max-height:500px;width:100%'>
  270. <div class="" id="data" >
  271. {{--<p class='form-control-static' id="module-menus-express"></p>--}}
  272. {{--<div style=" white-space:normal; width:100%;">--}}
  273. {{--20191111-08-01 18:24:48] ]【佛山市】 快件已在 【顺德乐从】 签收, 签收人: 同事/同学, 如有疑问请电联:18688290757 / 0757-28857568, 您的快递已经妥投。风里来雨里去, 只为客官您满意--}}
  274. {{--</div>--}}
  275. {{--<p style="white-space:normal; width:100%">[20191111-08-01 18:24:48] ]【佛山市】 快件已在 【顺德乐从】 签收, 签收人: 同事/同学, 如有疑问请电联:18688290757 / 0757-28857568, 您的快递已经妥投。风里来雨里去, 只为客官您满意。上有老下有小, 赏个好评好不好?【请在评价快递员处帮忙点亮五颗星星哦~】]</p>--}}
  276. </div>
  277. </div>
  278. <div class="modal-footer"><a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
  279. </div>
  280. </div>
  281. </div>
  282. </div>
  283. <script language='javascript'>
  284. function express_find(btn, orderid) {
  285. $(btn).button('loading');
  286. $.ajax({
  287. url: "{php echo $this->createWebUrl('order/list',array('op'=>'deal','to'=>'express'))}&id=" + orderid,
  288. cache: false,
  289. success: function (html) {
  290. $('#module-menus-express').html(html);
  291. $('#modal-express').modal();
  292. $(btn).button('reset');
  293. }
  294. })
  295. }
  296. function refundexpress_find(btn, orderid, flag) {
  297. {{--console.log("{!! yzWebUrl('order.list',array('op'=>'deal','to'=>'refundexpress')) !!}&id=" + orderid + "&flag=" + flag)--}}
  298. {{--console.log(orderid)--}}
  299. $(btn).button('loading');
  300. $.ajax({
  301. url: "{!! yzWebUrl('order.detail.express') !!}" +"&id="+orderid,//"{php echo $this->createWebUrl('order/list',array('op'=>'deal','to'=>'refundexpress'))}&id=" + orderid + "&flag=" + flag,
  302. cache: false,
  303. success: function (html) {
  304. console.log(html.data.data)
  305. if (html.data.data != null && html.data.data.length > 0){
  306. html.data.data.forEach(v=>{
  307. $('#data').append(` <p style="white-space:normal; width:100%">[`+v.time+`] ]`+ v.context+`]</p>`);
  308. });
  309. }
  310. console.log(html)
  311. $('#module-menus-express').html(html);
  312. $('#modal-express').modal();
  313. $(btn).button('reset');
  314. }
  315. })
  316. }
  317. // function refundexpress_find(btn, orderid, flag) {
  318. // $(btn).button('loading');
  319. // $.ajax({
  320. // url: "{php echo $this->createWebUrl('order/list',array('op'=>'deal','to'=>'refundexpress'))}&id=" + orderid + "&flag=" + flag,
  321. // cache: false,
  322. // success: function (html) {
  323. // $('#module-menus-express').html(html);
  324. // $('#modal-express').modal();
  325. // $(btn).button('reset');
  326. // }
  327. // })
  328. // }
  329. </script>