fix: 其他订单报错问题

This commit is contained in:
lyx 2024-03-15 13:39:40 +08:00
parent 74bc59a62b
commit 9a44893c83

View File

@ -27,8 +27,10 @@ export class RecordService {
if (!values) {
return;
}
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({