|
@@ -13,11 +13,38 @@ const measureType = require('../const/tender').measureType;
|
|
const fsUtil = require('../public/js/fsUtil');
|
|
const fsUtil = require('../public/js/fsUtil');
|
|
const auditConst = require('../const/audit');
|
|
const auditConst = require('../const/audit');
|
|
const signConst = require('../const/sign');
|
|
const signConst = require('../const/sign');
|
|
|
|
+const shenpiConst = require('../const/shenpi');
|
|
|
|
+const accountGroup = require('../const/account_group').group;
|
|
|
|
|
|
module.exports = app => {
|
|
module.exports = app => {
|
|
class ReportArchiveController extends app.BaseController {
|
|
class ReportArchiveController extends app.BaseController {
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取审批界面所需的 原报、审批人数据等
|
|
|
|
+ * @param ctx
|
|
|
|
+ * @return {Promise<void>}
|
|
|
|
+ * @private
|
|
|
|
+ */
|
|
|
|
+ async _getStageAuditViewData(ctx) {
|
|
|
|
+ if (!ctx.stage) return;
|
|
|
|
+ const times = ctx.stage.status === auditConst.stage.status.checkNo ? ctx.stage.times - 1 : ctx.stage.times;
|
|
|
|
+
|
|
|
|
+ ctx.stage.user = await ctx.service.projectAccount.getAccountInfoById(ctx.stage.user_id);
|
|
|
|
+ ctx.stage.auditHistory = [];
|
|
|
|
+ if (times >= 1) {
|
|
|
|
+ for (let i = 1; i <= times; i++) {
|
|
|
|
+ ctx.stage.auditHistory.push(await ctx.service.stageAudit.getAuditors(ctx.stage.id, i));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 获取审批流程中左边列表
|
|
|
|
+ ctx.stage.auditors2 = await ctx.service.stageAudit.getAuditGroupByListWithOwner(ctx.stage.id, times);
|
|
|
|
+ if (ctx.stage.status === auditConst.stage.status.uncheck || ctx.stage.status === auditConst.stage.status.checkNo) {
|
|
|
|
+ ctx.stage.auditorList = await ctx.service.stageAudit.getAuditors(ctx.stage.id, ctx.stage.times);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
async index(ctx) {
|
|
async index(ctx) {
|
|
|
|
+ await this._getStageAuditViewData(ctx);
|
|
const tender = ctx.tender;
|
|
const tender = ctx.tender;
|
|
const stage = ctx.stage;
|
|
const stage = ctx.stage;
|
|
let stage_id = -1;
|
|
let stage_id = -1;
|
|
@@ -73,6 +100,19 @@ module.exports = app => {
|
|
if (custTreeNodes.length > 0) {
|
|
if (custTreeNodes.length > 0) {
|
|
rpt_tpl_items = custTreeNodes[0].rpt_tpl_items;
|
|
rpt_tpl_items = custTreeNodes[0].rpt_tpl_items;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 获取用户权限
|
|
|
|
+ const accountInfo = await this.ctx.service.projectAccount.getDataById(this.ctx.session.sessionUser.accountId);
|
|
|
|
+ // 获取所有项目参与者
|
|
|
|
+ const accountList = await ctx.service.projectAccount.getAllDataByCondition({
|
|
|
|
+ where: { project_id: ctx.session.sessionProject.id, enable: 1 },
|
|
|
|
+ columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
|
|
|
|
+ });
|
|
|
|
+ const newAccountGroup = accountGroup.map((item, idx) => {
|
|
|
|
+ const groupList = accountList.filter(item => item.account_group === idx);
|
|
|
|
+ return { groupName: item, groupList };
|
|
|
|
+ });
|
|
|
|
+
|
|
//
|
|
//
|
|
const renderData = {
|
|
const renderData = {
|
|
tender: tender.data,
|
|
tender: tender.data,
|
|
@@ -94,8 +134,17 @@ module.exports = app => {
|
|
archiveEncryptionList,
|
|
archiveEncryptionList,
|
|
can_netcasign: false,
|
|
can_netcasign: false,
|
|
ossPath: signConst.path.oss,
|
|
ossPath: signConst.path.oss,
|
|
|
|
+ shenpiConst,
|
|
|
|
+ preUrl: '/tender/' + ctx.tender.id + '/measure/stage/' + ctx.params.order,
|
|
|
|
+ authMobile: accountInfo.auth_mobile,
|
|
|
|
+ accountGroup: newAccountGroup,
|
|
|
|
+ accountList,
|
|
};
|
|
};
|
|
- await this.layout('report/index_archive.ejs', renderData);
|
|
|
|
|
|
+ if (stage_id === -1) {
|
|
|
|
+ await this.layout('report/index_archive.ejs', renderData);
|
|
|
|
+ } else {
|
|
|
|
+ await this.layout('report/index_archive.ejs', renderData, 'stage/audit_modal.ejs');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
async getReportArchive(ctx) {
|
|
async getReportArchive(ctx) {
|