fix: 其他订单报错问题
This commit is contained in:
parent
74bc59a62b
commit
9a44893c83
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user