search_storage.html
8.91 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
<include file="public/layout"/>
<style>
.te_le .dataTables_paginate{float: left;}
.bot{float: right;padding: 15px 0}
.vdisib{vertical-align: middle;display: inline-block;*display: inline;*zoom: 1;}
.flexigrid .hDiv thead tr:hover{background-color: #F5F5F5;}
.flexigrid .hDiv tbody tr{background-color: #FFFFFF;}
</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 class="vdisib">(共<font id="allnum"></font>条记录)</h5>
</div>
<div class="sDiv">
<div class="sDiv2">
<input size="30" name="keywords" value="{$keywords}"class="qsbox" id="keywords" placeholder="关键字" type="text">
<input class="btn" value="搜索" type="submit" onclick="getdataList(1)">
</div>
</div>
</div>
<div class="hDiv">
<div class="bDiv hDivBox">
<table cellspacing="0" cellpadding="0" width="620">
<thead>
<tr>
<th align="left" width="w50">
<div style="text-align: left;">
<input type="checkbox" id="check" onclick="Checkall()"><label for="check">选择</label>
</div>
</th>
<th abbr="article_time" axis="col6" class="w100" align="left" >
<div style="text-align: left; " class="">门店编号</div>
</th>
<th abbr="article_time" axis="col6" class="w200" align="left" >
<div style="text-align: left; " class="">门店名称</div>
</th>
<!--<th abbr="article_time" axis="col6" class="w200" align="left" >-->
<!--<div style="text-align: left;" class="">管理人</div>-->
<!--</th>-->
<th axis="col1" class="w200" align="center" >
<div style="text-align: center;">操作</div>
</th>
</tr>
</thead>
<tbody id="goos_table"></tbody>
</table>
</div>
</div>
<!-- <div class="bDiv" style="height: auto;">
<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
<table><tbody id="goos_table"></tbody></table>
</div>
<div class="iDiv" style="display: none;"></div>
</div>-->
<!--分页位置-->
<div class="te_le">
<include file="public/page"/>
</div>
<div class="bot"><a onclick="okinesrt();" class="ncap-btn-big ncap-btn-green">确认载入</a></div>
</div>
</div>
<input type="hidden" id="idlist" value="">
<input type="hidden" id="list" value="">
<script type="application/javascript">
var is_all = false;
var table = '';
var list = $('#list').val();
if (list != '') {
brr = list.split(',');
} else {
brr = new Array();
}
// 全选/取消全选
function Checkall() {
if (is_all) {
$("table :checkbox").each(function () {
this.checked = false;
var id = $(this).attr('data-id');
list = trim(list.replace(id + ',', ''));
$('#list').val(list);
brr = list.split(',');
});
is_all = false;
} else {
$("table :checkbox").each(function () {
this.checked = true;
});
is_all = true;
}
}
var idlist = $('#idlist').val();
if (idlist != '') {
arr = idlist.split(',');
} else {
arr = new Array();
}
function okinesrt() {
//将没选中的复选框所在的 tr remove 然后删除复选框
$("table :checkbox").each(function () {
if ($(this).is(':checked')) {
if ($(this).attr('id') == 'check') {
return true;
}
var id = $(this).attr('data-id');
if ($.inArray(id, brr) == -1) {
list += id + ',';
}
}
});
$('#list').val(list);
import_data(list);
}
var page=1;
var data=window.parent.getSearDate();
var count=window.parent.getCount();
var pz=parseInt(count/10);
if((count%10)>0) pz++;
function settdata(d) {
data=d;
}
$(function (){
var ahtml="";
for(var i=0;i<data.length;i++) {
var row=data[i];
var htm = "<tr><td class='w50'><div> <input type='checkbox' data-id='"+row.Id+"' placeholder=''/></div></td><td class='w100'><div style='text-align: left; '>"+row.StorageNo+"</div></td> <td class='w200'style='text-align:left'><div>"+row.StorageName+"</div></td><td class='w200' style='text-align:center' align='center'><a gid='"+encodeURIComponent(row.Id)+"' class='btn red' onclick='select(this)'>选择</a></td></tr>";
// <td class='w200' style='text-align:left' ><div>"+row.Manager+"</div></td>
ahtml+=htm;
}
$("#goos_table").append(ahtml);
$("#allnum").text(count);
if(count>10){
$("#DivPage").show();
setpageval(count,pz,1,10);
}
});
//单个选择
function select(ob)
{
var id=$(ob).attr("gid");
import_data(id);
}
function import_data(gid) {
var html='';
var i=layer.msg('努力中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '200px', time:100000}) ;
$.ajax({
url:"{:U('Admin/Pickup/import_storage')}",
data: "idlist="+gid,
type: 'post',
dataType: 'json',
success: function (data) {
if (data.code==1) {
layer.close(i);
layer.msg(data.msg, {icon: 1, time: 2000});
setTimeout(function () {
window.parent.m_call_back();
}, 1000);
}else
{
layer.close(i);
layer.msg(data.msg, {icon: 2, time: 2000});
}
},
error: function () {
layer.close(i);
layer.msg('导入失败', {icon: 2, time: 2000});
}
});
}
function Canlce() {window.parent.Cancle();}
function getdataList(p1) {
var param="";
if ($("#keywords").val()!="")
{
param="/key/"+$("#keywords").val();
}
var url="/index.php/admin/pickup/selectshop/p/"+p1+param;
layer.msg('努力中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '200px', time:100000}) ;
$.ajax({
type : "get", url : url,
dataType:"json",
error: function(request) {
layer.closeAll();
layer.msg("服务器繁忙, 请联系管理员!",{icon:2});return;
},
success: function(data) {
layer.closeAll();
if(data==""){
layer.msg("未找到数据",{icon:2,time:1000});
return;
}
if(data.code=="0" || data.code==0){
if (data.data.total == undefined || data.data.total <= 0) {
layer.msg("未找到数据",{icon:2,time:1000});
return;
}
var data1=data.data.pageData;
count= data.data.total;
$("#allnum").text();
var ahtml="";
for(var i=0;i<data1.length;i++) {
var row=data1[i];
var htm = "<tr><td class='w50'><div> <input type='checkbox' data-id='"+row.Id+"' placeholder=''/></div></td><td class='w100'><div>"+row.StorageNo+"</div></td> <td class='w200'style='text-align:left'><div>"+row.StorageName+"</div></td><td class='w200' style='text-align:center' align='center'><a gid='"+row.Id+"' class='btn red' onclick='select(this)'>选择</a></td></tr>";
// <td class='w200' style='text-align:left' ><div>"+(row.Manager == undefined?"":row.Manager)+"</div></td>
ahtml+=htm;
}
$("#goos_table").html(ahtml);
setpageval(count,pz,p1,10);
settdata(data1);
}else{
layer.msg(data.msg,{icon:2,time:1000});
}
}
});
}
</script>
</body>
</html>