edit_order.html
14.4 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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<include file="public/layout" />
<style type="text/css">
html, body {
overflow: visible;
}
a.btn {
background: #fff none repeat scroll 0 0;
border: 1px solid #f5f5f5;
border-radius: 4px;
color: #999;
cursor: pointer !important;
display: inline-block;
font-size: 12px;
font-weight: normal;
height: 20px;
letter-spacing: normal;
line-height: 20px;
margin: 0 5px 0 0;
padding: 1px 6px;
vertical-align: top;
}
a.red:hover {
background-color: #e84c3d;
border-color: #c1392b;
color: #fff;
}
</style>
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
<div class="fixed-bar">
<div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
<div class="subject">
<h3>修改订单</h3>
<h5>修改订单商品信息和收货人信息</h5>
</div>
</div>
</div>
<form class="form-horizontal" action="{:U('Admin/Order/edit_order')}" id="order-add" method="post">
<div class="ncap-form-default">
<dl class="row">
<dt class="tit">
<label><em></em>订单总额</label>
</dt>
<dd class="opt">
<strong>{$order.total_amount}</strong>(商品总价:{$order.goods_price} 运费:{$order.shipping_price})
<span class="err"></span>
<p class="notic">订单总额=商品总价+运费 </p>
</dd>
</dl>
<empty name="$order.exp_type">
<dl class="row">
<dt class="tit">
<label for="consignee">收货人</label>
</dt>
<dd class="opt">
<input type="text" name="consignee" id="consignee" value="{$order.consignee}" class="input-txt" placeholder="收货人名字" />
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="consignee">手机</label>
</dt>
<dd class="opt">
<input type="text" name="mobile" id="mobile" value="{$order.mobile}" class="input-txt" placeholder="收货人联系电话" />
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="consignee">地址</label>
</dt>
<dd class="opt">
<select onchange="get_city(this)" id="province" name="province" >
<option value="0">选择省份</option>
<volist name="province" id="vo">
<option value="{$vo.id}" >{$vo.name}</option>
</volist>
</select>
<select onchange="get_area(this)" id="city" name="city">
<option value="0">选择城市</option>
<volist name="city" id="vo">
<option value="{$vo.id}">{$vo.name}</option>
</volist>
</select>
<select id="district" name="district" onchange="get_twon(this)">
<option value="0">选择区域</option>
<volist name="area" id="vo">
<option value="{$vo.id}">{$vo.name}</option>
</volist>
</select>
<select id="twon" name="twon" >
<option value="0">选择街道</option>
<volist name="twon" id="vo">
<option value="{$vo.id}">{$vo.name}</option>
</volist>
</select>
<input type="text" name="address" id="address" value="{$order.address}" class="input-txt" placeholder="详细地址"/>
</dd>
</dl>
<if condition="$order.shipping_code and ($order.order_status neq 2 or $order.order_status neq 4)">
<dl class="row">
<dt class="tit">
<label for="shipping">配送物流</label>
</dt>
<dd class="opt">
<select id="shipping" name="shipping" onchange="selship(this);">
<volist name="shipping_list" id="shipping">
<option <if condition="$order[shipping_code] eq $shipping[shipping_code]">selected</if> value="{$shipping.shipping_code}" >{$shipping.shipping_name}</option>
</volist>
</select><font color="red">(注:配送物流请勿随意更改,如需更改物流配送运费最好与顾客所选配送运费一致;前提与最好与顾客进行沟通。 )</font>
</dd>
</dl>
<dl class="row">
<dt class="tit">
<label for="shipping">物流单号</label>
</dt>
<dd class="opt">
<input type="text" name="expressno" id="expressno" value="{$order.expressno}" class="input-txt" placeholder="快递单号" />
</dd>
</dl>
</if>
</empty>
<dl class="row">
<dt class="tit">
<label for="shipping">取货门店</label>
</dt>
<dd class="opt">
<select onchange="get_storage(this)" id="storage" name="storage">
<volist name="storage_category" id="vo">
<option value="{$vo.cat_id}">{$vo.cat_name}</option>
</volist>
</select>
<select id="pickup" name="pickup_id" >
<volist name="pickup_list" id="vo">
<option value="{$vo.pickup_id}">{$vo.pickup_name}</option>
</volist>
</select>
</dd>
</dl>
<!--<dl class="row">-->
<!--<dt class="tit">-->
<!--<label for="payment">支付方式</label>-->
<!--</dt>-->
<!--<dd class="opt">-->
<!--<select id="payment" name="payment" >-->
<!--<volist name="payment_list" id="payment">-->
<!--<option <if condition="$order[pay_code] eq $payment[code]">selected</if> value="{$payment.code}" >{$payment.name}</option>-->
<!--</volist>-->
<!--</select>-->
<!--</dd>-->
<!--</dl>-->
<dl class="row dn">
<dt class="tit">
<label for="invoice_title">发票抬头</label>
</dt>
<dd class="opt">
<input type="text" name="invoice_title" value="{$order.invoice_title}" class="input-txt" placeholder="发票抬头"/>
</dd>
</dl>
<dl class="row dn">
<dt class="tit">
<label for="invoice_title">添加商品</label>
</dt>
<dd class="opt">
<a href="javascript:void(0);" onclick="selectGoods()" class="ncap-btn-big ncap-btn-green" ><i class="fa fa-search"></i>添加商品</a>
</dd>
</dl>
<dl class="row dn">
<dt class="tit">
<label for="invoice_title">商品列表</label>
</dt>
<dd class="opt">
<div class="ncap-order-details">
<div class="hDivBox" id="ajax_return">
<table cellspacing="0" cellpadding="0" style="border:0px">
<thead>
<tr>
<!--<th class="sign" axis="col0">
<div><i class="ico-check"></i></div>
</th>-->
<th align="left" abbr="order_sn" axis="col3" class="w500">
<div style="text-align: left; " class="">商品名称</div>
</th>
<th align="left" abbr="consignee" axis="col4" class="w120">
<div style="text-align: left;" class="">规格</div>
</th>
<th align="left" abbr="consignee" axis="col4" class="w120">
<div style="text-align: left; " class="">价格</div>
</th>
<th align="center" abbr="article_show" axis="col5" class="w10">
<div style="text-align: center; " class="">数量</div>
</th>
<th align="center" abbr="article_time" axis="col6" class="w150">
<div style="text-align: center;" class="">操作</div>
</th>
<!--<th style="width:100%" axis="col7">
<div></div>
</th>-->
</tr>
</thead>
<tbody>
<foreach name="orderGoods" item="vo">
<tr>
<!--<td class="sign" axis="col0">
<div style="width: 24px;"><i class="ico-check"></i></div>
</td>-->
<td align="left" abbr="goods_name" axis="col3" class="w500">
<div style="text-align: left;" class="">{$vo.goods_name}</div>
</td>
<td align="left" abbr="spec_key_name" axis="col4" class="w120">
<div style="text-align: left; " class="">{$vo.spec_key_name}</div>
</td>
<td align="left" abbr="goods_price" axis="col4" class="w120">
<div style="text-align: left;" class="">{$vo.goods_price}</div>
</td>
<td align="center" abbr="article_show" axis="col5" class="w100">
<div style="text-align: center;" class="">
<input type="hidden" name="spec[]" rel="{$vo.goods_id}" value="{$vo.spec_key}">
<input type="text" class="input-txt" style="width:60px !important;text-align:center" name="old_goods[{$vo.rec_id}]" value="{$vo.goods_num}" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')">
</div>
</td>
<td align="center" abbr="article_time" axis="col6" class="w150">
<div style="text-align: center; " class="">
<a class="btn red" href="javascript:void(0);" onclick="javascript:$(this).parent().parent().parent().remove();"><i class="fa fa-trash-o"></i>删除</a>
</div>
</td>
<!--<td style="width:100%" axis="col7">
<div></div>
</td>-->
</tr>
</foreach>
</tbody>
</table>
<div class="form-group">
<div class="col-xs-10" id="goods_td">
</div>
</div>
</div>
</div>
</dd>
</dl>
<dl class="row">
<dt class="tit">管理员备注</dt>
<dd class="opt">
<textarea class="tarea" style="width:440px; height:150px;" name="admin_note" id="admin_note">{$order.admin_note|htmlspecialchars_decode}</textarea>
<span class="err"></span>
<p class="notic"></p>
</dd>
</dl>
<input type="hidden" name="order_id" value="{$order.order_id}">
<div class="bot"><a href="JavaScript:void(0);" onClick="checkSubmit()" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
</div>
<input name="shipping_name" type="hidden" value="{$order.shipping_name}">
</form>
</div>
<script type="text/javascript">
/* 用户订单区域选择 */
$(document).ready(function(){
$('#province').val({$order.province});
$('#city').val({$order.city});
$('#district').val({$order.district});
$('#twon').val({$order.twon});
$('#shipping_id').val({$order.shipping_id});
$('#storage').val({$pickcate});
$('#pickup').val({$order.pickup_id});
});
//选择门店
function get_storage(obj) {
var cid=$(obj).val();
var list={$storage_all};
//alert($list.length);
var html="";
for (var i = 0; i < list.length; i++) {
if(list[i]["category_id"]==cid)
{
html+="<option value='"+list[i]["pickup_id"]+"'>"+list[i]["pickup_name"]+"</option>";
}
}
$("#pickup").html(html);
}
// 选择商品
function selectGoods(){
var url = "{:U('Admin/Order/search_goods')}";
layer.open({
type: 2,
title: '选择商品',
shadeClose: true,
shade: 0.8,
area: ['80%', '60%'],
content: url,
});
}
// 选择商品返回
function call_back(table_html)
{
$('#goods_td').empty().html('<table id="new_table" class="table table-bordered">'+table_html+'</table>');
//过滤选择重复商品
$('input[name*="spec"]').each(function(i,o){
if($(o).val()){
var name='goods_id['+$(o).attr('rel')+']['+$(o).val()+'][goods_num]';
$('input[name="'+name+'"]').parent().parent().parent().remove();
}
});
layer.closeAll('iframe');
}
function delRow(obj){
$(obj).parent().parent().parent().remove();
var length = $("#goos_table tr").length;
if(length == 0){
$('#goods_td').empty();
}
}
function checkSubmit()
{
layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '10px', time:100000}) ;
$("span[id^='err_']").each(function(){
$(this).hide();
});
($.trim($('#consignee').val()) == '') && $('#err_consignee').show();
($.trim($('#province').val()) == '') && $('#err_address').show();
($.trim($('#city').val()) == '') && $('#err_address').show();
($.trim($('#district').val()) == '') && $('#err_address').show();
($.trim($('#twon').val()) == '') && $('#err_address').show();
($.trim($('#address').val()) == '') && $('#err_address').show();
($.trim($('#mobile').val()) == '') && $('#err_mobile').show();
// if(($("input[name^='goods_id']").length ==0) && ($("input[name^='old_goods']").length == 0)){
// layer.alert('订单中至少要有一个商品', {icon: 2}); // alert('少年,订单中至少要有一个商品');
// return false;
// }
if($("span[id^='err_']:visible").length > 0 ) {
layer.closeAll();
return false;
}
$('#order-add').submit();
}
//选择物流
function selship(obj) {
$("input[name=shipping_name]").val($('#shipping option:selected').text());
}
</script>
</body>
</html>