|
@@ -132,6 +132,14 @@ $(document).ready(() => {
|
|
|
const cHeader = getObjHeight($(".c-header"));
|
|
|
$('.tab-content').height($(window).height()-cHeader-90+53-46);
|
|
|
|
|
|
+ const tabTypes = {
|
|
|
+ tourist: '游客',
|
|
|
+ schedule: '投资进度',
|
|
|
+ contract: '合同管理',
|
|
|
+ construction: '施工日志',
|
|
|
+ };
|
|
|
+ const tabTypeKeys = ['tourist', 'schedule', 'contract', 'construction'];
|
|
|
+
|
|
|
$('body').on('click', '.c-body .tender-info', function () {
|
|
|
$('.c-body .tender-info').removeClass('table-warning');
|
|
|
$(this).addClass('table-warning');
|
|
@@ -151,6 +159,7 @@ $(document).ready(() => {
|
|
|
setShenpiHtml(result.shenpi, result.tender, result.revising);
|
|
|
setTouristHtml(result.tourists);
|
|
|
setScheduleHtml(result.scheduleAuditList);
|
|
|
+ setContractHtml(result.contractAuditList);
|
|
|
setConstructionHtml(result.constructionAuditList);
|
|
|
resetAddUserHtml();
|
|
|
});
|
|
@@ -170,6 +179,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') === '#htgl') {
|
|
|
+ $('#add_user_dropdownMenuButton').attr('data-type', 'contract');
|
|
|
} else if ($(this).attr('href') === '#sgrz') {
|
|
|
$('#add_user_dropdownMenuButton').attr('data-type', 'construction');
|
|
|
}
|
|
@@ -228,6 +239,17 @@ $(document).ready(() => {
|
|
|
});
|
|
|
|
|
|
// 权限更改
|
|
|
+ $('body').on('click', '#contract-users input[type="checkbox"]', function () {
|
|
|
+ const type = $(this).attr('data-type');
|
|
|
+ const value = $(this).is(':checked') ? 1 : 0;
|
|
|
+ const id = parseInt($(this).val());
|
|
|
+ const updateInfo = { id };
|
|
|
+ updateInfo[type] = value;
|
|
|
+ postData(`/sp/${spid}/contract/tender/${cur_tenderid}/audit/save`, { type: 'save-permission', updateData: updateInfo }, function (result) {
|
|
|
+ })
|
|
|
+ });
|
|
|
+
|
|
|
+ // 权限更改
|
|
|
$('body').on('click', '#construction-users input[type="checkbox"]', function () {
|
|
|
const id = parseInt($(this).data('id'));
|
|
|
const prop = {
|
|
@@ -242,33 +264,27 @@ $(document).ready(() => {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- // 移除游客用户
|
|
|
- $('body').on('click', '#tourist-users .remove-tourist-user', function () {
|
|
|
- $('#remove_user_type').val('tourist');
|
|
|
- $('#remove_user_id').val($(this).data('id'));
|
|
|
- });
|
|
|
-
|
|
|
- // 移除投资进度用户
|
|
|
- $('body').on('click', '#schedule-users .remove-schedule-user', function () {
|
|
|
- $('#remove_user_type').val('schedule');
|
|
|
- $('#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'));
|
|
|
- });
|
|
|
+ for (const key of tabTypeKeys) {
|
|
|
+ $('body').on('click', `#${key}-users .remove-${key}-user`, function () {
|
|
|
+ $('#remove_user_type').val(key);
|
|
|
+ $('#remove_user_id').val($(this).data('id'));
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
// 移除用户确定
|
|
|
$('#remove_user_btn').click(function () {
|
|
|
const type = $('#remove_user_type').val();
|
|
|
- if (type !== 'tourist' && type !== 'schedule' && type !== 'construction') {
|
|
|
+ if (tabTypeKeys.indexOf(type) === -1) {
|
|
|
toastr.error('参数有误');
|
|
|
return;
|
|
|
}
|
|
|
const id = parseInt($('#remove_user_id').val());
|
|
|
- if (type === 'construction') {
|
|
|
+ if (type === 'contract') {
|
|
|
+ postData('/sp/' + spid + '/contract/tender/' + cur_tenderid + '/audit/save', { type: 'del-audit', id }, function (data) {
|
|
|
+ $('#'+ type + '-users').find('tr[data-id="'+ id +'"]').remove();
|
|
|
+ $('#remove-user').modal('hide');
|
|
|
+ });
|
|
|
+ } else if (type === 'construction') {
|
|
|
postData('/sp/' + spid + '/construction/' + cur_tenderid + '/audit/save', { type: 'del-audit', id }, function (data) {
|
|
|
$('#'+ type + '-users').find('tr[data-id="'+ id +'"]').remove();
|
|
|
$('#remove-user').modal('hide');
|
|
@@ -437,6 +453,26 @@ $(document).ready(() => {
|
|
|
</tr>`;
|
|
|
$('#schedule-users').append(html);
|
|
|
});
|
|
|
+ } else if (type === 'contract') {
|
|
|
+ const user = _.find(accountList, function (item) {
|
|
|
+ return item.id === id;
|
|
|
+ });
|
|
|
+ const saIdList = [];
|
|
|
+ for (let i = 0; i < $('#contract-users tr').length; i++) {
|
|
|
+ saIdList.push(parseInt($('#contract-users tr').eq(i).data('uid')));
|
|
|
+ }
|
|
|
+ if (_.includes(saIdList, id)) {
|
|
|
+ toastr.error('该用户已存在列表中,无需重复添加');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const prop = {
|
|
|
+ id: id,
|
|
|
+ type: 'add-audit',
|
|
|
+ };
|
|
|
+ postData('/sp/' + spid + '/contract/tender/' + cur_tenderid + '/audit/save', prop, function (datas) {
|
|
|
+ setContractHtml(datas);
|
|
|
+ });
|
|
|
} else if (type === 'construction') {
|
|
|
const user = _.find(accountList, function (item) {
|
|
|
return item.id === id;
|
|
@@ -475,7 +511,7 @@ $(document).ready(() => {
|
|
|
if (saIdList.length > 0) {
|
|
|
$('#bdcopy').modal('show');
|
|
|
} else {
|
|
|
- toastr.warning('未存在'+ (userType === 'tourist' ? '游客' : userType === 'schedule' ? '投资进度' : userType === 'construction' ? '施工日志' : '') +'用户账号,无法应用至其他标段');
|
|
|
+ toastr.warning('未存在'+ tabTypes[userType] +'用户账号,无法应用至其他标段');
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
@@ -593,6 +629,13 @@ $(document).ready(() => {
|
|
|
permission = scPermission.show;
|
|
|
}
|
|
|
userData.permission = permission;
|
|
|
+ } else if (userType === 'contract') {
|
|
|
+ userData.permission = {
|
|
|
+ add: $('#contract-users tr').eq(i).find('input[data-type="permission_add"]').eq(0).is(':checked') ? 1 : 0,
|
|
|
+ edit: $('#contract-users tr').eq(i).find('input[data-type="permission_edit"]').eq(0).is(':checked') ? 1 : 0,
|
|
|
+ showUnit: $('#contract-users tr').eq(i).find('input[data-type="permission_show_unit"]').eq(0).is(':checked') ? 1 : 0,
|
|
|
+ showNode: $('#contract-users tr').eq(i).find('input[data-type="permission_show_node"]').eq(0).is(':checked') ? 1 : 0,
|
|
|
+ }
|
|
|
} else if (userType === 'construction') {
|
|
|
userData.is_report = $('#construction-users tr').eq(i).find('input[type="checkbox"]').eq(0).is(':checked') ? 1 : 0;
|
|
|
}
|
|
@@ -837,6 +880,32 @@ function setScheduleHtml(scheduleAuditList) {
|
|
|
$('#schedule-users').html(html);
|
|
|
}
|
|
|
|
|
|
+function setContractHtml(datas) {
|
|
|
+ let list = '';
|
|
|
+ for (const ca of datas) {
|
|
|
+ list += `<tr data-uid="${ca.uid}" data-id="${ca.id}">
|
|
|
+ <td>${ca.name}</td>
|
|
|
+ <td>${ca.role}</td>
|
|
|
+ <td class="text-center">
|
|
|
+ <input type="checkbox" class="permission-checkbox" data-type="permission_edit" value="${ca.id}" ${ca.permission_edit ? 'checked' : ''}>
|
|
|
+ </td>
|
|
|
+ <td class="text-center">
|
|
|
+ <input type="checkbox" class="permission-checkbox" data-type="permission_add" value="${ca.id}" ${ca.permission_add ? 'checked' : ''}>
|
|
|
+ </td>
|
|
|
+ <td class="text-center">
|
|
|
+ <input type="checkbox" class="permission-checkbox" data-type="permission_show_unit" value="${ca.id}" ${ca.permission_show_unit ? 'checked' : ''}>
|
|
|
+ </td>
|
|
|
+ <td class="text-center">
|
|
|
+ <input type="checkbox" class="permission-checkbox" data-type="permission_show_node" value="${ca.id}" ${ca.permission_show_node ? 'checked' : ''}>
|
|
|
+ </td>
|
|
|
+ <td class="text-center">
|
|
|
+ <a href="#remove-user1" data-toggle="modal" data-target="#remove-user" class="btn btn-outline-danger btn-sm ml-1 remove-contract-user" data-id="${ca.id}">移除</a>
|
|
|
+ </td>
|
|
|
+ </tr>`;
|
|
|
+ }
|
|
|
+ $('#contract-users').html(list);
|
|
|
+}
|
|
|
+
|
|
|
function setConstructionHtml(constructionAuditList) {
|
|
|
let html = '';
|
|
|
if (constructionAuditList.length > 0) {
|