details.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <div class='flex flex-justify-start full-height'>
  3. <div class="full-height">
  4. <left-bar :data="data" :stage="stage" @change="change" @typeChange="typeChange"/>
  5. </div>
  6. <div class="full-height full-width white-bg padding-left padding-top" style="margin-left: 300px">
  7. <proinfo v-if="type === 0" :data="data" :issue="list" @refInfo="proInfo" @refresh="issueList"/>
  8. <folder_info v-else :id="id" :projectStageId="projectStageId"/>
  9. </div>
  10. </div>
  11. </template>
  12. <route>
  13. {
  14. name:'项目详情',
  15. }
  16. </route>
  17. <script>
  18. import leftBar from './component/left_bar.vue'
  19. import proinfo from './component/proinfo.vue'
  20. import folder_info from './component/folder_info.vue'
  21. export default {
  22. name: 'test',
  23. components: {leftBar, proinfo, folder_info},
  24. data() {
  25. return {
  26. type: 0,
  27. id: '',
  28. data: {},
  29. list: [],
  30. stage: [],
  31. projectStageId: ''
  32. }
  33. },
  34. created() {
  35. this.id = this.$route.query.id
  36. this.proInfo()
  37. this.issueList()
  38. this.getStage()
  39. },
  40. methods: {
  41. typeChange() {
  42. this.type = 0
  43. },
  44. proInfo() {
  45. this.$api.project.projectInfo(this.id).then(res => {
  46. if (res.code === 200) {
  47. this.data = res.data
  48. }
  49. })
  50. },
  51. issueList() {
  52. this.$api.project.issuanceDetail({projectId: this.id}).then(res => {
  53. if (res.code === 200) {
  54. this.list = res.data.records
  55. }
  56. })
  57. },
  58. getStage() {
  59. this.$api.project.includeStage({projectId: this.id}).then(res => {
  60. console.log(res)
  61. if (res.code === 200) {
  62. this.stage = res.data.map(e => {
  63. let newItem = {}
  64. newItem.title = e.stageName
  65. newItem.count = e.fileNumber
  66. newItem.id = e.id
  67. return newItem
  68. })
  69. }
  70. })
  71. },
  72. change(res) {
  73. this.type = 1
  74. this.projectStageId = this.stage[res].id
  75. },
  76. }
  77. }
  78. </script>
  79. <style scoped>
  80. </style>