|
@@ -39,7 +39,7 @@ $(function () {
|
|
|
|
|
|
function recursiveGetTenderNodeHtml (node, arr, pid) {
|
|
|
const html = [];
|
|
|
- html.push('<tr fid="' + (node.parent_id !== undefined ? node.id: 0) + '" pid="' + pid + '">');
|
|
|
+ html.push('<tr fid="' + (node.parent_id !== undefined ? node.folder_id: 0) + '" pid="' + pid + '">');
|
|
|
// 名称
|
|
|
html.push('<td style="width: 40%" class="in-' + node.level + '">');
|
|
|
if (node.parent_id !== undefined) {
|
|
@@ -84,13 +84,13 @@ $(function () {
|
|
|
html.push('<a class="dropdown-item show_del_btn" data-type="'+ (node.parent_id === undefined ? 'tender' : 'folder') +'" data-id="'+ node.id +'" href="javascript:void(0);"><i class="fa fa-remove mr-2"></i>删除</a>\n');
|
|
|
}
|
|
|
}
|
|
|
- if (auditPermission.admin && (node.uid === uid || is_admin) && (node.is_leaf || (node.parent_id !== undefined && !node.is_tender))) {
|
|
|
+ if (auditPermission.admin && (node.uid === uid || is_admin) && (node.is_leaf || (node.parent_id !== undefined && !node.is_tender)) && noSpTenderList.length === 0) {
|
|
|
html.push('<div class="dropdown-divider"></div>\n');
|
|
|
}
|
|
|
- if (auditPermission.admin && node.parent_id !== undefined && !node.is_tender) {
|
|
|
+ if (auditPermission.admin && node.parent_id !== undefined && !node.is_tender && noSpTenderList.length === 0) {
|
|
|
html.push('<a class="dropdown-item show_new_folder_btn" href="#add-folder" data-toggle="modal" data-target="#add-folder" data-parentName="'+ node.name +'" data-parentId="'+ node.folder_id +'"><i class="fa fa-folder-o mr-2"></i>新建子文件夹</a>\n');
|
|
|
}
|
|
|
- if (auditPermission.admin && node.is_leaf) {
|
|
|
+ if (auditPermission.admin && node.is_leaf && noSpTenderList.length === 0) {
|
|
|
html.push('<a class="dropdown-item show_new_tender_btn" href="javascript:void(0);"><i class="fa fa-folder-o mr-2"></i>新建标段</a>\n');
|
|
|
}
|
|
|
html.push(' </div>\n' +
|
|
@@ -227,7 +227,7 @@ $(function () {
|
|
|
$('.c-body table tr').removeClass('table-warning');
|
|
|
$(this).addClass('table-warning');
|
|
|
const fid = parseInt($(this).attr('fid'));
|
|
|
- const folderInfo = _.find(allFolders, { id: fid });
|
|
|
+ const folderInfo = _.find(allFolders, { folder_id: fid });
|
|
|
if (auditPermission.admin && folderInfo && folderInfo.is_leaf) {
|
|
|
$('#show_new_tender_btn').show();
|
|
|
$('#add_tender_folder_id').val(fid);
|
|
@@ -245,7 +245,8 @@ $(function () {
|
|
|
toastr.error('请选中文件夹');
|
|
|
return;
|
|
|
}
|
|
|
- const folderInfo = _.find(allFolders, { id: parseInt(fid) });
|
|
|
+ const folderInfo = _.find(allFolders, { folder_id: parseInt(fid) });
|
|
|
+ console.log(folderInfo);
|
|
|
if (!folderInfo || folderInfo.is_leaf === 0) {
|
|
|
toastr.error('文件夹不存在或存在子文件夹不能新建标段');
|
|
|
return;
|