|
@@ -1,10 +1,10 @@
|
|
|
'use strict';
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ *
|
|
|
*
|
|
|
* @author Mai
|
|
|
- * @date
|
|
|
+ * @date 20250613
|
|
|
* @version
|
|
|
*/
|
|
|
|
|
@@ -13,25 +13,38 @@ class reportMemoryFinancial {
|
|
|
this.ctx = ctx;
|
|
|
}
|
|
|
|
|
|
+ async checkTender(tid) {
|
|
|
+ this.tender = this.ctx.tender ? this.ctx.tender : await this.ctx.tender.getDataById(tid);
|
|
|
+ }
|
|
|
+
|
|
|
async pay(tid) {
|
|
|
- return await this.ctx.service.financialPay.getAllDataByCondition({ where: { tid }});
|
|
|
+ await this.checkTender(tid);
|
|
|
+ if (!this.tender || !this.tender.spid) return [];
|
|
|
+ return await this.ctx.service.financialPay.getAllDataByCondition({ where: { spid: this.tender.spid }});
|
|
|
}
|
|
|
|
|
|
async payContract(tid) {
|
|
|
- return await this.ctx.service.financialPayContract.getAllDataByCondition({ where: { tid } });
|
|
|
+ await this.checkTender(tid);
|
|
|
+ if (!this.tender || !this.tender.spid) return [];
|
|
|
+ return await this.ctx.service.financialPayContract.getAllDataByCondition({ where: { spid: this.tender.spid } });
|
|
|
}
|
|
|
|
|
|
async payTender(tid) {
|
|
|
- return await this.ctx.service.financialPayTender.getAllDataByCondition({ where: { tid } });
|
|
|
+ await this.checkTender(tid);
|
|
|
+ if (!this.tender || !this.tender.spid) return [];
|
|
|
+ return await this.ctx.service.financialPayTender.getAllDataByCondition({ where: { spid: this.tender.spid } });
|
|
|
}
|
|
|
|
|
|
async transfer(tid) {
|
|
|
- const tender = this.ctx.tender ? this.ctx.tender : await this.ctx.tender.getDataById(tid);
|
|
|
- return await this.ctx.service.financialTransfer.getAllDataByCondition({ where: { spid: tender.spid } });
|
|
|
+ await this.checkTender(tid);
|
|
|
+ if (!this.tender || !this.tender.spid) return [];
|
|
|
+ return await this.ctx.service.financialTransfer.getAllDataByCondition({ where: { spid: this.tender.spid } });
|
|
|
}
|
|
|
|
|
|
async transferTender(tid) {
|
|
|
- return await this.ctx.service.financialTransferTender.getAllDataByCondition({ where: { tid } });
|
|
|
+ await this.checkTender(tid);
|
|
|
+ if (!this.tender || !this.tender.spid) return [];
|
|
|
+ return await this.ctx.service.financialTransferTender.getAllDataByCondition({ where: { spid: this.tender.spid } });
|
|
|
}
|
|
|
}
|
|
|
|