projectTaskPlan-pmdept-update.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>工作计划</title>
  7. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  8. <script type="text/javascript">
  9. $(document).ready(function(){
  10. // 查看的时候,取消选择、清空按钮
  11. if($('#load').val() != null && $('#load').val() == 'detail'){
  12. $("#jzdepartSearch").attr("onclick","");
  13. $("#jzdepartRedo").attr("onclick","");
  14. $("#cronSetting").attr("onclick","");
  15. $("#cronRedo").attr("onclick","");
  16. $("#btn_submit").remove();
  17. }
  18. $('input:radio[name="sendTimeType"]').on('click',function(){
  19. var t = $(this);
  20. if(t.val()=='onetime'){
  21. timetype = 'onetime';
  22. $('#periodnum').removeAttr('datatype');
  23. $('#periodtimeset').hide();
  24. $('#onetimeset').show();
  25. $('#endTime').attr('datatype','*');
  26. }else {
  27. timetype = 'periodtime';
  28. $('#periodnum').attr('datatype','n');
  29. $('#periodtimeset').show();
  30. $('#onetimeset').hide();
  31. $('#endTime').removeAttr('datatype');
  32. }
  33. });
  34. var sendTimeType = $('input:radio[name="sendTimeType"]:checked');
  35. timetype = 'onetime';
  36. if(sendTimeType.val()=='onetime'){
  37. $('#periodtimeset').hide();
  38. $('#onetimeset').show();
  39. $('#periodnum').removeAttr('datatype');
  40. $('#endTime').attr('datatype','*');
  41. }else{
  42. timetype = 'periodtime';
  43. $('#periodnum').attr('datatype','n');
  44. $('#endTime').removeAttr('datatype');
  45. $('#periodtimeset').show();
  46. $('#onetimeset').hide();
  47. }
  48. });
  49. </script>
  50. </head>
  51. <body>
  52. <t:formvalid formid="formobj" dialog="false" usePlugin="password" layout="table" action="projectTaskPlanController.do?doUpdate" tiptype="1" callback="callback" beforeSubmit="beforesubmit">
  53. <input id="id" name="id" type="hidden" value="${projectTaskPlanPage.id }"/>
  54. <input id="status" name="status" type="hidden" value="${projectTaskPlanPage.status }"/>
  55. <input name="load" id="load" value="${load}" style="display:none"/>
  56. <input id="tasktype" name="tasktype" type="hidden" value="${projectTaskPlanPage.tasktype}"/>
  57. <%-- <input id="msgAdvanceQuantity" name="msgAdvanceQuantity" type="hidden" value="${projectTaskPlanPage.msgAdvanceQuantity}"/>
  58. --%> <input id="msgAdvanceType" name="msgAdvanceType" type="hidden" value="${projectTaskPlanPage.msgAdvanceType}"/>
  59. <input id="taskquantity" name="taskquantity" type="hidden" value="${projectTaskPlanPage.taskquantity}"/>
  60. <input id="cron" name="cron" type="hidden" />
  61. <%-- <t:dictSelect field="status" type="hidden" typeGroupCode="billstatus" defaultVal="${projectTaskPlanPage.status}" hasLabel="false" title="计划类型" ></t:dictSelect> --%>
  62. <table style="width: 1000px;" cellpadding="0" cellspacing="1" class="formtable">
  63. <tr>
  64. <td align="right">
  65. <label class="Validform_label">
  66. 任务计划编码:
  67. </label>
  68. </td>
  69. <td class="value">
  70. <input id="code" name="code" type="text" style="width: 150px" class="inputxt" ignore="ignore" value='${projectTaskPlanPage.code}' readonly="readonly"/>
  71. <span class="Validform_checktip"></span>
  72. <label class="Validform_label" style="display: none;">计划编码</label>
  73. </td>
  74. </tr>
  75. <tr>
  76. <td align="right">
  77. <label class="Validform_label">
  78. 任务计划名称:
  79. </label>
  80. </td>
  81. <td class="value">
  82. <input id="name" name="name" type="text" style="width: 150px" class="inputxt" ignore="ignore" value='${projectTaskPlanPage.name}'/>
  83. <span class="Validform_checktip"></span>
  84. <label class="Validform_label" style="display: none;">计划名称</label>
  85. </td>
  86. </tr>
  87. <tr>
  88. <td align="right">
  89. <label class="Validform_label">
  90. <span color="red" class="requiredIcon">*</span> 任务类型:
  91. </label>
  92. </td>
  93. <td class="value">
  94. <t:dictSelect field="sendTimeType" type="radio" typeGroupCode="tasktimetype" defaultVal="${projectTaskPlanPage.sendTimeType}" hasLabel="false" title="发送时间类型" ></t:dictSelect>
  95. <span class="Validform_checktip"></span>
  96. <label class="Validform_label" style="display: none;">发送时间类型</label>
  97. </td>
  98. </tr>
  99. <tr id="onetimeset" style="display: none;">
  100. <td align="right">
  101. <label class="Validform_label">
  102. <span color="red" class="requiredIcon">*</span> 临时工作截止时间:
  103. </label>
  104. </td>
  105. <td class="value">
  106. <input id="endTime" name="endTime" type="text" style="width: 150px;" datatype="*" class="Wdate"
  107. onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value='<fmt:formatDate value='${projectTaskPlanPage.endTime}' type="date" pattern="yyyy-MM-dd HH:mm:ss"/>' />
  108. <span class="Validform_checktip"></span>
  109. <label class="Validform_label" style="display: none;">临时工作截止时间</label>
  110. </td>
  111. </tr>
  112. <tr id="periodtimeset" style="display: none;">
  113. <td align="right">
  114. <label class="Validform_label">
  115. <span color="red" class="requiredIcon">*</span> 周期工作时间:
  116. </label>
  117. </td>
  118. <td class="value">
  119. <label class="Validform_label" style="padding-left: 10px;" >每</label>
  120. <t:dictSelect id="planperiodtype" field="planperiodtype" type="list" extendJson="{class:'form-control',style:'width:123px'}" typeGroupCode="planperiodtype" hasLabel="false" title="周期类型类型" defaultVal="${projectTaskPlanPage.planperiodtype}"></t:dictSelect>
  121. <label class="Validform_label" style="padding-left: 10px;" >第</label>
  122. <input id="periodnum" name="periodnum" type="text" style="width: 100px" class="inputxt" value="${projectTaskPlanPage.periodnum}" datatype="n" ignore="ignore" placeholder="填写数字"/>
  123. <label class="Validform_label" style="padding-left: 10px;" >天完成</label>
  124. <label class="Validform_label">
  125. / 工作所需天数:
  126. </label>
  127. <input id="msgAdvanceQuantity" name="msgAdvanceQuantity" type="text" style="width: 100px" class="inputxt" datatype="n" value="${projectTaskPlanPage.msgAdvanceQuantity}" ignore="ignore" placeholder="填写数字"/>
  128. <span class="Validform_checktip"></span>
  129. <label class="Validform_label" style="display: none;">工作所需天数</label>
  130. </td>
  131. </tr>
  132. <tr>
  133. <td align="right">
  134. <label class="Validform_label">
  135. <span color="red" class="requiredIcon">*</span>工作所属角色:
  136. </label>
  137. </td>
  138. <td class="value">
  139. <t:dictSelect field="ownerrole" type="list" dictTable="t_s_role" dictField="id" dictText="rolename" defaultVal="${projectTaskPlanPage.ownerrole}" hasLabel="false" title="工作所属角色" dictCondition=" where rolecode like 'T_%'"></t:dictSelect>
  140. <span class="Validform_checktip"></span>
  141. <label class="Validform_label" style="display: none;">工作所属角色</label>
  142. </td>
  143. </tr>
  144. <tr>
  145. <td align="right">
  146. <label class="Validform_label"> <span color="red" class="requiredIcon">*</span>分配项目: </label>
  147. </td>
  148. <td class="value">
  149. <textarea id="projectnames" name="projectnames" ignore="ignore" style="width: 280px" rows="6" readonly="readonly" >${projectTaskPlanPage.projectnames}</textarea>
  150. <input id="projectids" name="projectids" type="hidden" value="${projectTaskPlanPage.projectids}">
  151. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="jzdepartSearch" onclick="openDepartmentSelectjz()">选择</a>
  152. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="jzdepartRedo" onclick="callbackCleanjz()">清空</a>
  153. <span class="Validform_checktip" style="display: none;">分配项目</span>
  154. </td>
  155. </tr>
  156. <tr>
  157. <td align="right">
  158. <label class="Validform_label">
  159. 计划详述:
  160. </label>
  161. </td>
  162. <td class="value">
  163. <textarea id="description" name="description" ignore="ignore" style="width: 280px" rows="6" placeholder="请输入计划描述(最多输入文字数200)">${projectTaskPlanPage.description} </textarea>
  164. <%-- <input id="description" name="description" type="text" style="width: 150px" class="inputxt" ignore="ignore" value='${projectTaskPlanPage.description}'/> --%>
  165. <span class="Validform_checktip"></span>
  166. <label class="Validform_label" style="display: none;">计划详述</label>
  167. </td>
  168. </tr>
  169. <tr>
  170. <td align="right">
  171. <label class="Validform_label">附件:</label>
  172. </td>
  173. <td class="value">
  174. <c:choose>
  175. <c:when test="${load =='detail'}">
  176. <t:webUploader auto="true" busiId="${projectTaskPlanPage.id}" readOnly="true"
  177. busiTable="p_projecttaskplan"
  178. bizType="projecttaskplan"
  179. name="attachment" duplicate="true" fileNumLimit="10"
  180. nullMsg="附件不可为空"></t:webUploader>
  181. </c:when>
  182. <c:otherwise>
  183. <t:webUploader auto="true" busiId="${projectTaskPlanPage.id}"
  184. busiTable="p_projecttaskplan"
  185. bizType="projecttaskplan"
  186. name="attachment" duplicate="true" fileNumLimit="10"
  187. nullMsg="附件不可为空"></t:webUploader>
  188. </c:otherwise>
  189. </c:choose>
  190. <span class="Validform_checktip"></span>
  191. <label class="Validform_label" style="display: none;">附件</label>
  192. </td>
  193. </tr>
  194. <tr>
  195. <td height="50px" align="center" colspan="8">
  196. <div style="display:none"><input type="submit" id ="btnsub" value=""/></div>
  197. <a id="btn_submit" href="#" class="easyui-linkbutton l-btn" iconcls="icon-le-ok" onclick="btn_ok()">提交</a>
  198. <a style="margin-left:20px" href="#" class="easyui-linkbutton l-btn" plain="true" iconcls="icon-le-back" onclick="btn_back()">返回</a>
  199. </td>
  200. </tr>
  201. </table>
  202. </t:formvalid>
  203. </body>
  204. <script src = "webpage/com/xcgl/projecttaskplan/projectTaskPlan.js"></script>
  205. <script type="text/javascript">
  206. var timetype = '';
  207. function btn_ok(){
  208. $("#btnsub").click();
  209. }
  210. function callback(data){
  211. if(data.success){
  212. layer.alert(data.msg, function(index){
  213. window.location.href="projectTaskPlanController.do?list&type="+$("#tasktype").val();
  214. layer.close(index);
  215. });
  216. }
  217. else{
  218. layer.alert(data.msg);
  219. }
  220. }
  221. function btn_back(){
  222. var url = 'projectTaskPlanController.do?list&type='+$("#tasktype").val();
  223. window.location.href=url;
  224. }
  225. //项目多选
  226. function openDepartmentSelectjz() {
  227. $.dialog.setting.zIndex = getzIndex();
  228. var projectIds = $("#projectids").val();
  229. $.dialog({content: 'url:publicpageController.do?departSelectproject&checkbox=true&ids='+projectIds, zIndex: getzIndex(), title: '项目列表', lock: true, width: '800px', height: '550px', opacity: 0.4, button: [
  230. {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelectjz, focus: true},
  231. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  232. ]}).zindex();
  233. }
  234. function callbackDepartmentSelectjz() {
  235. var iframe = this.iframe.contentWindow;
  236. if(iframe.getReason().length>0){
  237. var strData=eval(iframe.getReason());
  238. var ids='',names='';
  239. for(var key in strData[0]){
  240. if(key=="strId"){
  241. ids += strData[0][key];
  242. }else if(key=="strName"){
  243. names += strData[0][key];
  244. }
  245. }
  246. }
  247. $('#projectnames').val(names);
  248. $('#projectnames').blur();
  249. $('#projectids').val(ids);
  250. }
  251. function callbackCleanjz(){
  252. $('#projectnames').val('');
  253. $('#projectids').val('');
  254. }
  255. function openCronSetting(){
  256. $.dialog.setting.zIndex = getzIndex();
  257. var cron = $("#cron").val();
  258. $.dialog({id:'cronsetting', content: 'url:projectTaskPlanController.do?cronsetting&cron='+cron, zIndex: 2100, title: '工作计划启动时间设置', lock: true, width: '950px', height: '600px', opacity: 0.4, button: [
  259. {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackCronSetting
  260. , focus: true},
  261. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  262. ]}).zindex();
  263. }
  264. function callbackCronSetting(){
  265. var iframe = this.iframe.contentWindow;
  266. var cron = iframe.getCron();
  267. if(cron.indexOf('false') == 0){
  268. alert(cron.substring(5));
  269. return false;
  270. }else{
  271. $('#cron').val(cron);
  272. return true;
  273. }
  274. }
  275. function cleanCron(){
  276. $('#cron').val('');
  277. }
  278. function beforesubmit(){
  279. if(timetype == 'onetime' && !$('#endTime').val()){
  280. tip('请输入临时工作截止时间');
  281. return false;
  282. }
  283. if(!$('#projectids').val()){
  284. tip('请选择工作要分配的项目');
  285. return false;
  286. }
  287. //设置cron
  288. if(timetype == 'periodtime'){
  289. if(!$('#periodnum').val() || !$('#msgAdvanceQuantity').val()){
  290. tip('请输入完整周期工作时间');
  291. return false;
  292. }
  293. var cronStr = '';
  294. if($('#planperiodtype').val() == 'week'){
  295. if($('#periodnum').val()<1 || $('#periodnum').val() > 7){
  296. tip('超出每星期的天数限制,请重新填写');
  297. return false;
  298. }
  299. cronStr = '59 59 23 ? * '+$('#periodnum').val()-1;
  300. }else{
  301. if($('#periodnum').val() < 0 || $('#periodnum').val() > 31){
  302. tip('超出每月天数限制,请重新填写');
  303. return false;
  304. }
  305. cronStr = '59 59 23 '+$('#periodnum').val()+' * ? *';
  306. }
  307. $('#cron').val(cronStr);
  308. }
  309. return true;
  310. }
  311. </script>