ソースを参照

变更令,转换类型,类别、性质、承担方数据

MaiXinRong 5 年 前
コミット
52af6f775c
1 ファイル変更14 行追加0 行削除
  1. 14 0
      app/service/report_memory.js

+ 14 - 0
app/service/report_memory.js

@@ -13,6 +13,7 @@ const _ = require('lodash');
 const StageIm = require('../lib/stage_im');
 const imType = require('../const/tender').imType;
 const audit = require('../const/audit');
+const changeConst = require('../const/change');
 // const path = require('path');
 // const fs = require('fs');
 
@@ -563,11 +564,24 @@ module.exports = app => {
             return dealPay;
         }
 
+        _getChangeConstName(define, value) {
+            for (const prop in define) {
+                if (define[prop].value === value) return define[prop].name;
+            }
+            return '';
+        }
+
         async _generateChange(tid) {
             if (this.changeData !== null) return;
             try {
                 const decimal = this.ctx.tender.info.decimal, ctx = this.ctx;
                 const change = await this.ctx.service.change.getListByStatus(tid, 3);
+                for (const c of change) {
+                    c.type = this._getChangeConstName(changeConst.type, c.type);
+                    c.class = this._getChangeConstName(changeConst.class, c.class);
+                    c.quality = this._getChangeConstName(changeConst.quality, c.quality);
+                    c.charge = this._getChangeConstName(changeConst.type, c.charge);
+                }
                 const changeBills = await this.ctx.service.changeAuditList.getChangeAuditBills(tid);
                 for (const d of changeBills) {
                     //const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, d.unit);