detail.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div id="detail">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="top">
  6. <el-button type="primary" size="mini" @click="back">返回</el-button>
  7. </el-col>
  8. <el-col :span="24" class="down">
  9. <el-col :span="24" class="setp">
  10. <el-steps :active="active" align-center>
  11. <el-step title="吉林省科技成果评价证书"> </el-step>
  12. <el-step title="(一)成果评价基础信息"> </el-step>
  13. <el-step title="(二)研究(开发,转化,实施,建设)内筒和技术(创新点)"></el-step>
  14. <el-step title="(三)成果取得的技术,经济指标(目标)"></el-step>
  15. <el-step title="(四)成果参加人员"></el-step>
  16. <el-step title="(五)现场测试(监测,测产)意见"></el-step>
  17. <el-step title="(六)评价意见"></el-step>
  18. <el-step title="(七)评价专家组名单"></el-step>
  19. </el-steps>
  20. </el-col>
  21. <el-col :span="24" class="form">
  22. <one :form="form" @next="next('2')" v-if="active == '1'"></one>
  23. <two :form="form" @up="up('1')" @next="next('3')" v-else-if="active == '2'"></two>
  24. <thr :form="form" @up="up('2')" @next="next('4')" v-else-if="active == '3'"></thr>
  25. <four :form="form" @up="up('3')" @next="next('5')" v-else-if="active == '4'"></four>
  26. <five :form="form" @up="up('4')" @next="next('6')" v-else-if="active == '5'"></five>
  27. <six :form="form" @up="up('5')" @next="next('7')" v-else-if="active == '6'"></six>
  28. <seven :form="form" @up="up('6')" @next="next('8')" v-else-if="active == '7'"></seven>
  29. <eight :form="form" @up="up('7')" @onSubmit="onSubmit" v-else-if="active == '8'"></eight>
  30. </el-col>
  31. </el-col>
  32. </el-col>
  33. </el-row>
  34. </div>
  35. </template>
  36. <script>
  37. import one from './parts/one.vue';
  38. import two from './parts/two.vue';
  39. import thr from './parts/thr.vue';
  40. import four from './parts/four.vue';
  41. import five from './parts/five.vue';
  42. import six from './parts/six.vue';
  43. import seven from './parts/seven.vue';
  44. import eight from './parts/eight.vue';
  45. import { mapState, createNamespacedHelpers } from 'vuex';
  46. const { mapActions: achieveApply } = createNamespacedHelpers('achieveApply');
  47. export default {
  48. name: 'detail',
  49. props: {},
  50. components: { one, two, thr, four, five, six, seven, eight },
  51. data: function() {
  52. return {
  53. // 成果详情
  54. active: 1,
  55. form: {
  56. // 基本信息
  57. basic: {},
  58. // 内容简介
  59. brief: {},
  60. // 参加人员
  61. research: [],
  62. // 会审照片
  63. file: {},
  64. },
  65. };
  66. },
  67. async created() {
  68. await this.search();
  69. },
  70. methods: {
  71. ...achieveApply(['fetch', 'update']),
  72. async search() {
  73. if (this.id) {
  74. let res = await this.fetch(this.id);
  75. if (this.$checkRes(res)) {
  76. this.$set(this, 'form', res.data);
  77. }
  78. }
  79. },
  80. back() {
  81. this.$router.push({ path: '/adminCate' });
  82. },
  83. // 提交
  84. async onSubmit({ data }) {
  85. console.log(data);
  86. let res = await this.update(data);
  87. if (this.$checkRes(res)) {
  88. console.log(res);
  89. }
  90. },
  91. // 上一步
  92. up(type) {
  93. this.active = parseInt(type);
  94. },
  95. // 下一步
  96. next(type) {
  97. this.active = parseInt(type);
  98. },
  99. },
  100. computed: {
  101. ...mapState(['user']),
  102. id() {
  103. return this.$route.query.id;
  104. },
  105. },
  106. metaInfo() {
  107. return { title: this.$route.meta.title };
  108. },
  109. watch: {},
  110. };
  111. </script>
  112. <style lang="less" scoped>
  113. .main {
  114. .top {
  115. text-align: right;
  116. margin: 0 0 15px 0;
  117. }
  118. .down {
  119. .setp {
  120. margin: 0 0 10px 0;
  121. /deep/.el-step__title {
  122. font-size: 14px;
  123. line-height: 20px;
  124. padding: 15px 0 0 0;
  125. }
  126. }
  127. }
  128. }
  129. </style>