project_add.jsp 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966
  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 src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  47. <script type="text/javascript" src="/shares/js/common.js"></script>
  48. <script type="text/javascript" src="/shares/js/file.js"></script>
  49. <link rel="stylesheet" type="text/css" href="/shares/css/yw/master1/win/jquery.jscrollpane.codrops1.css" />
  50. <!-- the mousewheel plugin -->
  51. <script type="text/javascript" src="/shares/js/yw/master1/jquery.mousewheel.js"></script>
  52. <!-- the jScrollPane script -->
  53. <script type="text/javascript" src="/shares/js/yw/master1/jquery.jscrollpane.min.js"></script>
  54. <script type="text/javascript" src="/shares/js/yw/master1/scroll-startstop.events.jquery.js"></script>
  55. <script type="text/javascript" src="/shares/js/yw/master1/scroll.js"></script>
  56. <link href="/shares/css/yw/master1/reset.css" rel="stylesheet" type="text/css" />
  57. <script type="text/javascript"
  58. src="/shares/xheditor/xheditor-1.1.14/xheditor-1.1.14-zh-cn.min.js"></script>
  59. <style type="text/css">
  60. .default-select {
  61. width: 500px;
  62. height: 22px;
  63. line-height: 22px;
  64. }
  65. .short-select {
  66. width: 273px;
  67. height: 22px;
  68. line-height: 22px;
  69. }
  70. .default-text {
  71. width: 270px;
  72. height: 22px;
  73. line-height: 22px
  74. }
  75. .short-text {
  76. width: 270px;
  77. line-height: 22px;
  78. height: 22px;
  79. }
  80. .l-text{
  81. width: 270px;
  82. line-height: 22px;
  83. height: 22px;
  84. }
  85. .text {
  86. height: 22px;
  87. line-height: 22px;
  88. margin-right: 10px;
  89. display: inline-block;
  90. margin-left: 1px
  91. }
  92. .title {
  93. font-size: 20px;
  94. font-weight: bold;
  95. padding-bottom: 20px;
  96. padding-left: 5px;
  97. border-bottom: 1px solid #ededed;
  98. vertical-align: middle;
  99. }
  100. .l-table-edit-td{
  101. width:270px;
  102. }
  103. .projectTable{margin: 5px}
  104. .projectTable tr{height: 25px; padding-bottom: 2px; margin: 10px auto}
  105. .projectTable .left-text {width: 80px; }
  106. .jp-container{
  107. height:500px;
  108. position:relative;
  109. overflow:hidden;
  110. }
  111. .forum-container-2 .l-table-edit-text11 {
  112. font-size: 16px;
  113. color: #000;
  114. font-family: "微软雅黑";
  115. font-weight: 100;
  116. height: 30px;
  117. width:89px;
  118. line-height: 30px;
  119. margin-right: 10px;
  120. color: #737373;
  121. text-align: right;
  122. vertical-align: text-top;
  123. }
  124. </style>
  125. <style type="text/css">
  126. #layout1{width:99%;margin:0; padding:0; }
  127. .checkList{
  128. margin-left:5px;
  129. }
  130. .checkList li{
  131. padding:3px 0px 0px 3px;
  132. cursor:pointer;
  133. }
  134. .userTree li{
  135. width:100%;
  136. }
  137. .l-layout-content{
  138. overflow:auto;
  139. }
  140. </style>
  141. <script type="text/javascript">
  142. var userScope = "${userScope}";
  143. var selectedData = null;
  144. var tab;
  145. if(userScope == "all"){
  146. tab = "1";
  147. }else if(userScope == "dept"){
  148. tab = "2";
  149. }
  150. $(function(){
  151. /* if('${flowOnOff}' !="" && typeof('${flowOnOff}')!="undefined"){
  152. $("#btnSave").attr({"disabled":"disabled"});
  153. $.ligerDialog.error("对不起,立项流程未配置,请通知流程管理员配置后,再操作!");
  154. } */
  155. var msg="${msg}";
  156. if(msg !=""){
  157. if("操作成功"==msg){
  158. $.ligerDialog({content:msg, title:"操作成功",type:"success",width:250,height:55,allowClose : false,
  159. buttons:[ {text:"关闭",onclick:function(){closeAndReload();}}]
  160. });
  161. }else{
  162. $.ligerDialog.success(msg);
  163. }
  164. }
  165. initTeamgrid();
  166. $("#project_code").keyup(function(){
  167. $("#project_code_error").html("");
  168. });
  169. $("#project_name").keyup(function(){
  170. $("#project_name_error").html("");
  171. });
  172. loadTypeTree("responsibleButton", {
  173. type : "usersingle",
  174. backId : "responsible",
  175. backName : "responsible_name",
  176. tab:tab
  177. });
  178. loadTypeTree("relate_depButton", {
  179. type : "dept",
  180. backId : "relate_dep_id",
  181. backName : "relate_dep_name",
  182. tab:tab
  183. });
  184. $("#app_date").ligerDateEditor({
  185. labelWidth : 100,
  186. labelAlign : 'right',
  187. initValue:'${map.app_date }'
  188. });
  189. $("#start_date").ligerDateEditor({
  190. labelWidth : 100,
  191. labelAlign : 'right',
  192. initValue:'${map.start_date }'
  193. });
  194. $("#end_date").ligerDateEditor({
  195. labelWidth : 100,
  196. labelAlign : 'right',
  197. initValue:'${map.end_date }'
  198. });
  199. $("#profile").xheditor({tools:"simple"});
  200. $("#target_").xheditor({tools:"simple"});
  201. /* $("#layout1").ligerLayout({ centerWidth:310,leftWidth : 590,rightWidth : 590,allowRightCollapse: false,allowLeftCollapse:false,height:'97%'});
  202. $("#navtab1").ligerTab({contextmenu:false,onBeforeSelectTabItem:function(tabid){
  203. if(tempTree=="")return;
  204. var tabitem = $(".l-selected").attr("tabid");
  205. var itemcontent = $("[tabid="+tabitem+"]",".l-tab-content");
  206. $(itemcontent).empty();
  207. $(itemcontent).append(tempTree);
  208. tempTree = "";
  209. }});
  210. tabitem = $("#navtab1").ligerGetTabManager();
  211. var height = $("#layout1").height();
  212. $(".l-tab-content-item").height(height-55); */
  213. //replaceItem();
  214. });
  215. function toAddUser(){
  216. var dept=$("#relate_dep_id").val();
  217. if(!dept){
  218. $.ligerDialog.warn('请在项目信息中选择涉及部门');
  219. return;
  220. }
  221. loadTypeTree("usernameButton",{tab:"2",type:"user",backId:"user_id",backName:"user_name",tabParam:[{tab:"2",root:dept}]});
  222. var data_string = "";
  223. selectedData = [];
  224. $.ligerDialog.open({width:550,height:430, url : 'pmProject.do?task=toChooseUser&groupid=' + $("#relate_dep_id").val(),title:"添加项目人员",
  225. buttons:[{
  226. text : '确定',
  227. onclick : function(item, dialog) {
  228. for (var i = 0; i < selectedData.length; i++){
  229. /* project_role user_id
  230. data_string += "user_id:"+ selectedData[i].user_id + */
  231. var json_string = JSON.stringify(selectedData[i]);
  232. if (i < selectedData.length - 1){
  233. data_string += json_string + ",";
  234. } else {
  235. data_string += json_string;
  236. }
  237. }
  238. data_string = {data_user:"[" + data_string + "]"};
  239. $.ajax({
  240. type:"POST",
  241. url:"pmProject.do?task=addteamuser&time=" + new Date().getTime() + "&universalid=" + $("#universalid").val(),
  242. data:data_string,
  243. timeout:10000,
  244. cache:false,
  245. dataType:"json",
  246. success:function(msg){
  247. msg = parseInt(msg);
  248. if(msg > 0){
  249. $.ligerDialog.hide();
  250. $.ligerDialog.open({content:"提交成功!", "title":"提交成功!", "type":"success",allowClose:true,
  251. buttons: [ { text: '确定', onclick: function (item, dialog) { dialog.close(); } } ]
  252. });
  253. /* $("#universalid").val(msg);
  254. $("#user_id").val("");
  255. $("#user_name").val("");
  256. $(role_id).attr("checked",false);
  257. $("#description").val(""); */
  258. initTeamgrid();
  259. }else{
  260. if(msg == -2){
  261. $.ligerDialog.warn("操作失败,请检查项目成员是否已选择");
  262. }else if(msg==0){
  263. $.ligerDialog.warn("操作失败,请检查项目成员是否已经存在项目中");
  264. }else{
  265. $.ligerDialog.warn("添加失败,请联系管理员");
  266. }
  267. }
  268. }
  269. });
  270. /* var idObj = o.win.getElementsByName(o.backId);
  271. var nameObj = o.win.getElementsByName(o.backName);
  272. if(idObj.length==0)idObj = o.win.getElementById(o.backId);
  273. if(nameObj.length==0)nameObj = o.win.getElementById(o.backName);
  274. var checkList = findIframeByJquery("deptTreeFrame",".checkList");
  275. var ids = "";
  276. var names="";
  277. $("li",checkList).each(function(){
  278. var selectId = $(this).attr("id");
  279. selectId = selectId.substring(selectId.indexOf("_")+1);
  280. names += ","+$(this).text();
  281. ids +=","+selectId;
  282. });
  283. if(ids!=""){
  284. ids = ids.substring(1);
  285. }
  286. if(names!=""){
  287. names = names.substring(1);
  288. }
  289. if(o.okpress){
  290. o.okpress(ids, names);
  291. }else{
  292. $(idObj).val(ids);
  293. $(nameObj).change();
  294. $(nameObj).val(names);
  295. }
  296. dialog.close(); */
  297. }
  298. }, {
  299. text : '取消',
  300. onclick : function(item, dialog) {
  301. dialog.close();
  302. }
  303. } ]});
  304. }
  305. var manager1;
  306. function initTeamgrid(){
  307. var id = $("#universalid").val();
  308. var jsonObject = {"project_id":""};
  309. if(id){
  310. jsonObject.project_id = id;
  311. }
  312. if(manager1 == undefined){
  313. manager1=$("#teamuser").ligerGrid({
  314. columns:[
  315. {display:"姓名",name:"name",align: 'center',width: 100},
  316. { display: '项目角色', name: 'rolename', width: 350, align: 'center'},
  317. { display: '加入时间', name: 'join_date', width: 80, align: 'center'},
  318. { display: '描述', name: 'description', width: 450, align: 'center', render: function (rowdata, rowindex, value)
  319. {
  320. var html="<span title="+value+">"+value+"<span>";
  321. return value == null ? "" : html;
  322. }
  323. },
  324. { display: '操作', isSort: false, width: 180, render: function (rowdata, rowindex, value)
  325. {
  326. var html = "<a href='javascript:toEditUser(" + rowdata.team_id + ",\"" + rowdata.name + "\",\"" + rowdata.rolename + "\",\"" + rowdata.description +"\")'>编辑</a>";
  327. html += "&nbsp;&nbsp;<a href='javascript:delUser(" + rowdata.team_id + ",\"" + rowdata.project_id + "\")'>删除</a>";
  328. return html;
  329. }
  330. }
  331. ],pageSize:10,
  332. url:"pmProject.do?task=toteamuser&time="+ new Date().getTime(),
  333. parms :jsonObject,
  334. pageParmName: 'p', //页索引参数名,(提交给服务器)
  335. pagesizeParmName: 'pSize', //页记录数参数名,(提交给服务器)
  336. width : '100%',
  337. height : '385px',
  338. rownumbers:true
  339. });
  340. }else{
  341. manager1._setParms({"project_id":id});
  342. setTimeout("manager1.loadData()",500);
  343. }
  344. }
  345. //关闭当前页面刷新列表必须要传入tabid
  346. function closeAndReload(){
  347. var old_tabid = '${tabid}';
  348. if(old_tabid.length > 0){
  349. var tabid = getCurrentTabId();
  350. window.parent.f_selectTab(old_tabid);
  351. window.parent.f_reloadTab(old_tabid);
  352. window.parent.f_closeTab(tabid);
  353. }
  354. }
  355. function delUser(team_id,project_id){
  356. if(confirm("确定要删除")){
  357. $.ajax({
  358. type:"POST",
  359. url:"pmProject.do?task=delteamuser&team_id="+team_id+"&project_id="+project_id+"&time=" + new Date().getTime(),
  360. timeout:10000,
  361. cache:false,
  362. dataType:"json",
  363. success:function(msg){
  364. //closeWaittingDialog();
  365. if(msg > 0){
  366. $.ligerDialog.hide();
  367. $.ligerDialog.success("删除成功");
  368. initTeamgrid();
  369. }else{
  370. $.ligerDialog.warn("删除失败");
  371. }
  372. }
  373. });
  374. }
  375. }
  376. function toEditUser(id,name,rolename,value){
  377. $("#team_id").val(id);
  378. $("#user_name_team").html(name);
  379. $("#pro_Role").html(rolename);
  380. $("#description").val(value == "null" ? "" : value);
  381. $.ligerDialog.open({width:380, target: $("#editUserDIV"),title:"编辑项目人员" });
  382. }
  383. function editUser(){
  384. var id = $("#team_id").val();
  385. var description = $("#description").val();
  386. $.ajax({
  387. type:"POST",
  388. url:"pmProject.do?task=editteamuser&universalid="+id+"&description="+encodeURI(encodeURI(description))+"&time=" + new Date().getTime(),
  389. timeout:10000,
  390. cache:false,
  391. dataType:"json",
  392. success:function(msg){
  393. msg = parseInt(msg);
  394. if(msg > 0){
  395. $.ligerDialog.hide();
  396. $.ligerDialog.open({content:"编辑成功!", "title":"编辑成功!", "type":"success",allowClose:true,
  397. buttons: [ { text: '确定', onclick: function (item, dialog) { dialog.close(); } } ]
  398. });
  399. initTeamgrid();
  400. }else{
  401. if(msg == -2){
  402. $.ligerDialog.warn("操作失败,请检查项目成员是否已选择");
  403. }else if(msg==0){
  404. $.ligerDialog.warn("操作失败,请检查项目成员是否已经存在项目中");
  405. }else{
  406. $.ligerDialog.warn("添加失败,请联系管理员");
  407. }
  408. }
  409. }
  410. });
  411. }
  412. function closeDiv(){
  413. $.ligerDialog.hide();
  414. }
  415. function addUser(){
  416. var rs = $.validate({
  417. name : "user_id",
  418. model : [ {
  419. type : "require",
  420. msg : "请选择参与项目人员!",
  421. msgBox: "useridmsg"
  422. }]
  423. });
  424. var role_id = document.getElementsByName("role_id");//项目状态
  425. if(rs){
  426. var userids = $("#user_id").val();
  427. var id = $("#universalid").val();
  428. if(role_id.length>0){
  429. var n = "";
  430. for ( var i = 0; i < role_id.length; i++) {
  431. if (role_id[i].checked) {
  432. n += role_id[i].value + ",";
  433. }
  434. }
  435. if(n.length==0){
  436. $("#projroleMsg").html("请选择项目角色");
  437. }
  438. if(n.length>0){
  439. n = n.substring(0, n.length-1);
  440. var description=$("#description").val();
  441. description=encodeURI(encodeURI(description));
  442. $.ajax({
  443. type:"POST",
  444. url:"pmProject.do?task=addteamuser&universalid="+id+"&userids="+userids+"&role_id="+n+"&description="+description+"&time=" + new Date().getTime(),
  445. timeout:10000,
  446. cache:false,
  447. dataType:"json",
  448. success:function(msg){
  449. msg = parseInt(msg);
  450. if(msg > 0){
  451. $.ligerDialog.hide();
  452. $.ligerDialog.open({content:"提交成功!", "title":"提交成功!", "type":"success",allowClose:true,
  453. buttons: [ { text: '确定', onclick: function (item, dialog) { dialog.close(); } } ]
  454. });
  455. $("#universalid").val(msg);
  456. $("#user_id").val("");
  457. $("#user_name").val("");
  458. $(role_id).attr("checked",false);
  459. $("#description").val("");
  460. initTeamgrid();
  461. }else{
  462. if(msg == -2){
  463. $.ligerDialog.warn("操作失败,请检查项目成员是否已选择");
  464. }else if(msg==0){
  465. $.ligerDialog.warn("操作失败,请检查项目成员是否已经存在项目中");
  466. }else{
  467. $.ligerDialog.warn("添加失败,请联系管理员");
  468. }
  469. }
  470. }
  471. });
  472. }
  473. }
  474. }
  475. }
  476. function submitForm(){
  477. var obj = window.top;
  478. var rs = $.validate({
  479. name : "project_name",
  480. model : [ {
  481. type : "require",
  482. msg : "请输入项目名称!"
  483. }, {
  484. type : "len",
  485. min : 1,
  486. max : 50,
  487. msg : "项目编号最长50个字以内!"
  488. } ]
  489. });
  490. rs = $.validate({
  491. name : "responsible_name",
  492. model : [ {
  493. type : "require",
  494. msg : "请输入责任人!"
  495. }]
  496. }) && rs;
  497. rs = $.validate({
  498. name : "custor_unit",
  499. model : [ {
  500. type : "require",
  501. msg : "请输入客户单位!"
  502. }, {
  503. type : "len",
  504. min : 1,
  505. max : 50,
  506. msg : "客户单位最长50个字以内!"
  507. } ]
  508. }) && rs;
  509. rs = $.validate({
  510. name : "profile",
  511. model : [ {
  512. type : "len",
  513. min : 0,
  514. max : 500,
  515. msg : "项目描述最长500个字以内!"
  516. } ]
  517. }) && rs;
  518. rs = $.validate({
  519. name : "target_",
  520. model : [ {
  521. type : "len",
  522. min : 0,
  523. max : 500,
  524. msg : "项目目标最长500个字以内!"
  525. } ]
  526. }) && rs;
  527. rs = $.validate({
  528. name : "relate_dep_name",
  529. model : [ {
  530. type : "require",
  531. msg : "涉及部门!"
  532. }]
  533. }) && rs;
  534. if (rs && comp_date()) {
  535. var flowTheme = $("#project_name").val() + "项目——" + $("#flowTheme").val();
  536. $.ligerDialog.prompt('流程标题',flowTheme, function (yes,value){
  537. if(yes){
  538. if(value != "" && typeof (value) != "undefined"){
  539. $("#flowTheme").val("");
  540. $("#flowTheme").val(value);
  541. $("#btnSave").attr({"disabled":"disabled"});
  542. $("#state").val("2");
  543. var sfz = document.getElementsByName("project_affix_id");
  544. var sfzEvalue = "";
  545. for(var i=0;i<sfz.length;i++){
  546. if(""!=sfz[i].value){
  547. sfzEvalue=sfzEvalue + sfz[i].value +",";
  548. }
  549. }
  550. $("#project_affix").val(sfzEvalue);
  551. $("#_project").submit();
  552. }else{
  553. obj.$.ligerDialog.warn("流程标题不能为空!");
  554. return;
  555. }
  556. }
  557. });
  558. }
  559. }
  560. function saveForm(){
  561. var rs = $.validate({
  562. name : "project_name",
  563. model : [ {
  564. type : "require",
  565. msg : "请输入项目名称!"
  566. }, {
  567. type : "len",
  568. min : 1,
  569. max : 50,
  570. msg : "项目名称最长50个字以内!"
  571. } ]
  572. });
  573. if(rs && comp_date()){
  574. $("#state").val("1");
  575. var sfz = document.getElementsByName("project_affix_id");
  576. var sfzEvalue = "";
  577. for(var i=0;i<sfz.length;i++){
  578. if(""!=sfz[i].value){
  579. sfzEvalue=sfzEvalue + sfz[i].value +",";
  580. }
  581. }
  582. $("#project_affix").val(sfzEvalue);
  583. $("#_project").submit();
  584. }
  585. }
  586. function editForm(){
  587. var rs = $.validate({
  588. name : "project_name",
  589. model : [ {
  590. type : "require",
  591. msg : "请输入项目名称!"
  592. }, {
  593. type : "len",
  594. min : 1,
  595. max : 50,
  596. msg : "项目编号最长50个字以内!"
  597. } ]
  598. });
  599. rs = $.validate({
  600. name : "responsible_name",
  601. model : [ {
  602. type : "require",
  603. msg : "请输入责任人!"
  604. }]
  605. }) && rs;
  606. rs = $.validate({
  607. name : "custor_unit",
  608. model : [ {
  609. type : "require",
  610. msg : "请输入客户单位!"
  611. }, {
  612. type : "len",
  613. min : 1,
  614. max : 50,
  615. msg : "客户单位最长50个字以内!"
  616. } ]
  617. }) && rs;
  618. rs = $.validate({
  619. name : "relate_dep_name",
  620. model : [ {
  621. type : "require",
  622. msg : "涉及部门!"
  623. }]
  624. }) && rs;
  625. if(rs && comp_date()){
  626. var sfz = document.getElementsByName("project_affix_id");
  627. var sfzEvalue = "";
  628. for(var i=0;i<sfz.length;i++){
  629. if(""!=sfz[i].value){
  630. sfzEvalue=sfzEvalue + sfz[i].value +",";
  631. }
  632. }
  633. $("#project_affix").val(sfzEvalue);
  634. $("#_project").submit();
  635. }
  636. }
  637. function comp_date(){
  638. var start_date=$("#start_date").val();
  639. var end_date=$("#end_date").val();
  640. if(start_date =="" || start_date==null){
  641. return true;
  642. }
  643. if(end_date =="" || end_date==null){
  644. return true;
  645. }
  646. var starts=start_date.split("-");
  647. var starttime = new Date(starts[0], starts[1], starts[2]);
  648. var starttimes = starttime.getTime();
  649. var ends=end_date.split("-");
  650. var endtime = new Date(ends[0], ends[1], ends[2]);
  651. var endtimes = endtime.getTime();
  652. if(starttimes>endtimes){
  653. $("#end_dateMsg").html("启动时间不得早于结束时间");
  654. return false;
  655. }
  656. $("#end_dateMsg").html("");
  657. return true;
  658. }
  659. </script>
  660. </head>
  661. <body style="overflow:hidden;" ontouchmove="event.preventDefault();">
  662. <c:choose>
  663. <c:when test="${map.universalid !=null }">
  664. <form method='post' name="_project" id="_project" action="mtProManage.do?task=dopteidt">
  665. <input type="hidden" name="universalid" id="universalid" value="${map.universalid }" />
  666. <input type="hidden" name="tinsId" id="tinsId" value="${tinsId }" />
  667. <input type="hidden" name="edit" id="edit" value="${edit }" />
  668. </c:when>
  669. <c:otherwise>
  670. <form method='post' name="_project" id="_project" action="mtProManage.do?task=doptAdd">
  671. <input type="hidden" name="universalid" id="universalid" value="${universalid }" />
  672. </c:otherwise>
  673. </c:choose>
  674. <div class="s_title b10 f6">
  675. <img src="/shares/images/master1/gg_ico.png" width="27" height="26" /> 项目立项编辑
  676. </div>
  677. <div id="title" class="form-button" style=" margin-top: 40px">
  678. <input type="button" id="back" class="l-button" value="返回" onclick="history.back(-1);" />
  679. <c:choose>
  680. <c:when test="${map.state==4 }">
  681. <input type="button" value="保存" class="l-button" onclick="editForm()" />
  682. </c:when>
  683. <c:otherwise>
  684. <input type="button" id="btnSave" class="l-button" value="立项" onclick="submitForm()" />
  685. <input type="button" value="暂存" class="l-button" onclick="saveForm()" />
  686. <!-- <input type="button" value="立项" class="l-button" onclick="saveForm()" /> -->
  687. </c:otherwise>
  688. </c:choose>
  689. </div>
  690. <div id="jp-container" class="jp-container liuyan" >
  691. <div class="forum-container-2" style="overflow: hidden;">
  692. <table border="0">
  693. <thead>
  694. <tr>
  695. <th colspan="4">
  696. <div class="l-table-edit line" style="float:left;margin-left:15px;">项目基本信息</div>
  697. <input type="hidden" name="state" id="state" value="${map.state }" />
  698. <input type="hidden" name="type" value="${type }" />
  699. <input type="hidden" name="old_project_code" value="${map.project_code }" />
  700. <c:choose>
  701. <c:when test="${map.old_project_name !=null }">
  702. <input type="hidden" name="old_project_name" value="${map.old_project_name }" />
  703. </c:when>
  704. <c:otherwise>
  705. <input type="hidden" name="old_project_name" value="${map.project_name }" />
  706. </c:otherwise>
  707. </c:choose>
  708. <input type="hidden" id="tabid" name="tabid" value="${param.tabid }" />
  709. <!-- 审批流程 -->
  710. <input type="hidden" id="tmodelId" name="tmodelId" value="${requestScope.tmodel.tmodelId }" />
  711. <input type="hidden" id="modelId" name="modelId" value="${requestScope.fmodel.modelId }" />
  712. <input type="hidden" id="flowTheme" name="flowTheme" value="${requestScope.flowTheme}"/>
  713. </th>
  714. </tr>
  715. </thead>
  716. <tr>
  717. <!-- <td class="l-table-edit-text11">项目编号<font color="red">*</font>:</td> -->
  718. <!-- <td class="l-table-edit-td"> -->
  719. <%-- <input type="text" name="project_code" id="project_code" value="${map.project_code }" maxlength="50" class="default-text"/> --%>
  720. <%-- <font color="red" id="project_code_error">${project_code_error}</font> --%>
  721. <!-- </td> -->
  722. <td class="l-table-edit-text11">项目名称<font color="red">*</font>:</td>
  723. <td class="l-table-edit-td">
  724. <input type="text" name="project_name" id="project_name" value="${map.project_name }" maxlength="50" class="default-text"/>
  725. <font color="red" id="project_name_error">${project_name_error}</font>
  726. </td>
  727. <td class="l-table-edit-text11">申请时间:</td>
  728. <td class="l-table-edit-td" >
  729. <input type="text" id="app_date" name="app_date" class="short-text" value='' readonly />
  730. </td>
  731. </tr>
  732. <tr>
  733. <td class="l-table-edit-text11">项目来源:</td>
  734. <td class="l-table-edit-td">
  735. <input type="text" name="project_source" id="project_source" value="${map.project_source }" maxlength="50" class="default-text"/>
  736. </td>
  737. <td class="l-table-edit-text11">责任人<font color="red">*</font>:</td>
  738. <td class="l-table-edit-td" >
  739. <input type="text" style="width: 190px" class="default-text" name="responsible_name" id="responsible_name" readonly="readonly" value="${map.responsible_name }" />
  740. <input type="hidden" name="responsible" id="responsible" readonly="readonly" value="${map.responsible}"/>
  741. <input type="button" class="l-button" value="请选择" id="responsibleButton"/>
  742. <label id="pmMsg"></label>
  743. </td>
  744. </tr>
  745. <tr>
  746. <td class="l-table-edit-text11">客户单位<font color="red">*</font>:</td>
  747. <td class="l-table-edit-td">
  748. <input type="text" name="custor_unit" id="custor_unit" value="${map.custor_unit }" maxlength="50" class="default-text"/>
  749. </td>
  750. <td class="l-table-edit-text11">涉及部门<font color="red">*</font>:</td>
  751. <td class="l-table-edit-td">
  752. <input type="text" style="width: 190px" class="default-text" name="relate_dep_name" id="relate_dep_name" readonly="readonly" value="${map.relate_dep_name }" />
  753. <input type="hidden" name="relate_dep_id" id="relate_dep_id" readonly="readonly" value="${map.relate_dep_id}"/>
  754. <input type="button" class="l-button" value="请选择" id="relate_depButton"/>
  755. </td>
  756. </tr>
  757. <tr>
  758. <td class="l-table-edit-text11">项目类型:</td>
  759. <td class="l-table-edit-td">
  760. <select name="project_type" id="project_type" class="short-select" >
  761. <c:forEach items="${projectType}" var="obj">
  762. <c:choose>
  763. <c:when test="${map.project_type eq obj.dvalue }">
  764. <option value="${obj.dvalue }" selected="selected">${obj.dname }</option>
  765. </c:when>
  766. <c:otherwise>
  767. <option value="${obj.dvalue }" >${obj.dname }</option>
  768. </c:otherwise>
  769. </c:choose>
  770. </c:forEach>
  771. </select>
  772. <select name="project_type_two" id="project_type_two" class="short-select" style="width:100px;" >
  773. <c:forEach items="${pm_projectType_two}" var="obj">
  774. <c:choose>
  775. <c:when test="${map.project_type_two eq obj.dvalue }">
  776. <option value="${obj.dvalue }" selected="selected">${obj.dname }</option>
  777. </c:when>
  778. <c:otherwise>
  779. <option value="${obj.dvalue }" >${obj.dname }</option>
  780. </c:otherwise>
  781. </c:choose>
  782. </c:forEach>
  783. </select>
  784. </td>
  785. <td class="l-table-edit-text11">申请部门<font color="red">*</font>:</td>
  786. <td class="l-table-edit-td">
  787. ${map.app_dep_name }
  788. <input type="hidden" name="app_dep_id" id="app_dep_id" readonly="readonly" value="${map.app_dep_id}"/>
  789. </td>
  790. </tr>
  791. <tr>
  792. <td class="l-table-edit-text11">启动时间:</td>
  793. <td class="l-table-edit-td" >
  794. <input type="text" id="start_date" name="start_date" class="short-text" value='' readonly />
  795. </td>
  796. <td class="l-table-edit-text11">结束时间:</td>
  797. <td class="l-table-edit-td" >
  798. <input type="text" id="end_date" name="end_date" class="short-text" value='' readonly /><span id="end_dateMsg" style="color:red;"></span>
  799. </td>
  800. </tr>
  801. <tr>
  802. <td class="l-table-edit-text11">附件:</td>
  803. <td class="l-table-edit-td" style="text-align:left;width:30%">
  804. <jsp:include page="/include/file.jsp">
  805. <jsp:param name="fieldName" value="project_affix_id" />
  806. <jsp:param name="folder" value="pm/bug" />
  807. <jsp:param name="documentId" value="${map.project_affix}" />
  808. <jsp:param name="size" value="5" />
  809. <jsp:param name="isView" value="1" />
  810. <jsp:param name="isDelFile" value="1" />
  811. <jsp:param name="definedCss" value="file-style" />
  812. </jsp:include>
  813. <input type="hidden" id="project_affix" name="project_affix" />
  814. </td>
  815. </tr>
  816. <tr>
  817. <td class="l-table-edit-text11">项目描述:</td>
  818. <td class="l-table-edit-td" colspan="3">
  819. <textarea id="profile" name="profile" rows="10" cols="100" maxlength="500">
  820. ${map.profile }
  821. </textarea>
  822. <div id="profileMsg" style="display: inline-block;"></div>
  823. </td>
  824. </tr>
  825. <tr>
  826. <td class="l-table-edit-text11">项目目标:</td>
  827. <td class="l-table-edit-td" colspan="3">
  828. <textarea id="target_" name="target_" class="xheditor-simple" rows="10" cols="100" maxlength="500" >
  829. ${map.target }
  830. </textarea>
  831. <div id="targetMsg" style="display: inline-block;"></div>
  832. </td>
  833. </tr>
  834. </table>
  835. <table border="0" cellspacing="1" cellpadding="0" style="border: 1px solid #ededed;">
  836. <thead>
  837. <tr>
  838. <th colspan="5">
  839. <div class="l-table-edit line" style="float:left;margin-left:15px;">项目组成员</div>
  840. </th>
  841. </tr>
  842. <tr>
  843. <td colspan="5">
  844. <input type="button" class="l-button" onclick="toAddUser();" style="width: 100px;" value="添加项目成员" />
  845. </td>
  846. </tr>
  847. <!-- <tr style="height:400px;">
  848. <td colspan="5">
  849. </td>
  850. </tr> -->
  851. </thead>
  852. </table>
  853. </div>
  854. <div id="teamuser" style="height:400px;" ></div>
  855. </div>
  856. </form>
  857. <%-- <div id="target1" style="width:360px; margin:0px; display:none;" class="forum-container2">
  858. <table style="" class="projectTable">
  859. <tr>
  860. <td class="" style="vertical-align: bottom;width: 60px;">成员:</td>
  861. <td class="" style="vertical-align: bottom;">
  862. <input type="text" id="user_name" name="user_name" style="width:150px;" readonly="readonly" />
  863. <input type="button" class="l-button" id="usernameButton" name="usernameButton" value="请选择"/>
  864. <input type="hidden" id="user_id" name="user_id" />
  865. <label id="useridmsg"></label>
  866. </td>
  867. </tr>
  868. <tr>
  869. <td class="" style="vertical-align: middle;">项目角色:</td>
  870. <td class="" style="vertical-align: bottom;">
  871. <c:forEach items="${projectRole}" var="obj">
  872. <input type="checkbox" name="role_id" value="${obj.dvalue }" id="role_id${obj.dvalue }" />
  873. <label for="role_id${obj.dvalue }">${obj.dname} </label><br/>
  874. </c:forEach>
  875. <span id="projroleMsg" style="color: red; "></span>
  876. </td>
  877. </tr>
  878. <tr>
  879. <td class="" style="vertical-align: middle;">描述:</td>
  880. <td class="" style="vertical-align: bottom;">
  881. <textarea rows="3" cols="30" id="description"></textarea>
  882. </td>
  883. </tr>
  884. <tr>
  885. <td colspan="2" style="text-align: center;" style="vertical-align: bottom;">
  886. <input type="button" class="l-button" value="确定" onclick=" addUser();" />
  887. <input type="button" class="l-button" value="关闭" onclick=" closeDiv();" />
  888. </td>
  889. </tr>
  890. </table>
  891. </div> --%>
  892. <div id="target1" class="l-content" style="width:360px; margin:0px; display:none;" >
  893. <div id="layout1">
  894. <div position="left" title="类型">
  895. <div id="navtab1" style="width:300px;height:99%">
  896. </div>
  897. </div>
  898. <div position="center" id="center" title="" style="text-align: center;top:50%;">
  899. <input type="button" value=">>>"/>
  900. <input type="button" value="<<<"/>
  901. </div>
  902. <div position="right" id="right" title="已选列表">
  903. <ul class="checkList" title="双击删除">
  904. </ul>
  905. </div>
  906. </div>
  907. </div>
  908. <div id="editUserDIV" style="width:360px; margin:0px; display:none;" class="forum-container2">
  909. <input type="hidden" id="team_id"/>
  910. <table style="" class="projectTable">
  911. <tr>
  912. <td class="" style="vertical-align: middle;width: 60px;">姓名:</td>
  913. <td id="user_name_team" style="vertical-align: middle;"></td>
  914. </tr>
  915. <tr>
  916. <td class="" style="vertical-align: middle;">项目角色:</td>
  917. <td id="pro_Role" style="vertical-align: middle;">
  918. </td>
  919. </tr>
  920. <tr>
  921. <td class="" style="vertical-align: middle;">描述:</td>
  922. <td class="" style="vertical-align: middle;">
  923. <textarea rows="3" cols="30" id="description"></textarea>
  924. </td>
  925. </tr>
  926. <tr>
  927. <td colspan="2" style="text-align: center;" style="vertical-align: bottom;">
  928. <input type="button" class="l-button" value="确定" onclick=" editUser();" />
  929. <input type="button" class="l-button" value="关闭" onclick=" closeDiv();" />
  930. </td>
  931. </tr>
  932. </table>
  933. </div>
  934. </body>
  935. </html>