瀏覽代碼

重新上报问题

MaiXinRong 6 年之前
父節點
當前提交
061ef731dc
共有 4 個文件被更改,包括 13 次插入13 次删除
  1. 9 8
      app/controller/stage_controller.js
  2. 3 3
      app/middleware/stage_check.js
  3. 0 1
      app/public/js/tender.js
  4. 1 1
      app/service/stage_audit.js

+ 9 - 8
app/controller/stage_controller.js

@@ -411,14 +411,14 @@ module.exports = app => {
             try {
             try {
                 await this._getStageAuditViewData(ctx);
                 await this._getStageAuditViewData(ctx);
                 const renderData = await this._getDefaultRenderData(ctx);
                 const renderData = await this._getDefaultRenderData(ctx);
-                const dealPay = await ctx.service.stagePay.getStagePays(ctx.stage);
-                if (dealPay && dealPay.length > 0) {
-                    renderData.dealPay = dealPay;
-                } else {
-                    await ctx.service.pay.addDefaultPayData(this.ctx.tender.id);
-                    await ctx.service.stagePay.addInitialStageData(ctx.stage);
-                    renderData.dealPay = await ctx.service.stagePay.getStagePays(ctx.stage);
-                }
+                renderData.dealPay = await ctx.service.stagePay.getStagePays(ctx.stage);
+                // if (dealPay && dealPay.length > 0) {
+                //     renderData.dealPay = dealPay;
+                // } else {
+                //     await ctx.service.pay.addDefaultPayData(this.ctx.tender.id);
+                //     await ctx.service.stagePay.addInitialStageData(ctx.stage);
+                //     renderData.dealPay = await ctx.service.stagePay.getStagePays(ctx.stage);
+                // }
                 renderData.calcBase = await ctx.service.stage.getStagePayCalcBase();
                 renderData.calcBase = await ctx.service.stage.getStagePayCalcBase();
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.stage.pay);
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.stage.pay);
 
 
@@ -747,6 +747,7 @@ module.exports = app => {
                 ctx.redirect(ctx.request.header.referer);
                 ctx.redirect(ctx.request.header.referer);
             } catch (err) {
             } catch (err) {
                 this.log(err);
                 this.log(err);
+                console.log(err);
                 ctx.session.postError = err.toString();
                 ctx.session.postError = err.toString();
                 ctx.redirect(ctx.request.header.referer);
                 ctx.redirect(ctx.request.header.referer);
             }
             }

+ 3 - 3
app/middleware/stage_check.js

@@ -53,7 +53,7 @@ module.exports = options => {
             const accountId = this.session.sessionUser.accountId, auditorIds = _.map(stage.auditors, 'aid'), shareIds = [];
             const accountId = this.session.sessionUser.accountId, auditorIds = _.map(stage.auditors, 'aid'), shareIds = [];
             if (accountId === stage.user_id) { // 原报
             if (accountId === stage.user_id) { // 原报
                 stage.readOnly = stage.status !== status.uncheck && stage.status !== status.checkNo;
                 stage.readOnly = stage.status !== status.uncheck && stage.status !== status.checkNo;
-                stage.curTimes = stage.status === status.checkNo ? stage.times + 1 : stage.times;
+                stage.curTimes = stage.times;
                 if (stage.status === status.uncheck || stage.status === status.checkNo) {
                 if (stage.status === status.uncheck || stage.status === status.checkNo) {
                     stage.curOrder = 0;
                     stage.curOrder = 0;
                 } else if (stage.status === status.checked) {
                 } else if (stage.status === status.checked) {
@@ -66,7 +66,7 @@ module.exports = options => {
                     throw '您无权查看该数据';
                     throw '您无权查看该数据';
                 }
                 }
                 stage.readOnly = (stage.status === status.checking || stage.status === status.checkNoPre) && accountId !== stage.curAuditor.aid;
                 stage.readOnly = (stage.status === status.checking || stage.status === status.checkNoPre) && accountId !== stage.curAuditor.aid;
-                stage.curTimes = stage.times;
+                stage.curTimes = stage.status === status.checkNo ? stage.times - 1 : stage.times;
                 if (stage.status === status.checked) {
                 if (stage.status === status.checked) {
                     stage.curOrder = _.max(_.map(stage.auditors, 'order'));
                     stage.curOrder = _.max(_.map(stage.auditors, 'order'));
                 } else if (stage.status === status.checkNo) {
                 } else if (stage.status === status.checkNo) {
@@ -82,7 +82,7 @@ module.exports = options => {
                     throw '您无权查看该数据';
                     throw '您无权查看该数据';
                 }
                 }
                 stage.readOnly = true;
                 stage.readOnly = true;
-                stage.curTimes = stage.times;
+                stage.curTimes = stage.status === status.checkNo ? stage.times - 1 : stage.times;
                 stage.curOrder = stage.status === status.checked ? _.max(_.map(stage.auditors, 'order')) : stage.curAuditor.order - 1;
                 stage.curOrder = stage.status === status.checked ? _.max(_.map(stage.auditors, 'order')) : stage.curAuditor.order - 1;
             } else { // 其他不可见
             } else { // 其他不可见
                 throw '您无权查看该数据';
                 throw '您无权查看该数据';

+ 0 - 1
app/public/js/tender.js

@@ -283,7 +283,6 @@ $(document).ready(function() {
             }
             }
         };
         };
         const tenderId = window.location.pathname.split('/')[2];
         const tenderId = window.location.pathname.split('/')[2];
-        console.log(prop);
         postData('/tender/' + tenderId + '/save', prop, function (data) {
         postData('/tender/' + tenderId + '/save', prop, function (data) {
             setReadOnly('#v-pills-2', true);
             setReadOnly('#v-pills-2', true);
             property.decimal = data.decimal;
             property.decimal = data.decimal;

+ 1 - 1
app/service/stage_audit.js

@@ -319,7 +319,7 @@ module.exports = app => {
 
 
                         // 计算该审批人最终数据
                         // 计算该审批人最终数据
                         await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);
                         await this.ctx.service.stagePay.calcAllStagePays(this.ctx.stage, transaction);
-                        // 复制一份最新数据给原报
+                        // 复制一份最新数据给上一人
                         await this.ctx.service.stagePay.copyAuditStagePays(this.ctx.stage, this.ctx.stage.times, audit.order + 1, transaction);
                         await this.ctx.service.stagePay.copyAuditStagePays(this.ctx.stage, this.ctx.stage.times, audit.order + 1, transaction);
                     } else {
                     } else {
                         throw '审核数据错误';
                         throw '审核数据错误';