endorsement.js
3.47 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
var path = "";
$(document).ready(function () {
var location = window.document.location;
path = location.protocol + "//" + location.host + "/OfficialDocument";
$("#div-document-selecttype>div").click(checkboxType_selected);
$("#doctype-selecttype>div").click(checkboxDocType_selected);
$("#allselected").click(checkboxType_selected);
//点击打开详情页面
$("#datalist tbody tr").click(openDetails);
// addEvent();
});
function addEvent() {
$("#btnNewDispatch").click(newDispatch);
$("#btnNewReceived").click(newReceivedWindow);
$("#btnNewLetters").click(newLettersWindow);
}
//右侧复选操作
function checkboxType_selected(evt) {
var checkbox = evt.currentTarget;
if($(checkbox).attr("class") == "div-checkbox-selected") {
$(checkbox).attr("class", "div-checkbox");
$(checkbox).find("img").attr("src", global.contextPath+"/image/officedocument/32x32/menu-document-checkbox.png");
}else {
if(checkbox.innerText == "全部"){
$("#doctype-selecttype>div").attr("class", "div-checkbox").find("img").attr("src", global.contextPath+"/image/officedocument/32x32/menu-document-checkbox.png");
}
$(checkbox).attr("class", "div-checkbox-selected");
$(checkbox).find("img").attr("src", global.contextPath+"/image/officedocument/32x32/menu-document-selected.png");
}
}
//公文筛选复选操作
function checkboxDocType_selected(evt) {
var checkbox = evt.currentTarget;
if ($(checkbox).attr("class") == "div-checkbox-selected") {
// if ($(".div-checkbox-selected").length <= 1) {
// layer.msg("请至少选中一项");
// return;
// }
/*if ($("#doctype-selecttype .div-checkbox-selected").length <= 1) {
layer.msg("请至少选中一项公文");
return;
}*/
$(checkbox).attr("class", "div-checkbox");
$(checkbox).find("img").attr("src", global.contextPath+"/image/officedocument/32x32/menu-document-checkbox.png");
} else {
if(checkbox.innerText == "发文" ||checkbox.innerText == "收文" ||checkbox.innerText == "信件"||checkbox.innerText == "纪要"){
$("#allselected").attr("class", "div-checkbox").find("img").attr("src", global.contextPath+"/image/officedocument/32x32/menu-document-checkbox.png");
}
$(checkbox).attr("class", "div-checkbox-selected");
$(checkbox).find("img").attr("src", global.contextPath+"/image/officedocument/32x32/menu-document-selected.png");
if($("#doctype-selecttype .div-checkbox-selected").length == 4){
$("#doctype-selecttype>div").attr("class", "div-checkbox").find("img").attr("src", global.contextPath+"/image/officedocument/32x32/menu-document-checkbox.png");
$("#allselected").attr("class", "div-checkbox-selected").find("img").attr("src", global.contextPath+"/image/officedocument/32x32/menu-document-selected.png");
}
}
}
//打开详情页面
function openDetails() {
var type=$(this).find(".td-document-type span").html();
if (type.indexOf("信件")>=0) {
newLettersWindow();
} else if (type.indexOf("收文") >= 0) {
newReceivedWindow();
} else if (type.indexOf("发文") >= 0) {
newDispatch();
}
}
//收文
function newReceivedWindow() {
window.open(path + "/form/newCirculate.html");//newReceived.html");
}
//信件
function newLettersWindow() {
window.open(path + "/form/newLetters.html");
}
//发文
function newDispatch() {
window.open(path + "/form/newDispatch.html");
}