|
@@ -435,6 +435,11 @@ module.exports = app => {
|
|
|
const sql = 'SELECT `tender_id`, `tr_id`, `td_id`, `aid`, `order` FROM ?? WHERE `td_id` = ? and `times` = ? GROUP BY `aid` ORDER BY `id` ASC';
|
|
|
const sqlParam = [this.tableName, detailId, times];
|
|
|
const auditors = await this.db.query(sql, sqlParam);
|
|
|
+ // 可能更换了上报人且存在于审批流程中,需要删除
|
|
|
+ const userIndex = this._.findIndex(auditors, { aid: trInfo.uid });
|
|
|
+ if (userIndex !== -1) {
|
|
|
+ auditors.splice(userIndex, 1);
|
|
|
+ }
|
|
|
let order = 1;
|
|
|
for (const a of auditors) {
|
|
|
a.times = times + 1;
|
|
@@ -442,11 +447,6 @@ module.exports = app => {
|
|
|
a.status = auditConst.status.uncheck;
|
|
|
order++;
|
|
|
}
|
|
|
- // 可能更换了上报人且存在于审批流程中,需要删除
|
|
|
- const userIndex = this._.findIndex(auditors, { aid: trInfo.uid });
|
|
|
- if (userIndex !== -1) {
|
|
|
- auditors.splice(userIndex, 1);
|
|
|
- }
|
|
|
const transaction = await this.db.beginTransaction();
|
|
|
try {
|
|
|
await transaction.update(this.tableName, { id: audit.id, status: checkData.checkType, opinion: checkData.opinion, end_time: time });
|