|
@@ -589,6 +589,35 @@ module.exports = app => {
|
|
|
throw error;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取审核人需要审核的期列表
|
|
|
+ *
|
|
|
+ * @param auditorId
|
|
|
+ * @return {Promise<*>}
|
|
|
+ */
|
|
|
+ async getAuditPayment(auditorId) {
|
|
|
+ const sql =
|
|
|
+ 'SELECT pda.`aid`, pda.`times`, pda.`order`, pda.`begin_time`, pda.`end_time`, pda.`tender_id`, pda.`tr_id`, pda.`td_id`,' +
|
|
|
+ ' pd.`code` As `scode`, pd.`order` As `sorder`, pd.`status` As `sstatus`,' +
|
|
|
+ ' t.`name`, t.`pid`, t.`uid` ' +
|
|
|
+ ' FROM ?? AS pda ' +
|
|
|
+ ' Left Join ?? AS pd On pda.`td_id` = pd.`id` ' +
|
|
|
+ ' Left Join ?? As t ON pda.`tender_id` = t.`id`' +
|
|
|
+ ' WHERE ((pda.`aid` = ? and pda.`status` = ?) OR (pd.`uid` = ? and pda.`status` = ? and pd.`status` = ? and pda.`times` = (pd.`times`-1)))' +
|
|
|
+ ' ORDER BY pda.`begin_time` DESC';
|
|
|
+ const sqlParam = [
|
|
|
+ this.tableName,
|
|
|
+ this.ctx.service.paymentDetail.tableName,
|
|
|
+ this.ctx.service.paymentTender.tableName,
|
|
|
+ auditorId,
|
|
|
+ auditConst.status.checking,
|
|
|
+ auditorId,
|
|
|
+ auditConst.status.checkNo,
|
|
|
+ auditConst.status.checkNo,
|
|
|
+ ];
|
|
|
+ return await this.db.query(sql, sqlParam);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return PaymentDetailAudit;
|