project.js
3.82 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/**
* @fileOverview 反馈模块
* @author:Hbomb(zhouqq@yoho.cn)
* @date:2013-05-27
*/
define('project',function(require, exports)
{
var box = require('box'); // 提示框
var $ = require("jquery");
require('lib/ui/jquery.gantt');
var form_html = $("#form_pan").html()+'';
var admin = $("#form_pan").attr("admin");
$("#form_pan").remove();
$("#btn-createproject").click(function()
{
box.confirm
(
form_html, submitProject,
{
title: '创建项目',
width: '750px',
autoClose: false
}
);
$('#finish_time,#create_time').click(function()
{
WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});
});
});
//查看
$(".look").click(function()
{
box.confirm
(
form_html, submitProject,
{
title: '查看项目',
width: '750px',
autoClose: false
}
);
var obj = $(this).parents("tr");
var name = obj.find("td:eq(1)").text();
var email_list = obj.find("td:eq(2)").text();
var finish_time = obj.find("td:eq(4)").text();
var create_time = obj.find("td:eq(3)").text();
var id = obj.find("td:eq(0)").text();
$("#id").val(id);
$("#name").val(name);
$("#email_list").val(email_list);
$("#finish_time").val(finish_time);
$("#create_time").val(create_time);
$("#state").val($(".search_panel select").val());
$('#finish_time,#create_time').click(function()
{
WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});
});
});
function submitProject()
{
if(admin==0)
{
alert("无权进行此操作");
return;
}
var name = $("#name").val();
var state = $("#state").val();
var finish_time = $("#finish_time").val();
var create_time = $("#create_time").val();
var email_list = $("#email_list").val();
var id = $("#id").val();
if(name==""||create_time==""||finish_time==""||email_list=="")
{
alert("所有字段不能为空!");
return;
}
$.ajax
({
type: "post",
url: '/default/default/submitproject',
data: "name=" + name+
"&finish_time="+finish_time+
"&create_time="+create_time+
"&email_list="+email_list+
"&state="+state+
"&id="+id,
success: function(data)
{
if (data.code == 200)
{
window.location.reload();
}
else
{
box.alert(data.message);
}
}
});
}
$.ajax
({
type: "get",
url: '/default/default/getprojectlist',
dataType:"json",
success: function(data)
{
if (data)
{
$(".gantt").gantt(
{
months:["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
dow:["日", "一", "二", "三", "四", "五", "六"],
source: data,
navigate: "scroll",
scale: "days",
maxScale: "months",
minScale: "days",
itemsPerPage: 10,
onItemClick: function(data) {
},
onAddClick: function(dt, rowId) {
},
onRender: function() {
}
});
}
}
});
});