|  | @@ -49,7 +49,7 @@ $(function () {
 | 
	
		
			
				|  |  |              const code = $(this).attr('data-trid');
 | 
	
		
			
				|  |  |              let html = '';
 | 
	
		
			
				|  |  |              if (newVal && newVal === oldSearchVal) {
 | 
	
		
			
				|  |  | -                accountList.filter(item => item && item.id !== cur_uid && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
 | 
	
		
			
				|  |  | +                accountList.filter(item => item && (!cur_uid || item.id !== cur_uid) && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
 | 
	
		
			
				|  |  |                      html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
 | 
	
		
			
				|  |  |                          <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
 | 
	
		
			
				|  |  |                                  class="ml-auto">${item.mobile || ''}</span></p>
 | 
	
	
		
			
				|  | @@ -66,7 +66,7 @@ $(function () {
 | 
	
		
			
				|  |  |                          </a> ${group.groupName}</dt>
 | 
	
		
			
				|  |  |                          <div class="dd-content" data-toggleid="${idx}">`;
 | 
	
		
			
				|  |  |                          group.groupList.forEach(item => {
 | 
	
		
			
				|  |  | -                            if (item.id !== cur_uid) {
 | 
	
		
			
				|  |  | +                            if (!cur_uid || item.id !== cur_uid) {
 | 
	
		
			
				|  |  |                                  html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
 | 
	
		
			
				|  |  |                                      <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
 | 
	
		
			
				|  |  |                                              class="ml-auto">${item.mobile || ''}</span></p>
 | 
	
	
		
			
				|  | @@ -139,6 +139,58 @@ $(function () {
 | 
	
		
			
				|  |  |      function makeProcess(tr_id) {
 | 
	
		
			
				|  |  |          const trInfo = _.find(tenderRptList, { id: tr_id });
 | 
	
		
			
				|  |  |          $('#process_set').find('.card-title').text(trInfo.rpt_name);
 | 
	
		
			
				|  |  | +        cur_uid = trInfo.uid;
 | 
	
		
			
				|  |  | +        let html = '<div class="mr-2">上报人<b class="text-danger">*</b></div>';
 | 
	
		
			
				|  |  | +        let divhtml = '';
 | 
	
		
			
				|  |  | +        accountGroup.forEach((group, idx) => {
 | 
	
		
			
				|  |  | +            let didivhtml = '';
 | 
	
		
			
				|  |  | +            if(group) {
 | 
	
		
			
				|  |  | +                group.groupList.forEach(item => {
 | 
	
		
			
				|  |  | +                    didivhtml += item.id !== cur_uid ? '<dd class="border-bottom p-2 mb-0 " data-id="' + item.id + '" >\n' +
 | 
	
		
			
				|  |  | +                        '<p class="mb-0 d-flex"><span class="text-primary">' + item.name + '</span><span\n' +
 | 
	
		
			
				|  |  | +                        '                                                                                class="ml-auto">' + item.mobile + '</span></p>\n' +
 | 
	
		
			
				|  |  | +                        '                                                                    <span class="text-muted">' + item.role + '</span>\n' +
 | 
	
		
			
				|  |  | +                        '                                                                    </dd>\n' : '';
 | 
	
		
			
				|  |  | +                });
 | 
	
		
			
				|  |  | +                divhtml += '<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="' + idx + '" data-type="hide"><i class="fa fa-plus-square"></i></a> ' + group.groupName + '</dt>\n' +
 | 
	
		
			
				|  |  | +                    '                                                                <div class="dd-content" data-toggleid="' + idx + '">\n' + didivhtml +
 | 
	
		
			
				|  |  | +                    '                                                                </div>\n';
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        if (trInfo.uid) {
 | 
	
		
			
				|  |  | +            const userInfo = _.find(accountList, { id: trInfo.uid });
 | 
	
		
			
				|  |  | +            html += '<div class="mr-2">'+ userInfo.name +'</div>\n' +
 | 
	
		
			
				|  |  | +                '<div><span class="d-inline-block">\n' +
 | 
	
		
			
				|  |  | +                '                                                <div class="dropdown text-right">\n' +
 | 
	
		
			
				|  |  | +                '                                                    <button class="btn btn-sm btn-primary dropdown-toggle" type="button" id="' + tr_id + '_dropdownMenuButton1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n' +
 | 
	
		
			
				|  |  | +                '                                                        替换\n' +
 | 
	
		
			
				|  |  | +                '                                                    </button>\n' +
 | 
	
		
			
				|  |  | +                '                                                    <div class="dropdown-menu dropdown-menu-right" id="' + tr_id + '_dropdownMenu1" aria-labelledby="' + tr_id + '_dropdownMenuButton1" style="width:220px">\n' +
 | 
	
		
			
				|  |  | +                '                                                        <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"\n' +
 | 
	
		
			
				|  |  | +                '                                                                                     placeholder="姓名/手机 检索" autocomplete="off" data-trid="' + tr_id + '"></div>\n' +
 | 
	
		
			
				|  |  | +                '                                                        <dl class="list-unstyled book-list">\n' + divhtml +
 | 
	
		
			
				|  |  | +                '                                                        </dl>\n' +
 | 
	
		
			
				|  |  | +                '                                                    </div>\n' +
 | 
	
		
			
				|  |  | +                '                                                </div>\n' +
 | 
	
		
			
				|  |  | +                '                                            </span>\n' +
 | 
	
		
			
				|  |  | +                '</div>';;
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +            html +='<div><span class="d-inline-block">\n' +
 | 
	
		
			
				|  |  | +                '                                                <div class="dropdown text-right">\n' +
 | 
	
		
			
				|  |  | +                '                                                    <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="' + tr_id + '_dropdownMenuButton2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n' +
 | 
	
		
			
				|  |  | +                '                                                        选择审批人\n' +
 | 
	
		
			
				|  |  | +                '                                                    </button>\n' +
 | 
	
		
			
				|  |  | +                '                                                    <div class="dropdown-menu dropdown-menu-right" id="' + tr_id + '_dropdownMenu2" aria-labelledby="' + tr_id + '_dropdownMenuButton2" style="width:220px">\n' +
 | 
	
		
			
				|  |  | +                '                                                        <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"\n' +
 | 
	
		
			
				|  |  | +                '                                                                                     placeholder="姓名/手机 检索" autocomplete="off" data-trid="' + tr_id + '"></div>\n' +
 | 
	
		
			
				|  |  | +                '                                                        <dl class="list-unstyled book-list">\n' + divhtml +
 | 
	
		
			
				|  |  | +                '                                                        </dl>\n' +
 | 
	
		
			
				|  |  | +                '                                                    </div>\n' +
 | 
	
		
			
				|  |  | +                '                                                </div>\n' +
 | 
	
		
			
				|  |  | +                '                                            </span>\n' +
 | 
	
		
			
				|  |  | +                '</div>';
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        $('#rpt_user').html(html);
 | 
	
		
			
				|  |  |          $('#process_set input[name="tender_process"][value="'+ trInfo.sp_status +'"]').prop('checked', true);
 | 
	
		
			
				|  |  |          const spt = sp_status_list[trInfo.sp_status];
 | 
	
		
			
				|  |  |          $('#process_set').find('.alert-warning').text(spt.name + ':' + spt.msg);
 | 
	
	
		
			
				|  | @@ -192,8 +244,8 @@ $(function () {
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    // 选中审批人
 | 
	
		
			
				|  |  | -    $('body').on('click', 'dl dd', function () {
 | 
	
		
			
				|  |  | +    // 选中审批流里的审批人
 | 
	
		
			
				|  |  | +    $('body').on('click', '.lc-show dl dd', function () {
 | 
	
		
			
				|  |  |          const id = parseInt($(this).data('id'));
 | 
	
		
			
				|  |  |          if (!id) return;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -244,6 +296,72 @@ $(function () {
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    // 选中上报人
 | 
	
		
			
				|  |  | +    $('body').on('click', '#rpt_user dl dd', function () {
 | 
	
		
			
				|  |  | +        const id = parseInt($(this).data('id'));
 | 
	
		
			
				|  |  | +        if (!id) return;
 | 
	
		
			
				|  |  | +        console.log(id);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        let this_tr_id = parseInt($('#tender_rpt_table').find('.table-warning').attr('data-id'));
 | 
	
		
			
				|  |  | +        if (!this_tr_id) this_tr_id = $(this).parents('.dropdown').attr('data-trid');
 | 
	
		
			
				|  |  | +        const user = _.find(accountList, function (item) {
 | 
	
		
			
				|  |  | +            return item.id === id;
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        if (!user) toastr.error('用户列表不存在此人');
 | 
	
		
			
				|  |  | +        const prop = {
 | 
	
		
			
				|  |  | +            tr_id: this_tr_id,
 | 
	
		
			
				|  |  | +            uid: id,
 | 
	
		
			
				|  |  | +            type: 'update-report',
 | 
	
		
			
				|  |  | +        };
 | 
	
		
			
				|  |  | +        postData('/payment/' + tenderId + '/process/save', prop, function (result) {
 | 
	
		
			
				|  |  | +            tenderRptList = result.list;
 | 
	
		
			
				|  |  | +            if (result.updateRows) {
 | 
	
		
			
				|  |  | +                toastr.warning('上报人不能同时作为审批人,审批流已移除 ' + user.name);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            makeProcess(this_tr_id);
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        //
 | 
	
		
			
				|  |  | +        // const this_status = parseInt($(this).parents('.lc-show').siblings('.form-group').find('input:checked').val());
 | 
	
		
			
				|  |  | +        // if (this_status === sp_status.gdspl) {
 | 
	
		
			
				|  |  | +        //     // 判断是否已存在审批人
 | 
	
		
			
				|  |  | +        //     const aid_num = $(this).parents('ul').find('.remove-audit').length;
 | 
	
		
			
				|  |  | +        //     for (let i = 0; i < aid_num; i++) {
 | 
	
		
			
				|  |  | +        //         const aid = parseInt($(this).parents('ul').find('.remove-audit').eq(i).data('id'));
 | 
	
		
			
				|  |  | +        //         if (aid === id) {
 | 
	
		
			
				|  |  | +        //             toastr.warning('该审核人已存在,请勿重复添加');
 | 
	
		
			
				|  |  | +        //             return;
 | 
	
		
			
				|  |  | +        //         }
 | 
	
		
			
				|  |  | +        //     }
 | 
	
		
			
				|  |  | +        //
 | 
	
		
			
				|  |  | +        // }
 | 
	
		
			
				|  |  | +        // const prop = {
 | 
	
		
			
				|  |  | +        //     status: this_status,
 | 
	
		
			
				|  |  | +        //     tr_id: this_tr_id,
 | 
	
		
			
				|  |  | +        //     audit_id: id,
 | 
	
		
			
				|  |  | +        //     type: 'add-audit',
 | 
	
		
			
				|  |  | +        // };
 | 
	
		
			
				|  |  | +        // const _self = $(this);
 | 
	
		
			
				|  |  | +        // postData('/payment/' + tenderId + '/process/save', prop, function (data) {
 | 
	
		
			
				|  |  | +        //     if (this_status === sp_status.gdspl) {
 | 
	
		
			
				|  |  | +        //         _self.parents('ul').append('<li class="pl-3"><a href="javascript:void(0);" class="add-audit"><i class="fa fa-plus"></i> 添加流程</a></li>');
 | 
	
		
			
				|  |  | +        //     }
 | 
	
		
			
				|  |  | +        //     _self.parents('.spr-span').html('<span class="d-inline-block"></span>\n' +
 | 
	
		
			
				|  |  | +        //         '<span class="d-inline-block"><span class="badge badge-light">'+ user.name +' <span class="dropdown">\n' +
 | 
	
		
			
				|  |  | +        //         '                                                            <a href="javascript:void(0);" class="btn-sm text-danger px-1" title="移除" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-remove"></i></a>\n' +
 | 
	
		
			
				|  |  | +        //         '                                                            <div class="dropdown-menu">\n' +
 | 
	
		
			
				|  |  | +        //         '                                                                <a class="dropdown-item" href="javascript:void(0);">确认移除审批人?</a>\n' +
 | 
	
		
			
				|  |  | +        //         '                                                                <div class="dropdown-divider"></div>\n' +
 | 
	
		
			
				|  |  | +        //         '                                                                <div class="px-2 py-1 text-center">\n' +
 | 
	
		
			
				|  |  | +        //         '                                                                    <button class="remove-audit btn btn-sm btn-danger" data-id="' + user.id + '">移除</button>\n' +
 | 
	
		
			
				|  |  | +        //         '                                                                    <button class="btn btn-sm btn-secondary">取消</button>\n' +
 | 
	
		
			
				|  |  | +        //         '                                                                </div>\n' +
 | 
	
		
			
				|  |  | +        //         '                                                            </div>\n' +
 | 
	
		
			
				|  |  | +        //         '                                                        </span> ' +
 | 
	
		
			
				|  |  | +        //         '                                            </span></span></span>\n');
 | 
	
		
			
				|  |  | +        //     // <a href="javascript:void(0);" class="remove-audit btn-sm text-danger px-1" title="移除" data-id="'+ user.id +'"><i class="fa fa-remove"></i></a></span> </span>');
 | 
	
		
			
				|  |  | +        // });
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      // 移除审批人
 | 
	
		
			
				|  |  |      $('body').on('click', '.remove-audit', function () {
 | 
	
		
			
				|  |  |          const id = parseInt($(this).data('id'));
 | 
	
	
		
			
				|  | @@ -369,7 +487,6 @@ $(function () {
 | 
	
		
			
				|  |  |          if ($(this).is(':checked') && parseInt($(this).val()) === -1) {
 | 
	
		
			
				|  |  |              $(this).prop('checked', false);
 | 
	
		
			
				|  |  |              const index = $("#rpt_table input").index(this);
 | 
	
		
			
				|  |  | -            console.log(rptProjectList[index]);
 | 
	
		
			
				|  |  |              // 循环选中当前子项值
 | 
	
		
			
				|  |  |              checkedRptProjectList(rptProjectList[index].items);
 | 
	
		
			
				|  |  |          }
 |