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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>等级协议</title>
[#include "/business/pages/include/static.html" /]
</head>
 
<body >
<input  type="hidden" id="type" name="type" value=""/>
<div class="fs_main clearfix" style="margin-top:10px;">
    <div class="fs_main fs_edit nopadding" style="border:1px solid #dadbdf ;" >
        <div class="deal_switch">
            <div class="dls_btn" id="dlsBtn">
                <a class="basicinfo focus"><span>人员</span></a>
                <a id="group" class="basicinfo"><span>角色</span></a>
                <a id="zdygroup" class="basicinfo"><span>自定义分组</span></a>
            </div>
        </div>
        <div class="deal_switch_wrap">
            <div class="deal_switch_con iframecon" style="display:block;" >
                <table id="selExecutors" class="pab_con">
    [#if groupList??&&groupList?size>0]
    [#list groupList as group]
        <tr><th>${group.name}</th><td>
        [#assign userList=group.dataList]
            [#if userList??&&userList?size>0]
                [#list userList as user]
                <div class="pabitem" style="margin-right:15px;">
                <input name="checkbox" value="${user.USER_ID}" class="pos" type="checkbox" /><span>${user.USER_NAME}</span>
                </div>
                [/#list]
            [/#if]
        </td></tr>
    [/#list]
    [/#if]
</table>
<table class="edit_layout2">
    <input type="hidden" name="alluserid" id="alluserid" >
    <input type="hidden" name="allusername" id="allusername" >
     <tr>
     <th ><label>主负责人:</label></th>
     <td>
     <select style="width: 140px;height:26px;" id="user" >
     </select>
     </td>
     </tr>
    </table>
        
            </div>
            <div class="deal_switch_con iframecon" style="display:none;" >
                
            </div>
            <div class="deal_switch_con iframecon" style="display:none;" >
                
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
var customer_id='${RequestParameters.customer_id}';
var serivceListId='${RequestParameters.serivceListId}';
var shownum=$("#shownum").val();
 
function loadGroup() {
    $("#type").val(3);
    $.post("${base}/business/pages/question/selectZdyGroup.html",{"customer_id":customer_id},function(data){
        $('div.deal_switch_con').eq(2).html(data);
    });
}
 
$(function() {
    
    $("#dlsBtn>a").click(function() {
        var index = $("#dlsBtn>a").index(this);
        $("#dlsBtn>a").removeClass("focus");
        $(this).addClass("focus");
        var $dom = $("div.deal_switch_con:eq("+index+")");
        $("#type").val(index+1);
        if($.util.isEmpty($.trim($dom.html()))) {
            if(index == 0) {
                $('div.deal_switch_con').eq(0).show();
            } else if(index == 1) {
                $.get("${base}/business/pages/question/selectGroup.html",{"customer_id":customer_id,"serivceListId":serivceListId},function(data){
                    $('div.deal_switch_con').eq(1).html(data);
                });
            } else if(index == 2) {
                loadGroup();
            }
        }
        $("div.deal_switch_con").hide();
        $dom.show();
    })
    
     $('.pos').click(function() {
         if($(this).is(":checked")){
           var id = $(this).val();
           if(!$("select option[value="+id+"]").length>0){
             var text = $(this).next("span").text();
             var html = "";
             $("#user").append("<option value='"+id+"'>"+text+"</option>");
             radioAddClick();
            }else{
              $(this).attr("checked",false);
              popupTips("此人已经选择");
            }
           
         }else{
            var checkid = $(this).val();
            var $temp = $('span.'+checkid).parent();
            
            $("#user option[value='"+checkid+"']").remove();  
            $temp.remove();
         }
            
            
    });
    
    
        $('div.deal_switch_con').hide();
        $('div.deal_switch_con').eq(0).show();
        $("#type").val(1);
        
})
function radioAddClick() {
        $('input.ropos').click( function() {
               var id = $(this).val();
               var text = $(this).next("span").text();
               $('#name').val(text);
               $('#userid').val(id);
        });
    }
function onDialogBtnClick(btnID, dialogID, config){
   if(btnID == "btnSure"){
      var typelx = $("#type").val();
      var alluserid1 = "";
      var allusername1 = "";
      if(typelx == 1){ 
        var checkUser = $(":checkbox:checked");
        if(checkUser.length==0) {
            popupTips("请选择人员");
            return;
        }
        var checkmain = $("#user").val();
        if($.util.isEmpty(checkmain)) {
            popupTips("请选择主要负责人");
            return;
        }
        var $users = $(":checkbox:checked");
        var alluserid = "";
        var allusername = "";
        if($users.length>0) {
            $users.each(function() {
                if($(this).val() == checkmain){
                    alluserid += $(this).val()+"-1,";
                    allusername += $(this).next("span").text()+"(主负责人),";
                }else{
                    alluserid += $(this).val()+",";
                    allusername += $(this).next("span").text()+",";
                }
            });
        }
         alluserid1 = alluserid.substring(0,alluserid.length-1)+"&"+allusername.substring(0,allusername.length-1);
         allusername1 = allusername.substring(0,allusername.length-1);
      }
      if(typelx == 2){ 
         var checkUser = $(":radio.pos:checked");
        if(checkUser.length!=1) {
            popupTips("请选择人员");
            return;
        }
        alluserid1 = checkUser.val()+"&"+checkUser.next("span").text();
        allusername1 = checkUser.next("span").text();
      
      } 
      if(typelx == 3){ 
        var checkUser = $(":radio.zdypos:checked");
        if(checkUser.length!=1) {
            popupTips("请选择人员");
            return;
        }
        var alluser=new Array();
        alluser = checkUser.val().split("&");
        alluserid1 = alluser[0]+"&"+alluser[1];
        allusername1 = alluser[1];
      
      }
      window.top.document.getElementById('dialogIframepersonList').contentWindow.selectUser(typelx,alluserid1,allusername1);
      window.top.hideDialog("dealer");
      
        
   }
}
 
    //添加分组
    function addGroup() {
        window.top.openDialog("zdyadd","添加分组",
                         {},
                         {"width":70,"height":70},
                         [{btnId:"btnSure", btnName:"提交", btnStyle:"bluebtn"}],
                         "${base}/business/pages/question/addzdyGroupUser.html?customer_id="+customer_id);
    }
    //修改分组
    function edit(id) {
        window.top.openDialog("zdyadd","修改分组",
                         {},
                         {"width":70,"height":70},
                         [{btnId:"btnSure", btnName:"提交", btnStyle:"bluebtn"}],
                         "${base}/business/pages/question/addzdyGroupUser.html?customer_id="+customer_id+"&groupId="+id);
    }
    
    //删除分组
    function del(id) {
         var msg;
         msg = "确定要删除该分组吗?";
         window.top.confirmInfo('信息确认', msg, function(){
           $.post("delzdyGroupUser.html", {'id':id},function(data,textStatus){
              if(data=="1"){
                  window.top.popupTips("操作成功");
                loadGroup();
              } else {
                  window.top.popupTips("操作失败");
              }
          });
      });
    }
    
 
    
</script>
</body>
</html>