search_goods.html
6.11 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
<include file="public/layout"/>
<style>
.te_le .dataTables_paginate{float: left;}
.bot{float: right;padding: 15px 0;}
.vdisib{display: inline-block;*display: inline;*zoom: 1;vertical-align: middle;}
.flexigrid .hDiv th, .flexigrid .bDiv td.dny{}
</style>
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div class="page" style="padding: 0px 1% 0 1%;">
<!-- 操作说明 -->
<div class="flexigrid">
<div class="mDiv">
<div class="ftitle vdisib">
<h3 class="vdisib">商品列表</h3>
<h5 id="good_count" class="vdisib"></h5>
</div>
<div title="刷新数据" class="pReload vdisib"><i class="fa fa-refresh"></i></div>
<form class="navbar-form form-inline" id="search-form2" onSubmit="return false">
<div class="sDiv">
<span style="font-size: 12px"> 每<input type="text" size="4" maxlength="4" name="pagenum" id="pagenum" class="qsbox" value="{$pagenum}">条/页</span>
<div class="sDiv2" style="margin-right: 10px;border:none;">
<select name="cat_id" id="cat_id">
<option value="">所有分类</option>
<foreach name="categoryList" item="v" key="k" >
<option value="{$v['id']}" <if condition="$v[id] eq $cat_id">selected</if>>{$v['name']}</option>
</foreach>
</select>
</div>
<div class="sDiv2" style="margin-right: 10px;border:none;">
<select name="brand_id" id="brand_id">
<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" style="margin-right: 10px;border:none;">
<select name="intro">
<option value="0">全部</option>
<option value="is_new">新品</option>
<option value="is_recommend">推荐</option>
</select>
</div>
<div class="sDiv2">
<!--<select name="status" class="select">-->
<!--<option value="">活动状态</option>-->
<!--</select>-->
<input size="30" name="keywords" value="{$keywords}"class="qsbox" placeholder="商品名称或者关键词" type="text">
<input class="btn" style="height: 27px" value="搜索" type="submit"
onclick="ajax_get_table('search-form2',1)">
<input type="hidden" value="{$formid}" name="formid" id="formid">
<input type="hidden" id="list" name="list" value="">
<input type="hidden" id="sel_list" name="sel_list" value="{$idlist}">
</div>
</div>
</form>
</div>
<div class="bDiv" style="height: auto;">
<div id="ajax_return" cellpadding="0" cellspacing="0" border="0"></div>
</div>
<div class="bot"><a onclick="select_goods();" class="ncap-btn-big ncap-btn-green">确认提交</a></div>
</div>
</div>
<div id="goods_table" style="display: none"></div>
<script>
$(document).ready(function () {
$('.fa-refresh').click(function () {
location.href = location.href;
});
ajax_get_table('search-form2', 1);
});
function select_goods()
{
// if($("table :checkbox:checked").length == 0)
// {
// layer.alert('请选择商品', {icon: 2}); //alert('请选择商品');
// return false;
// }
// //将没选中的复选框所在的 tr remove 然后删除复选框
// $("table :checkbox").each(function(){
// if($(this).is(':checked') == false)
// {
// $(this).parent().parent().parent().remove();
// }else{
// $(this).parent().parent().css('display','none');
// $(this).attr("checked","checked");
// }
// });
var list="";
//将没选中的复选框所在的 tr remove 然后删除复选框
$("#all_goodsist :checkbox").each(function () {
if ($(this).is(':checked')) {
if ($(this).attr('id') == 'check') {
return true;
}
var id = $(this).attr('data-id').replace('tr','');
if ($.inArray(id, brr) == -1) {
$(this).parent().parent().css('display', 'none');
$(this).parent().parent().parent().removeAttrs('class');
$(this).parent().parent().parent().find('.delshow div').css('display', '');
table += $(this).parent().parent().parent().prop('outerHTML');
list += id + ',';
}
}
});
$('#list').val(list);
$('#goods_table').append(table);
javascript:window.parent.call_back($('#goods_table').html());
}
function ajax_get_table(form, page) {
cur_page = page; //当前页面 保存为全局变量
layer.msg('加载中...', {
icon: 16,
shade: [0.5, '#f5f5f5'],
scrollbar: false,
offset: '200px',
time: 100000
});
$.ajax({
type: "POST",
url: "/index.php?m=Admin&c=Goods&a=ajax_search_goods&p=" + page, //+tab,
data: $('#' + form).serialize(), // 你的formid
success: function (data) {
$("#ajax_return").html('');
$("#ajax_return").append(data);
layer.closeAll();
}
});
}
</script>
</body>
</html>