returns_edit.html 14 KB

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