|
@@ -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);
|