|
|
@@ -85,7 +85,10 @@ module.exports = app => {
|
|
|
if (!node) {
|
|
|
throw '合同不存在';
|
|
|
}
|
|
|
- await this._checkPayLimit(options, node, this.ctx.helper.add(node.yf_price || 0, data.yf_price || 0));
|
|
|
+ await this._checkPayLimit(options, node, this.ctx.helper.add(
|
|
|
+ Number(node.yf_price || 0),
|
|
|
+ Number(data.yf_price || 0)
|
|
|
+ ));
|
|
|
const transaction = await this.db.beginTransaction();
|
|
|
try {
|
|
|
const insertData = {
|
|
|
@@ -141,8 +144,8 @@ module.exports = app => {
|
|
|
if (selectedStages.some(stage => !stage)) {
|
|
|
throw '付款阶段不存在或未通过审批';
|
|
|
}
|
|
|
- const addYfPrice = selectedStages.reduce((total, stage) => this.ctx.helper.add(total, stage.yf_price || 0), 0);
|
|
|
- await this._checkPayLimit(options, node, this.ctx.helper.add(node.yf_price || 0, addYfPrice));
|
|
|
+ const addYfPrice = selectedStages.reduce((total, stage) => this.ctx.helper.add(total, Number(stage.yf_price || 0)), 0);
|
|
|
+ await this._checkPayLimit(options, node, this.ctx.helper.add(Number(node.yf_price || 0), addYfPrice));
|
|
|
|
|
|
const existedPays = await this.getAllDataByCondition({ where: { cid, rela_stage: ids } });
|
|
|
if (existedPays.length > 0) {
|
|
|
@@ -282,8 +285,8 @@ module.exports = app => {
|
|
|
throw '关联标段期的合同支付不能编辑';
|
|
|
}
|
|
|
const newYfPrice = this.ctx.helper.add(
|
|
|
- this.ctx.helper.sub(node.yf_price || 0, cpInfo.yf_price || 0),
|
|
|
- data.yf_price || 0
|
|
|
+ this.ctx.helper.sub(Number(node.yf_price || 0), Number(cpInfo.yf_price || 0)),
|
|
|
+ Number(data.yf_price || 0)
|
|
|
);
|
|
|
await this._checkPayLimit(options, node, newYfPrice);
|
|
|
const transaction = await this.db.beginTransaction();
|