瀏覽代碼

删除本次审批,不删除任何附件

MaiXinRong 4 年之前
父節點
當前提交
4f47e564af
共有 1 個文件被更改,包括 0 次插入15 次删除
  1. 0 15
      app/service/stage_audit.js

+ 0 - 15
app/service/stage_audit.js

@@ -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 });
             // 其他台账