瀏覽代碼

小数位更新

laiguoran 3 年之前
父節點
當前提交
a3bd25a143

+ 2 - 2
app/controller/change_controller.js

@@ -3238,8 +3238,8 @@ module.exports = app => {
                     auditConst: audit.changeApply,
                     fileList,
                     whiteList,
-                    tpUnit: ctx.change.planDecimal ? ctx.change.planDecimal.tp : ctx.tender.info.decimal.tp,
-                    upUnit: ctx.change.planDecimal ? ctx.change.planDecimal.up : ctx.tender.info.decimal.up,
+                    tpUnit: ctx.change.decimal ? ctx.change.decimal.tp : ctx.tender.info.decimal.tp,
+                    upUnit: ctx.change.decimal ? ctx.change.decimal.up : ctx.tender.info.decimal.up,
                     changeUnits: changeConst.units,
                     precision: ctx.tender.info.precision,
                     returnUrl: this.app._.includes(ctx.request.headers.referer, '/tender/' + ctx.tender.id + '/change/plan') && !this.app._.includes(ctx.request.headers.referer, '/tender/' + ctx.tender.id + '/change/plan/' + ctx.change.id + '/information') ? ctx.request.headers.referer : null,

+ 1 - 1
app/middleware/change_apply_check.js

@@ -35,7 +35,7 @@ module.exports = options => {
             change.auditors = yield this.service.changeApplyAudit.getAuditors(change.id, change.times);
             change.curAuditor = yield this.service.changeApplyAudit.getCurAuditor(change.id, change.times);
             // decimal小数位设置
-            change.applyDecimal = change.decimal ? JSON.parse(change.decimal) : { tp: this.tender.info.decimal.tp, up: this.tender.info.decimal.up };
+            change.decimal = change.decimal ? JSON.parse(change.decimal) : { tp: this.tender.info.decimal.tp, up: this.tender.info.decimal.up };
 
             if (!change) throw '变更令数据有误';
             // 权限相关

+ 1 - 1
app/middleware/change_plan_check.js

@@ -35,7 +35,7 @@ module.exports = options => {
             change.auditors = yield this.service.changePlanAudit.getAuditors(change.id, change.times);
             change.curAuditor = yield this.service.changePlanAudit.getCurAuditor(change.id, change.times);
             // decimal小数位设置
-            change.planDecimal = change.decimal ? JSON.parse(change.decimal) : { tp: this.tender.info.decimal.tp, up: this.tender.info.decimal.up };
+            change.decimal = change.decimal ? JSON.parse(change.decimal) : { tp: this.tender.info.decimal.tp, up: this.tender.info.decimal.up };
 
             if (!change) throw '变更令数据有误';
             // 权限相关

+ 1 - 1
app/service/change_apply_audit.js

@@ -410,7 +410,7 @@ module.exports = app => {
                         id: caId, status: checkData.checkType,
                         notice_code: checkData.notice_code,
                         notice_uid: checkData.notice_uid,
-                        decimal: JSON.stringify(this.ctx.change.applyDecimal),
+                        decimal: JSON.stringify(this.ctx.change.decimal),
                     });
 
                     // 微信模板通知

+ 1 - 1
app/service/change_apply_list.js

@@ -179,7 +179,7 @@ module.exports = app => {
             const sqlParam = [this.tableName, this.ctx.change.id];
             const changeList = await transaction.query(sql, sqlParam);
             let total_price = 0;
-            const tp_decimal = this.ctx.tender.info.decimal.tp;
+            const tp_decimal = this.ctx.change.decimal.tp;
             for (const cl of changeList) {
                 total_price = this.ctx.helper.accAdd(total_price, this.ctx.helper.mul(cl.unit_price, cl.camount, tp_decimal));
             }

+ 1 - 1
app/service/change_plan_audit.js

@@ -411,7 +411,7 @@ module.exports = app => {
                     // 同步 期信息
                     await transaction.update(this.ctx.service.changePlan.tableName, {
                         id: cpId, status: checkData.checkType,
-                        decimal: JSON.stringify(this.ctx.change.planDecimal),
+                        decimal: JSON.stringify(this.ctx.change.decimal),
                     });
 
                     // 微信模板通知

+ 1 - 1
app/service/change_plan_list.js

@@ -179,7 +179,7 @@ module.exports = app => {
             const sqlParam = [this.tableName, this.ctx.change.id];
             const changeList = await transaction.query(sql, sqlParam);
             let total_price = 0;
-            const tp_decimal = this.ctx.tender.info.decimal.tp;
+            const tp_decimal = this.ctx.change.decimal.tp;
             for (const cl of changeList) {
                 total_price = this.ctx.helper.accAdd(total_price, this.ctx.helper.mul(cl.unit_price, cl.spamount, tp_decimal));
             }