|
@@ -145,6 +145,7 @@ $(document).ready(() => {
|
|
|
setShenpiHtml(result.shenpi, result.tender, result.revising);
|
|
|
setTouristHtml(result.tourists);
|
|
|
setScheduleHtml(result.scheduleAuditList);
|
|
|
+ setConstructionHtml(result.constructionAuditList);
|
|
|
resetAddUserHtml();
|
|
|
});
|
|
|
});
|
|
@@ -163,6 +164,8 @@ $(document).ready(() => {
|
|
|
$('#add_user_dropdownMenuButton').attr('data-type', 'tourist');
|
|
|
} else if ($(this).attr('href') === '#tzpro') {
|
|
|
$('#add_user_dropdownMenuButton').attr('data-type', 'schedule');
|
|
|
+ } else if ($(this).attr('href') === '#sgrz') {
|
|
|
+ $('#add_user_dropdownMenuButton').attr('data-type', 'construction');
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -218,6 +221,21 @@ $(document).ready(() => {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ // 权限更改
|
|
|
+ $('body').on('click', '#construction-users input[type="checkbox"]', function () {
|
|
|
+ const id = parseInt($(this).data('id'));
|
|
|
+ const prop = {
|
|
|
+ type: 'save-report',
|
|
|
+ updateData: {
|
|
|
+ id,
|
|
|
+ is_report: $(this).is(':checked') ? 1 : 0,
|
|
|
+ }
|
|
|
+ };
|
|
|
+ const _self = $(this);
|
|
|
+ postData('/construction/' + cur_tenderid + '/audit/save', prop, function (data) {
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
// 移除游客用户
|
|
|
$('body').on('click', '#tourist-users .remove-tourist-user', function () {
|
|
|
$('#remove_user_type').val('tourist');
|
|
@@ -230,22 +248,36 @@ $(document).ready(() => {
|
|
|
$('#remove_user_id').val($(this).data('id'));
|
|
|
});
|
|
|
|
|
|
+ // 移除施工日志用户
|
|
|
+ $('body').on('click', '#construction-users .remove-construction-user', function () {
|
|
|
+ $('#remove_user_type').val('construction');
|
|
|
+ $('#remove_user_id').val($(this).data('id'));
|
|
|
+ });
|
|
|
+
|
|
|
// 移除用户确定
|
|
|
$('#remove_user_btn').click(function () {
|
|
|
const type = $('#remove_user_type').val();
|
|
|
- if (type !== 'tourist' && type !== 'schedule') {
|
|
|
+ if (type !== 'tourist' && type !== 'schedule' && type !== 'construction') {
|
|
|
toastr.error('参数有误');
|
|
|
return;
|
|
|
}
|
|
|
const id = parseInt($('#remove_user_id').val());
|
|
|
- const prop = {
|
|
|
- id: id,
|
|
|
- type: 'del',
|
|
|
- };
|
|
|
- postData('/tender/' + cur_tenderid + '/' + type + '/audit/save', prop, function (data) {
|
|
|
- $('#'+ type + '-users').find('tr[data-id="'+ id +'"]').remove();
|
|
|
- $('#remove-user').modal('hide');
|
|
|
- });
|
|
|
+ if (type === 'construction') {
|
|
|
+ postData('/construction/' + cur_tenderid + '/audit/save', { type: 'del-audit', id }, function (data) {
|
|
|
+ $('#'+ type + '-users').find('tr[data-id="'+ id +'"]').remove();
|
|
|
+ $('#remove-user').modal('hide');
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ const prop = {
|
|
|
+ id: id,
|
|
|
+ type: 'del',
|
|
|
+ };
|
|
|
+ postData('/tender/' + cur_tenderid + '/' + type + '/audit/save', prop, function (data) {
|
|
|
+ $('#'+ type + '-users').find('tr[data-id="'+ id +'"]').remove();
|
|
|
+ $('#remove-user').modal('hide');
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
|
|
|
// 投资进度
|
|
@@ -399,6 +431,26 @@ $(document).ready(() => {
|
|
|
</tr>`;
|
|
|
$('#schedule-users').append(html);
|
|
|
});
|
|
|
+ } else if (type === 'construction') {
|
|
|
+ const user = _.find(accountList, function (item) {
|
|
|
+ return item.id === id;
|
|
|
+ });
|
|
|
+ const saIdList = [];
|
|
|
+ for (let i = 0; i < $('#construction-users tr').length; i++) {
|
|
|
+ saIdList.push(parseInt($('#construction-users tr').eq(i).data('uid')));
|
|
|
+ }
|
|
|
+ if (_.includes(saIdList, id)) {
|
|
|
+ toastr.error('该用户已存在列表中,无需重复添加');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const prop = {
|
|
|
+ id: id,
|
|
|
+ type: 'add-audit',
|
|
|
+ };
|
|
|
+ postData('/construction/' + cur_tenderid + '/audit/save', prop, function (datas) {
|
|
|
+ setConstructionHtml(datas);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -417,7 +469,7 @@ $(document).ready(() => {
|
|
|
if (saIdList.length > 0) {
|
|
|
$('#bdcopy').modal('show');
|
|
|
} else {
|
|
|
- toastr.warning('未存在'+ (userType === 'tourist' ? '游客' : '投资进度') +'用户账号,无法应用至其他标段');
|
|
|
+ toastr.warning('未存在'+ (userType === 'tourist' ? '游客' : userType === 'schedule' ? '投资进度' : userType === 'construction' ? '施工日志' : '') +'用户账号,无法应用至其他标段');
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
@@ -535,6 +587,8 @@ $(document).ready(() => {
|
|
|
permission = scPermission.show;
|
|
|
}
|
|
|
userData.permission = permission;
|
|
|
+ } else if (userType === 'construction') {
|
|
|
+ userData.is_report = $('#construction-users tr').eq(i).find('input[type="checkbox"]').eq(0).is(':checked') ? 1 : 0;
|
|
|
}
|
|
|
saIdList.push(userData);
|
|
|
}
|
|
@@ -727,3 +781,25 @@ function setScheduleHtml(scheduleAuditList) {
|
|
|
}
|
|
|
$('#schedule-users').html(html);
|
|
|
}
|
|
|
+
|
|
|
+function setConstructionHtml(constructionAuditList) {
|
|
|
+ let html = '';
|
|
|
+ if (constructionAuditList.length > 0) {
|
|
|
+ for (const sa of constructionAuditList) {
|
|
|
+ html += `<tr data-uid="${sa.uid}" data-id="${sa.id}">
|
|
|
+ <td>${sa.name}</td>
|
|
|
+ <td>${sa.role}</td>
|
|
|
+ <td class="text-center">
|
|
|
+ <div class="custom-control custom-checkbox mb-2">
|
|
|
+ <input type="checkbox" data-id="${sa.id}" id="${sa.id}_construction" name="customCheckbox" class="custom-control-input" ${sa.is_report ? 'checked' : ''}>
|
|
|
+ <label class="custom-control-label" for="${sa.id}_construction"></label>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td class="text-center">
|
|
|
+ <a href="#remove-user1" data-id="${sa.id}" data-toggle="modal" data-target="#remove-user" class="btn btn-sm btn-outline-danger remove-construction-user">移除</a>
|
|
|
+ </td>
|
|
|
+ </tr>`;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $('#construction-users').html(html);
|
|
|
+}
|