modals.blade.php 8.9 KB

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