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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>添加${Constants.CUSTOMER_CONSTANTS}联系人</title>
 
 
</head>
<body class="end_task_body widthauto">
[#include "/business/pages/include/static.html" /]
[#include "/component/newsel.html" /]
 
 
<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;
        }});
 
 
        $("#contractsName").formValidator({empty:false,onShow:"请输入联系人名称!"}).inputValidator({min:2,max:100,onError:"联系人名称2-100个字符或1-50个汉字"});
            $("#login_name").formValidator({empty:false,onShow:"请填写登录名称!",onFocus:"登录名长度为6~20位"}).inputValidator({min:6,max:20,onError:"登录名长度至少为6~20位"})
                .regexValidator({regExp:"username",dataType:"enum",onError:"登录名只能由字母或数字组成"})
                .ajaxValidator({
                    dataType : "html",
                    async : true,
                    url : "checkLogin_name.html",
                    data :{"login_name":$.util.encode($("#login_name").val())},
                    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 : "登录名称已存在!",
                    onWait : "请稍候..."
                });
 
        $("#email").formValidator({empty:true,onShow:"请输入邮箱",onFocus:"请输入邮箱"})
                    .regexValidator({regExp:"email",dataType:"enum",onError:"你输入的邮箱格式不正确"})
                    .ajaxValidator({
                    dataType : "html",
                    async : true,
                    url : "checkEmail.html",
                    data :{"email":$.util.encode($("#email").val())},
                    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 : "邮箱已存在!",
                    onWait : "请稍候..."
                });
        $("#contacts_type").formValidator({empty:false,onShow:"请输入联系方式!",onFocus:"联系方式不能为空!"}).functionValidator({fun:checkPhone});
 
        $("#ywks").formValidator({empty:false,onShow:"请输入业务科室!"}).inputValidator({min:2,max:100,onError:"业务科室2-100个字符或1-50个汉字"});
        $("#zw").formValidator({empty:false,onShow:"请输入职务!"}).inputValidator({min:2,max:40,onError:"职务2-40个字符或1-20个汉字"});
        // $("#telePhone").formValidator({empty:true,onShow:"请输入电话,格式为'0371-66666666'",onFocus:"请输入电话,格式为'0371-66666666'"})
        //             .regexValidator({regExp:"^(([0\\+]\\d{2,3}-)?(0\\d{2,3})-)?(\\d{7,8})(-(\\d{3,}))?$",onError:"你输入的办公电话格式不正确"});
        $("#mobile").formValidator({empty:true,onShow:"手机号码",onFocus:"11位手机号码"}).inputValidator({min:11,max:11,onError:"手机号码必须为11位数字"})
                    .regexValidator({regExp:"mobile",dataType:"enum",onError:"你输入的手机号码格式不正确"});
                //     .ajaxValidator({
                //     dataType : "html",
                //     async : true,
                //     url : "checkMobile.html",
                //     data :{"mobile":$("#mobile").val()},
                //     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 : "手机号码已存在!",
                //     onWait : "请稍候..."
                // });
        $("#levelId").formValidator({empty:false,onShow:"请选择等级名称!",onFocus:"等级名称不能为空"}).inputValidator({min:1,max:200,onError:"等级名称不能为空"});
        $(".yhzx").click(function(){
          if($(this).val()==1){
             $(".login").show();
             $("#login_name").attr("disabled",false).unFormValidator(false);
          }else{
             $(".login").hide();
             $("#login_name").attr("disabled",true).unFormValidator(true);
          }
        })
 
})
function checkPhone(value) {
    if($.util.isEmpty(value)) {
        return "联系方式不能为空";
    }
    if(!$.util.isMobile(value) && !$.util.isTelphone(value)) {
        return "联系方式格式不正确";
    }
    return true;
}
</script>
 
<div class="edit_txt">
    <form id="myform" action="${base}/business/pages/servicelist/slaproject/saveProjectContacts.html" method="post">
         <input type="hidden" name="customerId" value="${customerId}" />
         <table class="edit_layout2">
                <tr><th ><label class="required" >联系人名称:</label></th>
                    <td ><input class="general" type="text" name="contractsName" id="contractsName"/>
                    <div id="contractsNameTip" style="display:inline-block;width:180px;"></div>
                    </td>
                </tr>
                <tr><th><label class="required">用户中心登录:</label></th>
                    <td >
                        <input type="radio" value="1" name="allow_login" class="yhzx audit" checked/>允许
                        <input type="radio" value="2" name="allow_login" class="yhzx audit" />禁止
                    </td>
                </tr>
                <tr class="login"><th ><label class="required" >登录名:</label></th>
                    <td ><input class="general" type="text" name="login_name" id="login_name"/>
                    <div id="login_nameTip" style="display:inline-block;width:280px;"></div>
 
                    </td>
                </tr>
                <tr class="login"><th ></th>
                    <td >
                   <font color="red">默认密码为88888888</font>
                    </td>
                </tr>
                <tr><th ><label>邮箱:</label></th>
                    <td ><input class="general" type="text" name="email" id="email"/>
                    <div id="emailTip" style="display:inline-block;width:180px;"></div>
                    </td>
                </tr>
 
                <tr><th ><label>${Constants.UNIT_CONSTANTS}:</label></th>
                    <td ><input  class="general" type="text" name="sub_customer_name" id="sub_customer_name" readOnly onclick="subCus();"/>
                            <input type="hidden" name="sub_customer_id" id="sub_customer_id" />
                    </td>
                </tr>
                <tr><th ><label class="required" >联系方式 :</label></th>
                    <td ><input class="general" type="text" name="contacts_type" id="contacts_type"/>
                    <div id="contacts_typeTip" style="display:inline-block;width:200px;"></div>
                    </td>
                </tr>
                <tr><th><label class="required" >业务科室:</label></th>
                    <td ><input class="general" type="text" name="ywks" id="ywks"/>
                    <div id="ywksTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr><th><label class="required" >职务:</label></th>
                    <td ><input class="general" type="text" name="zw" id="zw"/>
                    <div id="zwTip" style="display:inline-block;"></div>
                    </td>
                </tr>
<!--                 <tr><th><label>办公电话:</label></th>-->
<!--                    <td ><input class="general" type="text" name="telePhone" id="telePhone"/>-->
<!--                    <div id="telePhoneTip" style="display:inline-block;width:280px;"></div>-->
<!--                    </td>-->
<!--                </tr>-->
                <tr><th><label>手机号:</label></th>
                    <td ><input class="general" type="text" name="mobile" id="mobile" />
                    <div id="mobileTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr><th><label class="required">等级名称:</label></th>
                    <td >[@sel id="levelId" name="levelId"  source=levelList textField="ID" valueField="DATAVALUE" /]
                    <div id="levelIdTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr><th><label class="required">是否满意度调查:</label></th>
                    <td >
                        <input type="radio" value="0" name="isStais" class="mark audit" checked/>否
                        <input type="radio" value="1" name="isStais" class="mark audit"/>是
                    </td>
                </tr>
 
                <tr><th><label >联系人说明:</label></th>
                    <td ><textarea class="general" style="width:360px;" name="contactsNote" id="note" /></textarea>
                    </td>
                </tr>
            </table>
     </form>
</div>
 
 
 
<script type="text/javascript">
function onDialogBtnClick(btnID, dialogID, config){
    if(btnID == "btnSure"){
        $("#myform").submit();
    }
}
 
function subCus() {
        var customer_id = '${RequestParameters.customerId}';
        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":60,"height":80},
                             [{btnId:"btnSure", btnName:"确定", btnStyle:"bluebtn"}],url);
}
 
function showCus(labelId,labelName) {
    $("#sub_customer_name").val(labelName);
    $("#sub_customer_id").val(labelId);
}
</script>
 
 
</body>
</html>