cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>例行维护项周期</title>
 
[#include "/business/pages/include/static.html" /]
[#include "/component/DatePicker.html" /]
[#include "/component/newsel.html" /]
</head>
<body class="end_task_body widthauto">
 
<script type="text/javascript">
$(function() {
    $.formValidator.initConfig({formID:"myform",onError:function(msg){popupTips(msg)},onSuccess:function(){
                        document.getElementById("myform").target = window.top.openDialog("1","操作",
                         {},
                         {"width":40,"height":40},[{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
                         return true;
        }});
 
 
        $("#leix").formValidator({empty: false, onShow: "请选择周期类型", onFocus: "周期类型不能为空!"}).inputValidator({min: 1, onError: "周期类型不能为空!"});
        $("#zhouqi").formValidator({empty: false, onShow: "请输入周期", onFocus: "周期为1到3位数字!"}).inputValidator({min: 1, onError: "周期为1到3位的数字!"}).regexValidator({regExp:"intege", dataType:"enum", onError:"周期必须为1到3位数字"});
        $("#beginExecDate").formValidator({empty: false, onShow: "请选择开始执行日期", onFocus: "开始执行日期不能为空!"}).inputValidator({min: 1, onError: "开始执行日期不能为空!"});
        $("#contactsName").formValidator({empty: false, onShow: "请输入联系人", onFocus: "联系人不能为空!"}).inputValidator({min: 1, onError: "联系人不能为空!"});
        $("#contactsTel").formValidator({empty: false, onShow: "请输入联系手机号码", onFocus: "联系手机号码不能为空!"}).inputValidator({min: 1, onError: "联系手机号码不能为空!"}).regexValidator({regExp:"mobile", dataType:"enum", onError:"格式如:15933332222"});
 
        [#if item.LEIX == 1]
        $("#zhouqi,#beginExecDate").attr("disabled",false).unFormValidator(false);//恢复校验
        [#else]
        $("#zhouqi,#beginExecDate").attr("disabled",true).unFormValidator(true); //解除校验
        [/#if]
 
})
</script>
 
<div class="edit_txt">
    <form id="myform" action="${base}/business/pages/remind/itemCycle.html" method="post">
         <input type="hidden" value="${item.ID}" name="id" />
         <input type="hidden" value="${itemId}" name="project_item_id" />
         <input type="hidden" value="${customerId}" name="customerId" />
         <input type="hidden" value="${subId}" name="subId" />
         <input type="hidden" value="${outDate}" id="check" />
 
         <table class="edit_layout2">
                <tr>
                    <th><label class="required">周期类型:</label></th>
                    <td>
                    <select name="leix" id="leix" class="mysel" >
                        <option value="">请选择</option>
                        <option value="1" [#if item.LEIX==1]selected="selected"[/#if]>周期执行</option>
                        <option value="2" [#if item.LEIX==2]selected="selected"[/#if]>指定日期执行</option>
                    </select>
                    <div id="leixTip" style="display:inline-block;"></div>
                    </td>
                </tr>
 
 
                <tr id="kszx" [#if item.LEIX == 2]style="display:none;"[/#if]><th><label class="required">开始执行时间:</label></th>
                    <td>
                    [#if item.LEIX==1]
                    [@datepicker id="beginExecDate" class="general" length=8 value="" value="${item.BEGIN_EXEC_DATE}"/]
                    [#else]
                    [@datepicker id="beginExecDate" class="general" length=8 value=""  /]
                    [/#if]
                    <div id="beginExecDateTip" style="display:inline-block;"></div>
                    </td>
                </tr>
 
                <tr id="zq" [#if item.LEIX == 2]style="display:none;"[/#if]><th><label class="required">周期:</label></th>
                    <td><input class="general" type="text" name="zhouqi" id="zhouqi" [#if item.LEIX==1]value="${item.ZHOUQI}"[/#if]/>&nbsp;天
                    <div id="zhouqiTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="required">联系人:</label></th>
                    <td><input class="general" type="text" name="contactsName" id="contactsName" value="${item.CONTACTS_NAME}" />
                     <div id="contactsNameTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="required">联系方式:</label></th>
                    <td><input class="general" type="text" name="contactsTel" id="contactsTel" value="${item.CONTACTS_TEL}" />
                     <div id="contactsTelTip" style="display:inline-block;"></div>
                    </td>
                </tr>
 
            </table>
     </form>
</div>
 
 
 
<script type="text/javascript">
 
$(function() {
    if ($("#leix").val() == 1){
        $("#zq,#kszx").show();
    }else {
        $("#zq,#kszx").hide();
    }
});
 
$("#leix").change(function() {
    var value = $(this).val();
    if(value==1) {
        $("#zq,#kszx").show();
        $("#zhouqi,#beginExecDate").attr("disabled",false).unFormValidator(false);//恢复校验
    } else {
        $("#zq,#kszx").hide();
        $("#zhouqi,#beginExecDate").attr("disabled",true).unFormValidator(true); //解除校验
    }
});
 
function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            var checkDate = $("#check").val();
            if(checkDate == 1){
                popupTips("开始执行时间必须小于服务结束时间");
                return;
            }
            $("#myform").submit();
        }
    }
</script>
 
</body>
</html>