projectTaskPlan-pmdept-add.jsp 14 KB

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