瀏覽代碼

变更令,变更类型取值问题

MaiXinRong 5 年之前
父節點
當前提交
0fadf57038
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      app/service/report_memory.js

+ 8 - 2
app/service/report_memory.js

@@ -566,18 +566,24 @@ module.exports = app => {
 
         _getChangeConstName(define, value) {
             for (const prop in define) {
-                if (define[prop].value === value) return define[prop].name;
+                if (define[prop].value === value) {
+                    return define[prop].name;
+                }
             }
             return '';
         }
 
         async _generateChange(tid) {
             if (this.changeData !== null) return;
+            const self = this;
             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);
+                    const types = ctx.helper._.map(c.type.split(','), function (t) {
+                        return self._getChangeConstName(changeConst.type, ctx.helper._.toInteger(t));
+                    });
+                    c.type = types.join(';');
                     c.class = this._getChangeConstName(changeConst.class, c.class);
                     c.quality = this._getChangeConstName(changeConst.quality, c.quality);
                     c.charge = this._getChangeConstName(changeConst.type, c.charge);