| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@include file="/context/mytags.jsp"%>
- <!DOCTYPE html>
- <html>
- <head>
- <title>工作计划</title>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <script type="text/javascript">
- </script>
- </head>
- <body>
- <t:formvalid formid="formobj" dialog="false" usePlugin="password" layout="table" action="projectTaskPlanController.do?doAdd" tiptype="1" callback="callback" beforeSubmit="beforesubmit">
- <input id="id" name="id" type="hidden" value="${projectTaskPlanPage.id }"/>
- <input id="status" name="status" type="hidden" value="1"/>
- <input id="tasktype" name="tasktype" type="hidden" value="${projectTaskPlanPage.tasktype}"/>
- <%-- <input id="msgAdvanceQuantity" name="msgAdvanceQuantity" type="hidden" value="${projectTaskPlanPage.msgAdvanceQuantity}"/> --%>
- <input id="msgAdvanceType" name="msgAdvanceType" type="hidden" value="day"/>
- <input id="taskquantity" name="taskquantity" type="hidden" value="1"/>
- <input id="code" name="code" type="hidden" value="${projectTaskPlanPage.code}"/>
- <input id="cron" name="cron" type="hidden" />
-
- <table style="width: 1000px;" cellpadding="0" cellspacing="1" class="formtable">
- <tr>
- <td align="right">
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span>任务计划名称:
- </label>
- </td>
- <td class="value">
- <input id="name" name="name" type="text" style="width: 150px" class="inputxt" datatype="*" ignore="ignore" />
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">计划名称</label>
- </td>
- </tr>
- <tr>
- <td align="right">
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span> 任务类型:
- </label>
- </td>
- <td class="value">
- <t:dictSelect id="sendTimeType" field="sendTimeType" type="radio" typeGroupCode="tasktimetype" defaultVal="${empty projectTaskPlanPage.sendTimeType?'onetime':projectTaskPlanPage.sendTimeType}" hasLabel="false" title="发送时间类型" ></t:dictSelect>
-
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">发送时间类型</label>
- </td>
- </tr>
- <tr id="onetimeset" style="display: none;">
- <td align="right">
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span> 临时工作截止时间:
- </label>
- </td>
- <td class="value">
- <input id="endTime" name="endTime" type="text" style="width: 150px;" class="Wdate"
- onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">临时工作截止时间</label>
- </td>
- </tr>
- <tr id="periodtimeset" style="display: none;">
- <!-- <td align="right">
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span> 周期工作截止时间:
- </label>
- </td>
- <td class="value">
- <input id="cron" name="cron" type="text" style="width: 150px" class="inputxt" datatype="*" readonly="readonly" ignore="ignore" placeholder="点击右侧按钮设置"/>
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="cronSetting" onclick="openCronSetting()">设置</a>
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="cronRedo" onclick="cleanCron()">清空</a>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">计划工作时间</label>
- </td> -->
- <td align="right">
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span> 周期工作时间:
- </label>
- </td>
- <td class="value">
- <label class="Validform_label" style="padding-left: 10px;" >每</label>
- <t:dictSelect id="planperiodtype" field="planperiodtype" type="list" extendJson="{class:'form-control',style:'width:123px'}" typeGroupCode="planperiodtype" hasLabel="false" title="周期类型类型" defaultVal="month"></t:dictSelect>
- <label class="Validform_label" style="padding-left: 10px;" >第</label>
- <input id="periodnum" name="periodnum" type="text" style="width: 100px" class="inputxt" datatype="n" ignore="ignore" placeholder="填写数字"/>
- <label class="Validform_label" style="padding-left: 10px;" >天完成</label>
- <!--
- <input id="cron" name="cron" type="text" style="width: 150px" class="inputxt" datatype="*" readonly="readonly" ignore="ignore" placeholder="点击右侧按钮设置"/>
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="cronSetting" onclick="openCronSetting()">设置</a>
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="cronRedo" onclick="cleanCron()">清空</a>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">计划工作时间</label> -->
- <!-- </td>
- <td align="right"> -->
- <label class="Validform_label">
- / 工作所需天数:
- </label>
- <!-- </td>
- <td class="value"> -->
- <input id="msgAdvanceQuantity" name="msgAdvanceQuantity" type="text" style="width: 100px" class="inputxt" datatype="n" value="15" ignore="ignore" placeholder="填写数字"/>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">工作所需天数</label>
- </td>
- </tr>
- <%-- <tr>
- <td align="right">
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span> 限时完成:发布后
- </label>
- </td>
- <td class="value">
- <input id="msgAdvanceQuantity" name="msgAdvanceQuantity" type="text" class="inputxt" datatype="n" ignore="checked" value="${msgAdvanceQuantity}">
- <span class="Validform_label" >天</span> --%>
- <%-- <span class="Validform_checktip" style="display: none;">提前量</span> --%>
- <%-- <t:dictSelect field="msgAdvanceType" type="list" extendJson="{class:'form-control'}" typeGroupCode="msgTipType" hasLabel="false" title="限时时间类型"></t:dictSelect> --%>
- <!-- <label class="Validform_label"> 发布 </label> -->
- <!-- </td>
- </tr> -->
- <tr>
- <td align="right">
- <label class="Validform_label">
- <span color="red" class="requiredIcon">*</span> 工作所属角色:
- </label>
- </td>
- <td class="value">
- <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>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">工作所属角色</label>
- </td>
- </tr>
- <tr>
- <td align="right">
- <label class="Validform_label"> <span color="red" class="requiredIcon">*</span>分配项目: </label>
- </td>
- <td class="value">
- <textarea id="projectnames" name="projectnames" ignore="ignore" style="width: 280px" rows="6" readonly="readonly" >${projectTaskPlanPage.projectnames}</textarea>
- <input id="projectids" name="projectids" type="hidden" value="${projectTaskPlanPage.projectids}"/>
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="jzdepartSearch" onclick="openDepartmentSelectjz()">选择</a>
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="jzdepartRedo" onclick="callbackCleanjz()">清空</a>
- <span class="Validform_checktip" style="display: none;">分配项目</span>
- </td>
- </tr>
- <tr>
- <td align="right">
- <label class="Validform_label">
- 工作内容详述:
- </label>
- </td>
- <td class="value" >
- <textarea id="description" name="description" ignore="ignore" style="width: 280px" rows="6" placeholder="请输入计划描述(最多输入文字数200)" ></textarea>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">工作内容详述</label>
- </td>
- </tr>
- <tr>
- <td align="right">
- <label class="Validform_label">附件:</label>
- </td>
- <td class="value">
- <t:webUploader auto="true" busiId="${projectTaskPlanPage.id}"
- busiTable="p_projecttaskplan"
- bizType="projecttaskplan"
- name="attachment" duplicate="true" fileNumLimit="10"
- nullMsg="附件不可为空"></t:webUploader>
-
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">附件</label>
- </td>
- </tr>
- <tr>
- <td height="50px" align="center" colspan="8">
- <div style="display:none"><input type="submit" id ="btnsub" value=""/></div>
- <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-le-ok" onclick="btn_ok()">提交</a>
- <a style="margin-left:20px" href="#" class="easyui-linkbutton l-btn" plain="true" iconcls="icon-le-back" onclick="btn_back()">返回</a>
- </td>
- </tr>
-
- </table>
- </t:formvalid>
-
- </body>
- <script src = "webpage/com/xcgl/projecttaskplan/projectTaskPlan.js"></script>
- <script>
- $(document).ready(function(){
- /* if($("#tasktype").val().length == 0)
- document.getElementById("tasktype").readonly=false; */
- $('input:radio[name="sendTimeType"]').on('click',function(){
- var t = $(this);
- if(t.val()=='onetime'){
- timetype = 'onetime';
- // $('#planSendTime').attr('datatype','*');
- // $('#planSendTime').show();
- $('#periodnum').removeAttr('datatype');
- $('#periodtimeset').hide();
- //$('#endTime').attr('datatype','*');
- $('#onetimeset').show();
- }else {
- timetype = 'periodtime';
- $('#periodnum').attr('datatype','n');
- $('#periodtimeset').show();
- // $('#endTime').removeAttr('datatype');
- $('#onetimeset').hide();
- }
- });
- var sendTimeType = $('input:radio[name="sendTimeType"]:checked');
- timetype = 'onetime';
- if(sendTimeType.val()=='onetime'){
- $('#periodtimeset').hide();
- $('#onetimeset').show();
- }
- });
- var timetype = '';
- function btn_ok(){
- $("#btnsub").click();
- }
- function callback(data){
- if(data.success){
- layer.alert(data.msg, function(index){
- window.location.href="projectTaskPlanController.do?list&type="+$("#tasktype").val();
- layer.close(index);
- });
- }
- else{
- layer.alert(data.msg);
- }
- }
- function btn_back(){
- var url = 'projectTaskPlanController.do?list&type='+$("#tasktype").val();
- window.location.href=url;
- }
- //项目多选
- function openDepartmentSelectjz() {
- $.dialog.setting.zIndex = getzIndex();
- var projectIds = $("#projectids").val();
- $.dialog({content: 'url:publicpageController.do?departSelectproject&checkbox=true&ids='+projectIds,zIndex: getzIndex(), title: '项目列表', lock: true, width: '800px', height: '550px', opacity: 0.4, button: [
- {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelectjz, focus: true},
- {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
- ]}).zindex();
- }
-
- function callbackDepartmentSelectjz() {
- var iframe = this.iframe.contentWindow;
- if(iframe.getReason().length>0){
- var strData=eval(iframe.getReason());
- var ids='',names='';
- for(var key in strData[0]){
- if(key=="strId"){
- ids += strData[0][key];
- }else if(key=="strName"){
- names += strData[0][key];
- }
- }
- }
- $('#projectnames').val(names);
- $('#projectnames').blur();
- $('#projectids').val(ids);
- }
- function callbackCleanjz(){
- $('#projectnames').val('');
- $('#projectids').val('');
- }
-
- function openCronSetting(){
- $.dialog.setting.zIndex = getzIndex();
- var cron = $("#cron").val();
- $.dialog({id:'cronsetting', content: 'url:projectTaskPlanController.do?cronsetting&cron='+cron, zIndex: 2100, title: '工作计划启动时间设置', lock: true, width: '950px', height: '600px', opacity: 0.4, button: [
- {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackCronSetting
- , focus: true},
- {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
- ]}).zindex();
- }
- function callbackCronSetting(){
- var iframe = this.iframe.contentWindow;
- var cron = iframe.getCron();
- if(cron.indexOf('false') == 0){
- alert(cron.substring(5));
- return false;
- }else{
- $('#cron').val(cron);
- return true;
- }
- }
-
- function cleanCron(){
- $('#cron').val('');
- }
- function beforesubmit(){
- if(timetype == 'onetime' && !$('#endTime').val()){
- tip('请输入临时工作截止时间');
- return false;
- }
- if(!$('#projectids').val()){
- tip('请选择工作要分配的项目');
- return false;
- }
- //设置cron
- if(timetype == 'periodtime'){
- if(!$('#periodnum').val() || !$('#msgAdvanceQuantity').val()){
- tip('请输入完整周期工作时间');
- return false;
- }
- var cronStr = '';
- if($('#planperiodtype').val() == 'week'){
- if($('#periodnum').val()<1 || $('#periodnum').val() > 7){
- tip('超出每星期的天数限制,请重新填写');
- return false;
- }
- cronStr = '59 59 23 ? * '+$('#periodnum').val()-1;
- }else{
- if($('#periodnum').val() < 0 || $('#periodnum').val() > 31){
- tip('超出每月天数限制,请重新填写');
- return false;
- }
- cronStr = '59 59 23 '+$('#periodnum').val()+' * ? *';
- }
- $('#cron').val(cronStr);
- }
- return true;
- }
- </script>
|