express_list.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. </head>
  6. <body>
  7. <style>
  8. .move_item{width:18%;}
  9. </style>
  10. <form action="{:U('order/kdniao_order')}" method="post" id="export_form" class="form-horizontal form-search " role="form">
  11. <input type="hidden" name="controller" value="order/print_order" />
  12. <input type="hidden" name="c" value="order" />
  13. <input type="hidden" name="a" value="kdniao_order" />
  14. <input type="hidden" name="order_id" value="{$order_id}" id="order_id"/>
  15. <input type="hidden" name="print_type" value="{$type}" id="print_type"/>
  16. <div class="layui-fluid">
  17. <div class="layui-row layui-col-space15">
  18. <div class="layui-col-md12">
  19. <div class="layui-card">
  20. <div class="layui-card-header">选择快递</div>
  21. <div class="layui-card-body multi-img-details">
  22. <?php foreach( $express_list as $k=>$v ){ ?>
  23. <label class="move_item">
  24. <input type="radio" lay-skin="primary" name="express_code" value="<?php echo $v['simplecode']; ?>" class="item_input" /><?php echo $v['name']; ?>
  25. </label>
  26. <?php } ?>
  27. </div>
  28. </div>
  29. </div>
  30. <div class='layui-row'>
  31. <div class="layui-col-sm-12">
  32. <div class="modal-footer" style="text-align: left">
  33. <button type="submit" class="btn " id="sub_orderexport" name="cancelsend" value="yes">确认打印</button>
  34. <input type="hidden" name="modify_explode_arr" id="modify_explode_arr" value="" />
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </form>
  41. <script type="text/javascript" src="/static/js/jquery-migrate-1.1.1.js"></script>
  42. <script src="/static/js/jquery-ui.min.js"></script>
  43. <script>
  44. $(function(){
  45. $('#sub_orderexport').click(function(){
  46. var order_id = $("#order_id").val();
  47. var print_type = $("#print_type").val();
  48. var express_code = $("input[name='express_code']:checked").val();
  49. if(typeof(express_code) == "undefined" || express_code == ""){
  50. layer.msg("请选择快递公司",{icon: 2,time: 2000});
  51. return false;
  52. }
  53. if(print_type != 'one'){
  54. layer.closeAll();
  55. $('#kdn_print_content').html("打印中");
  56. $.ajax({
  57. url: "{:U('order/kdniao_print_orders')}",
  58. type:'post',
  59. dataType:'json',
  60. data:{print_type:print_type,order_id:order_id,express_code:express_code},
  61. success:function(info){
  62. layer.closeAll();
  63. $.post("{:U('order/kdn_orders_info')}", {order_ids:info.order_ids}, function(shtml){
  64. layer.open({
  65. title: "快递面单",
  66. type: 1,
  67. area: ['450px', '700px'],
  68. content: shtml
  69. });
  70. });
  71. }
  72. })
  73. }else{
  74. $.ajax({
  75. url: "{:U('order/kdniao_order')}",
  76. type:'post',
  77. dataType:'json',
  78. data:{order_id:order_id,express_code:express_code},
  79. success:function(info){
  80. console.log(info);
  81. if(info.status == 0)
  82. {
  83. /*layer.msg('打印面单成功',{time: 1000,
  84. end:function(){
  85. layer.closeAll();
  86. }
  87. });*/
  88. layer.closeAll();
  89. $.post("{:U('order/kdn_info')}", {order_id:order_id}, function(shtml){
  90. layer.open({
  91. title: "快递面单",
  92. type: 1,
  93. area: ['450px', '700px'],
  94. content: shtml
  95. });
  96. });
  97. }else if(info.status == 1){
  98. layer.msg(info.message,{icon: 2,time: 2000});
  99. }else if(info.status == 2){
  100. kdniao_set();
  101. }else if(info.status == 3){
  102. kdniao_sender_set(info.message);
  103. }
  104. }
  105. })
  106. }
  107. return false;
  108. })
  109. })
  110. function kdniao_set(){
  111. var html = '暂未设置快递对应的<span style="color:#428bca;">客户账号</span>或者<span style="color:#428bca;">客户密码</span>,请先<br/>到后台<span style="color:#428bca;">设置</span>——<span style="color:#428bca;">物流设置</span>——<span style="color:#428bca;">快递方式设置</span>,设置好参数后,再进行打印面单操作';
  112. layer.confirm(html, {
  113. btn: ['去设置','取消'] //按钮
  114. }, function(){
  115. window.location.href = "{:U('express/config')}";
  116. }, function(){
  117. layer.closeAll();
  118. });
  119. }
  120. function kdniao_sender_set(message){
  121. var html = '<span style="color:red;">'+message+'</span><br/>暂未设置快递鸟的<span style="color:#428bca;">寄件人信息</span>,请先<br/>到后台<span style="color:#428bca;">设置</span>——<span style="color:#428bca;">物流设置</span>——<span style="color:#428bca;">物流接口</span>,设置好寄件人参数后,再进行打印面单操作';
  122. layer.confirm(html, {
  123. btn: ['去设置','取消'] //按钮
  124. }, function(){
  125. window.location.href = "{:U('logistics/inface')}";
  126. }, function(){
  127. layer.closeAll();
  128. });
  129. }
  130. </script>
  131. </body>
  132. </html>