reject.html 3.45 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <title>main</title>
    <script src="/ufoPlatform/js/include.js"></script>
</head>
<body class="easyui-layout" fit="true">

<div id="rejectDiv" region="center">
    <table id="rejectTable" border="1px" cellpadding="1" cellspacing="0" align="center"
           style="margin-top: 30px; line-height: 30px;width:95%;border-color: #999999">
       <tr>
           <td>商品寄回地址:</td>
           <td colspan="2" >
               <input type="hidden" id="sendBackInfo_mobile">
               <span id="sendBackInfo"></span>
           </td>
       </tr>
       <tr>
           <td>快递公司:</td>
           <td colspan="2">
               <input id="expressCompany"  class="easyui-combobox"  disabled="disabled" readonly/>
           </td>
       </tr>
       <tr>
           <td>快递单号:</td>
           <td colspan="2">
               <input type="text" class="easyui-textbox" id="waybillCode"  style="width:300px"/>
           </td>
       </tr>
    </table>

</div>
<script>
    $(function () {
        //根据skup获取卖家收货信息
        getSendBackInfo();        
    	
    	// 快递公司下拉框
		initExpressCompanyDropdown();

		if($("#waybillCode").next()&&$("#waybillCode").next().children()){
            $("#waybillCode").next().children()[0].focus();
        }
    });
    
    function getSendBackInfo(){
    	var form = new FormData();
	    form.append("skup", document.getElementById("skup").value);
        //发送请求
		$.ajax({
		     type: "POST",
             url: contextPath + '/buyerOrder/getSendBackInfoBySkup',
             data: form,
             async: false,
             cache: false,
             contentType: false,
             processData: false,
             dataType: 'json',
             success: function (result) {
                 if(result.code == 200) {
                	 var name = result.data.receiveName;
                	 var mobile = result.data.receiveMobile;
                	 var address = result.data.receiveAddress;

                	 $("#sendBackInfo_mobile").val(mobile);
                	 $("#sendBackInfo").html("姓名:" + name + "<br>" + "手机号:" + mobile + "<br>" + "地址:" + address + "&nbsp;<button id='rejectAddressCopy'>复制</button>");

                     new ClipboardJS('#rejectAddressCopy', {
                         text: function() {
                             return name + '\r\n' + mobile + '\r\n' +  address.replace(/ /g, '');
                         }
                     });
                 }
                 else {
                     $.messager.alert("失败", result.message, "error");
                 }
             }
         });           
    }
    
    function initExpressCompanyDropdown() {
    	$.ajax({                              
            contentType: "application/json",
            dataType: "json",
            type: "POST",
            url: contextPath + '/buyerOrder/queryExpressCompanyList',
            data: {},
            success: function (data) {
                if (data.code != 200 || !data.data || data.data.length == 0) {
                    return;
                }
                $("#expressCompany").combobox({
                    width: 130,
                    data: data.data,
                    valueField: "id",
                    textField: "companyName"
                });
                $("#expressCompany").combobox("setValue",data.data[0].id);
            }
        });
    }
    
</script>
</body>
</html>