search_pind_ware.html
8.94 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
<script src="../../../../public/static/js/normal.js"></script>
<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;}
.item-title ul {
font-size: 0;
}
.item-title ul li {
font-size: 14px;
vertical-align: middle;
display: inline-block;
*display: inline;
*zoom: 1;
margin-right: 10px;
padding: 5px;
}
.item-title ul li.on,
.item-title ul li:hover {
background-color: #d4d5d5;
}
.flexigrid .bDiv{overflow: auto;height: 300px;}
</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="item-title">
<ul>
<li class="on">商品列表</li>
<li >商品分组</li>
</ul>
</div>-->
<div class="flexigrid">
<div class="mDiv">
<div class="ftitle vdisib">
<h3 class="vdisib">商品列表</h3>
<h5 class="vdisib">(共{$pager->totalRows}条记录)</h5>
</div>
<div title="刷新数据" class="pReload vdisib"><i class="fa fa-refresh"></i></div>
<form class="navbar-form form-inline" id="search-form2" action="{:U('Uploadify/search_pind_ware')}" method="get">
<input id="bfunc" name="func" value="{$func}" type="hidden" />
<input type="hidden" name="glist" value="{$_GET['glist']}" />
<div class="sDiv">
<div class="sDiv2">
<input size="30" name="key_word" value="{$_GET['key_word']}"class="qsbox" placeholder="商品名称或者关键词" type="text">
<input class="btn" value="搜索" type="submit">
</div>
</div>
</form>
</div>
<div class="hDiv">
<div class="hDivBox">
<table cellspacing="0" cellpadding="0">
<thead>
<tr>
<th abbr="article_title" axis="col3" class="w50" align="left">
<div style="text-align: left; " class=""><input type="checkbox" onclick="$('input[name*=\'goods_id\']').prop('checked', this.checked);"></div>
</th>
<th abbr="ac_id" axis="col4" class="w200" align="left">
<div style="text-align: left; " class="">商品编号</div>
</th>
<th abbr="article_time" axis="col6" class="w400" align="left">
<div style="text-align: left; " class="">商品名称</div>
</th>
<th abbr="ac_id" axis="col4" class="w100" align="left">
<div style="text-align: center; " class="">价格</div>
</th>
<th abbr="ac_id" axis="col4" class="w100" align="left">
<div style="text-align: center; " class="">原价</div>
</th>
<!--<th axis="col1" class="w100" align="center">-->
<!--<div style="text-align: center;">操作</div>-->
<!--</th>-->
</tr>
</thead>
</table>
</div>
</div>
<div class="bDiv" style="height: auto;">
<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
<table>
<tbody id="goos_table">
<volist name="data" id="list">
<tr>
<td class="w50" align="left">
<div style="text-align: left; ">
<input type="checkbox" class="inpucheck" name="goods_id[]" value="{$list.goods_id}"/>
</div>
</td>
<td class="w200" align="left">
<div style="text-align: left; ">{$list.goods_id}</div>
</td>
<td class="w400" align="left">
<div style="text-align: left; ">{$list.goods_name}</div>
</td>
<td class="w100" align="left">
<div style="text-align: center;">{$list.shop_price}</div>
</td>
<td class="w100" align="left">
<div style="text-align: center;">{$list.market_price}</div>
</td>
<td class='w100' style='display: none'>
<a href="javascript:void(0);" class='groupdata btn red' thisid="{$list.goods_id}"
name="{$list.goods_name}" gimg="{:getimg($list.original_img,NOIMG,0,1)}" ct_num="{$list.kttype}"
price="{$list.shop_price}" goods_price="{$list.market_price}"
salenum="{$list.buy_num}" show_time="{$list.show_time}" start_time="{$list.start_time}"
end_time="{$list.end_time}" title="{$list.title}" pttype="{$list.kttype}">
</a>
</td>
</tr>
</volist>
</table>
</div>
<div class="iDiv" style="display: none;"></div>
</div>
<!--分页位置-->
<div class="te_le">
{$page}
</div>
<div class="bot">
<a href="javascript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="select_goods()">确认提交</a>
</div>
</div>
</div>
<script>
var goodslist="<?php echo I('glist');?>";
//确认菜单内容-选择商品
function selectpro(obj) {
var proid=$(obj).attr("thisid");
var name=$(obj).attr("name");
var gimg=$(obj).attr("gimg");
var price=$(obj).attr("price");
var goods_price=$(obj).attr("goods_price");
var salenum=$(obj).attr("salenum");
var show_time=$(obj).attr("show_time");
var start_time=$(obj).attr("start_time");
var end_time=$(obj).attr("end_time");
var ct_num=$(obj).attr("ct_num");
var data_time=show_time-Date.parse(new Date());
var preheat=0;
var kttype=$(obj).attr("pttype");
var title=$(obj).attr("title");
if(data_time > 0){
data_time=show_time-Date.parse(new Date());
preheat = 1;
}else{
data_time=end_time-start_time;
}
var d=Math.floor(data_time/1000/60/60/24);
var h=Math.floor(data_time/1000/60/60%24);
var m=Math.floor(data_time/1000/60%60);
var s=Math.floor(data_time/1000%60);
var ele={'goodsid':proid, 'goodsimg': gimg, 'goodsname': name,'price': price,'goods_price':goods_price,'salenum': salenum,'day':d,"hour":h,"minute":m,"second":s,"preheat":preheat,"title":title,'kttype':kttype,'tun_num':ct_num};
return ele;
}
function select_goods()
{
if($(".inpucheck:checked").length == 0)
{
layer.alert('请选择商品', {icon: 2}); //alert('请选择商品');
return false;
}
if($(".inpucheck:checked").length > 6)
{
layer.alert('最多选择6个商品', {icon: 2}); //alert('请选择商品');
return false;
}
var str=new Array();
var i=0;
if(goodslist!="") {
garr=goodslist.split(",");
}
var isok=true;
var err="";
//将没选中的复选框所在的 tr remove 然后删除复选框
$(".inpucheck").each(function(){
if($(this).is(':checked') == true)
{
var e=selectpro($(this).parent().parent().parent().find(".groupdata"));
if(goodslist!="") {
var val=e.goodsid
var i = $.inArray(val, garr)
if(i!=-1){
err+= e.goodsname+"<br/>";
isok=false;
return;
}
str.push(e);
}else {
str.push(e);
}
}
});
if(!isok) {
layer.msg(err+" 已经添加过了", {
icon: 1, // 成功图标
time: 2000 //2秒关闭(如果不配置,默认是3秒)
});
return;
}
if($("#bfunc").val()!=""){
eval("window.parent."+$("#bfunc").val()+"(str)");
}else {
javascript:window.parent.call_back_func(str);
}
}
</script>
</body>
</html>