MaiXinRong пре 3 година
родитељ
комит
dacd25c75f
2 измењених фајлова са 4 додато и 3 уклоњено
  1. 2 1
      app/controller/report_controller.js
  2. 2 2
      app/service/stage_change.js

+ 2 - 1
app/controller/report_controller.js

@@ -1012,7 +1012,8 @@ async function getMultiRptsCommon(ctx, params, outputType, baseDir) {
             let customSelect = rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_AUDIT_SELECT].enable
                 ? await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, params.stage_id, rptTpl.id)
                 : await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, -1, rptTpl.id);
-            if (rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_CHANGE_SELECT]) {
+            console.log(rptTpl[JV.NODE_CUSTOM_DEFINE]);
+            if (rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_CHANGE_SELECT].enable) {
                 customSelect = { tid: params.tender_id, rid: params.rpt_tpl_id, sid: -1, change_select: params.customSelect[tplIdx].change_select };
             }
 

+ 2 - 2
app/service/stage_change.js

@@ -289,7 +289,7 @@ module.exports = app => {
         async getUsedData(tid, cid) {
             if (this.ctx.stage.status === audit.stage.status.checked) {
                 const sql = 'SELECT scf.* ' +
-                    '  FROM ' + this.tableName + ' scf ' +
+                    '  FROM ' + this.ctx.service.stageChangeFinal.tableName + ' scf ' +
                     '  LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
                     '  WHERE scf.tid = ? And scf.cid = ? And s.order = ?';
                 const result = await this.db.query(sql, [tid, cid, this.ctx.stage.order]);
@@ -457,7 +457,7 @@ module.exports = app => {
                 if (!c) continue;
 
                 for (const cb of changeBillsPart[cid]) {
-                    cb.tp = this.ctx.helper.mul(cb.spamount, cb.unit_price, c.tp_decimal);
+                    cb.tp = this.ctx.helper.mul(cb.spamount, cb.unit_price, this.ctx.tender.info.decimal.tp);
                     cb.used_tp = this.ctx.helper.mul(cb.used_qty, cb.unit_price, this.ctx.tender.info.decimal.tp);
 
                     c.used_tp = this.ctx.helper.add(c.used_tp, cb.used_tp);