fix: 修复直发单生成租赁单时维修赔偿数据没有更新 (#1459)

Reviewed-on: daoyoucloud/tachybase#1459
Reviewed-by: sealday <zhanglin@daoyoucloud.com>
Co-authored-by: wjh <wwwjh0710@163.com>
Co-committed-by: wjh <wwwjh0710@163.com>
This commit is contained in:
wjh 2024-08-14 12:57:16 +08:00 committed by sealday
parent 27cda38a90
commit f020a2a4d3

View File

@ -45,16 +45,14 @@ export class RecordService {
records.map((item) => item.id),
transaction,
);
// 删除新建时创建的订单
await this.db.sequelize.query(
`
delete from records
where records.direct_record_id = ${model.id}
`,
{
transaction,
await this.db.getRepository('records').destroy({
filter: {
direct_record_id: {
$eq: model.id,
},
},
);
transaction,
});
const numbers = deleteDatas.map((item) => item.number);
await this._createRecord(model, values, transaction, context, numbers);
}
@ -392,6 +390,9 @@ export class RecordService {
purchaseData['number'] = numbers[0];
}
purchaseData.items.forEach((element) => {
element.fee_items?.forEach((feeItem) => {
delete feeItem.id;
});
delete element.record_id;
delete element.id;
});
@ -411,6 +412,9 @@ export class RecordService {
leaseData['number'] = numbers[1];
}
leaseData.items.forEach((element) => {
element.fee_items?.forEach((feeItem) => {
delete feeItem.id;
});
delete element.record_id;
delete element.id;
});
@ -448,6 +452,9 @@ export class RecordService {
leaseInData['number'] = numbers[0];
}
leaseInData.items.forEach((element) => {
element.fee_items?.forEach((feeItem) => {
delete feeItem.id;
});
delete element.record_id;
delete element.id;
});
@ -467,6 +474,9 @@ export class RecordService {
leaseOutData['number'] = numbers[1];
}
leaseOutData.items.forEach((element) => {
element.fee_items?.forEach((feeItem) => {
delete feeItem.id;
});
delete element.record_id;
delete element.id;
});