modals.blade.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <!-- 确认发货 -->
  2. <style>
  3. .bootstrap-select{width:0;padding:0;margin:0;}
  4. .dropdown-toggle .pull-left{margin:0;line-height: 20px;height:20px;}
  5. .main .form-horizontal .form-group {
  6. margin-bottom: 15px !important;
  7. }
  8. </style>
  9. <div id="modal-confirmsend" class="modal fade" tabindex="-1" role="dialog" style="width:600px;margin:0px auto;">
  10. <form class="form-horizontal form" action="" method="get"
  11. enctype="multipart/form-data">
  12. <input type='hidden' name='c' value='site'/>
  13. <input type='hidden' name='a' value='entry'/>
  14. <input type='hidden' name='m' value='yun_shop'/>
  15. <input type='hidden' name='do' value='{{YunShop::request()->do}}'/>
  16. <input type='hidden' name='order_sn' value=''/>
  17. <input type='hidden' name='order_id' value=''/>
  18. <input type='hidden' name='route' value='plugin.jd-supply.admin.cloud-order.send' id="send_form"/>
  19. <div class="modal-dialog">
  20. <div class="modal-content">
  21. <div class="modal-header">
  22. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
  23. <h3>快递信息</h3>
  24. </div>
  25. <div class="modal-body">
  26. <div class="form-group">
  27. <label class="col-xs-10 col-sm-3 col-md-3 control-label">收件人信息</label>
  28. <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
  29. <div class="form-control-static">
  30. 收 件 人: <span class="realname">{{$order['order']['real_name']}}</span> / <span class="mobile">{{$order['order']['mobile']}}</span><br>
  31. 收货地址: <span class="address">{{$order['order']['address']}}</span>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="form-group" style="overflow: visible !important;">
  36. <label class="col-xs-10 col-sm-3 col-md-3 control-label">快递公司</label>
  37. <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
  38. <select class="form-control selectpicker" data-live-search="true" name="express_code" id="express_company">
  39. @foreach ($express as $item)
  40. <option value="{{$item['name']}}" data-name="{{$item['name']}}">{{$item['name']}}</option>
  41. @endforeach
  42. </select>
  43. <input type='hidden' name='express_company_name' id='expresscom'/>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="col-xs-10 col-sm-3 col-md-3 control-label">快递单号</label>
  48. <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
  49. <input type="text" id="express_sn" name="express_sn" class="form-control"/>
  50. </div>
  51. </div>
  52. <div id="module-menus"></div>
  53. </div>
  54. <div class="modal-footer">
  55. <button type="submit" class="btn btn-primary span2" name="confirmsend" onclick="confirmSend()"
  56. value="yes">确认发货
  57. </button>
  58. <a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
  59. </div>
  60. </div>
  61. </div>
  62. </form>
  63. </div>
  64. </form>
  65. </div>
  66. <div id='changeprice_container'>
  67. </div>
  68. <script language='javascript'>
  69. var order_price = 0;
  70. var dispatch_price = 0;
  71. function mc_init() {
  72. order_price = parseFloat($('#changeprice-orderprice').val());
  73. dispatch_price = parseFloat($('#changeprice-dispatchprice').val());
  74. $('input', $('#modal-changeprice')).blur(function () {
  75. if ($.isNumber($(this).val())) {
  76. mc_calc();
  77. }
  78. });
  79. }
  80. function mc_calc() {
  81. var change_dispatchprice = parseFloat($('#changeprice_dispatchprice').val());
  82. if (!$.isNumber($('#changeprice_dispatchprice').val())) {
  83. change_dispatchprice = dispatch_price;
  84. }
  85. var dprice = change_dispatchprice;
  86. if (dprice <= 0) {
  87. dprice = 0;
  88. }
  89. $('#dispatchprice').html(dprice.toFixed(2));
  90. var oprice = 0;
  91. $('.changeprice_orderprice').each(function () {
  92. var p = 0;
  93. if ($.trim($(this).val()) != '') {
  94. p = parseFloat($.trim($(this).val()));
  95. }
  96. oprice += p;
  97. });
  98. if (Math.abs(oprice) > 0) {
  99. if (oprice < 0) {
  100. $('#changeprice').css('color', 'red');
  101. $('#changeprice').html(" - " + Math.abs(oprice));
  102. } else {
  103. $('#changeprice').css('color', 'green');
  104. $('#changeprice').html(" + " + Math.abs(oprice));
  105. }
  106. }
  107. var lastprice = order_price + dprice + oprice;
  108. $('#lastprice').html(lastprice.toFixed(2));
  109. }
  110. function mc_check() {
  111. var can = true;
  112. var lastprice = 0;
  113. $('.changeprice').each(function () {
  114. if ($.trim($(this).val()) == '') {
  115. return true;
  116. }
  117. var p = 0;
  118. if (!$.isNumber($(this).val())) {
  119. $(this).select();
  120. alert('请输入数字!');
  121. can = false;
  122. return false;
  123. }
  124. var val = parseFloat($(this).val());
  125. if (val <= 0 && Math.abs(val) > parseFloat($(this).parent().prev().html())) {
  126. $(this).select();
  127. alert('单个商品价格不能优惠到负数!');
  128. can = false;
  129. return false;
  130. }
  131. lastprice += val;
  132. });
  133. var op = order_price + dispatch_price + lastprice;
  134. if (op < 0) {
  135. alert('订单价格不能小于0元!');
  136. return false;
  137. }
  138. if (!can) {
  139. return false;
  140. }
  141. return true;
  142. }
  143. </script>
  144. <script language="javascript">
  145. function confirmSend() {
  146. var numerictype = /^[a-zA-Z0-9]+$/;;
  147. if ($('#express_sn').val() == '' && $('#express_company').val() != '') {
  148. $('#send_form').val("order.list");
  149. return confirm('请填写快递单号!');
  150. }
  151. $('#expresscom').val($('#express_company option:selected').attr('data-name'));
  152. if ($('#express_sn').val() != '') {
  153. if (!numerictype.test($('#express_sn').val())) {
  154. $('#send_form').val("order.list");
  155. return confirm('快递单号格式不正确!');
  156. }
  157. }
  158. //todo 当未选择其他快递的时候,不允许提交
  159. }
  160. function send(btn) {
  161. var modal = $('#modal-confirmsend');
  162. var itemid = $(btn).parent().find('.itemsn').val();
  163. $(".id").val(itemsn);
  164. modal.find(':input[name=order_sn]').val(itemid);
  165. modal.find('.order_id').html($(btn).parent().find('.itemid').val());
  166. modal.find('.realname').html($(btn).parent().find('.addressname').val());
  167. modal.find('.mobile').html($(btn).parent().find('.addresstel').val());
  168. modal.find('.address').html($(btn).parent().find('.addressdata').val());
  169. }
  170. </script>
  171. <!-- 查看物流 -->
  172. <div id="modal-express" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"
  173. style="width:620px;margin:0px auto;">
  174. <div class="modal-dialog">
  175. <div class="modal-content">
  176. <div class="modal-header">
  177. <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
  178. <h3>查看物流</h3></div>
  179. <div class="modal-body" style='max-height:500px;overflow: auto;'>
  180. <div class="form-group">
  181. <p class='form-control-static' id="module-menus-express"></p>
  182. </div>
  183. </div>
  184. <div class="modal-footer"><a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. <script language='javascript'>
  190. function express_find(btn, orderid) {
  191. $(btn).button('loading');
  192. $.ajax({
  193. url: "{php echo $this->createWebUrl('order/list',array('op'=>'deal','to'=>'express'))}&id=" + orderid,
  194. cache: false,
  195. success: function (html) {
  196. $('#module-menus-express').html(html);
  197. $('#modal-express').modal();
  198. $(btn).button('reset');
  199. }
  200. })
  201. }
  202. function refundexpress_find(btn, orderid, flag) {
  203. $(btn).button('loading');
  204. $.ajax({
  205. url: "{php echo $this->createWebUrl('order/list',array('op'=>'deal','to'=>'refundexpress'))}&id=" + orderid + "&flag=" + flag,
  206. cache: false,
  207. success: function (html) {
  208. $('#module-menus-express').html(html);
  209. $('#modal-express').modal();
  210. $(btn).button('reset');
  211. }
  212. })
  213. }
  214. </script>