|
@@ -147,6 +147,7 @@ module.exports = app => {
|
|
|
// const advanceType = typeConsts.typeCol.find(item => item.key === 'start');
|
|
|
// const advanceList = await ctx.service.advance.getAdvanceListDirectly(tender.id, advanceType.type);
|
|
|
const advanceList = await ctx.service.advance.getAdvanceListDirectly(tender.id);
|
|
|
+ const advanceAuditList = await ctx.service.advanceAudit.getAuditAdvanceByTender(tender.id);
|
|
|
// const materialList = await ctx.service.advance.getValidMaterials(tender.id);
|
|
|
const isAdmin = ctx.session.sessionUser.is_admin;
|
|
|
// console.log('this.ctx.session.sessionUser.accountId: ' + this.ctx.session.sessionUser.accountId);
|
|
@@ -268,6 +269,7 @@ module.exports = app => {
|
|
|
reportConst.rptDataType[JV.NODE_CUS_MATERIAL_SELECT]);
|
|
|
|
|
|
const materialList = await ctx.service.material.getValidMaterials(ctx.tender.id);
|
|
|
+ const materialAdjAuditList = await ctx.service.materialAudit.getAuditorsByTender(tender.id);
|
|
|
|
|
|
|
|
|
if (stage !== null && stage !== undefined) {
|
|
@@ -329,7 +331,9 @@ module.exports = app => {
|
|
|
customSelects,
|
|
|
rptCustomType: reportConst.rptCustomType,
|
|
|
advanceList: JSON.stringify(advanceList),
|
|
|
+ advanceAuditList: JSON.stringify(advanceAuditList),
|
|
|
materialAdjList: JSON.stringify(materialList),
|
|
|
+ materialAdjAuditList: JSON.stringify(materialAdjAuditList),
|
|
|
materialList,
|
|
|
stages: stageList,
|
|
|
dataSelects,
|
|
@@ -488,7 +492,9 @@ module.exports = app => {
|
|
|
customSelects,
|
|
|
rptCustomType: reportConst.rptCustomType,
|
|
|
advanceList: JSON.stringify([]),
|
|
|
+ advanceAuditList: JSON.stringify([]),
|
|
|
materialAdjList: JSON.stringify(materialList),
|
|
|
+ materialAdjAuditList: JSON.stringify([]),
|
|
|
materialList,
|
|
|
stages: stageList,
|
|
|
dataSelects,
|
|
@@ -636,7 +642,9 @@ module.exports = app => {
|
|
|
customSelects,
|
|
|
rptCustomType: reportConst.rptCustomType,
|
|
|
advanceList: JSON.stringify([]),
|
|
|
+ advanceAuditList: JSON.stringify([]),
|
|
|
materialAdjList: JSON.stringify(materialList),
|
|
|
+ materialAdjAuditList: JSON.stringify([]),
|
|
|
materialList,
|
|
|
stages: stageList,
|
|
|
dataSelects,
|
|
@@ -824,7 +832,9 @@ module.exports = app => {
|
|
|
customSelects,
|
|
|
rptCustomType: reportConst.rptCustomType,
|
|
|
advanceList: JSON.stringify([]),
|
|
|
+ advanceAuditList: JSON.stringify([]),
|
|
|
materialAdjList: JSON.stringify(materialList),
|
|
|
+ materialAdjAuditList: JSON.stringify([]),
|
|
|
materialList,
|
|
|
stages: stageList,
|
|
|
dataSelects,
|
|
@@ -974,6 +984,35 @@ module.exports = app => {
|
|
|
stgAudit.push({ aid: audit.aid, status: audit.status, opinion: audit.opinion, end_time: audit.end_time, times: audit.times, order: audit.order });
|
|
|
});
|
|
|
break;
|
|
|
+ case -400: // 预付款
|
|
|
+ const advanceList = await ctx.service.advance.getAdvanceListDirectly(params.tender_id);
|
|
|
+ for (const advance of advanceList) {
|
|
|
+ if (advance.id === params.advance_id) {
|
|
|
+ stgAudit.push({ aid: advance.uid, status: advance.status, opinion: '同意', end_time: advance.end_time, order: 0 }); // 加上原报
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const advanceAuditList = await ctx.service.advanceAudit.getAuditAdvanceByTender(params.tender_id);
|
|
|
+ advanceAuditList.forEach(advAudit => {
|
|
|
+ if (advAudit.vid === params.advance_id) {
|
|
|
+ stgAudit.push({ aid: advAudit.autdit_id, status: advAudit.status, opinion: advAudit.opinion, end_time: advAudit.end_time, times: advAudit.times, order: advAudit.order });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case -500: // 材差
|
|
|
+ const materialList = await ctx.service.material.getValidMaterials(params.tender_id);
|
|
|
+ for (const material of materialList) {
|
|
|
+ if (material.id === params.material_id) {
|
|
|
+ stgAudit.push({ aid: material.user_id, status: material.status, opinion: '同意', end_time: material.in_time, order: 0 }); // 加上原报
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const materialAdjAuditList = await ctx.service.materialAudit.getAuditorsByTender(params.tender_id);
|
|
|
+ materialAdjAuditList.forEach(material => {
|
|
|
+ if (material.id === params.material_id) {
|
|
|
+ stgAudit.push({ aid: material.aid, status: material.status, opinion: material.opinion, end_time: material.end_time, order: material.order }); // 加上原报
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|