returns_add.html 11 KB

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