reject.html
3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!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 + " <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>