|
|
@@ -36,11 +36,17 @@ $(function () {
|
|
36
|
36
|
}
|
|
37
|
37
|
if(typeUser==5){
|
|
38
|
38
|
$("#OA_task").css("margin-top","45px");
|
|
|
39
|
+ $('.BtnReutrn').show();
|
|
|
40
|
+ $('.borrow').show();
|
|
|
41
|
+ $('.search').show();
|
|
39
|
42
|
state="";
|
|
40
|
43
|
Staff=1;
|
|
41
|
44
|
Ajax();
|
|
42
|
45
|
}else if(typeUser==1){
|
|
43
|
46
|
$("#OA_task").css("margin-top","85px");
|
|
|
47
|
+ $('.out').show();
|
|
|
48
|
+ $('.warehousing').show();
|
|
|
49
|
+ $('.search').show();
|
|
44
|
50
|
state=1;
|
|
45
|
51
|
Staff="";
|
|
46
|
52
|
Ajax();
|
|
|
@@ -61,13 +67,15 @@ function Ajax() {
|
|
61
|
67
|
dataType: 'json',
|
|
62
|
68
|
type: 'get', //HTTP请求类型
|
|
63
|
69
|
success: function(data) {
|
|
|
70
|
+ $("#OA_task").empty();
|
|
64
|
71
|
if(data.data.rows && data.data.rows.length > 0) {
|
|
65
|
72
|
$(".noinfor").text("");
|
|
66
|
|
- $("#OA_task").empty();
|
|
67
|
73
|
$(data.data.rows).each(function(i, n) {
|
|
68
|
|
- $('<li class="mui-table-view-cell order" data-index="' + n.id + '">' +
|
|
|
74
|
+ $('<li class="mui-table-view-cell">' +
|
|
|
75
|
+ '<div class="mui-input-row mui-checkbox mui-left">'+
|
|
|
76
|
+ '<input name="checkbox1" data-item="' + n.id + '" value="'+n.stateName+'" type="checkbox" class="selected"></div>'+
|
|
69
|
77
|
'<div class="mui-table">' +
|
|
70
|
|
- '<div class="mui-table-cell mui-col-xs-8">' +
|
|
|
78
|
+ '<div class="mui-table-cell mui-col-xs-8 order" data-index="' + n.id + '">' +
|
|
71
|
79
|
'<h4 class="mui-ellipsis">' + n.A_archiveName +
|
|
72
|
80
|
'</h4><h5>' + n.OperationDate +
|
|
73
|
81
|
'</h5></div>'+
|
|
|
@@ -90,6 +98,169 @@ function Ajax() {
|
|
90
|
98
|
})
|
|
91
|
99
|
|
|
92
|
100
|
}
|
|
|
101
|
+var idArr=[];
|
|
|
102
|
+var nameArr=[];
|
|
|
103
|
+//借阅
|
|
|
104
|
+$(".borrow").click(function(){
|
|
|
105
|
+ idArr=[];
|
|
|
106
|
+ nameArr=[];
|
|
|
107
|
+ $(".mui-checkbox input[type='checkbox']:checked").each(function(index,item){
|
|
|
108
|
+ idArr.push($(this).attr('data-item'));
|
|
|
109
|
+ nameArr.push($(this).val())
|
|
|
110
|
+ })
|
|
|
111
|
+ for(var i=0;i<nameArr.length;i++){
|
|
|
112
|
+ if(nameArr[i] !=='在库'){
|
|
|
113
|
+ mui.toast('不能借阅')
|
|
|
114
|
+ return false
|
|
|
115
|
+ }
|
|
|
116
|
+ }
|
|
|
117
|
+ var btnArray = ['否', '是'];
|
|
|
118
|
+ mui.confirm('确定借阅吗?', '提示', btnArray, function(f) {
|
|
|
119
|
+ if(f.index == 1) {
|
|
|
120
|
+ $.ajax({
|
|
|
121
|
+ type: "post",
|
|
|
122
|
+ dataType: 'json',
|
|
|
123
|
+ url: huayi.config.callcenter_url + 'archives/CustomerBorrowJY',
|
|
|
124
|
+ async: true,
|
|
|
125
|
+ data: {
|
|
|
126
|
+ archivesids: idArr.toString(), //否 strubg 工单编号
|
|
|
127
|
+ openid: openid, //微信openid 测试用
|
|
|
128
|
+ },
|
|
|
129
|
+ success: function(data) {
|
|
|
130
|
+ debugger
|
|
|
131
|
+ if(data.state == "success") {
|
|
|
132
|
+ mui.toast('操作成功');
|
|
|
133
|
+ window.location.href = "borrowList.html?Itype=1";
|
|
|
134
|
+ } else {
|
|
|
135
|
+ mui.toast(data.message);
|
|
|
136
|
+ }
|
|
|
137
|
+ }
|
|
|
138
|
+ });
|
|
|
139
|
+ } else {
|
|
|
140
|
+ mui.toast("取消");
|
|
|
141
|
+ }
|
|
|
142
|
+ })
|
|
|
143
|
+})
|
|
|
144
|
+//归还
|
|
|
145
|
+$(".BtnReutrn").click(function(){
|
|
|
146
|
+ idArr=[];
|
|
|
147
|
+ nameArr=[];
|
|
|
148
|
+ $(".mui-checkbox input[type='checkbox']:checked").each(function(index,item){
|
|
|
149
|
+ idArr.push($(this).attr('data-item'));
|
|
|
150
|
+ nameArr.push($(this).val())
|
|
|
151
|
+ })
|
|
|
152
|
+ for(var i=0;i<nameArr.length;i++){
|
|
|
153
|
+ if(nameArr[i] =='在库'){
|
|
|
154
|
+ mui.toast('不能归还')
|
|
|
155
|
+ return false
|
|
|
156
|
+ }
|
|
|
157
|
+ }
|
|
|
158
|
+ var btnArray = ['否', '是'];
|
|
|
159
|
+ mui.confirm('确定归还吗?', '提示', btnArray, function(f) {
|
|
|
160
|
+ if(f.index == 1) {
|
|
|
161
|
+ $.ajax({
|
|
|
162
|
+ type: "post",
|
|
|
163
|
+ dataType: 'json',
|
|
|
164
|
+ url: huayi.config.callcenter_url + 'archives/CustomerBorrowGH',
|
|
|
165
|
+ async: true,
|
|
|
166
|
+ data: {
|
|
|
167
|
+ archivesids: idArr.toString(), //否 strubg 工单编号
|
|
|
168
|
+ openid: openid, //微信openid 测试用
|
|
|
169
|
+ },
|
|
|
170
|
+ success: function(data) {
|
|
|
171
|
+ if(data.state == "success") {
|
|
|
172
|
+ mui.toast('操作成功');
|
|
|
173
|
+ window.location.href = "borrowList.html?Itype=1";
|
|
|
174
|
+ } else {
|
|
|
175
|
+ mui.toast(data.message);
|
|
|
176
|
+ }
|
|
|
177
|
+ }
|
|
|
178
|
+ });
|
|
|
179
|
+ } else {
|
|
|
180
|
+ mui.toast("取消");
|
|
|
181
|
+ }
|
|
|
182
|
+ })
|
|
|
183
|
+})
|
|
|
184
|
+//出库
|
|
|
185
|
+$(".out").click(function(){
|
|
|
186
|
+ idArr=[];
|
|
|
187
|
+ nameArr=[];
|
|
|
188
|
+ $(".mui-checkbox input[type='checkbox']:checked").each(function(index,item){
|
|
|
189
|
+ idArr.push($(this).attr('data-item'));
|
|
|
190
|
+ nameArr.push($(this).val())
|
|
|
191
|
+ })
|
|
|
192
|
+ for(var i=0;i<nameArr.length;i++){
|
|
|
193
|
+ if(nameArr[i] !=='在库'){
|
|
|
194
|
+ mui.toast('不能出库')
|
|
|
195
|
+ return false
|
|
|
196
|
+ }
|
|
|
197
|
+ }
|
|
|
198
|
+ var btnArray = ['否', '是'];
|
|
|
199
|
+ mui.confirm('确定出库吗?', '提示', btnArray, function(f) {
|
|
|
200
|
+ if(f.index == 1) {
|
|
|
201
|
+ $.ajax({
|
|
|
202
|
+ type: "post",
|
|
|
203
|
+ dataType: 'json',
|
|
|
204
|
+ url: huayi.config.callcenter_url + 'archives/insideOperationCk',
|
|
|
205
|
+ async: true,
|
|
|
206
|
+ data: {
|
|
|
207
|
+ archivesids: idArr.toString(), //否 strubg 工单编号
|
|
|
208
|
+ openid: openid, //微信openid 测试用
|
|
|
209
|
+ },
|
|
|
210
|
+ success: function(data) {
|
|
|
211
|
+ if(data.state == "success") {
|
|
|
212
|
+ mui.toast('操作成功');
|
|
|
213
|
+ window.location.href = "borrowList.html?Itype=1";
|
|
|
214
|
+ } else {
|
|
|
215
|
+ mui.toast(data.message);
|
|
|
216
|
+ }
|
|
|
217
|
+ }
|
|
|
218
|
+ });
|
|
|
219
|
+ } else {
|
|
|
220
|
+ mui.toast("取消");
|
|
|
221
|
+ }
|
|
|
222
|
+ })
|
|
|
223
|
+})
|
|
|
224
|
+//入库
|
|
|
225
|
+$(".warehousing").click(function(){
|
|
|
226
|
+ idArr=[];
|
|
|
227
|
+ nameArr=[];
|
|
|
228
|
+ $(".mui-checkbox input[type='checkbox']:checked").each(function(index,item){
|
|
|
229
|
+ idArr.push($(this).attr('data-item'));
|
|
|
230
|
+ nameArr.push($(this).val())
|
|
|
231
|
+ })
|
|
|
232
|
+ for(var i=0;i<nameArr.length;i++){
|
|
|
233
|
+ if(nameArr[i] =='在库'){
|
|
|
234
|
+ mui.toast('不能入库')
|
|
|
235
|
+ return false
|
|
|
236
|
+ }
|
|
|
237
|
+ }
|
|
|
238
|
+ var btnArray = ['否', '是'];
|
|
|
239
|
+ mui.confirm('确定入库吗?', '提示', btnArray, function(f) {
|
|
|
240
|
+ if(f.index == 1) {
|
|
|
241
|
+ $.ajax({
|
|
|
242
|
+ type: "post",
|
|
|
243
|
+ dataType: 'json',
|
|
|
244
|
+ url: huayi.config.callcenter_url + 'archives/insideOperationRK',
|
|
|
245
|
+ async: true,
|
|
|
246
|
+ data: {
|
|
|
247
|
+ archivesids: idArr.toString(), //否 strubg 工单编号
|
|
|
248
|
+ openid: openid, //微信openid 测试用
|
|
|
249
|
+ },
|
|
|
250
|
+ success: function(data) {
|
|
|
251
|
+ if(data.state == "success") {
|
|
|
252
|
+ mui.toast('操作成功');
|
|
|
253
|
+ window.location.href = "borrowList.html?Itype=1";
|
|
|
254
|
+ } else {
|
|
|
255
|
+ mui.toast(data.message);
|
|
|
256
|
+ }
|
|
|
257
|
+ }
|
|
|
258
|
+ });
|
|
|
259
|
+ } else {
|
|
|
260
|
+ mui.toast("取消");
|
|
|
261
|
+ }
|
|
|
262
|
+ })
|
|
|
263
|
+})
|
|
93
|
264
|
//下拉刷新
|
|
94
|
265
|
function pullupRefresh() {
|
|
95
|
266
|
setTimeout(function() {
|
|
|
@@ -110,15 +281,17 @@ function pullupRefresh() {
|
|
110
|
281
|
total = data.data.total;
|
|
111
|
282
|
if(data.data.rows && data.data.rows.length > 0) {
|
|
112
|
283
|
$(data.data.rows).each(function(i, n) {
|
|
113
|
|
- $('<li class="mui-table-view-cell order" data-index="' + n.id + '">' +
|
|
114
|
|
- '<div class="mui-table">' +
|
|
115
|
|
- '<div class="mui-table-cell mui-col-xs-8">' +
|
|
116
|
|
- '<h4 class="mui-ellipsis">' + n.A_archiveName +
|
|
117
|
|
- '</h4><h5>' + n.OperationDate +
|
|
118
|
|
- '</h5></div>'+
|
|
119
|
|
- '<div class="mui-table-cell mui-col-xs-4 mui-text-right">'+
|
|
120
|
|
- '<span class="mui-h5">'+n.stateName+
|
|
121
|
|
- '</span></div></div></li>').appendTo('#OA_task');
|
|
|
284
|
+ $('<li class="mui-table-view-cell">' +
|
|
|
285
|
+ '<div class="mui-input-row mui-checkbox mui-left">'+
|
|
|
286
|
+ '<input name="checkbox1" data-item="' + n.id + '" value="'+n.stateName+'" type="checkbox" class="selected"></div>'+
|
|
|
287
|
+ '<div class="mui-table">' +
|
|
|
288
|
+ '<div class="mui-table-cell mui-col-xs-8 order" data-index="' + n.id + '">' +
|
|
|
289
|
+ '<h4 class="mui-ellipsis">' + n.A_archiveName +
|
|
|
290
|
+ '</h4><h5>' + n.OperationDate +
|
|
|
291
|
+ '</h5></div>'+
|
|
|
292
|
+ '<div class="mui-table-cell mui-col-xs-4 mui-text-right">'+
|
|
|
293
|
+ '<span class="mui-h5">'+n.stateName+
|
|
|
294
|
+ '</span></div></div></li>').appendTo('#OA_task');
|
|
122
|
295
|
});
|
|
123
|
296
|
//工单跳转
|
|
124
|
297
|
$('.order').on('tap', function() {
|