task_add.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <%@ page language="java" contentType="text/html;charset=GBK"
  2. pageEncoding="GBK"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <title>非项目任务项管理-添加任务</title>
  9. <link
  10. href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css"
  11. rel="stylesheet" type="text/css" />
  12. <link href="/shares/xheditor/xheditor-1.1.14/demos/common.css"
  13. rel="stylesheet" type="text/css" media="screen" />
  14. <link href="/shares/css/yw/tms/task.css" rel="stylesheet"
  15. type="text/css" />
  16. <link href="${pageContext.request.contextPath }/main.css"
  17. rel="stylesheet" type="text/css" />
  18. <script
  19. src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js"
  20. type="text/javascript"></script>
  21. <script
  22. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js"
  23. type="text/javascript"></script>
  24. <script
  25. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js"
  26. type="text/javascript"></script>
  27. <script
  28. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDialog.js"
  29. type="text/javascript"></script>
  30. <script
  31. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerCheckBox.js"
  32. type="text/javascript"></script>
  33. <script
  34. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerResizable.js"
  35. type="text/javascript"></script>
  36. <script
  37. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerComboBox.js"
  38. type="text/javascript"></script>
  39. <script src="/shares/js/common.js" type="text/javascript"></script>
  40. <script
  41. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerTab.js"
  42. type="text/javascript"></script>
  43. <script
  44. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js"
  45. type="text/javascript"></script>
  46. <script type="text/javascript" src="/shares/js/common.js"></script>
  47. <link rel="stylesheet" type="text/css" href="/shares/css/yw/master1/win/jquery.jscrollpane.codrops1.css" />
  48. <!-- the mousewheel plugin -->
  49. <script type="text/javascript" src="/shares/js/yw/master1/jquery.mousewheel.js"></script>
  50. <!-- the jScrollPane script -->
  51. <script type="text/javascript" src="/shares/js/yw/master1/jquery.jscrollpane.min.js"></script>
  52. <script type="text/javascript" src="/shares/js/yw/master1/scroll-startstop.events.jquery.js"></script>
  53. <script type="text/javascript" src="/shares/js/yw/master1/scroll.js"></script>
  54. <link href="/shares/css/yw/master1/reset.css" rel="stylesheet" type="text/css" />
  55. <script type="text/javascript"
  56. src="/shares/xheditor/xheditor-1.1.14/xheditor-1.1.14-zh-cn.min.js"></script>
  57. <style type="text/css">
  58. .l-table-edit-text {
  59. width: 100px;
  60. font-weight: bold;
  61. color: #cc000
  62. }
  63. .default-select {
  64. width: 500px;
  65. height: 22px;
  66. line-height: 22px;
  67. }
  68. .short-select {
  69. width: 273px;
  70. height: 22px;
  71. line-height: 22px;
  72. }
  73. .default-text {
  74. width: 270px;
  75. height: 22px;
  76. line-height: 22px
  77. }
  78. .short-text {
  79. width: 270px;
  80. line-height: 22px;
  81. height: 22px;
  82. }
  83. .l-text{
  84. width: 270px;
  85. line-height: 22px;
  86. height: 22px;
  87. }
  88. .text {
  89. height: 22px;
  90. line-height: 22px;
  91. margin-right: 10px;
  92. display: inline-block;
  93. margin-left: 1px
  94. }
  95. .title {
  96. font-size: 20px;
  97. font-weight: bold;
  98. padding-bottom: 20px;
  99. padding-left: 5px;
  100. border-bottom: 1px solid #ededed;
  101. vertical-align: middle;
  102. }
  103. .l-table-edit-td{
  104. width:270px;
  105. }
  106. .l-table-edit-text{
  107. width:89px;
  108. }
  109. .forum-container-2 .l-table-edit-text{
  110. width:99px;
  111. }
  112. .projectTable{margin: 5px}
  113. .projectTable tr{height: 25px; padding-bottom: 2px; margin: 10px auto}
  114. .projectTable .left-text {width: 80px; }
  115. .jp-container{
  116. height:500px;
  117. position:relative;
  118. overflow:hidden;
  119. }
  120. </style>
  121. <script type="text/javascript">
  122. var userScope = "${userScope}";
  123. var tab;
  124. if(userScope == "all"){
  125. tab = "1";
  126. }else if(userScope == "dept"){
  127. tab = "2";
  128. }
  129. $(function(){
  130. var msg="${msg}";
  131. if(msg !=""){
  132. if("操作成功"==msg){
  133. $.ligerDialog({content:msg, title:"操作成功",type:"success",width:250,height:55,allowClose : false,
  134. buttons:[ {text:"关闭",onclick:function(){closeAndReload();}}]
  135. });
  136. }else{
  137. $.ligerDialog.success(msg);
  138. }
  139. }
  140. $("#startDate").ligerDateEditor({
  141. labelWidth : 100,
  142. labelAlign : 'right',
  143. showTime: true,
  144. initValue:'${map.startDate }'
  145. });
  146. $("#endDate").ligerDateEditor({
  147. labelWidth : 100,
  148. labelAlign : 'right',
  149. showTime: true,
  150. initValue:'${map.endDate }'
  151. });
  152. });
  153. function toAddUser(){
  154. var dept=$("#relate_dep_id").val();
  155. if(!dept){
  156. $.ligerDialog.warn('请在项目信息中选择涉及部门');
  157. return;
  158. }
  159. loadTypeTree("usernameButton",{tab:"2",type:"user",backId:"user_id",backName:"user_name",tabParam:[{tab:"2",root:dept}]});
  160. $.ligerDialog.open({width:380, target: $("#target1"),title:"添加项目人员" });
  161. }
  162. //关闭当前页面刷新列表必须要传入tabid
  163. function closeAndReload(){
  164. var old_tabid = '${tabid}';
  165. if(old_tabid.length > 0){
  166. var tabid = getCurrentTabId();
  167. window.parent.f_selectTab(old_tabid);
  168. window.parent.f_reloadTab(old_tabid);
  169. window.parent.f_closeTab(tabid);
  170. }
  171. }
  172. function delUser(team_id,project_id){
  173. if(confirm("确定要删除")){
  174. $.ajax({
  175. type:"POST",
  176. url:"pmProject.do?task=delteamuser&team_id="+team_id+"&project_id="+project_id+"&time=" + new Date().getTime(),
  177. timeout:10000,
  178. cache:false,
  179. dataType:"json",
  180. success:function(msg){
  181. //closeWaittingDialog();
  182. if(msg > 0){
  183. $.ligerDialog.hide();
  184. $.ligerDialog.success("删除成功");
  185. initTeamgrid();
  186. }else{
  187. $.ligerDialog.warn("删除失败");
  188. }
  189. }
  190. });
  191. }
  192. }
  193. function closeDiv(){
  194. $.ligerDialog.hide();
  195. }
  196. function submitForm(){
  197. var obj = window.top;
  198. $("#tasktitle_msg").empty();
  199. $("#taskDetail_msg").empty();
  200. $("#planjobtime_msg").empty();
  201. $("#endDate_msg").empty();
  202. $("#startDate_msg").empty();
  203. $("#planjobtime_msg_").empty();
  204. $("#tasktitle_msg_").empty();
  205. var rs = $.validate({
  206. name : "tasktitle",
  207. model : [ {
  208. type : "require",
  209. msg : "请输入任务标题!"
  210. }, {
  211. type : "len",
  212. min : 1,
  213. max : 50,
  214. msg : "任务标题最长50个字以内!"
  215. } ]
  216. });
  217. rs = $.validate({
  218. name : "taskDetail",
  219. model : [ {
  220. type : "len",
  221. min : 0,
  222. max : 50,
  223. msg : "任务描述最长50个字以内!",
  224. msgBox : "taskDetail_msg"
  225. } ]
  226. }) && rs;
  227. rs = $.validate({
  228. name : "planjobtime",
  229. model : [ {
  230. type : "isNumber",
  231. msg : "请输入数字!"
  232. } ,{
  233. type : "require",
  234. msg : "请输入计划工作量!"
  235. }]
  236. }) && rs;
  237. rs = $.validate({
  238. name : "endDate",
  239. model : [ {
  240. type : "require",
  241. msg : "请选择正确的时间格式!",
  242. msgBox : "endDate_msg"
  243. } ]
  244. }) && rs;
  245. rs = $.validate({
  246. name : "startDate",
  247. model : [ {
  248. type : "require",
  249. msg : "请选择正确的时间格式!",
  250. msgBox : "startDate_msg"
  251. } ]
  252. }) && rs;
  253. if(rs){
  254. if ($("#planjobtime").val() <= 0){
  255. $("#planjobtime_msg").append("<font color=\"red\">计划工作量应大于0!</font>");
  256. document.all.planjobtime.focus();
  257. rs = false;
  258. }else if (new Date(Date.parse($("#endDate").val().replace("-","/"))) <= new Date(Date.parse($("#startDate").val().replace("-","/")))){
  259. $("#endDate_msg").append("<font color=\"red\">结束时间不能早于或等于开始时间!</font>");
  260. document.all.endDate.focus();
  261. rs = false;
  262. }
  263. }
  264. if (rs && comp_date()) {
  265. $("#_project").submit();
  266. }
  267. }
  268. function comp_date(){
  269. var start_date=$("#startDate").val();
  270. var end_date=$("#endDate").val();
  271. if(start_date =="" || start_date==null){
  272. return true;
  273. }
  274. if(end_date =="" || end_date==null){
  275. return true;
  276. }
  277. var starts=start_date.split("-");
  278. var starttime = new Date(starts[0], starts[1], starts[2]);
  279. var starttimes = starttime.getTime();
  280. var ends=end_date.split("-");
  281. var endtime = new Date(ends[0], ends[1], ends[2]);
  282. var endtimes = endtime.getTime();
  283. if(starttimes>endtimes){
  284. $("#end_dateMsg").html("开始时间不得早于结束时间");
  285. return false;
  286. }
  287. $("#end_dateMsg").html("");
  288. return true;
  289. }
  290. </script>
  291. </head>
  292. <body style="overflow:hidden;" ontouchmove="event.preventDefault();">
  293. <form method='post' name="_project" id="_project" <c:if test="${map.edit == 'edit' }"> action="mtTaskCenterMgr.do?task=editTask"</c:if> <c:if test="${map.edit == null }"> action="mtTaskCenterMgr.do?task=createTask"</c:if>>
  294. <input type="hidden" name="universalid" id="universalid" value="${universalid }" />
  295. <!-- 任务的id -->
  296. <input type="hidden" name="taskid" id="taskid" value="${map.taskid }" />
  297. <div class="s_title b10 f6">
  298. <img src="/shares/images/master1/gg_ico.png" width="27" height="26" /><c:if test="${map.edit == 'edit' }"> 修改非项目任务</c:if> <c:if test="${map.edit == null }"> 新增非项目任务</c:if>
  299. </div>
  300. <div id="title" class="form-button" style=" margin-top: 40px">
  301. <input type="button" id="back" class="l-button" value="返回" onclick="history.back(-1);" />
  302. <input type="button" value="保存" class="l-button" onclick="submitForm()" />
  303. </div>
  304. <div id="jp-container" class="jp-container liuyan" >
  305. <div class="forum-container-2" style="overflow: hidden;">
  306. <table border="0" cellspacing="1" cellpadding="0" style="border: 1px solid #ededed;">
  307. <tr>
  308. <td class="l-table-edit-text">任务标题<font color="red">*</font>:</td>
  309. <td class="l-table-edit-td">
  310. <input type="text" name="tasktitle" id="tasktitle" value="${map.tasktitle }" maxlength="50" class="default-text"/>
  311. <div id="tasktitle_msg" style="display: inline;"></div>
  312. <div id="tasktitle_msg_" style="display: inline;"></div>
  313. </td>
  314. <td class="l-table-edit-text">任务类型:</td>
  315. <td class="l-table-edit-td" >
  316. <select name="tasktype" id="tasktype" class="short-select" >
  317. <c:forEach var="list" items="${listTaskType}">
  318. <c:choose>
  319. <c:when test="${list.value_name eq requestScope.map.tasktype}">
  320. <option value="${list.data_id }" selected="selected">${list.value_name }</option>
  321. </c:when>
  322. <c:otherwise>
  323. <option value="${list.data_id }">${list.value_name }</option>
  324. </c:otherwise>
  325. </c:choose>
  326. </c:forEach>
  327. </select>
  328. </td>
  329. </tr>
  330. <tr>
  331. <td class="l-table-edit-text">任务责任人<font color="red">*</font>:</td>
  332. <td class="l-table-edit-td" >
  333. <input type="text" style="width: 190px" class="default-text" name="receive_name" id="receive_name" readonly="readonly" value="${user_name }" />
  334. <input type="hidden" name="receiveIds" id="receiveIds" readonly="readonly" value="${user_id}"/>
  335. <label id="pmMsg"></label>
  336. </td>
  337. <td class="l-table-edit-text">计划工作量<font color="red">*</font>:</td>
  338. <td class="l-table-edit-td">
  339. <input type="text" name="planjobtime" id="planjobtime" value="${map.planjobtime }" maxlength="50" class="default-text"/>
  340. <div id="planjobtime_msg" style="display: inline;"></div>
  341. <div id="planjobtime_msg_" style="display: inline;"></div>
  342. </td>
  343. </tr>
  344. <tr>
  345. <td class="l-table-edit-text">任务开始时间<font color="red">*</font>:</td>
  346. <td class="l-table-edit-td">
  347. <input type="text" name="startDate" id="startDate" value="${map.startDate }" maxlength="50" class="default-text"/>
  348. <div id="startDate_msg" style="display: inline;"></div>
  349. </td>
  350. <td class="l-table-edit-text">任务结束时间<font color="red">*</font>:</td>
  351. <td class="l-table-edit-td">
  352. <input type="text" name="endDate" id="endDate" value="${map.endDate }" maxlength="50" class="default-text"/>
  353. <div id="endDate_msg" style="display: inline;"></div>
  354. </td>
  355. </tr>
  356. <tr>
  357. <td class="l-table-edit-text">任务描述<font color="red"></font>:</td>
  358. <td class="l-table-edit-td">
  359. <textarea id="taskDetail" name="taskDetail" rows="5" cols="50">${map.taskDetail }</textarea>
  360. <div id="taskDetail_msg" style="display: inline;"></div>
  361. </td>
  362. </tr>
  363. </table>
  364. </div>
  365. <input type="hidden" name="state" id="state" value="${map.state }" />
  366. <input type="hidden" name="type" value="${type }" />
  367. <input type="hidden" id="tabid" name="tabid" value="${param.tabid }"/>
  368. </div>
  369. </form>
  370. </body>
  371. </html>