file_controller.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict';
  2. /**
  3. *
  4. *
  5. * @author Mai
  6. * @date 2021/10/27
  7. * @version
  8. */
  9. const auditConst = require('../const/audit');
  10. module.exports = app => {
  11. class BudgetController extends app.BaseController {
  12. /**
  13. * 概算投资
  14. *
  15. * @param ctx
  16. * @returns {Promise<void>}
  17. */
  18. async index(ctx) {
  19. try {
  20. const renderData = {
  21. jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.file.index),
  22. auditConst,
  23. };
  24. renderData.projectList = await ctx.service.subProject.getFileProject(ctx.session.sessionProject.id, ctx.session.sessionUser.accountId, ctx.session.sessionUser.is_admin);
  25. renderData.tenderList = await ctx.service.tender.getList4Select('stage');
  26. renderData.categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
  27. await this.layout('file/index.ejs', renderData, 'file/modal.ejs');
  28. } catch (err) {
  29. ctx.log(err);
  30. }
  31. }
  32. }
  33. return BudgetController;
  34. };