Forráskód Böngészése

修复多人协同测试bug

laiguoran 4 éve
szülő
commit
3cf053a51c

+ 1 - 1
app/public/js/stage.js

@@ -339,7 +339,7 @@ $(document).ready(() => {
                 html.push('<td>', moment(p.confirm_time).format('YYYY-MM-DD HH:mm') + ' ' + (coopwd ? `<a name="ledger-unconfirm" href="javascript: void(0);" lid="${p.ledger_id}">重新审批</a>` : ''), '</td>');
             } else if (!p.check && p.confirm) {
                 html.push('<td>', moment(p.confirm_time).format('YYYY-MM-DD HH:mm'), '</td>');
-            } else if (p.check && !p.confirm) {
+            } else if (p.check && !p.confirm && coopwd) {
                 html.push('<td>', `<a name="ledger-confirm" href="javascript: void(0);" lid="${p.ledger_id}" class="btn btn-sm btn-success">确认</a>`, '</td>');
             } else {
                 html.push('<td>', '</td>');

+ 4 - 0
app/service/cooperation_confirm.js

@@ -53,6 +53,10 @@ module.exports = app => {
             // }
             return await this.getAllDataByCondition(condition);
         }
+
+        async delBycheckNoPre(uid, stage, transaction) {
+            return await transaction.delete(this.tableName, { tid: stage.tid, sid: stage.id, times: stage.times, uid });
+        }
     }
 
     return CooperationConfirm;

+ 4 - 0
app/service/stage_audit.js

@@ -750,6 +750,10 @@ module.exports = app => {
                 await this.ctx.service.stageBonus.updateHistory(this.ctx.stage, transaction);
                 await this.ctx.service.stageOther.updateHistory(this.ctx.stage, transaction);
 
+                // 多人协同数据确认删除本人和上一个审批人确认状态
+                await this.ctx.service.cooperationConfirm.delBycheckNoPre(audit.aid, this.ctx.stage, transaction);
+                await this.ctx.service.cooperationConfirm.delBycheckNoPre(preAuditor.aid, this.ctx.stage, transaction);
+
                 // 同步 期信息
                 await transaction.update(this.ctx.service.stage.tableName, {
                     id: stageId,