advance_controller.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. 'use strict'
  2. module.exports = app => {
  3. class advanceController extends app.BaseController {
  4. /**
  5. * 开工预付款页面(AJAX) GET
  6. * @param {Object} ctx 全局上下文
  7. */
  8. async index(ctx) {
  9. const renderData = {
  10. type: 'start',
  11. advancePayTotal: ctx.tender.info.deal_param.startAdvance
  12. }
  13. await this.layout('advance/index.ejs', renderData, 'advance/modal.ejs')
  14. }
  15. /**
  16. * 材料预付款页面(AJAX) GET
  17. * @param {Object} ctx 全局上下文
  18. */
  19. async materialInfo(ctx) {
  20. const renderData = {
  21. type: 'material',
  22. advancePayTotal: ctx.tender.info.deal_param.materialAdvance
  23. }
  24. await this.layout('advance/index.ejs', renderData, 'advance/modal.ejs')
  25. }
  26. /**
  27. * 预付款详情页(AJAX) GET
  28. * @param {Object} ctx 全局上下文
  29. */
  30. async detail(ctx) {
  31. const renderData = {}
  32. await this.layout('advance/detail.ejs', renderData)
  33. }
  34. /**
  35. * 开始新一期(AJAX) GET
  36. * @param {Object} ctx 全局上下文
  37. */
  38. async add(ctx) {
  39. const type = ctx.params.type
  40. console.log(ctx.tender)
  41. const renderData = {
  42. isEdited: true
  43. }
  44. await this.layout('advance/detail.ejs', renderData)
  45. }
  46. }
  47. return advanceController
  48. }