Merge pull request 'fix_record_direct_problem' (#382) from fix_record_direct_problem into @hera/dev

Reviewed-on: daoyoucloud/tachycode#382
Reviewed-by: sealday <zhanglin@daoyoucloud.com>
This commit is contained in:
sealday 2024-03-15 13:54:00 +08:00
commit 8f1b7693a8

View File

@ -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,7 +650,7 @@ export class RecordService {
async createRecord(model, values, transaction, context, updateData) {
delete values.number;
delete values.id;
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({