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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>新增</title>
[#include "/business/pages/include/static.html" /]
[#include "/component/sel.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>
<script type="text/javascript">
    $(document).ready(function() {
        $.formValidator.initConfig({formID:"myform",onError:function(msg){popupTips(msg)},onSuccess:function(){
                        document.getElementById("myform").target = window.top.openDialog("2","操作",
                         {},
                         {"width":40,"height":40},[{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
                         return true;
        }});
        $("#duty_plan_name").formValidator({empty:false,onShow:"请输入计划名称!"}).inputValidator({min:1,max:200,onError:"计划名称不能为空"});
        $("#customer_id").formValidator({empty:false,onShow:"请选择项目!"}).inputValidator({min:1,max:200,onError:"项目不能为空"});
        $("#sub_customer_id").formValidator({empty:false,onShow:"请选择子项目!"}).inputValidator({min:1,max:200,onError:"子项目不能为空"});
    });
</script>
 
</head>
 
<body>
 
 
<div>
<form id="myform" action="" method="post">
    <input type="hidden" name="id" value="${RequestParameters.planId}"/>    
    <table class="basicinfo2" >
            <tr>
                <th><label class="required">计划名称:</label></th>
                <td>
                    <input id="duty_plan_name" name="duty_plan_name" value="${info.duty_plan_name}" class="general" type="text"/>
                    <div id="duty_plan_nameTip" style="display:inline-block;"></div>    
                </td>
            </tr>
             
            <tr></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>
            </tr>
            
            <tr></tr>
            <tr>
                <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 class="postop" >备注:</th>
                <td colspan="3"><textarea id="note" name="note" class="general">${info.note}</textarea></td>
            </tr>
       </table>
</form>
</div>
 
</body>
<script type="text/javascript">
 
    //点击事件
    function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            $("#customer_name").val($("#customer_id :selected").text());
             $("#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("");
    }
</script>
</html>