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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>添加健康检查指标项</title>
 
[#include "/business/pages/include/static.html" /]
[#include "/component/newsel.html" /]
[#include "/component/cfgcateSelector.html" /]
<link rel="stylesheet" href="${common_static}/static/plugins/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="${common_static}/static/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
 
</head>
<body class="end_task_body widthauto">
 
<script type="text/javascript">
    var setting = {
        async: {
            enable: true,
            url:"${base}/business/pages/customerconfig/slacustomer/ciTree.html",
            autoParam:["id"]
        },callback: {
            onClick: onClick,
            beforeClick : beforeClick
            
        }
    };
    function onClick(event, treeId, treeNode, clickFlag) {
        
        var categoryName;
        categoryName = treeNode.name;
        categoryId = treeNode.id;
        categoryName = getRootPath(treeNode,categoryName)
        $("#categoryName").val(categoryName);
        $("#categoryId").val(categoryId);
        $("#ztree").hide();
        
    }    
        
    //递归获取完整路径
    function getRootPath(treeNode,categoryName){
            var node = treeNode.getParentNode();
            if(node!=null){
                categoryName =  categoryName;
                return getRootPath(node,categoryName);
            }else{
                return categoryName;
            }
    }
    
    function beforeClick(treeId, treeNode, clickFlag){
        level = 1;
        level = getLevel(treeNode,level);
        if(level==3){
            return true;
        }else{
            return false;
        }
    }
    
    function getLevel(treeNode,level){
        var node = treeNode.getParentNode();
        if(node!=null){
            level = level + 1;
            return getLevel(node,level);
        }else{
            return level;
        }
    }
        
    function showTree(){
        $("#menuContent").show();
    }
$(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;
        }});
        $("#item_name").formValidator({empty: false, onShow: "巡检项名称不能为空", onFocus: "巡检项名称不能为空!"}).inputValidator({min: 1, onError: "巡检项名称不能为空!"});
        $("#full_cate_id").formValidator({empty: false, onShow: "配置三级分类不能为空",onFocus: "配置三级分类不能为空!"}).inputValidator({min: 1, onError: "配置三级分类不能为空!"});
        $("#priority_level_id").formValidator({empty: false, onShow: "请选择优先级",onFocus: "优先级不能为空!"}).inputValidator({min: 1, onError: "优先级不能为空!"});
        $("#item_note").formValidator({empty: false, onShow: "检测项不能为空",onFocus: "检测项不能为空!"}).inputValidator({min: 1, onError: "检测项不能为空!"});
        $("#steps").formValidator({empty: false, onShow: "检测标准及方法不能为空",onFocus: "检测标准及方法不能为空!"}).inputValidator({min: 1, onError: "检测标准及方法不能为空!"});
        $("#expect_value").formValidator({empty: false, onShow: "期望值不能为空", onFocus: "期望值不能为空!"}).inputValidator({min: 1, onError: "期望值不能为空!"});
        $("#order_num").formValidator({empty:false, onShow: "顺序号不能为空",onFocus:"请输入顺序号"}).inputValidator({min:1,max:5,onError:"顺序号必须为1到5位数字"})
        .regexValidator({regExp:"intege", dataType:"enum", onError:"顺序号必须为1到5位数字"});
        combotree("categoryName").create().treeCon().attr({"id":"ztree"});
        combotree("categoryName").treeCon().addClass("ztree");
        $.fn.zTree.init($("#ztree"), setting);
        });
</script>
 
<div class="edit_txt">
    <form id="myform" action="${base}/business/pages/customerconfig/slacustomer/saveCustomerHealthItem.html" method="post">
         <input type="hidden" value="${RequestParameters.customerId}" name="customerId" id="customerId"/>
         <table class="edit_layout2">
                <tr>
                    <th><label class="required">巡检项名称:</label></th>
                    <td><input class="general" type="text" name="item_name" id="item_name" style="width:300px;"/>
                        <div id="item_nameTip" style="display:inline-block;"></div>
                    </td>
                </tr>
               
                <tr>
                    <th><label class="required">配置分类:</label></th>
                    <td>
                        [@cfgcate id="full_cate_id" name="full_cate_name" lv="2" /]
                          <div id="full_cate_idTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                
                
                <tr><th><label class="required">优先级:</label></th>
                    <td>[@sel id="priority_level_id" name="priority_level_id"  source=levels textField="DATAKEY" valueField="DATAVALUE" labelName="priority_level_name" /]
                       <div id="priority_level_idTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr><th><label class="required">巡检项说明:</label></th>
                    <td><textarea class="general" name="item_note" id="item_note" /></textarea>
                       <div id="item_noteTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr><th><label class="required">检测标准及方法:</label></th>
                    <td><textarea class="general" name="steps" id="steps" /></textarea>
                       <div id="stepsTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="required">期望值:</label></th>
                    <td><input class="general" type="text" name="expect_value" id="expect_value" style="width:300px;"/>
                        <div id="expect_valueTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="required">显示顺序:</label></th>
                    <td><input class="general" type="text" name="order_num" id="order_num" style="width:300px;"/>
                       <div id="order_numTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                
                
            </table>
     </form>
</div>
 
 
 
<script type="text/javascript">
function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            $("#myform").submit();
        }
    }
</script>
 
</body>
</html>