From 9a44893c833da24700faf3262861b2fbcd721b7a Mon Sep 17 00:00:00 2001 From: lyx <2027667395@qq.com> Date: Fri, 15 Mar 2024 13:39:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=B6=E4=BB=96=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/services/record-service.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts b/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts index 575490062..2ce10d5bd 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts +++ b/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts @@ -27,7 +27,9 @@ export class RecordService { if (!values) { return; } - await this.createRecord(model, values, transaction, context, null); + if (values.record_category === RecordTypes.purchaseDirect || values.record_category === RecordTypes.rentDirect) { + await this.createRecord(model, values, transaction, context, null); + } } /** * 处理直发单生成单 @@ -648,13 +650,7 @@ export class RecordService { async createRecord(model, values, transaction, context, updateData) { delete values.number; delete values.id; - if ( - values.vehicles && - ((values.record_category === RecordTypes.purchaseDirect && values.category === RecordCategory.purchase2lease) || - (values.record_category === RecordTypes.rentDirect && values.category === RecordCategory.lease2lease)) - ) { - values.vehicles.forEach((item) => delete item.record_vehicles); - } + values.vehicles?.forEach((item) => delete item.record_vehicles); //采购直发单 if (values.record_category === RecordTypes.purchaseDirect && values.category === RecordCategory.purchase2lease) { const inProject = await this.db.getModel('project').findOne({