|
@@ -994,7 +994,6 @@ module.exports = app => {
|
|
|
* @return {Promise<void>}
|
|
|
*/
|
|
|
async _timesDelete(sid, times, transaction) {
|
|
|
- console.log(sid, times);
|
|
|
// 审批流程
|
|
|
await transaction.delete(this.tableName, { sid: sid, times: times });
|
|
|
await transaction.delete(this.ctx.service.pos.tableName, {add_stage: sid, add_times: times});
|
|
@@ -1002,20 +1001,6 @@ module.exports = app => {
|
|
|
await transaction.delete(this.ctx.service.stagePos.tableName, { sid: sid, times: times });
|
|
|
await transaction.delete(this.ctx.service.stageDetail.tableName, { sid: sid, times: times });
|
|
|
await transaction.delete(this.ctx.service.stageChange.tableName, { sid: sid, stimes: times });
|
|
|
- // 合同支付
|
|
|
- const payList = await this.ctx.service.stagePay.getAllDataByCondition({ where: { sid: sid, stimes: times } });
|
|
|
- if (payList) {
|
|
|
- for (const pt of payList) {
|
|
|
- if (pt.attachment !== null && pt.attachment !== '') {
|
|
|
- const payAttList = JSON.parse(pt.attachment);
|
|
|
- for (const pat of payAttList) {
|
|
|
- if (fs.existsSync(path.join(this.app.baseDir, pat.filepath))) {
|
|
|
- await fs.unlinkSync(path.join(this.app.baseDir, pat.filepath));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
await transaction.delete(this.ctx.service.stagePay.tableName, { sid: sid, stimes: times });
|
|
|
await transaction.delete(this.ctx.service.pay.tableName, { csid: sid, cstimes: times });
|
|
|
// 其他台账
|