瀏覽代碼

上传按钮调整

MaiXinRong 4 年之前
父節點
當前提交
be2c279593
共有 3 個文件被更改,包括 8 次插入8 次删除
  1. 2 2
      app/controller/stage_extra_controller.js
  2. 5 5
      app/public/js/se_bonus.js
  3. 1 1
      app/service/stage_bonus.js

+ 2 - 2
app/controller/stage_extra_controller.js

@@ -206,7 +206,7 @@ module.exports = app => {
                 const create_time = Date.parse(new Date()) / 1000;
                 let stream = await parts();
                 const bonus = await ctx.service.stageBonus.getStageDataById(parts.field.bonus_id);
-                if (!bonus || bonus.sid !== ctx.stage.id) throw '该奖罚金,当前不允许上传附件';
+                //if (!bonus || bonus.sid !== ctx.stage.id) throw '该奖罚金,当前不允许上传附件';
                 while (stream !== undefined) {
                     if (!stream.filename) {
                         throw '未发现上传文件!';
@@ -228,7 +228,7 @@ module.exports = app => {
                         filepath: path.join(dirName, fileName),
                         uid: ctx.session.sessionUser.accountId,
                         in_time: moment(create_time * 1000).format('YYYY-MM-DD'),
-                        renew: ctx.stage.status === auditConst.status.checked,
+                        renew: bonus.sid === ctx.stage.id ? ctx.stage.status === auditConst.status.checked : true,
                     });
                     ++index;
                     if (Array.isArray(parts.field.size) && index < parts.field.size.length) {

+ 5 - 5
app/public/js/se_bonus.js

@@ -206,11 +206,11 @@ $(document).ready(() => {
             });
         },
         canUpload(data) {
-            if (data.sid === stageId) {
-                $('#upload-file-panel').show();
-            } else {
-                $('#upload-file-panel').hide();
-            }
+            // if (data.sid === stageId) {
+            //     $('#upload-file-panel').show();
+            // } else {
+            //     $('#upload-file-panel').hide();
+            // }
         }
     };
 

+ 1 - 1
app/service/stage_bonus.js

@@ -122,7 +122,7 @@ module.exports = app => {
 
             const datas = data instanceof Array ? data : [data];
             const orgDatas = await this.getAllDataByCondition({
-                where: { sid: this.ctx.stage.id, id: this.ctx.helper._.map(datas, 'id') }
+                where: { id: this.ctx.helper._.map(datas, 'id') }
             });
 
             const uDatas = [];