123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- {Template header}
- <body>
- <div class="warp">
- <div class="title winnone">退单信息 - 添加</div>
- <ul class="setting">
- <li class="length remark">
- <em>收货地址:</em>
- <div class="checkbox">
- <span class="ckrows"><label><input name="region" type="radio" value="1"><font>国 内</font></label></span>
- <span class="ckrows"><label><input name="region" type="radio" value="2"><font>美国店</font></label></span>
- </div>
- </li>
- <li>
- <em>店铺:</em>
- <select name="shop" class="select class">
- {loop usershop() as $val}
- <option value="{$val['id']}">{$val['shopname']}</option>
- {/loop}
- <option value="0">不确定</option>
- </select>
- </li>
- <li>
- <em>退件物流方式:</em>
- <select name="express" class="select class">
- <option value="">请选择</option>
- <option value="USPS">USPS</option>
- <option value="UPS">UPS</option>
- <option value="Fedex">Fedex</option>
- <option value="DHL">DHL</option>
- <option value="Royal Mail">Royal Mail</option>
- <option value="Canada Post">Canada Post</option>
- <option value="France Post">France Post</option>
- <option value="Germany Post">Germany Post</option>
- <option value="Australia Post">Australia Post</option>
- <option value="TNT">TNT</option>
- <option value="邮政">邮政</option>
- <option value="其它">其它</option>
- </select>
- </li>
- <li>
- <em>订单编号:</em>
- <input value="" name="number" type="text" placeholder="国内填写" >
- </li>
- <li>
- <span onclick="getInfo()" style="width: 260px;height: 30px;line-height: 30px;background: #2084db;text-align: center;color: #fff;
- border-radius: 5px;display: inline-block;cursor: pointer;">一键加入 订单号/客户姓名/仓库品名</span>
- </li>
- <li>
- <em>网站订单号:</em>
- <input value="" name="orderinfo" type="text" placeholder="国内填写" >
- </li>
- <li>
- <em>客户姓名:</em>
- <input value="" name="name" type="text" placeholder="国内填写" >
- </li>
- <li>
- <em>退回运单号:</em>
- <input value="" name="torderinfo" type="text" placeholder="国内或美国仓填写" >
- </li>
- <li>
- <em>发货日期:</em>
- <input value="" onClick="laydate({istime: true,format:'YYYY-MM-DD'})" name="ftime" type="text" placeholder="国内填写" >
- </li>
- <li>
- <em>收到日期:</em>
- <input value="" onClick="laydate({istime: true,format:'YYYY-MM-DD'})" name="stime" type="text" >
- </li>
- <li class="length remark">
- <em>应退回货物:</em>
- <textarea class="textarea" name="goods" style="height:55px;" placeholder="国内填写"></textarea>
- </li>
- <li class="length remark">
- <em>实际收到货物:</em>
- <textarea class="textarea" name="received" style="height:55px;" placeholder="美国仓填写"></textarea>
- </li>
- <li>
- <em>退货登记编码:</em>
- <input value="" name="ret_regist_no" type="text">
- </li>
- <li>
- <em>退货箱号:</em>
- <input value="" name="xh" type="text">
- </li>
- <li class="remark length">
- <em>选择产品数量:</em>
- <select name="sl" class="select class">
- <option value="0">请选择</option>
- <option value="1">1个</option>
- <option value="2">2个</option>
- <option value="3">3个</option>
- </select>
- </li>
- <!--<li>-->
- <!--<em>退货箱号:</em>-->
- <!--<input value="" name="xh" type="text">-->
- <!--</li>-->
- <div class="dxh">
- </div>
- <li class="length scimg">
- <span class="upimg"></span>
- <font>+</font>
- </li>
- <div style="clear:both;"></div>
- </ul>
- <div class="button"><font class="datasavezy">提 交</font> <font class="fh">关 闭</font></div>
- </div>
- <div style="display:none;">
- <input id="upload-file" name="files" accept="image/xls,image/xlsx" type="file">
- </div>
- <script>
- var scwd = "/fullorderexcel/scwd";
- var addedit="/returns/add/";
- $(document).ready(function() {
- $("select[name='sl']").change(function() {
- var t = $(this).find("option:selected").val();
- var f = 0;
- $(".dxh .xntj").each(function() {
- f = f + 1;
- });
- //$(".dxh").html("");
- if(t > f)
- {
- for(i=0;i<t-f;i++)
- {
- $(".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>');
- }
- }
- else if (t < f)
- {
- for(i=0;i<f-t+1;i++)
- {
- $(".dxh .xntj:eq("+(f-i)+")").remove();
- }
- }
- });
- $("select[name='sl']").change();
- var button = $(".scimg font"), interval;
- var fileType = "pic", fileNum = "one";
- new AjaxUpload(button, {
- action: "/img/",
- name: "userfile",
- onSubmit: function(file, ext) {
- if (fileType == "pic") {
- if (ext && /^(jpg|png|jpeg|gif)$/.test(ext)) {
- this.setData({
- info: "文件类型为图片"
- });
- }
- else if (ext && /^(3gp|rmvb|flv|wmv|avi|mkv|mp4|mp3|wav)$/.test(ext)) {
- this.setData({
- info: "文件类型为视频"
- });
- } else {
- alert("提示:您上传的是非图片类型!");
- return false;
- }
- }
- $(".scimg font").hide();
- $(".loadimg").show();
- layx.load('loadId','上传中');
- if (fileNum == "one") {
- this.disable();
- }
- },
- onComplete: function(file, response) {
- eval("var obj=" + response);
- if (obj.ok) {
- layx.destroy('loadId');
- if (/^(.jpg|.png|.jpeg|.gif)$/.test(obj.lx)) {
- $(".scimg span").append('<img src="' + obj.filename + '" title="点击图片删除">');
- }
- else if (/^(.3gp|.rmvb|.flv|.wmv|.avi|.mkv|.mp4|.mp3|.wav)$/.test(obj.lx)) {
- $(".scimg span").append('<video src="' + obj.filename + '" controls="controls"></video>');
- }
- } else {
- layx.destroy('loadId');
- $(".ts p").html("上传失败,请重试");
- $(".ts").fadeIn();
- setTimeout('$(".ts").fadeOut()', 800);
- }
- $(".loadimg").hide();
- $(".scimg font").show();
- window.clearInterval(interval);
- this.enable();
- }
- });
- });
- $(".datasavezy").click(function() {
- $(".ts p").html("<i class='fa fa-2x fa-cog fa-spin'></i> 正在添加中,请稍后...");
- $(".ts").show();
- var f = "";
- var e = "";
- var x = '';
- $(".select").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
- });
- $("input:text").each(function() {
- var str = $(this).val().replace(/\+/g,"%2B");
- var str = str.replace(/&/g,"%26");
- f = f + $(this).attr("name") + "=" + str + "&";
- });
- $("input:password").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- $("input:hidden").each(function() {
- f = f + $(this).attr("name") + "=" + $(this).val() + "&";
- });
- $("textarea").each(function() {
- var str2 = $(this).val().replace(/\+/g,"%2B");
- var str2 = str2.replace(/&/g,"%26");
- f = f + $(this).attr("name") + "=" + str2 + "&";
- });
- if($(".scimg img").length > 0 || $(".scimg video").length > 0)
- {
- var a = '';
- for (var b = 0; b < $(".scimg .upimg img").length; b++)
- {
- a = a + $(".scimg .upimg img")[b].src + "|";
- }
- for (var b = 0; b < $(".scimg .upimg video").length; b++)
- {
- a = a + $('.scimg .upimg video')[b].src + "|";
- }
- f = f + "img=" + a + "&";
- }
- for(i=0;i<$(".checkbox").length;i++)
- {
- var checkid = ""; var checkname = "";
- $(".checkbox:eq("+i+") .ckrows input:checked").each(function(){
- checkname = $(this).attr("name");
- checkid = checkid + $(this).val()+",";
- });
- if(checkname == "")
- {
- $(".ts p").text($(".checkbox:eq("+i+")").prevAll("em").text()+"为必填项");
- $(".ts").show();
- setTimeout('$(".ts").fadeOut()', 600);
- return false;
- }
- f = f + checkname + "=" + checkid + "&";
-
- }
-
-
- $(".dxh .xntj").each(function() {
- var str2 = $(this).find("textarea").val().replace(/\+/g,"%2B");
- var str2 = str2.replace(/&/g,"%26");
- x = x + $(this).find(".checkboxfbt .ckrows input:checked").val()+ "~" + str2 + "|";
- });
- f = f + "degreetext="+x+"&";
-
- var ab = 0;
- $(".must").each(function() {
- if ($.trim($(this).val()).length == 0) {
- $(this).css("border", "1px solid #F66");
- ab = ab + 1;
- }
- });
- if (ab > 0) {
- $(".ts p").text("红框为必填项");
- $(".ts").show();
- setTimeout('$(".ts").fadeOut()', 600);
- return false;
- }
- $.ajax({
- url: addedit,
- data: f,
- type: "POST",
- dataType: "json",
- success: function(a) {
- if (a && a.success) {
- $(".ts").hide();
- $(".express p:eq(0)").html(a.msg+"是否关闭?");
- $(".express p:eq(1)").html("<font class='fh'>确 定</font><font class='esc'>取 消</font>");
- $(".express").show();
- } else {
- $(".ts").hide();
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
- setTimeout('$(".ts").fadeOut()', 800);
- }
- }
- });
- });
- $(document).on("click", ".scimg .upimg img", function() {
- $(this).remove();
- });
- $(document).on("click", ".scimg .upimg video", function() {
- $(this).remove();
- });
- function getInfo(){
- let order_no = $("input[name='number']").val()
- if(!order_no){
- $(".ts").hide();
- $(".ts p").html("请输入订单编号");
- $(".ts").fadeIn();
- setTimeout('$(".ts").fadeOut()', 1000);
- return ;
- }
- $.ajax({
- url: "/orderinfo/get_info/"+order_no,
- type: "get",
- dataType: "json",
- success: function(a) {
- if (a.code == 1) {
- let info = a.data
- $("input[name='orderinfo']").val(info.orderinfo)
- $("input[name='name']").val(info.client)
- $("input[name='name']").val(info.client)
- $("textarea[name='goods']").val(info.shipremarks)
- } else {
- $(".ts").hide();
- $(".ts p").html(a.msg);
- $(".ts").fadeIn();
- setTimeout('$(".ts").fadeOut()', 800);
- }
- }
- });
- }
- </script>
- <script type="text/javascript" src="{$theme}js/ajaxupload.3.5.js"></script>
- <script type="text/javascript" src="{$theme}js/laydate.js"></script>
- {Template footer}
|