浏览代码

支付审批列表页bug处理

ellisran 4 月之前
父节点
当前提交
e03728e377
共有 3 个文件被更改,包括 8 次插入7 次删除
  1. 7 6
      app/public/js/payment_index.js
  2. 1 0
      app/view/payment/index.ejs
  3. 0 1
      app/view/payment/modal.ejs

+ 7 - 6
app/public/js/payment_index.js

@@ -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;

+ 1 - 0
app/view/payment/index.ejs

@@ -32,4 +32,5 @@
     const uid = <%- ctx.session.sessionUser.accountId %>;
     const is_admin = <%- ctx.session.sessionUser.is_admin %>;
     const auditPermission = JSON.parse(unescape('<%- escape(JSON.stringify(auditPermission)) %>'));
+    const noSpTenderList = JSON.parse(unescape('<%- escape(JSON.stringify(noSpTenderList)) %>'));
 </script>

+ 0 - 1
app/view/payment/modal.ejs

@@ -239,7 +239,6 @@
     <!--<script src="/public/js/bootstrap/bootstrap-table-fixed-columns.min.js"></script>-->
 <script>
     <% if (noSpTenderList.length > 0) { %>
-    const noSpTenderList = JSON.parse(unescape('<%- escape(JSON.stringify(noSpTenderList)) %>'));
     const noSpFolderList = JSON.parse(unescape('<%- escape(JSON.stringify(noSpFolderList)) %>'));
     <% } %>
     $(function () {