Browse Source

fix: 变更附件上传权限问题

lanjianrong 4 năm trước cách đây
mục cha
commit
02911d81a0
2 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 4 1
      app/public/js/change_detail.js
  2. 1 0
      app/view/change/info.ejs

+ 4 - 1
app/public/js/change_detail.js

@@ -49,7 +49,7 @@ $(document).ready(() => {
             $('#bills').removeClass('first-bill-pane');
         }
     });
-
+    console.log(auditList)
     // 上传附件
     $('#upload-file-btn').click(function () {
         const files = $('#upload-file')[0].files;
@@ -74,6 +74,9 @@ $(document).ready(() => {
             formData.append('size', filesize);
             formData.append('file[]', file);
         }
+        if (auditList.findIndex(item => item.uid === accountId) === -1) {
+            return toastr.error('暂无权限上传!')
+        }
         postDataWithFile(window.location.pathname + '/file/upload', formData, function (data) {
             $('#addfujian').modal('hide');
             let html = '';

+ 1 - 0
app/view/change/info.ejs

@@ -746,6 +746,7 @@
     const ledgeStatus = '<%- tender.ledger_status %>';
     const ledgerConsts = JSON.parse('<%- JSON.stringify(ledgerConsts) %>');
     const auditStatus = '<%- auditStatus %>'
+    const auditList = JSON.parse('<%- JSON.stringify(auditList) %>');
     autoFlashHeight();
     $('a[href="#sub-ap"').click(function() {
         if (parseInt(ledgeStatus) === ledgerConsts.uncheck) {