ajaxGoodsList.html
11.2 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
<style type="text/css">
.flexigrid .bDiv tr{display: block;}
.bd-line{font-size: 0;}
.flexigrid .bDiv td{border: 0;}
.flexigrid div.bDiv tr:hover td{background-color: #F4FCFA;}
.flexigrid div.bDiv tr.trSelected td{ background: #ffffdf none repeat scroll 0 0;}
.flexigrid .bDiv a{color: #999;}
.flexigrid .bDiv .active a,.flexigrid .bDiv span a:hover{color: #FFF;}
.flexigrid .bDiv .row a:hover{text-decoration: none;color: #C4182E;background-color: #EEEEEE;text-decoration: underline;}
.flexigrid .bDiv .row .active a:hover{text-decoration: none;color: #fff;background-color: #999;text-decoration: underline;}
.ncsc-default-table thead {font-size: 0;}
.ncsc-default-table thead th{font-size: 12px; vertical-align: middle;display: inline-block;*display: inline;*zoom: 1;}
.w20{width: 2% !important;}
.w50{width: 5% !important;}
.w60{width: 6% !important;}
.w80{width: 8% !important;}
.w120{width: 10% !important;}
.w150{width: 12% !important;}
.w200{width: 14% !important;}
.w250{width: 16% !important;}
</style>
<table class="ncsc-default-table">
<thead>
<tr>
<th class="w20"><input type="checkbox" onclick="$('input[name=\'goods_id\[\]\']').prop('checked', this.checked);"></th>
<th class="w50"> </th>
<th class="w200">商品名称</th>
<th class="w150">
<a href="javascript:sort('cat_id');">分类</a>
</th>
<th class="w40">
<a href="javascript:sort('dis_type');">分销</a>
</th>
<th class="w60">
<a href="javascript:sort('shop_price');">价格</a>
</th>
<th class="w60">
<a href="javascript:sort('is_recommend');">推荐</a>
</th>
<th class="w60">
<a href="javascript:sort('is_new');">新品</a>
</th>
<th class="w50">
<a href="javascript:sort('is_hot');">热卖</a>
</th>
<th class="w50">
<a href="javascript:sort('is_on_sale');">上/下架</a>
</th>
<th class="w50">
<a href="javascript:sort('give_integral');">是否积分</a>
</th>
<th class="w60">
<a href="javascript:sort('store_count');">库存</a>
</th>
<th class="w60">
<a href="javascript:sort('sort');">排序</a>
</th>
<th class="w140">操作</th>
</tr>
</thead>
<tbody>
<empty name="goodsList">
<tr>
<td colspan="20" class="norecord">
<div class="warning-option"><i class="icon-warning-sign"></i><span>暂无符合条件的数据记录</span></div>
</td>
</tr>
<else/>
<volist name="goodsList" id="list">
<tr class="bd-line">
<td class="w20">
<input type="checkbox" name="goods_id[]" value="{$list.goods_id}"/>
</td>
<td class=" w50">
<div class="pic-thumb">
<a href="/Mobile/Goods/goodsInfo/stoid/{:getAdmStoId()}/id/{$list['goods_id']}.html" target="_blank">
<img style="width:32px;height:32px" src="{:getImg($list.original_img,'__PUBLIC__/images/not_adv.jpg',0,0)}" />
</a>
</div>
</td>
<td class="tl w200">
<dl class="goods-name">
<dt style="max-width: 450px !important;">
<if condition="$list[is_virtual] eq 1"><span class="type-virtual" title="虚拟兑换商品">虚拟</span></if>
{$list.goods_name|getSubstr=0,33}</dt>
<dd>商品编号:{$list.goods_sn}</dd>
<dd class="serve">
<if condition="$list.prom_type eq 1">
<a href="{:U('Promotion/flash_sale_info',array('id'=>$list['prom_id']))}"><span class="open" title="秒杀商品"><i class="commend">秒</i></span></a>
</if>
<if condition="$list.prom_type eq 2">
<a href="{:U('Promotion/group_buy',array('act'=>'edit','id'=>$list['prom_id']))}"><span class="open" title="团购商品"><i class="commend">团</i></span></a>
</if>
<if condition="$list.prom_type eq 3">
<a href="{:U('Promotion/prom_goods_info',array('id'=>$list['prom_id']))}"> <span class="open" title="促销优惠"><i class="commend">惠</i></span></a>
</if>
<if condition="$list.prom_type eq 4">
<a href="{:U('Marketing/integral_shop',array('id'=>$list['prom_id']))}"><span class="open" title="积分购"><i class="commend">积</i></span></a>
</if>
<if condition="$list.prom_type eq 6">
<a href="{:U('team/addinfo',array('id'=>$list['prom_id']))}"><span class="open" title="天天拼单"><i class="commend">拼</i></span></a>
</if>
<a href="javascript:" onclick="show_mobile_man(this)" b_href="{:U('Mobile/Goods/goodsInfo',array('stoid'=>getAdmStoId(),'id'=> $list['goods_id']))}"><span title="手机端商品详情"><i class="icon-tablet"></i></span></a>
</dd>
</dl>
</td>
<td class="w150"><span>{$catList[$list[cat_id]][name]}</span></td>
<td class="w40"><span>
<if condition='$list[dis_type] eq 0'>
<font color="red">主营</font>
<else />
可选
</if>
</span></td>
<td class="w60"><span style="color:red">¥{$list.shop_price}</span></td>
<td align="center" axis="col0" class="w60">
<div style="text-align: center;">
<if condition='$list[is_recommend] eq 1'>
<span class="yes" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_recommend',this)"><i class="fa fa-check-circle"></i>是</span>
<else />
<span class="no" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_recommend',this)"><i class="fa fa-ban"></i>否</span>
</if>
</div>
</td>
<td align="center" axis="col0" class="w60">
<div style="text-align: center; ">
<if condition='$list[is_new] eq 1'>
<span class="yes" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_new',this)"><i class="fa fa-check-circle"></i>是</span>
<else />
<span class="no" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_new',this)"><i class="fa fa-ban"></i>否</span>
</if>
</div>
</td>
<td align="center" axis="col0" class="w50">
<div style="text-align: center;">
<if condition='$list[is_hot] eq 1'>
<span class="yes" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_hot',this)"><i class="fa fa-check-circle"></i>是</span>
<else />
<span class="no" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','is_hot',this)"><i class="fa fa-ban"></i>否</span>
</if>
</div>
</td>
<td align="center" axis="col0" class="w50">
<div style="text-align: center;">
<if condition='$list[is_on] eq 1'>
<span class="yes" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','down_time',this,1)"><i class="fa fa-check-circle"></i>是</span>
<else />
<span class="no" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','down_time',this,1)"><i class="fa fa-ban"></i>否</span>
</if>
</div>
</td>
<td align="center" axis="col0" class="w50">
<div style="text-align: center;">
<if condition='$list[give_integral] eq 1'>
<span class="yes" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','give_integral',this)"><i class="fa fa-check-circle"></i>是</span>
<else />
<span class="no" onClick="changeTableVal('goods','goods_id','{$list.goods_id}','give_integral',this)"><i class="fa fa-ban"></i>否</span>
</if>
</div>
</td>
<td class="w60">
<input style="<if condition='$list.store_count lt $store_warning_storage'>color: red</if>" class="txt-cen" type="text" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" onChange="changeTableVal5('goods','goods_id','{$list.goods_id}','store_count',this)" name="store_count" size="4" data-table="goods" data-id="{$list.goods_id}" value="{$list.store_count}" />
</td>
<td class="w60">
<input class="txt-cen" type="text" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" onChange="changeTableVal('goods','goods_id','{$list.goods_id}','sort',this)" size="4" value="{$list.sort}" />
</td>
<td class="nscs-table-handle w140">
<a class="btn green aClick" id="{$list['goods_id']}" storeid="{$list['store_id']}" href="javascript:void(0)"><i class="fa fa-chain"></i>链接</a>
<a class="btn green" href="{:U('Admin/Goods/addEditGoods',array('sku'=>trim($list['sku'])))}?oldurl={$oldurl}"><i class="fa fa-edit"></i>编辑</a>
<if condition="$p_erpid">
<a class="btn green" href="{:U('Admin/Goods/goods_erplist',array('goods_id'=>$list['goods_id']))}"><i class="fa fa-list"></i>预出库订单</a>
</if><br>
<a class="btn green" href="javascript:void(0);" onclick="del('{$list[goods_id]}')"><i class="fa fa-trash"></i>删除</a>
<if condition="$p_erpid">
<a class="btn green" href="javascript:void(0);" onclick="updatesku('{$list[erpwareid]}')" title="同步线下条码、商品编号及市场价格"><i class="fa fa-refresh" ></i>同步信息</a>
<!--<a class="btn green" href="javascript:void(0);" onclick="updatewareno('{$list[goods_sn]}')" title="同步线下条码及商品ID"><i class="fa fa-refresh" ></i>按编号同步信息</a>-->
</if>
</td>
</tr>
</volist>
</empty>
</tbody>
</table>
<div class="layer_box dn">
<input readonly="readonly" class="contentTxt" id="content" value="" />
<div id="btn" class="js-copy" data-clipboard-target="#content"><span>复制</span></div>
</div>
<!--分页位置--> {$page}
<script>
var btn = document.getElementById('btn');
var clipboard = new Clipboard(btn);//实例化
//复制成功执行的回调,可选
clipboard.on('success', function(e) {
layer.alert('复制成功', {
closeBtn: 0
}, function() {
layer.closeAll();
$(".layer_box").addClass("dn");
});
});
//复制失败执行的回调,可选
clipboard.on('error', function(e) {
layer.alert('复制失败');
});
$(".aClick").click(function(e) {
var store_id = $(this).attr("storeid");
var gpid = $(this).attr("id");
var http ="";
var ishttps = 'https:' == document.location.protocol ? true : false;
if(ishttps) {http ="https://"; } else {http ="http://";}
var host = window.location.host;
var controller = "/Mobile/Goods/goodsInfo/stoid/";
var val = store_id+"/id/"+gpid;
var url = http+host+controller+val;
$("#content").val(url);
var t = $(this).parents("tr").index();
$(".layer_box").css("top", (t + 1) * 70-20)
$(".layer_box").removeClass("dn");
e.stopPropagation();//阻止冒泡到body
});
$(" body").click(function(){
$(".layer_box").addClass("dn");
});
// 点击分页触发的事件
$(".pagination a").click(function(){
cur_page = $(this).data('p');
$("#cur_page").val(cur_page);
ajax_get_table('search-form2',cur_page);
});
$(document).ready(function(){
// 表格行点击选中切换
$('#flexigrid >table>tbody>tr').click(function(){
$(this).toggleClass('trSelected');
});
$('#good_count').empty().html("{$pager->totalRows}");
});
// 点击分页触发的事件
$(".pagination a").click(function() {
cur_page = $(this).data('p');
ajax_get_table('search-form2', cur_page);
});
</script>