|
@@ -1,9 +1,9 @@
|
|
|
'use strict';
|
|
|
const accountGroup = require('../const/account_group').group;
|
|
|
const auditConst = require('../const/audit').advance;
|
|
|
-
|
|
|
module.exports = app => {
|
|
|
class advanceController extends app.BaseController {
|
|
|
+
|
|
|
/**
|
|
|
* 开工预付款页面(AJAX) GET
|
|
|
* @param {Object} ctx 全局上下文
|
|
@@ -12,6 +12,8 @@ module.exports = app => {
|
|
|
const type = auditConst.type.start;
|
|
|
const advanceList = await ctx.service.advance.getAdvanceList(ctx.tender.id, type);
|
|
|
const latestOrder = await ctx.service.advance.getLastestAdvance(ctx.tender.id, type, true);
|
|
|
+ const advancePayTotal = ctx.tender.info.deal_param.startAdvance;
|
|
|
+ const progress = await ctx.service.advance.calcProgress(latestOrder, advancePayTotal);
|
|
|
const renderData = {
|
|
|
type,
|
|
|
advanceList,
|
|
@@ -19,7 +21,8 @@ module.exports = app => {
|
|
|
auditConst,
|
|
|
preUrl: `/tender/${ctx.tender.id}/advance/${type}/create`,
|
|
|
jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.advance.main),
|
|
|
- advancePayTotal: ctx.tender.info.deal_param.startAdvance,
|
|
|
+ advancePayTotal,
|
|
|
+ progress,
|
|
|
};
|
|
|
await this.layout('advance/index.ejs', renderData, 'advance/modal.ejs');
|
|
|
}
|
|
@@ -32,6 +35,8 @@ module.exports = app => {
|
|
|
const type = auditConst.type.material;
|
|
|
const advanceList = await ctx.service.advance.getAdvanceList(ctx.tender.id, type);
|
|
|
const latestOrder = await ctx.service.advance.getLastestAdvance(ctx.tender.id, type, true);
|
|
|
+ const advancePayTotal = ctx.tender.info.deal_param.materialAdvance;
|
|
|
+ const progress = await ctx.service.advance.calcProgress(latestOrder, advancePayTotal);
|
|
|
const renderData = {
|
|
|
type,
|
|
|
advanceList,
|
|
@@ -39,7 +44,8 @@ module.exports = app => {
|
|
|
auditConst,
|
|
|
preUrl: `/tender/${ctx.tender.id}/advance/${type}/create`,
|
|
|
jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.advance.main),
|
|
|
- advancePayTotal: ctx.tender.info.deal_param.materialAdvance,
|
|
|
+ advancePayTotal,
|
|
|
+ progress,
|
|
|
};
|
|
|
await this.layout('advance/index.ejs', renderData, 'advance/modal.ejs');
|
|
|
}
|
|
@@ -114,7 +120,6 @@ module.exports = app => {
|
|
|
const { status } = ctx.advance;
|
|
|
// 获取上一期预付款记录
|
|
|
const prevAdvance = await ctx.service.advance.getPreviousRecord(ctx.tender.id, ctx.advance.type);
|
|
|
- console.log('prevAdvance', prevAdvance);
|
|
|
renderData.isEdited = status === uncheck || status === checkNo;
|
|
|
renderData.advance = ctx.advance;
|
|
|
renderData.advancePayTotal = advancePayTotal;
|