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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!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" /]
<style>
.fixflow{overflow:hidden;margin-bottom:10px;}
.fixflow a{margin-left:10px;height:26px;line-height:26px;display: inline-block;}
.fixflow a.add{
    width: 26px;
    background: url("${base}/static/images/addbtn.gif") center no-repeat;
}
.fixflow a.minus{
    width: 26px;
    background: url("${base}/static/images/del.jpg") center no-repeat;
    background-size:24px;
}
</style>
</head>
<body class="edit_txt_body">
 
<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;
            }
        });
 
        $("#plan_name").formValidator({empty: false, onFocus: "请输入计划名称"}).inputValidator({min: 1, max: 100, onError: "计划名称为1到50汉字"});
        $("#customer_id").formValidator({empty: false, onFocus: "请选择项目"}).inputValidator({min: 1, onError: "项目不能为空"});
        $("#sub_customer_id").formValidator({empty: false, onFocus: "请选择子项目"}).inputValidator({min: 1, onError: "子项目不能为空"});
        $("#intent").formValidator({empty: false, onFocus: "请输入编制目的"}).inputValidator({min: 1, max: 200, onError: "编制目的为1到100汉字"});
        $("#plan_range").formValidator({empty: true, onFocus: "请输入使用范围"}).inputValidator({min: 0, max: 200, onError: "使用范围为1到100汉字"});
        $("#standard").formValidator({empty: true, onFocus: "请输入启动标准"}).inputValidator({min: 0, max: 200, onError: "启动标准为1到100汉字"});
        $("#level").formValidator({empty: true, onFocus: "请输入预案级别"}).inputValidator({min: 0, max: 200, onError: "预案级别为1到100汉字"});
        $("#duty").formValidator({empty: true, onFocus: "请输入应急机构及职责"}).inputValidator({min: 0, max: 200, onError: "应急机构及职责为1到100汉字"});
        $("#plan_describe").formValidator({empty: false, onFocus: "请输入预案描述"}).inputValidator({min: 1, onError: "预案描述不能为空"});
        $("#command").formValidator({empty: false, onFocus: "请输入总指挥"}).inputValidator({min: 1, max: 200, onError: "总指挥为1到100汉字"});
        $("#partake").formValidator({empty: false, onFocus: "请输入参与人"}).inputValidator({min: 1, max: 200, onError: "参与人为1到100汉字"});
    })
</script>
 
<div class="edit_txt">
    <form action="${base}/business/pages/emergencyPlan/saveEmergencyPlan.html" method="post" id="myform" name="myform">
        <input type="hidden" name="id" value="${info.ID}"/>
        <table class="edit_layout" width="99%">
            <tr>
                <th><label class="required">计划名称:</label></th>
                <td colspan="3"><input class="general" type="text" value="${info.PLAN_NAME}" name="plan_name" id="plan_name" style="width:360px"/>
                    <div id="plan_nameTip" style="display:inline-block;"></div>
                </td>
            </tr>
            <tr>
                <th><label class="required">${Constants.CUSTOMER_CONSTANTS}名称:</label></th>
                <td>
                    [@sel id="customer_id" name="customer_id" value="${info.CUSTOMER_ID}" source=customers textField="ID" valueField="CUSTOMER_NAME" labelName="customer_name" callback="changeMsg"/]
                    <div id="customer_idTip" style="display:inline-block;"></div>    
                </td>
                <th><label class="required">${Constants.UNIT_CONSTANTS}:</label></th>
                <td>
                    <input  class="general" value="${info.SUB_CUSTOMER_NAME}" type="text" name="sub_customer_name" id="sub_customer_name" readOnly onclick="subCus();"/>
                       <input type="hidden" name="sub_customer_id" id="sub_customer_id" value="${info.SUB_CUSTOMER_ID}" />
                       <div id="sub_customer_idTip" style="display:inline-block;"></div>    
                </td>
            </tr>
            <tr>
                <th><label class="required">编制目的:</label></th>
                <td colspan="3"><input class="general" type="text" value="${info.INTENT}" name="intent" id="intent" style="width:360px"/>
                    <div id="intentTip" style="display:inline-block;"></div>
                </td>
            </tr>
            <tr>
                <th><label>使用范围:</label></th>
                <td colspan="3">
                    <input class="general" type="text" value="${info.PLAN_RANGE}" name="plan_range" id="plan_range" style="width:360px"/>
                    <div id="plan_rangeTip" style="display:inline-block;"></div>
                </td>
            </tr>
            <tr>
                <th><label>启动标准:</label></th>
                <td colspan="3">
                    <input class="general" type="text" value="${info.STANDARD}" name="standard" id="standard" style="width:360px"/>
                    <div id="standardTip" style="display:inline-block;"></div>
                </td>
            </tr>
            <tr>
                <th><label>预案级别:</label></th>
                <td colspan="3">
                    <select id="level" name="level" class="mysel">
                        <option value="A" [#if info.LEVEL=='A']selected="selected"[/#if]>A</option>
                        <option value="B" [#if info.LEVEL=='B']selected="selected"[/#if]>B</option>
                        <option value="C" [#if info.LEVEL=='C']selected="selected"[/#if]>C</option>
                        <option value="D" [#if info.LEVEL=='D']selected="selected"[/#if]>D</option>
                    </select>
                    <div id="levelTip" style="display:inline-block;"></div>
                </td>
            </tr>
            <tr>
                <th><label>应急机构及职责:</label></th>
                <td colspan="3">
                    <input class="general" type="text" value="${info.DUTY}" name="duty" id="duty" style="width:360px"/>
                    <div id="dutyTip" style="display:inline-block;"></div>
                </td>
            </tr>
            <tr>
                <th><label class="required">预案描述:</label></th>
                <td colspan="3">
                    <textarea class="general" style="width:360px;" id="plan_describe" name="plan_describe"/>${info.PLAN_DESCRIBE}</textarea>
                    <div id="plan_describeTip" style="display:inline-block;"></div>
                </td>
            </tr>
            <tr>
                <th><label>解决方案:</label></th>
                <td colspan="3">
                    <textarea class="general" style="width:360px;" id="solve" name="solve"/>${info.SOLVE}</textarea>
                </td>
            </tr>
            <tr>
                <th><label>风险预防:</label></th>
                <td colspan="3">
                    <textarea class="general" style="width:360px;" id="prevention" name="prevention"/>${info.PREVENTION}</textarea>
                </td>
            </tr>
            
            
            <tr>
                <th style="vertical-align:top;padding-top:14px;"><label class="required">演练时间:</label></th>
                <td id="date">
                    [#if dateList?size>0]
                        [#list dateList as date]
                        [#if date_index==0]
                        <div class="fixflow">[@datepicker id="endDate" name="ylTime" minDate=DateUtil.getCurrentDate14() value="${date.PLAN_DATE}" length=8 /]<a onclick="addYl()" class="add"></a></div>
                        [#else]
                        <div class="fixflow">[@datepicker id="endDate" name="ylTime" minDate=DateUtil.getCurrentDate14() value="${date.PLAN_DATE}" length=8 /]<a onclick="addYl()" class="add"></a><a onclick="delDate(this)" class="minus"></a></div>
                        [/#if]
                        [/#list]
                    [#else]
                        <div class="fixflow">[@datepicker id="endDate" minDate=DateUtil.getCurrentDate14() name="ylTime" value="" length=8 /]<a onclick="addYl()" class="add"></a></div>
                    [/#if]
                </td>
                
            </tr>
            
            <tr>
                <th><label class="required">总指挥:</label></th>
                <td colspan="3">
                    <input class="general" type="text" value="${info.COMMAND}" name="command" id="command" style="width:360px"/>
                    <div id="commandTip" style="display:inline-block;"></div>
                </td>
            </tr>
            <tr>
                <th><label class="required">参与人:</label></th>
                <td colspan="3">
                    <input class="general" type="text" value="${info.PARTAKE}" name="partake" id="partake" style="width:360px"/>
                    <div id="partakeTip" style="display:inline-block;"></div>
                </td>
            </tr>
        </table>
        <input name="ylDate" id="ylDate" type="hidden">
    </form>
</div>
 
 
<script type="text/javascript">
    
    function onDialogBtnClick(btnID, dialogID, config) {
        if (btnID == "btnSure") {
            $("#customer_name").val($("#customer_id :selected").text());
            var dates="";
            $('input[name="ylTime"]').each(function(){
                if($(this).val()!=''){
                    dates+=$(this).val()+",";
                }
            });
            $("#ylDate").val(dates);
            if(dates==""){
                popupTips("请先选择演练时间");
                return;
            }
            $("#myform").submit();
        }
    }
    function subCus() {
        var customer_id = $("#customer_id").val();
        if($.util.isEmpty(customer_id)) {
            popupTips("请先选择${Constants.CUSTOMER_CONSTANTS}");
            return;
        }
        
        var sub_customer_id = $("#sub_customer_id").val();
        
        var url = "${base}/business/pages/servicelist/slaproject/subCus.html?type=3&customerId="+customer_id+"&subCustomerId="+sub_customer_id;
        window.top.openDialog("selectSubCus","操作",
                             {},
                             {"width":80,"height":80},
                             [{btnId:"btnSure", btnName:"确定", btnStyle:"bluebtn"}],url);
    }
    
    function showCus(labelId,labelName) {
        $("#sub_customer_name").val(labelName);
        $("#sub_customer_id").val(labelId);
    }
    function changeMsg(customerId,customerName) {
        $("#sub_customer_id").val("");
        $("#sub_customer_name").val("");
    }
    function addYl(){
        var ss="<div class='fixflow'><input type='date' onchange='changeTime(this)' name='ylTime' class='general' value=''  /><a onclick='delDate(this)' class='minus'></a></div>";
        
        $("#date").append(ss);
    }
    
    function addYl(){
        $.ajax({
                type: "POST",
                url:"${base}/business/pages/emergencyPlan/ylDate.html",
                data:{},
                error: function() {
                   window.top.popupTips("操作失败");
                },
                success: function(data) {
                    $("#date").append(data);
                }
        });
    }
    function delDate(obj){
        $(obj).parent().remove();
    }
    function changeTime(obj){
        var now='${now}';
        var time=($(obj).val()).replace("-", "").replace("-", "");
        var nowTime=Number(time);
        var n=Number(now);
        if(n>nowTime){
            popupTips("演练时间应不小于今天");
            $(this).val("");
        }
    }
</script>
 
 
</body>
</html>