modals.blade.php 16 KB

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