Explorar o código

修复变更bug

ellisran hai 21 horas
pai
achega
55ba0de532
Modificáronse 2 ficheiros con 3 adicións e 3 borrados
  1. 1 1
      app/controller/change_controller.js
  2. 2 2
      app/service/change.js

+ 1 - 1
app/controller/change_controller.js

@@ -1151,7 +1151,7 @@ module.exports = app => {
                 const pid = this.ctx.session.sessionProject.id;
                 switch (status) {
                     case 3:// 审批通过
-                        const revising = await ctx.service.change.checkRevising(changeData.tid, changeData.cid);
+                        const revising = await ctx.service.change.checkRevising(changeData.tid, changeData.cid, changeData.order_by);
                         if (revising) {
                             throw '台账修订中并本变更令存在新增清单,无法审批通过';
                         }

+ 2 - 2
app/service/change.js

@@ -2282,12 +2282,12 @@ module.exports = app => {
             return change;
         }
 
-        async checkRevising(tenderId, cid) {
+        async checkRevising(tenderId, cid, order_by) {
             let flag = false;
             // 判断修订及变更清单里是否有新增部位清单
             const lastRevise = await this.ctx.service.ledgerRevise.getLastestRevise(tenderId);
             if (lastRevise && lastRevise.status !== audit.revise.status.checked) {
-                const changeAuditList = await this.ctx.service.changeAuditList.getList(cid);
+                const changeAuditList = await this.ctx.service.changeAuditList.getList(cid, order_by);
                 const changeLedgerList = await this.ctx.service.changeLedger.getAllDataByCondition({ where: { tender_id: tenderId } });
                 const changePosList = await this.ctx.service.changePos.getAllDataByCondition({ where: { tid: tenderId } });
                 for (const cl of changeAuditList) {