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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>新增${Constants.CUSTOMER_CONSTANTS}</title>
[#include "/business/pages/include/static.html" /]
</head>
[#include "/component/newsel.html" /]
[#include "/component/DatePicker.html" /]
[#include "/component/areaSelector.html" /]    
[#include "/component/webupload.html" /]
<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,"noclose":true},
                             [{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
                             return true;
        }});
        
        $("#customer_name").formValidator({empty: false, onShow:"请输入${Constants.CUSTOMER_CONSTANTS}名称!",onFocus: "请输入${Constants.CUSTOMER_CONSTANTS}名称"}).inputValidator({min: 2,max:100, onError: "${Constants.CUSTOMER_CONSTANTS}名称长度为2-100个字符或1-50个汉字"});
        $("#code").formValidator({empty: false, onShow:"请输入${Constants.CUSTOMER_CONSTANTS}编码!",onFocus: "请输入${Constants.CUSTOMER_CONSTANTS}编码"}).inputValidator({min: 2,max:50, onError: "${Constants.CUSTOMER_CONSTANTS}编码长度2-50个字符或1-25个汉字"})
        .ajaxValidator({
            dataType : "html",
            data:{
                         "code" : function(){return $("#code").val();},
                         "id" : function(){return $("#id").val();}
                     },
            async : true,
            url : "checkCusCode.html",
            success : function(data){
                if( data == 0 ) return true;
                if( data == 1 ) return false;
                return false;
            },
            buttons: $("#dosubmit"),
            error: function(jqXHR, textStatus, errorThrown){alert("服务器没有返回数据,可能服务器忙,请重试"+errorThrown);},
            onError : "该${Constants.CUSTOMER_CONSTANTS}编码已存在,请更换标志",
            onWait : "正在对${Constants.CUSTOMER_CONSTANTS}编码进行合法性校验,请稍候..."
        });
        $("#contact").formValidator({empty: false, onShow:"请输入联系人!",onFocus: "联系人不能为空"}).inputValidator({min: 4,max:100,onError: "联系人4-100个字符或2-50个汉字"});
        $("#phone").formValidator({empty:false,onShow:"请输入联系电话!",onFocus:"联系电话不能为空"})
        .inputValidator({min:1,max:12,onError:"联系电话最长12位"});
        $("#email").formValidator({empty:true,onShow:"请输入电子邮箱!",onFocus:"请输入电子邮箱"})
                .inputValidator({min:5,max:64,onError:"邮箱为5到32位字符"})
                .regexValidator({regExp:"email",dataType:"enum",onError:"email格式不正确"});
        
        $("#telephone").formValidator({empty:false,onShow:"请输入办公电话,格式'0371-45896325'!",onFocus:"办公电话不能为空"})
            .inputValidator({min:1,max:15,onError:"请输入办公电话,格式'0371-45896325'!"})
            .regexValidator({regExp:"tel", dataType:"enum", onError:"办公电话格式不正确"});
 
      
 
        $("#industry_id").formValidator({empty: false, onShow:"请选择行业!",onFocus: "请选择行业"}).inputValidator({min: 1,onError: "所属行业不能为空"});
        $("#valid_begin_date").formValidator({empty:false,onShow:"请选择服务开始时间!",onFocus:"请选择服务开始时间!"}).inputValidator({min:1,onError:"服务开始时间不能为空"});
        $("#valid_end_date").formValidator({empty:false,onShow:"请选择服务结束时间!",onFocus:"请选择服务结束时间!"}).inputValidator({min:1,onError:"服务结束时间不能为空"});
        $("#addressId").formValidator({empty:false,onShow:"请选择区域!",onFocus:"请选择区域!"}).inputValidator({min:1,max:128,onError:"区域不能为空"});
        $("#address").formValidator({empty: true, onShow:"请输入详细地址(可以不填)!",onFocus: "请输入详细地址(可以不填)!"}).inputValidator({min:0,max:100, onError: "详细地址长度不超过100个字符或50个汉字"});
        
        
    });
</script>
 
<div class="edit_txt">
    <form id="myform" action="${base}/business/pages/customermanage/customerManageAdd.html" method="post">
    <input type="hidden" id ="id" name ="id" value=${partner.ID}>
    <input type="hidden" id ="account_id" name ="account_id" value=${partner.ACCOUNT_ID}>
         <table class="edit_layout2">
                 <tr>
                    <th><label class="required">${Constants.CUSTOMER_CONSTANTS}名称:</label></th>
                    <td >
                    <input class="general" type="text" id="customer_name" name="customer_name" value="${partner.CUSTOMER_NAME}"/>
                    <div id="customer_nameTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="required">${Constants.CUSTOMER_CONSTANTS}编码:</label></th>
                    <td >
                    <input class="general" type="text" id="code" name="code" value="${partner.CUSTOMER_CODE}" />
                    <div id="codeTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                    <th><label >简称:</label></th>
                    <td>
                        <input class="general" type="text" name="short_name" id="short_name" maxlength="32" value="${partner.SHORT_NAME}"/>
                        <div id="short_nameTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="required">运维经理:</label></th>
                    <td >
                    [@sel id="ywjl_id" labelName="ywjl_name"  value="${partner.ywjl_id}" text="${partner.ywjl_name}" source=users textField="id" valueField="name"  blankFlag="y"/]
                    </td>
                </tr>
                <tr>
                    
                    <th><label class="required">联系人:</label></th>
                    <td>
                    <input type="text" name="contact" id="contact"  class="general" value="${partner.CONTACT}" />
                        <div id="contactTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="required">联系电话:</label></th>
                    <td>
                        <input type="text" name="phone" id="phone"  class="general" value="${partner.PHONE}"/>
                        <div id="phoneTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                
                    <th><label>Email:</label></th>
                    <td>
                        <input type="text" name="email" id="email"  class="general" value="${partner.EMAIL}"/>
                        <div id="emailTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="required">所属行业:</label></th>
                    <td>
                         [@sel id="industry_id" name="industry_id" text="${partner.INDUSTRY_NAME}" value="${partner.INDUSTRY_ID}" source=hangye textField="DATAKEY" valueField="DATAVALUE" labelName="industry_name" /]
                        <div id="industry_idTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                    
                    <th><label class="required">服务开始时间:</label></th>
                    <td>
                        [@datepicker name="valid_begin_date" id="valid_begin_date" value="${partner.VALID_BEGIN_DATE}"/]
                        <div id="valid_begin_dateTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="required">服务结束时间:</label></th>
                    <td>
                        [@datepicker name="valid_end_date" id="valid_end_date" value="${partner.VALID_END_DATE}" /]
                        <div id="valid_end_dateTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                
                    <tr>
                    <th><label class="required">所在区域:</label></th>
                    <td >
                        [#if partner.PROVINCE_ID?? &&  partner.CITY_ID?? && partner.COUNTY_ID??]
                            [@area  name="addressName" id="addressId" iframe="{'lv1_id':'dialogIframe0'}" id_val="${partner.PROVINCE_ID}-${partner.CITY_ID}-${partner.COUNTY_ID}" name_val="${partner.PROVINCE_NAME}-${partner.CITY_NAME}-${partner.COUNTY_NAME}"/]
                        [#else]
                            [@area  name="addressName" id="addressId" iframe="{'lv1_id':'dialogIframe0'}" /]
                        [/#if]
                        <div id="addressIdTip" style="display:inline-block;"></div>
                    </td>
                </tr> 
                   <tr>
                    
                    <th><label>详细地址:</label></th>
                    <td>
                        <input style="width:300px;" type="text" name="address" id="address"  class="general" value="${partner.ADDRESS}"/>
                        <div id="addressTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                
                 <tr>
                    <th class="postop"><label>业务描述:</label></th>
                    <td><textarea cols="20" class="general" id="business_desc" name="business_desc">${partner.BUSINESS_DESC}</textarea>
                     <div id="business_descTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                
                <tr>
                    <th class="postop"><label>附件:</label></th>
                    <td>
                        <div class="upload_file">
                            [@webupload id="files" multiple="true" fileList=customerFiles /]
                        </div>
                    </td>
                </tr>
                
            </table>
     </form>
</div>
 
<script type="text/javascript">
function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            var beginTime = $("#valid_begin_date").val();
               var endTime = $("#valid_end_date").val();
            if(endTime < beginTime ){
                popupTips("服务结束时间不能小于服务开始时间!");
                return;
            }
            $("#myform").submit();
        }
    }
    
 
 
</script>
 
</body>
</html>