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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
[#include "/business/pages/include/static.html" /]
[#include "/component/newsel.html" /]
<title>选择执行人</title>
</head>
<body class="personnel_allocation_body">
<table id="selExecutors" class="pab_con">
    [#if resList??&&resList?size>0]
    [#list resList as item]
        [#assign userList=item.children]
        [#if userList??&&userList?size>0]
        <tr><th>${item.ROLENAME}</th><td>
        [/#if]
            [#if userList??&&userList?size>0]
                [#list userList as user]
                <div class="pabitem">
                <input name="userId" value="${user.USER_ID}" class="pos" type="checkbox" /><span>${user.USER_NAME}</span>
                </div>
                [/#list]
            [/#if]
        </td></tr>
    [/#list]
    [/#if]
    <tr style="margin-top:2px">
        <td>主负责人</td>
        <td style="text-align: left;">
            <select style="width: 20%" id="main_executor" >
            </select>
        </td>
    </tr>
    <tr>
        <td class="greybg"><label >备注</label></td>
        <td style="padding:0;">
            <textarea class="general" id="flowNote" name="flowNote" style="width:95%;height:100px;border:0;" ></textarea>
        </td>
    </tr>
</table>
</body>
 
<script type="text/javascript">
    $(document).ready(function(){
        $('input[name=userId]').live('click',function(){
            if($(this).is(":checked")){
                var userId = $(this).val();
                var userName = $(this).next("span").text();
                if(!$("select option[value="+userId+"]").length>0){
                    $("#main_executor").append("<option value='"+userId+"'>"+userName+"</option>");
                }else{
                    $(this).attr("checked",false);
                    window.top.popupTips("不能选择重复人员");
                }
                
            }else{
                var userId = $(this).val();
                $("#main_executor option[value='"+userId+"']").remove();  
            }
        });
        
    });
    
    //点击事件
    function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            var generalId = '${generalId}';
            var trIndex = '${trIndex}';
            var executorIds='';
            var executorNames='';
            $('input:checkbox:checked').each(function(){
                if(executorIds==''){
                    executorIds+=$(this).val();
                    executorNames=$(this).next("span").text();
                }else{
                    executorIds = executorIds + ',' + $(this).val();
                    executorNames=executorNames + ',' + $(this).next("span").text();
                }    
            });
            var main_executorId = $("#main_executor").val();
            var flowNote = $("#flowNote").val();
            if(flowNote.length>200){
                window.top.popupTips('不超过200个汉字或字符', 1);
                return;
            }
            if($.util.isEmpty(executorIds)){
                window.top.popupTips('请选择执行人', 1);
                return;
            }
            if($.util.isEmpty(main_executorId)){
                window.top.popupTips('请选择主负责人', 1);
                return;
            }
            
            window.top.frames["baseInfo"].formSubmit(executorIds,executorNames,main_executorId,flowNote);
             window.top.hideDialog(dialogID);
        }
    }
</script>
</html>