|
|
@@ -190,6 +190,16 @@ module.exports = app => {
|
|
|
if (!updateNode) {
|
|
|
const contractNode = await this.ctx.service.contract.getDataById(row.id);
|
|
|
if (contractNode) {
|
|
|
+ if (Object.prototype.hasOwnProperty.call(row, 'settle_price')) {
|
|
|
+ const settlePrice = Number(row.settle_price || 0);
|
|
|
+ if (!Number.isFinite(settlePrice) || settlePrice < 0) {
|
|
|
+ throw '结算金额只能输入大于等于0的数字';
|
|
|
+ }
|
|
|
+ if (settlePrice !== 0 && settlePrice < Number(contractNode.yf_price || 0)) {
|
|
|
+ throw '结算金额不能小于累计应' + (options.contract_type === contractConst.type.expenses ? '付' : '回') + '金额';
|
|
|
+ }
|
|
|
+ row.settle_price = settlePrice;
|
|
|
+ }
|
|
|
const updateContractData = !updateAll ? this._filterUpdateInvalidField(contractNode.id, row) : row;
|
|
|
updateContractDatas.push(updateContractData);
|
|
|
continue;
|