search_goods.html
9.71 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
<include file="public/layout" />
<script type="text/javascript" src="__PUBLIC__/static/js/layer/laydate/laydate.js"></script>
<style type="text/css">
.vdisib{display: inline-block;*display: inline;*zoom: 1;vertical-align: middle;}
</style>
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page" style="padding:10px">
<div class="flexigrid" >
<div class="mDiv">
<div class="ftitle vdisib">
<h3 class="vdisib">商品列表</h3>
<h5 class="vdisib">(共{$totalSize}条记录)</h5>
</div>
<div title="刷新数据" class="pReload vdisib"><i class="fa fa-refresh"></i></div>
<form class="navbar-form form-inline" method="post" action="{:U('Admin/Order/search_goods')}" name="search-form2" id="search-form2">
<div class="sDiv">
<div class="sDiv2">
<select name="cat_id" id="cat_id" class="select">
<option value="">所有分类</option>
<foreach name="categoryList" item="v" key="k" >
<option value="{$v['id']}" <if condition="$v[id] eq $cat_id">selected</if> ><?php echo str_pad('',($v[level] * 5),'-',STR_PAD_LEFT); ?> {$v['name']}</option>
</foreach>
</select>
</div>
<div class="sDiv2">
<select name="brand_id" id="brand_id" class="select">
<option value="">所有品牌</option>
<foreach name="brandList" item="v" key="k" >
<option value="{$v['id']}" <if condition="$v[id] eq $brand_id">selected</if> >{$v['name']}</option>
</foreach>
</select>
</div>
<div class="sDiv2">
<select name="intro" class="select">
<option value="0">全部</option>
<option value="is_new">新品</option>
<option value="is_recommend">推荐</option>
</select>
</div>
<div class="sDiv2" style="border:0px">
<input type="text" name="keywords" value="{$keywords}" placeholder="搜索词" id="input-order-id" class="input-txt">
</div>
<div class="sDiv2" style="border:0px">
<input type="submit" class="btn" value="搜索">
</div>
</div>
</form>
</div>
<div class="hDiv">
<div class="hDivBox" id="ajax_return">
<table cellspacing="0" cellpadding="0" id="table_head" width="100%">
<thead>
<tr>
<!--<th class="sign" axis="col0" width="24px">
<div style="width: 24px;"><i class="ico-check"></i></div>
</th>-->
<th align="left" abbr="order_sn" axis="col3" class="" width="46%">
<div style="text-align: left;" class="">商品名称</div>
</th>
<th align="left" abbr="consignee" axis="col4" class="" width="15%">
<div style="text-align: left;" class="">价格</div>
</th>
<th align="center" abbr="article_show" axis="col5" class="" width="10%">
<div style="text-align: center;" class="">库存</div>
</th>
<th align="center" abbr="article_show" axis="col5" class="" style="display:none;" width="15%">
<div style="text-align: center;" class="">购买数量
<input type="checkbox" checked="checked" style="display:none;" /></div>
</th>
<th align="center" abbr="article_time" axis="col6" class="" width="15%">
<div style="text-align: center;" class="" >操作</div>
</th>
<!--<th style="width:100%" axis="col7">
<div></div>
</th>-->
</tr>
</thead>
</table>
</div>
</div>
<div class="bDiv" style="height: auto;">
<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
<table cellspacing="0" cellpadding="0" id="goos_table">
<tbody>
<volist name="goodsList" id="list">
<!--如果有商品规格-->
<if condition="$list['spec_goods'] neq null">
<volist name="list['spec_goods']" id="spec_goods">
<tr date-id="{$list.goods_id}">
<!--<td class="sign" axis="col0" width="24px">
<div style="width: 24px;"><i class="ico-check"></i></div>
</td>-->
<td align="left" abbr="order_sn" axis="col3" class="" width="46%">
<div style="text-align: left;" class="">{$list.goods_name|getSubstr=0,33} ( {$spec_goods[key_name]} )</div>
</td>
<td align="left" abbr="consignee" axis="col4" class="" width="15%">
<div style="text-align: left;" class="">{$spec_goods[price]}</div>
</td>
<td align="center" abbr="article_show" axis="col5" class="" width="10%">
<div style="text-align: center;" class="">{$spec_goods[store_count]}</div>
</td>
<td align="center" abbr="article_show" axis="col5" class="" style="display:none;"width="15%">
<div style="text-align: center;" class="">
<input type="text" name="goods_id[{$list.goods_id}][{$spec_goods[key]}][goods_num]" value="1" class="input-txt" style="width:60px !important;text-align:center" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" style="display:none;" />
<input type="checkbox" style="display:none;" />
</div>
</td>
<td align="center" abbr="article_time" axis="col6" class="" width="15%">
<div style="text-align: center;" class="">
<a class="btn red" href="javascript:void(0);" onclick="delRow(this)"><i class="fa fa-trash-o"></i>删除</a>
</div>
</td>
<!--<td style="width:100%" axis="col7">
<div></div>
</td>-->
</tr>
</volist>
<else/>
<tr date-id="{$list.goods_id}">
<!--<td class="sign" axis="col0" width="24px">
<div style="width: 24px;"><i class="ico-check"></i></div>
</td>-->
<td align="left" abbr="order_sn" axis="col3" class="" width="46%">
<div style="text-align: left;" class="">{$list.goods_name|getSubstr=0,33}</div>
</td>
<td align="left" abbr="consignee" axis="col4" class="" width="15%">
<div style="text-align: left;" class="">{$list.shop_price}</div>
</td>
<td align="center" abbr="article_show" axis="col5" class="" width="10%">
<div style="text-align: center;" class="">
{$list.store_count}
</div>
</td>
<td align="center" abbr="article_show" axis="col5" class="" style="display:none;" width="15%">
<div style="text-align: center;" class="" >
<input type="text" name="goods_id[{$list.goods_id}][key][goods_num]" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" class="input-txt" style="width:60px !important;text-align:center" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" value="1" class="input-sm" style="display:none;" />
<input type="checkbox" style="display:none;" />
</div>
</td>
<td align="center" abbr="article_time" axis="col6" class="" width="15%">
<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>
</if>
</volist>
</tbody>
</table>
<div class="sDiv" style="float:left;margin-top:10px">
<div class="sDiv2" style="border:0px">
<input type="button" onclick="select_goods()" class="btn" value="确定">
</div>
</div>
</div>
<div class="iDiv" style="display: none;"></div>
</div>
<!--分页位置-->
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#flexigrid > table>tbody >tr').click(function(){
$(this).toggleClass('trSelected');
var checked = $(this).hasClass('trSelected');
$(this).find('input[type="checkbox"]').attr('checked',checked);
});
$('.ico-check ' , '.hDivBox').click(function(){
$('tr' ,'.hDivBox').toggleClass('trSelected' , function(index,currentclass){
var hasClass = $(this).hasClass('trSelected');
$('tr' , '#flexigrid').each(function(){
if(hasClass){
$(this).addClass('trSelected');
}else{
$(this).removeClass('trSelected');
}
});
});
});
});
function select_goods()
{
if($("input[type='checkbox']:checked").length == 0)
{
layer.alert('请选择商品', {icon: 2}); //alert('请选择商品');
return false;
}
// 将没选中的复选框所在的 tr remove 然后删除复选框
$("input[type='checkbox']").each(function(){
if($(this).is(':checked') == false)
{
$(this).parent().parent().parent().remove();
}
$(this).parent().parent().show();
$(this).siblings().show();
$(this).remove();
});
$(".btn-info").remove();
var tabHtml = $('#table_head').append($('#goos_table')).html();
javascript:window.parent.call_back(tabHtml.replace(/选择/,'购买数量'));
}
</script>
</body>
</html>