瀏覽代碼

支付审批,安全生产费,小数位数调整

MaiXinRong 1 年之前
父節點
當前提交
8504d97544
共有 3 個文件被更改,包括 5 次插入5 次删除
  1. 1 1
      app/middleware/payment_detail_check.js
  2. 3 3
      app/service/payment_detail.js
  3. 1 1
      sql/update.sql

+ 1 - 1
app/middleware/payment_detail_check.js

@@ -31,7 +31,7 @@ module.exports = options => {
             if (!detail) {
                 throw '支付审批表单不存在';
             }
-            detail.decimal = detail.decimal ? JSON.parse(detail.decimal) : { qty: 3, tp: 2, up: 2};
+            detail.decimal = detail.bills_decimal ? JSON.parse(detail.bills_decimal) : { qty: 3, tp: 2, up: 2};
             const trInfo = yield this.service.paymentTenderRpt.getDataById(detail.tr_id);
             if (!trInfo) {
                 throw '支付审批报表不存在';

+ 3 - 3
app/service/payment_detail.js

@@ -11,7 +11,7 @@ module.exports = app => {
 
         async getValidDetails(tr_id) {
             const details = await this.db.select(this.tableName, {
-                column: ['id', 'in_time', 'tr_id', 'uid', 'status', 'order', 'times', 'code', 's_time', 'decimal'],
+                column: ['id', 'in_time', 'tr_id', 'uid', 'status', 'order', 'times', 'code', 's_time', 'bills_decimal'],
                 where: { tr_id },
                 orders: [['order', 'desc']],
             });
@@ -36,7 +36,7 @@ module.exports = app => {
 
         async getDetail(id) {
             const details = await this.db.select(this.tableName, {
-                column: ['id', 'in_time', 'tr_id', 'uid', 'status', 'order', 'times', 'code', 's_time', 'decimal'],
+                column: ['id', 'in_time', 'tr_id', 'uid', 'status', 'order', 'times', 'code', 's_time', 'bills_decimal'],
                 where: { id },
                 orders: [['order', 'desc']],
             });
@@ -91,7 +91,7 @@ module.exports = app => {
                     report_json: JSON.stringify(pageRst),
                     in_time: new Date(),
                 };
-                if (preDetail) newDetail.decimal = preDetail.decimal;
+                if (preDetail) newDetail.bills_decimal = preDetail.bills_decimal;
                 const result = await transaction.insert(this.tableName, newDetail);
                 if (result.affectedRows === 1) {
                     newDetail.id = result.insertId;

+ 1 - 1
sql/update.sql

@@ -10,4 +10,4 @@ ADD COLUMN `occupy_land`  varchar(20) NOT NULL DEFAULT '' COMMENT '永久占用
 ADD COLUMN `demolish_building`  varchar(20) NOT NULL DEFAULT '' COMMENT '实际拆迁房屋' AFTER `occupy_land`;
 
 ALTER TABLE `zh_payment_detail`
-ADD COLUMN `decimal`  varchar(100) NOT NULL DEFAULT '{"tp":2, "up": 2, "qty": 3}' COMMENT '小数位数' AFTER `in_time`;
+ADD COLUMN `bills_decimal`  varchar(100) NOT NULL DEFAULT '{"tp":2, "up": 2, "qty": 3}' COMMENT '小数位数' AFTER `in_time`;