|
|
@@ -22,123 +22,126 @@ $(document).ready(function() {
|
|
22
|
22
|
function(row) {
|
|
23
|
23
|
return row;
|
|
24
|
24
|
});
|
|
25
|
|
- console.log(ids);
|
|
26
|
25
|
//获取物资id、获取物资状态
|
|
27
|
|
- for(var i = 0; i < ids.length; i++) {
|
|
|
26
|
+ for(var i = 0; i < ids.length; i++) {
|
|
28
|
27
|
wzId.push(ids[i].id);
|
|
29
|
28
|
wzState.push(ids[i].statename);
|
|
30
|
29
|
}
|
|
31
|
|
- console.log(wzId,wzState);
|
|
32
|
30
|
var newids = wzId.join(","); //物资id
|
|
33
|
31
|
var newfields = fields.join(","); //图片id
|
|
34
|
32
|
if(state == "出库") {
|
|
35
|
|
- console.log("出库");
|
|
36
|
33
|
for(var i = 0; i < wzState.length; i++) {
|
|
37
|
34
|
if(wzState[i] == "已出库") {
|
|
38
|
35
|
parent.layer.msg("出库失败,已有物资是出库状态");
|
|
39
|
|
- wzState=[];
|
|
40
|
|
- wzId=[];
|
|
|
36
|
+ wzState = [];
|
|
|
37
|
+ wzId = [];
|
|
41
|
38
|
initTable();
|
|
42
|
39
|
return;
|
|
43
|
40
|
}
|
|
44
|
|
- $.ajax({
|
|
45
|
|
- type: "post",
|
|
46
|
|
- url: huayi.config.callcenter_url + "archives/CKOperate",
|
|
47
|
|
- async: true,
|
|
48
|
|
- dataType: 'json',
|
|
49
|
|
- data: {
|
|
50
|
|
- ids: newids, //物资id
|
|
51
|
|
- remark: $('#content').val(), //备注信息
|
|
52
|
|
- inside: $('#customer_isbankSlips').find('input[type="radio"]:checked').val(), //是否再外
|
|
53
|
|
- openid: "", //微信公众号用的
|
|
54
|
|
- companyName: companyname, //公司名称
|
|
55
|
|
- fields: newfields, //图片id
|
|
56
|
|
- token: $.cookie("token")
|
|
57
|
|
- },
|
|
58
|
|
- success: function(data) {
|
|
|
41
|
+ }
|
|
|
42
|
+ $.ajax({
|
|
|
43
|
+ type: "post",
|
|
|
44
|
+ url: huayi.config.callcenter_url + "archives/CKOperate",
|
|
|
45
|
+ async: true,
|
|
|
46
|
+ dataType: 'json',
|
|
|
47
|
+ data: {
|
|
|
48
|
+ ids: newids, //物资id
|
|
|
49
|
+ remark: $('#content').val(), //备注信息
|
|
|
50
|
+ inside: $('#customer_isbankSlips').find('input[type="radio"]:checked').val(), //是否再外
|
|
|
51
|
+ openid: "", //微信公众号用的
|
|
|
52
|
+ companyName: companyname, //公司名称
|
|
|
53
|
+ fields: newfields, //图片id
|
|
|
54
|
+ token: $.cookie("token")
|
|
|
55
|
+ },
|
|
|
56
|
+ success: function(data) {
|
|
59
|
57
|
|
|
60
|
|
- if(data.state == "success") {
|
|
61
|
|
- var index = parent.layer.getFrameIndex(window.name);
|
|
62
|
|
- parent.layer.close(index);
|
|
63
|
|
- parent.layer.msg("出库成功");
|
|
64
|
|
- parent.initTable();
|
|
65
|
|
- }
|
|
66
|
|
- console.log(data);
|
|
|
58
|
+ if(data.state == "success") {
|
|
|
59
|
+ var index = parent.layer.getFrameIndex(window.name);
|
|
|
60
|
+ parent.layer.close(index);
|
|
|
61
|
+ parent.layer.msg("出库成功");
|
|
|
62
|
+ parent.initTable();
|
|
67
|
63
|
}
|
|
68
|
|
- })
|
|
69
|
|
- }
|
|
|
64
|
+ }
|
|
|
65
|
+ })
|
|
70
|
66
|
} else if(state == "入库") {
|
|
71
|
67
|
console.log("入库");
|
|
72
|
68
|
for(var i = 0; i < wzState.length; i++) {
|
|
73
|
69
|
if(wzState[i] == "在库") {
|
|
74
|
70
|
parent.layer.msg("入库失败,已有物资是在库状态");
|
|
75
|
|
- wzState=[];
|
|
76
|
|
- wzId=[];
|
|
|
71
|
+ wzState = [];
|
|
|
72
|
+ wzId = [];
|
|
77
|
73
|
initTable();
|
|
78
|
74
|
return;
|
|
79
|
75
|
}
|
|
80
|
|
- $.ajax({
|
|
81
|
|
- type: "post",
|
|
82
|
|
- url: huayi.config.callcenter_url + "archives/RKOperate",
|
|
83
|
|
- async: true,
|
|
84
|
|
- dataType: 'json',
|
|
85
|
|
- data: {
|
|
86
|
|
- ids: newids, //物资id
|
|
87
|
|
- remark: $('#content').val(), //备注信息
|
|
88
|
|
- inside: $('#customer_isbankSlips').find('input[type="radio"]:checked').val(), //是否再外
|
|
89
|
|
- openid: "", //微信公众号用的
|
|
90
|
|
- companyName: companyname, //公司名称
|
|
91
|
|
- fields: newfields, //图片id
|
|
92
|
|
- token: $.cookie("token")
|
|
93
|
|
- },
|
|
94
|
|
- success: function(data) {
|
|
95
|
|
- if(data.state == "success") {
|
|
96
|
|
- var index = parent.layer.getFrameIndex(window.name);
|
|
97
|
|
- parent.layer.close(index);
|
|
98
|
|
- parent.layer.msg("入库成功");
|
|
99
|
|
- parent.initTable();
|
|
100
|
|
- }
|
|
101
|
|
- console.log(data);
|
|
102
|
|
- }
|
|
103
|
|
- })
|
|
104
|
76
|
}
|
|
|
77
|
+ $.ajax({
|
|
|
78
|
+ type: "post",
|
|
|
79
|
+ url: huayi.config.callcenter_url + "archives/RKOperate",
|
|
|
80
|
+ async: true,
|
|
|
81
|
+ dataType: 'json',
|
|
|
82
|
+ data: {
|
|
|
83
|
+ ids: newids, //物资id
|
|
|
84
|
+ remark: $('#content').val(), //备注信息
|
|
|
85
|
+ inside: $('#customer_isbankSlips').find('input[type="radio"]:checked').val(), //是否再外
|
|
|
86
|
+ openid: "", //微信公众号用的
|
|
|
87
|
+ companyName: companyname, //公司名称
|
|
|
88
|
+ fields: newfields, //图片id
|
|
|
89
|
+ token: $.cookie("token")
|
|
|
90
|
+ },
|
|
|
91
|
+ success: function(data) {
|
|
|
92
|
+ if(data.state == "success") {
|
|
|
93
|
+ var index = parent.layer.getFrameIndex(window.name);
|
|
|
94
|
+ parent.layer.close(index);
|
|
|
95
|
+ parent.layer.msg("入库成功");
|
|
|
96
|
+ parent.initTable();
|
|
|
97
|
+ }
|
|
|
98
|
+ console.log(data);
|
|
|
99
|
+ }
|
|
|
100
|
+ })
|
|
105
|
101
|
} else if(state == "借阅") {
|
|
106
|
|
- console.log("借阅");
|
|
107
|
102
|
for(var i = 0; i < wzState.length; i++) {
|
|
108
|
103
|
if(wzState[i] == "已出库") {
|
|
109
|
104
|
parent.layer.msg("借阅失败,有物资是出库状态");
|
|
110
|
|
- wzState=[];
|
|
111
|
|
- wzId=[];
|
|
|
105
|
+ wzState = [];
|
|
|
106
|
+ wzId = [];
|
|
112
|
107
|
initTable();
|
|
113
|
108
|
return;
|
|
114
|
109
|
}
|
|
115
|
|
- $.ajax({
|
|
116
|
|
- type: "post",
|
|
117
|
|
- url: huayi.config.callcenter_url + "archives/JYOperate ",
|
|
118
|
|
- async: true,
|
|
119
|
|
- dataType: 'json',
|
|
120
|
|
- data: {
|
|
121
|
|
- ids: newids, //物资id
|
|
122
|
|
- remark: $('#content').val(), //备注信息
|
|
123
|
|
- // inside: $('#customer_isbankSlips').find('input[type="radio"]:checked').val(), //是否再外
|
|
124
|
|
- openid: "", //微信公众号用的
|
|
125
|
|
- companyName: companyname, //公司名称
|
|
126
|
|
- fields: newfields, //图片id
|
|
127
|
|
- token: $.cookie("token")
|
|
128
|
|
- },
|
|
129
|
|
- success: function(data) {
|
|
130
|
|
- if(data.state == "success") {
|
|
131
|
|
- var index = parent.layer.getFrameIndex(window.name);
|
|
132
|
|
- parent.layer.close(index);
|
|
133
|
|
- parent.layer.msg("借阅成功");
|
|
134
|
|
- parent.initTable();
|
|
135
|
|
- }
|
|
136
|
|
- console.log(data);
|
|
137
|
|
- }
|
|
138
|
|
- })
|
|
139
|
110
|
}
|
|
|
111
|
+ $.ajax({
|
|
|
112
|
+ type: "post",
|
|
|
113
|
+ url: huayi.config.callcenter_url + "archives/JYOperate ",
|
|
|
114
|
+ async: true,
|
|
|
115
|
+ dataType: 'json',
|
|
|
116
|
+ data: {
|
|
|
117
|
+ ids: newids, //物资id
|
|
|
118
|
+ remark: $('#content').val(), //备注信息
|
|
|
119
|
+ // inside: $('#customer_isbankSlips').find('input[type="radio"]:checked').val(), //是否再外
|
|
|
120
|
+ openid: "", //微信公众号用的
|
|
|
121
|
+ companyName: companyname, //公司名称
|
|
|
122
|
+ fields: newfields, //图片id
|
|
|
123
|
+ token: $.cookie("token")
|
|
|
124
|
+ },
|
|
|
125
|
+ success: function(data) {
|
|
|
126
|
+ if(data.state == "success") {
|
|
|
127
|
+ var index = parent.layer.getFrameIndex(window.name);
|
|
|
128
|
+ parent.layer.close(index);
|
|
|
129
|
+ parent.layer.msg("借阅成功");
|
|
|
130
|
+ parent.initTable();
|
|
|
131
|
+ }
|
|
|
132
|
+ console.log(data);
|
|
|
133
|
+ }
|
|
|
134
|
+ })
|
|
140
|
135
|
} else {
|
|
141
|
|
- console.log("归还");
|
|
|
136
|
+ for(var i = 0; i < wzState.length; i++) {
|
|
|
137
|
+ if(wzState[i] != "借阅中") {
|
|
|
138
|
+ parent.layer.msg("归还失败,有物资不是借阅状态");
|
|
|
139
|
+ wzState = [];
|
|
|
140
|
+ wzId = [];
|
|
|
141
|
+ initTable();
|
|
|
142
|
+ return;
|
|
|
143
|
+ }
|
|
|
144
|
+ }
|
|
142
|
145
|
$.ajax({
|
|
143
|
146
|
type: "post",
|
|
144
|
147
|
url: huayi.config.callcenter_url + "archives/GHOperate",
|
|
|
@@ -159,9 +162,9 @@ $(document).ready(function() {
|
|
159
|
162
|
parent.layer.close(index);
|
|
160
|
163
|
parent.layer.msg("归还成功");
|
|
161
|
164
|
parent.initTable();
|
|
162
|
|
- }else{
|
|
163
|
|
- wzState=[];
|
|
164
|
|
- wzId=[];
|
|
|
165
|
+ } else {
|
|
|
166
|
+ wzState = [];
|
|
|
167
|
+ wzId = [];
|
|
165
|
168
|
initTable();
|
|
166
|
169
|
}
|
|
167
|
170
|
}
|
|
|
@@ -328,8 +331,8 @@ $(document).ready(function() {
|
|
328
|
331
|
queryParamsType: "undefined",
|
|
329
|
332
|
queryParams: function queryParams(params) { //设置查询参数
|
|
330
|
333
|
var param = {
|
|
331
|
|
- PageIndex:params.pageNumber,
|
|
332
|
|
- pageSize:params.pageSize,
|
|
|
334
|
+ PageIndex: params.pageNumber,
|
|
|
335
|
+ pageSize: params.pageSize,
|
|
333
|
336
|
F_CompanyName: companyname,
|
|
334
|
337
|
token: $.cookie("token")
|
|
335
|
338
|
};
|