|
|
@@ -59,42 +59,49 @@ function initTable() {
|
|
59
|
59
|
});
|
|
60
|
60
|
}
|
|
61
|
61
|
|
|
62
|
|
-//选择公司名称
|
|
63
|
|
-$.getJSON(huayi.config.callcenter_url + "archives/getCompanyName", {
|
|
64
|
|
- token: $.cookie("token"),
|
|
65
|
|
- name:$("#companyName").val()
|
|
66
|
|
- }, function(res) {
|
|
67
|
|
- console.log(res);
|
|
68
|
|
- if(res.state.toLowerCase() == "success") {
|
|
69
|
|
- companyNameList = res.data.row;
|
|
70
|
|
- CompanyName($("#companyName"));
|
|
71
|
|
- }
|
|
72
|
|
- });
|
|
73
|
|
-function CompanyName(obj) {
|
|
|
62
|
+//搜索公司名称
|
|
|
63
|
+$.getJSON(huayi.config.callcenter_url + "archives/getCompanyName",{
|
|
|
64
|
+ token:$.cookie("token"),
|
|
|
65
|
+ name:$("#companyName").val()
|
|
|
66
|
+},function(res){
|
|
|
67
|
+ console.log(res);
|
|
|
68
|
+ if(res.state=="success"){
|
|
|
69
|
+ companyNameList=res.data.rows;
|
|
|
70
|
+ CompanyName($("#companyName"));
|
|
|
71
|
+ }
|
|
|
72
|
+})
|
|
|
73
|
+function CompanyName(obj){
|
|
74
|
74
|
obj.empty();
|
|
75
|
75
|
obj.append('<option value="">请选择公司名称</option>');
|
|
76
|
|
- $(companyNameList).each(function(i, n) {
|
|
77
|
|
- console.log(i,n);
|
|
78
|
|
- obj.append('<option value="' + i + '">' + n + '</option>');
|
|
|
76
|
+ $(companyNameList).each(function(i,n) {
|
|
|
77
|
+ obj.append('<option value="' + i+ '">' + n + '</option>');
|
|
79
|
78
|
})
|
|
80
|
|
-}
|
|
81
|
|
-
|
|
|
79
|
+}
|
|
82
|
80
|
|
|
83
|
81
|
//格式化操作
|
|
84
|
82
|
function formatterOprate(val, row) {
|
|
85
|
|
- if(row.stateName=='在库'){
|
|
86
|
|
- return '<ul class="tool_downs">' +
|
|
87
|
|
- '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_edit_' + row.id + '" onclick="btn_edit(\'' + row.id + '\')" title="修改">修改</a></li>' +
|
|
88
|
|
- '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_edit_' + row.id + '" onclick="btn_out( '+ row.id +' )" title="出库">出库</a></li>' +
|
|
89
|
|
- '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_delete_' + row.id + '" onclick="btn_delete(' + row.id + ')" title="删除">删除</a></li>' +
|
|
90
|
|
- '</ul>';
|
|
91
|
|
- }else{
|
|
92
|
|
- return '<ul class="tool_downs">' +
|
|
93
|
|
- '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_edit_' + row.id + '" onclick="btn_edit(\'' + row.id + '\')" title="修改">修改</a></li>' +
|
|
94
|
|
- '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_edit_' + row.id + '" onclick="btn_warehousing(\'' + row.id + '\')" title="入库">入库</a></li>' +
|
|
95
|
|
- '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_delete_' + row.id + '" onclick="btn_delete(' + row.id + ')" title="删除">删除</a></li>' +
|
|
96
|
|
- '</ul>';
|
|
97
|
|
- }
|
|
|
83
|
+ console.log(val, row);
|
|
|
84
|
+ return '<ul class="tool_downs">' +
|
|
|
85
|
+ '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_watch_' + row.companyname+ '" onclick="btn_watch(\'' + row.companyname + '\')" title="查看">查看</a></li>' +
|
|
|
86
|
+ '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_edit_' + row.companyname + '" onclick="btn_warehousing(\'' + row.companyname + '\')" title="入库">入库</a></li>' +
|
|
|
87
|
+ '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_EXwarehouse_' + row.companyname + '" onclick="btn_EXwarehouse(' + row.companyname + ')" title="出库">出库</a></li>' +
|
|
|
88
|
+ '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_Borrowing_' + row.companyname + '" onclick="btn_Borrowing(' + row.companyname + ')" title="借阅">借阅</a></li>' +
|
|
|
89
|
+ '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_giveBack_' + row.companyname + '" onclick="btn_giveBack(' + row.companyname + ')" title="出库">归还</a></li>' +
|
|
|
90
|
+ '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_delete_' + row.companyname + '" onclick="btn_delete(\'' + row.companyname + '\')" title="删除">删除</a></li>' +
|
|
|
91
|
+ '</ul>';
|
|
|
92
|
+// if(row.stateName=='在库'){
|
|
|
93
|
+// return '<ul class="tool_downs">' +
|
|
|
94
|
+// '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_edit_' + row.id + '" onclick="btn_edit(\'' + row.id + '\')" title="修改">修改</a></li>' +
|
|
|
95
|
+// '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_edit_' + row.id + '" onclick="btn_out( '+ row.id +' )" title="出库">出库</a></li>' +
|
|
|
96
|
+// '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_delete_' + row.id + '" onclick="btn_delete(' + row.id + ')" title="删除">删除</a></li>' +
|
|
|
97
|
+// '</ul>';
|
|
|
98
|
+// }else{
|
|
|
99
|
+// return '<ul class="tool_downs">' +
|
|
|
100
|
+// '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_edit_' + row.id + '" onclick="btn_edit(\'' + row.id + '\')" title="修改">修改</a></li>' +
|
|
|
101
|
+// '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_edit_' + row.id + '" onclick="btn_warehousing(\'' + row.id + '\')" title="入库">入库</a></li>' +
|
|
|
102
|
+// '<li><a href="javascript:;" class="aBtn " authorize="yes" id="HY_delete_' + row.id + '" onclick="btn_delete(' + row.id + ')" title="删除">删除</a></li>' +
|
|
|
103
|
+// '</ul>';
|
|
|
104
|
+// }
|
|
98
|
105
|
|
|
99
|
106
|
}
|
|
100
|
107
|
|
|
|
@@ -120,6 +127,19 @@ function btn_out(id,archivesid) {
|
|
120
|
127
|
});
|
|
121
|
128
|
}
|
|
122
|
129
|
/**
|
|
|
130
|
+ * 查看
|
|
|
131
|
+ */
|
|
|
132
|
+function btn_watch(companyname){
|
|
|
133
|
+ console.log(companyname);
|
|
|
134
|
+ layer.open({
|
|
|
135
|
+ type: 2,
|
|
|
136
|
+ title: '查看档案物资信息',
|
|
|
137
|
+ maxmin: true, //开启最大化最小化按钮
|
|
|
138
|
+ area: ['50%', '60%'],
|
|
|
139
|
+ content: '../commonTpl/watchOrEditArchivesList.html?companyname='+companyname
|
|
|
140
|
+ });
|
|
|
141
|
+}
|
|
|
142
|
+/**
|
|
123
|
143
|
* 入库
|
|
124
|
144
|
*/
|
|
125
|
145
|
function btn_warehousing(id,archivesid) {
|
|
|
@@ -163,7 +183,7 @@ function btn_edit(editId) {
|
|
163
|
183
|
type: 2,
|
|
164
|
184
|
title: '修改档案物资信息',
|
|
165
|
185
|
maxmin: true, //开启最大化最小化按钮
|
|
166
|
|
- area: ['50%', '60%'],
|
|
|
186
|
+ area: ['70%', '90%'],
|
|
167
|
187
|
content: '../commonTpl/addOrEditArchivesList.html?edit_id=' + editId
|
|
168
|
188
|
});
|
|
169
|
189
|
}
|
|
|
@@ -183,6 +203,7 @@ function btn_export() {
|
|
183
|
203
|
|
|
184
|
204
|
//删除
|
|
185
|
205
|
function btn_delete(cid) {
|
|
|
206
|
+ console.log(cid);
|
|
186
|
207
|
layer.confirm('确定删除当前记录?', {
|
|
187
|
208
|
icon: 7,
|
|
188
|
209
|
btn: ['是', '否'] //按钮
|
|
|
@@ -190,11 +211,11 @@ function btn_delete(cid) {
|
|
190
|
211
|
/*执行删除*/
|
|
191
|
212
|
$.ajax({
|
|
192
|
213
|
type: "post",
|
|
193
|
|
- url: huayi.config.callcenter_url + "archives/DeleteQuestion",
|
|
|
214
|
+ url: huayi.config.callcenter_url + "archives/delateArchivesByCompanyName",
|
|
194
|
215
|
dataType: 'json',
|
|
195
|
216
|
async: true,
|
|
196
|
217
|
data: {
|
|
197
|
|
- id: cid,//客户Id,可多选[1,2,3]
|
|
|
218
|
+ companyName: cid,//客户Id,可多选[1,2,3]
|
|
198
|
219
|
token: $.cookie("token")
|
|
199
|
220
|
},
|
|
200
|
221
|
success: function(data) {
|
|
|
@@ -205,6 +226,29 @@ function btn_delete(cid) {
|
|
205
|
226
|
});
|
|
206
|
227
|
});
|
|
207
|
228
|
}
|
|
|
229
|
+//function btn_delete(cid) {
|
|
|
230
|
+// layer.confirm('确定删除当前记录?', {
|
|
|
231
|
+// icon: 7,
|
|
|
232
|
+// btn: ['是', '否'] //按钮
|
|
|
233
|
+// }, function(index) {
|
|
|
234
|
+// /*执行删除*/
|
|
|
235
|
+// $.ajax({
|
|
|
236
|
+// type: "post",
|
|
|
237
|
+// url: huayi.config.callcenter_url + "archives/DeleteQuestion",
|
|
|
238
|
+// dataType: 'json',
|
|
|
239
|
+// async: true,
|
|
|
240
|
+// data: {
|
|
|
241
|
+// id: cid,//客户Id,可多选[1,2,3]
|
|
|
242
|
+// token: $.cookie("token")
|
|
|
243
|
+// },
|
|
|
244
|
+// success: function(data) {
|
|
|
245
|
+// layer.msg("删除成功!");
|
|
|
246
|
+// $('#cusList').bootstrapTable('refresh');
|
|
|
247
|
+// layer.close(index);
|
|
|
248
|
+// }
|
|
|
249
|
+// });
|
|
|
250
|
+// });
|
|
|
251
|
+//}
|
|
208
|
252
|
|
|
209
|
253
|
//导出
|
|
210
|
254
|
$('.btn_export1').click(function() {
|