Jelajahi Sumber

审批退回,锁定相关

MaiXinRong 2 tahun lalu
induk
melakukan
6faa92ce07
1 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 4 4
      app/service/stage_audit_ass.js

+ 4 - 4
app/service/stage_audit_ass.js

@@ -97,12 +97,12 @@ module.exports = app => {
                 x.locked_ledger_id = x.ass_ledger_id.split(',');
             });
             // 审批人数据锁定
-            const locking = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: uid } });
+            const locking = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: uid, confirm: 1 } });
             if (locking.length > 0) {
                 const updateLock = locking.map(x => { return { id: x.id, locked: 1 }; });
                 await transaction.updateRows(this.tableName, updateLock);
             }
-            const preConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: pre_uid } });
+            const preConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: pre_uid, confirm: 1 } });
             // 前审批人数据,与被锁定数据相关数据确认状态保留
             locked.push(...locking);
             if (preConfirm.length > 0) {
@@ -125,7 +125,7 @@ module.exports = app => {
         async lockConfirm4CheckNo(stage, uid, auditors, transaction) {
             if (!transaction) throw '缺少参数';
             // 审批人数据锁定
-            const lockConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: uid } });
+            const lockConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: uid, confirm: 1 } });
             if (lockConfirm.length === 0) return;
 
             const insertData = [];
@@ -141,7 +141,7 @@ module.exports = app => {
                 if (a.aid === uid) break;
                 keepUid.push(a.aid);
             }
-            const keepConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: keepUid } });
+            const keepConfirm = await this.getAllDataByCondition({ where: { sid: stage.id, times: stage.curTimes, user_id: keepUid, confirm: 1 } });
             for (const kc of keepConfirm) {
                 const bills = await this.ctx.service.ledger.getDataByCondition({ tender_id: stage.tid, ledger_id: kc.ledger_id });
                 const billsOwner = bills ? bills.full_path.split('-') : [];