returns_edit.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. {Template header}
  2. <body>
  3. <div class="warp">
  4. <div class="title winnone">退单信息 - 补充</div>
  5. <ul class="setting">
  6. <li class="length remark">
  7. <em>收货地址:</em>
  8. <div class="checkbox">
  9. <span class="ckrows"><label><input name="region" type="radio" value="1" {if $returns['region'] == '1'}checked{/if}><font>国 内</font></label></span>
  10. <span class="ckrows"><label><input name="region" type="radio" value="2" {if $returns['region'] == '2'}checked{/if}><font>美国店</font></label></span>
  11. </div>
  12. </li>
  13. <li>
  14. <em>店铺:</em>
  15. <select name="shop" class="select class">
  16. {loop usershop() as $val}
  17. <option value="{$val['id']}" {if $returns['shop'] == $val['id']}selected="selected"{/if}>{$val['shopname']}</option>
  18. {/loop}
  19. <option value="0" {if $returns['shop'] == 0}selected="selected"{/if}>不确定</option>
  20. </select>
  21. </li>
  22. <li>
  23. <em>退件物流方式:</em>
  24. <select name="express" class="select class">
  25. <option value="" {if $returns['express'] == ''}selected="selected"{/if}>请选择</option>
  26. <option value="USPS" {if $returns['express'] == 'USPS'}selected="selected"{/if}>USPS</option>
  27. <option value="UPS" {if $returns['express'] == 'UPS'}selected="selected"{/if}>UPS</option>
  28. <option value="Fedex" {if $returns['express'] == 'Fedex'}selected="selected"{/if}>Fedex</option>
  29. <option value="DHL" {if $returns['express'] == 'DHL'}selected="selected"{/if}>DHL</option>
  30. <option value="Royal Mail" {if $returns['express'] == 'Royal Mail'}selected="selected"{/if}>Royal Mail</option>
  31. <option value="Canada Post" {if $returns['express'] == 'Canada Post'}selected="selected"{/if}>Canada Post</option>
  32. <option value="France Post" {if $returns['express'] == 'France Post'}selected="selected"{/if}>France Post</option>
  33. <option value="Germany Post" {if $returns['express'] == 'Germany Post'}selected="selected"{/if}>Germany Post</option>
  34. <option value="Australia Post" {if $returns['express'] == 'Australia Post'}selected="selected"{/if}>Australia Post</option>
  35. <option value="TNT" {if $returns['express'] == 'TNT'}selected="selected"{/if}>TNT</option>
  36. <option value="邮政" {if $returns['express'] == '邮政'}selected="selected"{/if}>邮政</option>
  37. <option value="其它" {if $returns['express'] == '其它'}selected="selected"{/if}>其它</option>
  38. </select>
  39. </li>
  40. <li>
  41. <em>订单编号:</em>
  42. <input value="{$returns['number']}" name="number" type="text" placeholder="国内填写" >
  43. </li>
  44. <li>
  45. <em>网站订单号:</em>
  46. <input value="{$returns['orderinfo']}" name="orderinfo" type="text" placeholder="国内填写" >
  47. </li>
  48. <li>
  49. <em>客户姓名:</em>
  50. <input value="{$returns['name']}" name="name" type="text" placeholder="国内填写" >
  51. </li>
  52. <li>
  53. <em>退回运单号:</em>
  54. <input value="{$returns['torderinfo']}" name="torderinfo" type="text" placeholder="国内或美国仓填写" >
  55. </li>
  56. <li>
  57. <em>发货日期:</em>
  58. <input value="{$returns['ftime']!=0?date('Y-m-d',$returns['ftime']):''}" onClick="laydate({istime: true,format:'YYYY-MM-DD'})" name="ftime" type="text" placeholder="国内填写" >
  59. </li>
  60. <li>
  61. <em>收到日期:</em>
  62. <input value="{$returns['stime']!=0?date('Y-m-d',$returns['stime']):''}" onClick="laydate({istime: true,format:'YYYY-MM-DD'})" name="stime" type="text" >
  63. </li>
  64. <li class="length remark">
  65. <em>应退回货物:</em>
  66. <textarea name="goods" style="height:55px;" placeholder="国内填写">{$returns['goods']}</textarea>
  67. </li>
  68. <li class="length remark">
  69. <em>实际收到货物:</em>
  70. <textarea name="received" style="height:55px;" placeholder="美国仓填写">{$returns['received']}</textarea>
  71. </li>
  72. <li>
  73. <em>退货登记编码:</em>
  74. <input value="{$returns['ret_regist_no']}" name="ret_regist_no" type="text">
  75. </li>
  76. <li>
  77. <em>退货箱号:</em>
  78. <input value="{$returns['xh']}" name="xh" type="text">
  79. </li>
  80. <li class="remark length">
  81. <em>选择产品数量:</em>
  82. <select name="sl" class="select class">
  83. <option value="0" {if $returns['sl'] == 0}selected="selected"{/if}>请选择</option>
  84. <option value="1" {if $returns['sl'] == 1}selected="selected"{/if}>1个</option>
  85. <option value="2" {if $returns['sl'] == 2}selected="selected"{/if}>2个</option>
  86. <option value="3" {if $returns['sl'] == 3}selected="selected"{/if}>3个</option>
  87. </select>
  88. </li>
  89. <div class="dxh">
  90. {$returns['degreetext']}
  91. </div>
  92. <li class="length scimg">
  93. <span class="upimg">{$returns['img']}</span>
  94. <font>+</font>
  95. </li>
  96. <div style="clear:both;"></div>
  97. </ul>
  98. <input type="hidden" name="id" value="{$returns['id']}" />
  99. <div class="button"><font class="datasavezy">提 交</font> <font class="fh">关 闭</font></div>
  100. </div>
  101. <div style="display:none;">
  102. <input id="upload-file" name="files" accept="image/xls,image/xlsx" type="file">
  103. </div>
  104. <script>var addedit="/returns/edit/";
  105. var scwd = "/fullorderexcel/scwd";
  106. $(document).ready(function() {
  107. $("select[name='sl']").change(function() {
  108. var t = $(this).find("option:selected").val();
  109. var f = 0;
  110. $(".dxh .xntj").each(function() {
  111. f = f + 1;
  112. });
  113. //$(".dxh").html("");
  114. if(t > f)
  115. {
  116. for(i=0;i<t-f;i++)
  117. {
  118. $(".dxh").append('<div class="xntj"><li class="length remark"><em>完好程度-'+(f+i+1)+':</em><div class="checkboxfbt"><span class="ckrows"><label><input name="degree'+(f+i+1)+'" type="radio" value="1"><font>可 用</font></label></span><span class="ckrows"><label><input name="degree'+(f+i+1)+'" type="radio" value="2"><font>精打理</font></label></span><span class="ckrows"><label><input name="degree'+(f+i+1)+'" type="radio" value="3"><font>不可用</font></label></span><span class="ckrows"><label><input name="degree'+(f+i+1)+'" type="radio" value="4"><font>其 它</font></label></span></div></li><li class="length remark"><em>完好程度补充-'+(f+i+1)+':</em><textarea name="degreetext" style="height:55px;" placeholder="美国仓填写"></textarea></li></div>');
  119. }
  120. }
  121. else if (t < f)
  122. {
  123. for(i=0;i<f-t+1;i++)
  124. {
  125. $(".dxh .xntj:eq("+(f-i)+")").remove();
  126. }
  127. }
  128. });
  129. var d= {$returns["degree"]};
  130. $.each(d, function(j, v) {
  131. $(".dxh .xntj:eq("+j+") .checkboxfbt input:eq("+(v-1)+")").attr("checked","checked");
  132. });
  133. var button = $(".scimg font"), interval;
  134. var fileType = "pic", fileNum = "one";
  135. new AjaxUpload(button, {
  136. action: "/img/",
  137. name: "userfile",
  138. onSubmit: function(file, ext) {
  139. if (fileType == "pic") {
  140. if (ext && /^(jpg|png|jpeg|gif)$/.test(ext)) {
  141. this.setData({
  142. info: "文件类型为图片"
  143. });
  144. }
  145. else if (ext && /^(3gp|rmvb|flv|wmv|avi|mkv|mp4|mp3|wav)$/.test(ext)) {
  146. this.setData({
  147. info: "文件类型为视频"
  148. });
  149. } else {
  150. alert("提示:您上传的是非图片或视频类型!");
  151. return false;
  152. }
  153. }
  154. $(".scimg font").hide();
  155. $(".loadimg").show();
  156. layx.load('loadId','上传中');
  157. if (fileNum == "one") {
  158. this.disable();
  159. }
  160. },
  161. onComplete: function(file, response) {
  162. eval("var obj=" + response);
  163. if (obj.ok) {
  164. layx.destroy('loadId');
  165. if (/^(.jpg|.png|.jpeg|.gif)$/.test(obj.lx)) {
  166. $(".scimg span").append('<img src="' + obj.filename + '" title="点击图片删除">');
  167. }
  168. else if (/^(.3gp|.rmvb|.flv|.wmv|.avi|.mkv|.mp4|.mp3|.wav)$/.test(obj.lx)) {
  169. $(".scimg span").append('<video src="' + obj.filename + '" controls="controls"></video>');
  170. }
  171. } else {
  172. layx.destroy('loadId');
  173. $(".ts p").html("上传失败,请重试");
  174. $(".ts").fadeIn();
  175. setTimeout('$(".ts").fadeOut()', 800);
  176. }
  177. $(".loadimg").hide();
  178. $(".scimg font").show();
  179. window.clearInterval(interval);
  180. this.enable();
  181. }
  182. });
  183. });
  184. $(".datasavezy").click(function() {
  185. $(".ts p").html("<i class='fa fa-2x fa-cog fa-spin'></i> &nbsp; 正在添加中,请稍后...");
  186. $(".ts").show();
  187. var f = "";
  188. var e = "";
  189. var x = '';
  190. $(".select").each(function() {
  191. f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
  192. });
  193. $("input:text").each(function() {
  194. var str = $(this).val().replace(/\+/g,"%2B");
  195. var str = str.replace(/&/g,"%26");
  196. f = f + $(this).attr("name") + "=" + str + "&";
  197. });
  198. $("input:password").each(function() {
  199. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  200. });
  201. $("input:hidden").each(function() {
  202. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  203. });
  204. $("textarea").each(function() {
  205. var str2 = $(this).val().replace(/\+/g,"%2B");
  206. var str2 = str2.replace(/&/g,"%26");
  207. f = f + $(this).attr("name") + "=" + str2 + "&";
  208. });
  209. if($(".scimg img").length > 0 || $(".scimg video").length > 0)
  210. {
  211. var a = '';
  212. for (var b = 0; b < $(".scimg .upimg img").length; b++)
  213. {
  214. a = a + $(".scimg .upimg img")[b].src + "|";
  215. }
  216. for (var b = 0; b < $(".scimg .upimg video").length; b++)
  217. {
  218. a = a + $('.scimg .upimg video')[b].src + "|";
  219. }
  220. f = f + "img=" + a + "&";
  221. }
  222. for(i=0;i<$(".checkbox").length;i++)
  223. {
  224. var checkid = ""; var checkname = "";
  225. $(".checkbox:eq("+i+") .ckrows input:checked").each(function(){
  226. checkname = $(this).attr("name");
  227. checkid = checkid + $(this).val()+",";
  228. });
  229. if(checkname == "")
  230. {
  231. $(".ts p").text($(".checkbox:eq("+i+")").prevAll("em").text()+"为必填项");
  232. $(".ts").show();
  233. setTimeout('$(".ts").fadeOut()', 600);
  234. return false;
  235. }
  236. f = f + checkname + "=" + checkid + "&";
  237. }
  238. $(".dxh .xntj").each(function() {
  239. var str2 = $(this).find("textarea").val().replace(/\+/g,"%2B");
  240. var str2 = str2.replace(/&/g,"%26");
  241. x = x + $(this).find(".checkboxfbt .ckrows input:checked").val()+ "~" + str2 + "|";
  242. });
  243. f = f + "degreetext="+x+"&";
  244. var ab = 0;
  245. $(".must").each(function() {
  246. if ($.trim($(this).val()).length == 0) {
  247. $(this).css("border", "1px solid #F66");
  248. ab = ab + 1;
  249. }
  250. });
  251. if (ab > 0) {
  252. $(".ts p").text("红框为必填项");
  253. $(".ts").show();
  254. setTimeout('$(".ts").fadeOut()', 600);
  255. return false;
  256. }
  257. $.ajax({
  258. url: addedit,
  259. data: f,
  260. type: "POST",
  261. dataType: "json",
  262. success: function(a) {
  263. if (a && a.success) {
  264. $(".ts").hide();
  265. $(".express p:eq(0)").html(a.msg+"是否关闭?");
  266. $(".express p:eq(1)").html("<font class='fh'>确 定</font><font class='esc'>取 消</font>");
  267. $(".express").show();
  268. } else {
  269. $(".ts").hide();
  270. $(".ts p").html(a.msg);
  271. $(".ts").fadeIn();
  272. setTimeout('$(".ts").fadeOut()', 800);
  273. }
  274. }
  275. });
  276. });
  277. $(document).on("click", ".scimg .upimg .deldata em", function() {
  278. $(this).parent(".deldata").remove();
  279. });
  280. $(document).on("click", ".scimg .upimg .deldata em", function() {
  281. $(this).parent(".deldata").remove();
  282. });
  283. </script>
  284. <script type="text/javascript" src="{$theme}js/ajaxupload.3.5.js"></script>
  285. <script type="text/javascript" src="{$theme}js/laydate.js"></script>
  286. {Template footer}