collectionStorage.js
2.85 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
/**
* 入库
*/
var CollectionStorage = function() {
return {
search : function() {
$("#data-grid").datagrid({
url : "/ration/storage/search",
queryParams : App.dataGridQueryParams('search-form')
});
},
beforeVote : function() {
var row = $("#data-grid").datagrid("getSelected");
if (row) {
$("#add-form").form("clear");
$('#applyNo').val(row.APPLY_NO);
$("#add-dialog").dialog('open');
} else {
$.messager.alert('Warning', '请选择要操作的数据');
}
},
/** 鉴定否决 */
vote : function() {
$("#add-form").form('submit', {
url : "/ration/storage/vote",
onSubmit : function(param) {
return $(this).form('validate');
},
success : function(data) {
$.messager.show({
title : '信息',
msg : $.parseJSON(data).message,
});
$("#add-dialog").dialog("close");
$("#data-grid").datagrid("reload");
}
});
},
/** 取消托管 */
cancel : function() {
var row = $("#data-grid").datagrid("getSelected");
if (row) {
var confirmMsg = '<div>确认要取消该托管记录吗?取消成功后,<br>1、托管状态变为申请取消,鉴定费为0。<br>';
confirmMsg += '2、退还用户鉴定费。<br>3、取消数量增加到剩余征集量。</div>';
$.messager.confirm('Confirm', confirmMsg, function(ok) {
if (ok) {
$.post('/ration/storage/cancel', {
applyNo : row.APPLY_NO
}, function(result) {
$('#data-grid').datagrid('reload');
$.messager.alert('信息', result.message);
}, 'json');
}
});
} else {
$.messager.alert('Warning', '请选择要操作的数据');
}
},
/** 入库 */
storage : function() {
var select = $("#data-grid").datagrid("getSelections");
var params = select[0].APPLY_NO;
for (var i = 0; i < select.length; i++) {
params += "," + select[i].APPLY_NO;
}
$.ajax({
url : "/ration/storage/storage",
type : "post",
dataType : "json",
data : {
param : params
},
success : function(data) {
if (data.resultCode == "1") {
$.messager.show({
title : '信息',
msg : '设置成功'
});
$('#data-grid').datagrid('reload');
}
}
});
},
export : function() {
$.messager.confirm('Confirm', '确定导出确权文件吗?', function(ok) {
if (ok) {
window.open('/ration/storage/export?' + $('#search-form').serialize());
}
});
},
applyType : function(value, row, index) {
var status;
switch (value) {
case "0":
return "待审核";
case "2":
return "待鉴定";
case "3":
return "鉴定不通过";
case '4':
status = '待入库';
break;
case '5':
status = '已入库';
break;
case '6':
status = '已确权';
break;
case '7':
status = '申请取消';
break;
}
return status;
}
}
}();