cy
2022-06-22 6e06bba1c89f8077e29d0fbf0ce12f89f027d8d2
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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>添加${Constants.UNIT_CONSTANTS}</title>
 
 
</head>
<body class="edit_txt_body">
[#include "/business/pages/include/static.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;
        }});
        
        
        $("#customer_name").formValidator({empty:false,onShow:"请输入单位名称!",onFocus: "单位名称不能为空"}).inputValidator({min:1,max:40,onError:"单位名称为1到20个汉字"});
        $("#contact").formValidator({empty: false, onShow:"请输入联系人!",onFocus: "联系人不能为空"}).inputValidator({min: 1,max:40,onError: "联系人为1到20个汉字"});
        $("#phone").formValidator({empty:false,onShow:"请输入联系方式!",onFocus:"联系方式不能为空!"}).functionValidator({fun:checkPhone});
})
 
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="" method="post">
         <table class="edit_layout" >
                <tr><th><label class="required">单位名称:</label></th>
                    <td><input class="general" type="text" name="customer_name" id="customer_name" value="${cus.CUSTOMER_NAME}"/>
                    <div id="customer_nameTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                
                <tr><th><label class="required">联系人:</label></th>
                    <td><input class="general" type="text" name="contact" id="contact" value="${cus.CONTACT}"/>
                    <div id="contactTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                
                
                <tr><th><label class="required">联系方式:</label></th>
                    <td><input class="general" type="text" name="phone" id="phone" value="${cus.PHONE}"/>
                    <div id="phoneTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                
                
                <tr><th><label>备注:</label></th>
                    <td><textarea id="note" class="general" name="note">${cus.NOTE}</textarea></td>
                </tr>
                
            </table>
     </form>
</div>
 
 
 
<script type="text/javascript">
function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            $("#myform").submit();
        }
    }
</script>
 
</body>
</html>