|
@@ -1708,17 +1708,34 @@
|
|
|
</dl>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="card mt-3">
|
|
|
- <div class="card-header">
|
|
|
- 游客列表
|
|
|
- </div>
|
|
|
- <div class="modal-height-300">
|
|
|
- <ul class="list-group list-group-flush" id="tourist-users">
|
|
|
+ <div class="mt-3">
|
|
|
+ <!-- <div class="card-header">
|
|
|
+ 游客列表
|
|
|
+ </div> -->
|
|
|
+ <div class="">
|
|
|
+ <table class="table table-bordered">
|
|
|
+ <tr><th>用户</th><th>附件</th><th >书签</th><th>设置</th></tr>
|
|
|
+ <tbody id="tourist-users">
|
|
|
<% for (const t of tourists) { %>
|
|
|
- <li class="list-group-item" data-id="<%- t.user_id %>">
|
|
|
- <a href="javascript:void(0);" class="text-danger pull-right remove-tourist-user" data-id="<%- t.id %>">移除</a><%- t.user_name %> <small class="text-muted"><%- t.user_role %></small><p class="m-0 ml-2"><small class="text-muted"><%- t.user_company %></small></p></li>
|
|
|
+ <tr data-id="<%- t.user_id %>">
|
|
|
+ <td><b class="col-3 pl-0"><%- t.user_name %></b></td>
|
|
|
+ <td>
|
|
|
+ <div class="custom-control custom-checkbox mb-2">
|
|
|
+ <input type="checkbox" id="<%- t.id %>_file" data-id="<%- t.id %>" name="file" class="custom-control-input set-tourist-permission" <% if(t.permission.file) { %>checked<% } %>>
|
|
|
+ <label class="custom-control-label" for="<%- t.id %>_file"></label>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <div class="custom-control custom-checkbox mb-2">
|
|
|
+ <input type="checkbox" id="<%- t.id %>_tag" data-id="<%- t.id %>" name="tag" class="custom-control-input set-tourist-permission" <% if(t.permission.tag) { %>checked<% } %>>
|
|
|
+ <label class="custom-control-label" for="<%- t.id %>_tag"></label>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td><a href="javascript:void(0);" data-id="<%- t.id %>" class="text-danger remove-tourist-user">移除</a></td>
|
|
|
+ </tr>
|
|
|
<% } %>
|
|
|
- </ul>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -1857,8 +1874,8 @@
|
|
|
return item.id === id;
|
|
|
});
|
|
|
const saIdList = [];
|
|
|
- for (let i = 0; i < $('#tourist-users li').length; i++) {
|
|
|
- saIdList.push(parseInt($('#tourist-users li').eq(i).data('id')));
|
|
|
+ for (let i = 0; i < $('#tourist-users tr').length; i++) {
|
|
|
+ saIdList.push(parseInt($('#tourist-users tr').eq(i).data('id')));
|
|
|
}
|
|
|
if (_.includes(saIdList, id)) {
|
|
|
toastr.error('该用户已存在列表中,无需重复添加');
|
|
@@ -1870,12 +1887,28 @@
|
|
|
type: 'add',
|
|
|
};
|
|
|
postData('/tender/' + cur_tenderid + '/tourist/audit/save', prop, function (data) {
|
|
|
- const html = '<li class="list-group-item" data-id="' + user.id + '">\n' +
|
|
|
- '<a href="javascript:void(0);" class="text-danger pull-right remove-tourist-user" data-id="' + data.id + '">移除</a>' + user.name + ' ' +
|
|
|
- '<small class="text-muted">' + user.role + '</small><p class="m-0 ml-2"><small class="text-muted">' + user.company + '</small></p></li>';
|
|
|
+ // const html = '<li class="list-group-item" data-id="' + user.id + '">\n' +
|
|
|
+ // '<a href="javascript:void(0);" class="text-danger pull-right remove-tourist-user" data-id="' + data.id + '">移除</a>' + user.name + ' ' +
|
|
|
+ // '<small class="text-muted">' + user.role + '</small><p class="m-0 ml-2"><small class="text-muted">' + user.company + '</small></p></li>';
|
|
|
+ const html = '<tr data-id="' + user.id + '">\n' +
|
|
|
+ ' <td><b class="col-3 pl-0">' + user.name + '</b></td>\n' +
|
|
|
+ ' <td>\n' +
|
|
|
+ ' <div class="custom-control custom-checkbox mb-2">\n' +
|
|
|
+ ' <input type="checkbox" id="'+ data.id +'_file" data-id="'+ data.id +'" name="file" class="custom-control-input set-tourist-permission">\n' +
|
|
|
+ ' <label class="custom-control-label" for="'+ data.id +'_file"></label>\n' +
|
|
|
+ ' </div>\n' +
|
|
|
+ ' </td>\n' +
|
|
|
+ ' <td>\n' +
|
|
|
+ ' <div class="custom-control custom-checkbox mb-2">\n' +
|
|
|
+ ' <input type="checkbox" id="'+ data.id +'_tag" data-id="'+ data.id +'" name="tag" class="custom-control-input set-tourist-permission">\n' +
|
|
|
+ ' <label class="custom-control-label" for="'+ data.id +'_tag"></label>\n' +
|
|
|
+ ' </div>\n' +
|
|
|
+ ' </td>\n' +
|
|
|
+ ' <td><a href="javascript:void(0);" data-id="' + data.id + '" class="text-danger remove-tourist-user">移除</a></td>\n' +
|
|
|
+ ' </tr>';
|
|
|
$('#tourist-users').append(html);
|
|
|
// 外面显示游客数量
|
|
|
- const num = $('#tourist-users li').length;
|
|
|
+ const num = $('#tourist-users tr').length;
|
|
|
if (!$('#tourist-num').hasClass('badge')) {
|
|
|
$('#tourist-num').addClass('badge badge-secondary').text(num);
|
|
|
} else {
|
|
@@ -1895,9 +1928,9 @@
|
|
|
};
|
|
|
const _self = $(this);
|
|
|
postData('/tender/' + cur_tenderid + '/tourist/audit/save', prop, function (data) {
|
|
|
- _self.parents('li').remove();
|
|
|
+ _self.parents('tr').remove();
|
|
|
// 外面显示游客数量
|
|
|
- const num = $('#tourist-users li').length;
|
|
|
+ const num = $('#tourist-users tr').length;
|
|
|
if (num == 0) {
|
|
|
$('#tourist-num').removeClass('badge badge-secondary').text('');
|
|
|
} else {
|
|
@@ -1906,6 +1939,23 @@
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ // 权限设置
|
|
|
+ $('body').on('click', '#tourist-users .set-tourist-permission', function () {
|
|
|
+ const id = parseInt($(this).data('id'));
|
|
|
+ const permission = {
|
|
|
+ file: ($(this).attr('name') === 'file' ? $(this).is(':checked') : $('#' + id + '_file').is(':checked')) ? 1 : 0,
|
|
|
+ tag: ($(this).attr('name') === 'tag' ? $(this).is(':checked') : $('#' + id + '_tag').is(':checked')) ? 1 : 0,
|
|
|
+ }
|
|
|
+ const prop = {
|
|
|
+ id,
|
|
|
+ type: 'permission',
|
|
|
+ permission,
|
|
|
+ }
|
|
|
+ console.log(prop);
|
|
|
+ postData('/tender/' + cur_tenderid + '/tourist/audit/save', prop, function (data) {
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|
|
|
</script>
|
|
|
<% } %>
|