|
@@ -584,6 +584,17 @@ module.exports = app => {
|
|
|
await transaction.delete(this.ctx.service.stageOther.tableName, { sid: id });
|
|
|
// 同步删除进度里所选的期
|
|
|
await transaction.delete(this.ctx.service.scheduleStage.tableName, { tid: stageInfo.tid, order: stageInfo.order });
|
|
|
+ const detailAtt = await this.ctx.service.stageDetailAtt.getStageData(id);
|
|
|
+ if (detailAtt && detailAtt.length > 0) {
|
|
|
+ for (const da of detailAtt) {
|
|
|
+ for (const daa of da.attachment) {
|
|
|
+ if (fs.existsSync(path.join(this.app.baseDir, daa.filepath))) {
|
|
|
+ await fs.unlinkSync(path.join(this.app.baseDir, daa.filepath));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ await transaction.delete(this.ctx.service.stageDetailAtt.tableName, { sid: id });
|
|
|
// 重算进度计量总金额
|
|
|
await this.ctx.service.scheduleStage.calcStageSjTp(transaction, stageInfo.tid);
|
|
|
// 删除收方单及附件
|