list.html
7.5 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
</head>
<body class="easyui-layout">
<input type="hidden" id="buyerOrderCode">
<input type="skup" id="skup">
<div region="north" style="height:180px;">
<script>
document.write(addHead('打款管理', '列表管理'));
</script>
<div style="padding:20px;">
<label>订单编号:</label>
<input id="orderCode" type="text" class="easyui-textbox" style="width:150px">
<label>UID:</label>
<input id="uid" type="text" class="easyui-textbox" style="width:150px"/>
<label>手机号:</label>
<input id="mobile" type="text" class="easyui-textbox" style="width:150px"/>
<label>订单状态:</label>
<select id="status" class="easyui-combobox" style="width:100px;" >
<option value="">全部状态</option>
<option value="100">打款成功</option>
<option value="999">打款失败</option>
</select>
<a id="searchBtn" class="btn-info">查询</a>
<!--<a id="allBtn" class="btn-success">全部</a>-->
</div>
</div>
<div id="tradeBillsList" region="center">
<table id="tradeBillsListTable"></table>
</div>
<div id="refundConfirmDialog" class="easyui-dialog" style="width:400px;height:300px;"
data-options="title:'人工打款确认',buttons:'#refundConfirmDialog_tb',modal:true,closed:true">
<div style="padding:20px;">
<input id="refund_tradeBillsId" type="hidden" readonly disabled/>
<input id="refund_uid" type="hidden" readonly disabled/>
<label>订 单 编 号:</label>
<input id="refund_orderCode" type="text" class="easyui-textbox" style="width:250px" readonly disabled/>
<br/><br/>
<label>支付宝账号:</label>
<input id="refund_alipayAccount" type="text" class="easyui-textbox" style="width:250px" readonly disabled/>
<br/><br/>
<label>打 款 金 额:</label>
<input id="refund_amount" type="text" class="easyui-textbox" style="width:250px" readonly disabled/>
</div>
</div>
<div id="refundConfirmDialog_tb">
<a href="#" id="refundConfirmDialog_btn_save" onclick="refundGo();" class="easyui-linkbutton btn-danger" >确定</a>
<a href="#" id="refundConfirmDialog_btn_close" onclick="$('#refundConfirmDialog').dialog('close');" class="easyui-linkbutton btn-info" >关闭</a>
</div>
<script>
$(function() {
$("#status").combobox({
panelHeight:'auto',
multiple:false,
});
$("#searchBtn").linkbutton({
iconCls : "icon-search",
onClick : function() {
/*if(!$("#orderCode").val()
&& !$("#uid").val()
&& !$("#mobile").val()){
$.messager.alert("提示","请录入查询条件<br/>[订单编号、UID、手机号]至少选择一个!");
$("#orderCode").focus();
return;
}*/
loadTradeBillsData();
}
});
getTradeBillsList();
});
function loadTradeBillsData() {
$("#tradeBillsListTable").datagrid("load", {
status : $("#status").myCombobox("getValue"),
orderCode : $("#orderCode").val(),
uid : $("#uid").val(),
mobile : $("#mobile").val()
});
}
function getTradeBillsList(){
$("#tradeBillsListTable").myDatagrid({
fit: true,
fitColumns: true,
striped: true,
url: contextPath + "/tradeBills/queryTradeBillsList",
method: 'POST',
queryParams: {},
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp=null==temp?[]:temp;
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "订单编号",
field: "orderCode",
width: 30,
align: "center"
},{
title: "打款金额",
field: "amount",
width: 30,
align: "center"
},{
title: "用户uid",
field: "uid",
width: 30,
align: "center"
},{
title: "用户手机号",
field: "mobile",
width: 30,
align: "center"
} ,{
title: "打款时间",
field: "createTimeStr",
width: 20,
align: "center"
},{
title: "操作员",
field: "operatorName",
width: 20,
align: "center"
},{
title: "订单状态",
field: "tradeStatus",
width: 20,
align: "center",
formatter: function (value, rowData, rowIndex) {
if (value == 100) {
return "打款成功";
}else {
return "<span style='color: red'>打款失败</span>";
}
}
}, {
title: "原因",
field: "tradeStatusDesc",
width: 20,
align: "center"
}, {
title: "操作",
field: "asdf",
width: 40,
align: "center",
formatter: function (value, rowData, rowIndex) {
if (rowData.tradeStatus != 100) {
var btn= "<a role='refundsConfirm' onclick='openConfirmDialog(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\")' style='margin-left:10px;background-color: #5cb85c !important;'>打款</a>";
btn = btn.replace("%s",rowData.id);
btn = btn.replace("%s",rowData.uid);
btn = btn.replace("%s",rowData.orderCode);
btn = btn.replace("%s",rowData.alipayAccount);
btn = btn.replace("%s",rowData.amount);
return btn;
}
}
}]],
cache: false,
pagination: true,
//pageSize: 20,
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
$(this).datagrid("getPanel").find("a[role='refundsConfirm']").linkbutton({});
}
});
}
function openConfirmDialog(id,uid,orderCode,alipayAccount,amount) {
//重新赋值
$("#refund_tradeBillsId").val(id);
$("#refund_uid").val(uid);
$("#refund_orderCode").textbox('setValue',orderCode);
$("#refund_alipayAccount").textbox('setValue',alipayAccount);
$("#refund_amount").textbox('setValue',amount);
$("#refundConfirmDialog").dialog('open');
}
//确认打款
function refundGo() {
var param={};
param.tradeBillsId = $("#refund_tradeBillsId").val();
param.uid=$("#refund_uid").val();
param.orderCode=$("#refund_orderCode").val();
param.alipayAccount=$("#refund_alipayAccount").val();
param.amount=$("#refund_amount").val();
//发送请求
$.ajax({
type: "POST",
url: contextPath + '/tradeBills/manualRefund',
data: param,
async: false,
cache: false,
dataType: 'json',
success: function (result) {
if(result.code == 200) {
$("#refundConfirmDialog").dialog('close');
loadTradeBillsData();
}
else {
$.messager.alert("失败", result.message, "error");
$("#refundConfirmDialog").dialog('close');
loadTradeBillsData();
}
}
});
//按钮置灰
$("#refundConfirmDialog_btn_save").linkbutton("disabled");
$("#refundConfirmDialog_btn_close").linkbutton("disabled");
}
</script>
</body>
</html>