MaiXinRong 1 年之前
父節點
當前提交
4e049a2a69
共有 3 個文件被更改,包括 4 次插入3 次删除
  1. 1 1
      app/controller/stage_controller.js
  2. 2 1
      app/service/role_rpt_rel.js
  3. 1 1
      db_script/test_query.js

+ 1 - 1
app/controller/stage_controller.js

@@ -1351,7 +1351,7 @@ module.exports = app => {
                 if (ctx.stage.revising) {
                     throw '台账修订中,请勿修改提交期数据';
                 }
-                if (ctx.stage.readySettle.final_sorder >= ctx.stage.order) {
+                if (ctx.stage.readySettle && ctx.stage.readySettle.final_sorder >= ctx.stage.order) {
                     throw '已结算,不可重审';
                 }
 

+ 2 - 1
app/service/role_rpt_rel.js

@@ -190,6 +190,7 @@ module.exports = app => {
 
         async checkSignDate(transaction, stage, curAudit, time) {
             const rptRole = await this.getAllDataByCondition({ where: { sid: stage.id }});
+            const period = stage.period.split(' ~ ');
 
             const updateData = [];
             for (const rc of rptRole) {
@@ -204,7 +205,7 @@ module.exports = app => {
                             role.sign_date = stage.auditors[0].begin_time || time;
                         } else {
                             const audit = this.ctx.helper._.findLast(stage.auditors, x => { return x.aid === role.acc_id; });
-                            role.sign_date = audit ? audit.end_time || time : time;
+                            role.sign_date = audit ? audit.end_time || time : new Date(period[period.length - 1]);
                         }
                         bChange = true;
                     }

+ 1 - 1
db_script/test_query.js

@@ -13,7 +13,7 @@ const saveJSON = async function(obj, file) {
 const loadReportArchiveData = async function() {
     //const tid = 4417, sOrder = 2;
     // const tid = 3698, sOrder = 7;
-    const tid = 5161, sOrder = 8;
+    const tid = 5161, sOrder = 9;
     const stage = await querySql('SELECT * FROM zh_stage where tid = ? and `order` = ?', [tid, sOrder]);
     const rptArchive = await querySql('SELECT * FROM zh_rpt_archive where stage_id = ?', [stage[0].id]);
     for (const ra of rptArchive) {