Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

order_send.htm 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="overflow-x: hidden;padding: 0;min-width: 674px;background: #fff;">
  3. <style type="text/css">
  4. .ncap-form-default dd.opt { width: 79%; }
  5. .select-express {border: 1px solid red !important; color: red !important;}
  6. </style>
  7. <div id="append_parent"></div>
  8. <div id="ajaxwaitid"></div>
  9. <div class="page" style="width: 664px;margin: 0 auto;">
  10. <div class="flexigrid">
  11. <form class="form-horizontal" id="postForm" action="{:url('Shop/order_send_operating', ['_ajax'=>1])}" method="post">
  12. <input type="hidden" name="order_id" value="{$OrderData.order_id}">
  13. <input type="hidden" name="order_code" value="{$OrderData.order_code}">
  14. <input type="hidden" name="users_id" value="{$OrderData.users_id}">
  15. <input type="hidden" name="consignee" value="{$OrderData.consignee}">
  16. <input type="hidden" name="express_id" id="express_id">
  17. <input type="hidden" name="express_name" id="express_name">
  18. <input type="hidden" name="express_code" id="express_code">
  19. <div class="ncap-form-default">
  20. {eq name="$OrderData.prom_type" value="0"}
  21. <dl class="row">
  22. <dt class="tit"> <label>收货人</label> </dt> <dd class="opt"> {$OrderData.consignee} </dd>
  23. </dl>
  24. <dl class="row">
  25. <dt class="tit"> <label>联系方式</label> </dt> <dd class="opt"> {$OrderData.mobile} </dd>
  26. </dl>
  27. <dl class="row">
  28. <dt class="tit"> <label>收货地址</label> </dt>
  29. <dd class="opt">
  30. {$OrderData.country} {$OrderData.province} {$OrderData.city} {$OrderData.district} {$OrderData.address}
  31. </dd>
  32. </dl>
  33. <dl class="row">
  34. <dt class="tit"> <label>发货方式</label> </dt>
  35. <dd class="opt" style="line-height: 30px;">
  36. <label>
  37. <input type="radio" name="prom_type" value="0" {eq name="$OrderData.prom_type" value="0"}checked="checked"{/eq}>录入物流单号
  38. </label>
  39. &nbsp;&nbsp;&nbsp;
  40. <label>
  41. <input type="radio" name="prom_type" value="1" {eq name="$OrderData.prom_type" value="1"}checked="checked"{/eq}>无需物流
  42. </label>
  43. </dd>
  44. </dl>
  45. {else/}
  46. <input type="hidden" name="prom_type" value="1">
  47. {/eq}
  48. <div class="{eq name='$OrderData.prom_type' value='1'}none{/eq}" id="ShippingInfo">
  49. <dl class="row">
  50. <dt class="tit"> <label><em>*</em>快递公司</label> </dt>
  51. <dd class="opt">
  52. <select id="select_express" style="width: 300px;" onchange="SelectExpress(this);">
  53. <option value="0">请选择</option>
  54. {volist name="$express" id="vo"}
  55. <option value="{$vo.express_id}" code="{$vo.express_code}" name="{$vo.express_name}" {eq name="$vo.express_code" value="$OrderData.express_code"}selected{/eq}>{$vo.express_name}</option>
  56. {/volist}
  57. </select>
  58. <div class="express-tag">
  59. {volist name="$express" id="vo"}
  60. {if condition='$i <= 4'}
  61. <span class="span_all span_{$vo.express_id} {eq name='$vo.express_code' value='$OrderData.express_code'} select-express {/eq}" data-id="{$vo.express_id}" data-code="{$vo.express_code}" data-name="{$vo.express_name}" data-i="{$i}" onclick="SpanSelectExpress(this);">{$vo.express_name}</span>
  62. {/if}
  63. {/volist}
  64. </div>
  65. </dd>
  66. </dl>
  67. <dl class="row">
  68. <dt class="tit"> <label>快递费用</label> </dt> <dd class="opt"> ¥{$OrderData.shipping_fee} </dd>
  69. </dl>
  70. <dl class="row">
  71. <dt class="tit"> <label><em>*</em>快递单号</label> </dt>
  72. <dd class="opt">
  73. <input type="text" value="{$OrderData.express_order}" name="express_order" id="express_order" class="input-txt">
  74. </dd>
  75. </dl>
  76. </div>
  77. <div class="{if condition='$OrderData.prom_type == 0 && $OrderData.prom_type_virtual == false'}none{/if}" id="VirtualDelivery">
  78. <dl class="row">
  79. <dt class="tit"> <label>给买家回复</label> </dt>
  80. <dd class="opt">
  81. <textarea rows="5" cols="60" name="virtual_delivery" style="height:60px;">{$OrderData.virtual_delivery}</textarea>
  82. </dd>
  83. </dl>
  84. </div>
  85. </div>
  86. <div class="ncap-form-default">
  87. <div class="bot" style="padding-bottom:0px;">
  88. <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">
  89. {eq name="$OrderData['order_status']" value='1'}
  90. 确认发货
  91. {/eq}
  92. {eq name="$OrderData['order_status']" value='2'}
  93. 修改保存
  94. {/eq}
  95. </a>
  96. </div>
  97. </div>
  98. </form>
  99. </div>
  100. </div>
  101. <script type="text/javascript">
  102. $(document).ready(function(){
  103. // 表格行点击选中切换
  104. $('#flexigrid > table>tbody >tr').click(function(){
  105. $(this).toggleClass('trSelected');
  106. });
  107. // 发货方式
  108. $('input[name="prom_type"]').click(function() {
  109. var prom_type = $(this).val();
  110. if (1 == prom_type) {
  111. $('#ShippingInfo').hide();
  112. $('#VirtualDelivery').show();
  113. } else {
  114. $('#ShippingInfo').show();
  115. $('#VirtualDelivery').hide();
  116. }
  117. });
  118. });
  119. // 下拉框选择
  120. function SelectExpress(obj) {
  121. // 选中的对象
  122. var selectObj = $(obj).find("option:selected");
  123. // 赋值隐藏域
  124. $('#express_id').val($(selectObj).attr('value'));
  125. $('#express_name').val($(selectObj).attr('name'));
  126. $('#express_code').val($(selectObj).attr('code'));
  127. // span选中效果
  128. $('.span_all').removeClass('select-express');
  129. $('.span_' + $(selectObj).attr('value')).addClass('select-express');
  130. }
  131. // span选择
  132. function SpanSelectExpress(obj) {
  133. // 赋值隐藏域
  134. $('#express_id').val($(obj).data('id'));
  135. $('#express_name').val($(obj).data('name'));
  136. $('#express_code').val($(obj).data('code'));
  137. // 下拉框选中效果
  138. var obj_i = $(obj).data('i');
  139. obj_i++;
  140. $("#select_express option:nth-child("+obj_i+")").prop("selected", 'selected');
  141. // span选中效果
  142. $('.span_all').removeClass('select-express');
  143. $('.span_' + $(obj).data('id')).addClass('select-express');
  144. }
  145. // 物流公司选择框
  146. function Express() {
  147. var url = "{:url('Shop/order_express')}";
  148. //iframe窗
  149. layer.open({
  150. type: 2,
  151. title: '选择快递',
  152. shadeClose: false,
  153. maxmin: false, //开启最大化最小化按钮
  154. area: ['60%', '80%'],
  155. content: url
  156. });
  157. }
  158. // 选中地址,关闭物流公司弹框
  159. function express(obj, express_id){
  160. var express_name = $(obj).parent().find('#express_name_'+express_id).val();
  161. var express_code = $(obj).parent().find('#express_code_'+express_id).val();
  162. $('#express_id').val(express_id);
  163. $('#express_name').val(express_name);
  164. $('#express_name_new').html(express_name);
  165. $('#express_code').val(express_code);
  166. layer.closeAll();
  167. }
  168. // 表单提交
  169. function checkForm() {
  170. // if (0 == $('input[name="prom_type"]:checked').val() && $('#express_order').val() == '') {
  171. // showErrorMsg('配送单号不能为空!');
  172. // $('#express_order').focus();
  173. // return false;
  174. // }
  175. var _parent = parent;
  176. layer.confirm('此操作不可恢复,确认发货?', {
  177. area: ['480px', '190px'],
  178. move: false,
  179. title: '提示',
  180. btnAlign:'r',
  181. closeBtn: 3,
  182. btn: ['确定', '取消'] ,//按钮
  183. success: function () {
  184. $(".layui-layer-content").css('text-align', 'left');
  185. }
  186. },function(){
  187. layer_loading('正在处理');
  188. $.ajax({
  189. type: "POST",
  190. url: $('#postForm').attr('action'),
  191. data: $('#postForm').serialize(),
  192. dataType: 'json',
  193. success: function (res) {
  194. if(res.code == 1){
  195. if (!res.data.email && !res.data.mobile && !res.data.notice) {
  196. layer.closeAll();
  197. layer.msg(res.msg, {icon: 1, time: 1000}, function(){
  198. _parent.window.location.reload();
  199. });
  200. } else {
  201. if (res.data.email) SendEmail(res.data.email);
  202. if (res.data.mobile) SendMobile(res.data.mobile);
  203. if (res.data.notice) SendNotice(res.data.notice);
  204. layer.closeAll();
  205. layer.msg('发货成功', {icon: 1, time: 1000}, function(){
  206. _parent.window.location.reload();
  207. });
  208. }
  209. } else {
  210. layer.closeAll();
  211. layer.alert(res.msg, {icon: 2, title: false, closeBtn: 0});
  212. return false;
  213. }
  214. },
  215. error:function(e){
  216. layer.closeAll();
  217. layer.alert(e.responseText, {icon: 2, title: false, closeBtn: 0});
  218. }
  219. });
  220. });
  221. }
  222. function SendEmail(result) {
  223. if (result) {
  224. $.ajax({
  225. url: result.url,
  226. data: result.data,
  227. type:'post',
  228. dataType:'json'
  229. });
  230. }
  231. }
  232. function SendMobile(result) {
  233. if (result) {
  234. $.ajax({
  235. url: result.url,
  236. data: result.data,
  237. type:'post',
  238. dataType:'json'
  239. });
  240. }
  241. }
  242. function SendNotice(result) {
  243. if (result) {
  244. $.ajax({
  245. url: result.url,
  246. data: result,
  247. type:'post',
  248. dataType:'json'
  249. });
  250. }
  251. }
  252. </script>