Procházet zdrojové kódy

奖罚金,附件,调整

MaiXinRong před 5 roky
rodič
revize
f289bdf001

+ 1 - 0
app/controller/stage_extra_controller.js

@@ -203,6 +203,7 @@ module.exports = app => {
                         throw '未发现上传文件!';
                     }
                     if (!bonus) bonus = await ctx.service.stageBonus.getStageDataById(parts.field.bonus_id);
+                    if (!bonus) throw '往期数据不允许上传附件';
                     const fileInfo = path.parse(stream.filename);
                     const dirName = 'app/public/upload/extra/' + moment().format('YYYYMMDD');
                     const fileName = create_time + '_' + index + fileInfo.ext;

+ 8 - 0
app/public/js/se_bonus.js

@@ -64,6 +64,7 @@ $(document).ready(() => {
             if (!col) return;
 
             if (col.field === 'proof_file') {
+                fileObj.canUpload(data);
                 fileObj.generateFilesHtml(data);
                 $('#file').modal('show');
             }
@@ -189,6 +190,13 @@ $(document).ready(() => {
                 fileObj.generateFilesHtml(select);
                 SpreadJsObj.reLoadNodesData(bonusSheet, [select]);
             });
+        },
+        canUpload(data) {
+            if (data.sid === stageId) {
+                $('#upload-file-panel').show();
+            } else {
+                $('#upload-file-panel').hide();
+            }
         }
     };
 

+ 1 - 1
app/view/stage_extra/bonus_modal.ejs

@@ -7,7 +7,7 @@
             </div>
             <div class="modal-body">
                 <% if (!ctx.stage.readOnly) { %>
-                <div class="form-group">
+                <div class="form-group" id="upload-file-panel">
                     <label for="formGroupExampleInput">大小限制:30MB,支持<span data-toggle="tooltip" data-placement="bottom" title="doc,docx,xls,xlsx,ppt,pptx,pdf">office等文档格式</span>、<span data-toggle="tooltip" data-placement="bottom" title="jpg,png,bmp">图片格式</span>、<span data-toggle="tooltip" data-placement="bottom" title="rar,zip">压缩包格式</span></label>
                     <input type="file" class="" id="upload-file" multiple onclick="file">
                 </div>