Forráskód Böngészése

变更数量小数位数保存问题

laiguoran 3 éve
szülő
commit
b91880a940

+ 2 - 2
app/controller/change_controller.js

@@ -332,7 +332,7 @@ module.exports = app => {
                     auditList,
                     changeList,
                     tpUnit: change.tp_decimal ? change.tp_decimal : ctx.tender.info.decimal.tp,
-                    upUnit: ctx.tender.info.decimal.up,
+                    upUnit: change.up_decimal ? change.up_decimal : ctx.tender.info.decimal.up,
                     authMobile: auth_mobile,
                     shenpiConst,
                 };
@@ -598,7 +598,7 @@ module.exports = app => {
                     whiteList,
                     auditList,
                     tpUnit: change.tp_decimal ? change.tp_decimal : ctx.tender.info.decimal.tp,
-                    upUnit: ctx.tender.info.decimal.up,
+                    upUnit: change.up_decimal ? change.up_decimal : ctx.tender.info.decimal.up,
                     authMobile: auth_mobile,
                     shenpiConst,
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.change.information),

+ 7 - 2
app/service/change.js

@@ -105,7 +105,8 @@ module.exports = app => {
                     in_time: new Date(),
                     code,
                     name,
-                    tp_decimal: this.ctx.tender.info.decimal.tp,
+                    // tp_decimal: this.ctx.tender.info.decimal.tp,
+                    // up_decimal: this.ctx.tender.info.decimal.up,
                 };
                 const operate = await this.transaction.insert(this.tableName, change);
 
@@ -626,7 +627,7 @@ module.exports = app => {
                     charge: postData.charge,
                     w_code: postData.w_code,
                     total_price,
-                    tp_decimal: this.ctx.tender.info.decimal.tp,
+                    // tp_decimal: this.ctx.tender.info.decimal.tp,
                 };
                 const options = {
                     where: {
@@ -634,6 +635,8 @@ module.exports = app => {
                     },
                 };
                 if (change_status) {
+                    cArray.tp_decimal = this.ctx.tender.info.decimal.tp;
+                    cArray.up_decimal = this.ctx.tender.info.decimal.up;
                     cArray.status = audit.flow.status.checking;
                     cArray.cin_time = Date.parse(new Date()) / 1000;
                 }
@@ -936,6 +939,7 @@ module.exports = app => {
                     cin_time: Date.parse(new Date()) / 1000,
                     total_price,
                     tp_decimal: null,
+                    up_decimal: null,
                 };
                 const options = {
                     where: {
@@ -1413,6 +1417,7 @@ module.exports = app => {
                     cin_time: Date.parse(new Date()) / 1000,
                     // total_price,
                     tp_decimal: null,
+                    up_decimal: null,
                     is_revise: 1,
                 };
                 const options = {

+ 1 - 0
app/service/change_audit.js

@@ -612,6 +612,7 @@ module.exports = app => {
                 const updateData = {
                     total_price,
                     tp_decimal: this.ctx.tender.info.decimal.tp,
+                    up_decimal: this.ctx.tender.info.decimal.up,
                     status: auditConst.status.checking,
                 };
                 await transaction.update(this.ctx.service.change.tableName, updateData, options);

+ 2 - 0
sql/update.sql

@@ -323,3 +323,5 @@ UPDATE `zh_ledger_revise` SET pos_file = replace(pos_file, '/revise', 'revise')
 ALTER TABLE `zh_material_checklist` CHANGE `unit_price` `unit_price` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '单价';
 ALTER TABLE `zh_material_checklist` CHANGE `quantity` `quantity` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '数量(工程量)';
 ALTER TABLE `zh_material_checklist` CHANGE `total_price` `total_price` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '金额';
+
+ALTER TABLE `zh_change` ADD `up_decimal` TINYINT(2) NULL DEFAULT NULL COMMENT '数量小数位数' AFTER `tp_decimal`;