detail.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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')" @teSubmit="teSubmit" v-if="active == '1'"></one>
  23. <two :form="form" @up="up('1')" @next="next('3')" @teSubmit="teSubmit" v-else-if="active == '2'"></two>
  24. <thr :form="form" @up="up('2')" @next="next('4')" @teSubmit="teSubmit" v-else-if="active == '3'"></thr>
  25. <four :form="form" @up="up('3')" @next="next('5')" @teSubmit="teSubmit" v-else-if="active == '4'"></four>
  26. <five :form="form" @up="up('4')" @next="next('6')" @teSubmit="teSubmit" v-else-if="active == '5'"></five>
  27. <six :form="form" @up="up('5')" @next="next('7')" @teSubmit="teSubmit" v-else-if="active == '6'"></six>
  28. <seven :form="form" @up="up('6')" @next="next('8')" @teSubmit="teSubmit" v-else-if="active == '7'"></seven>
  29. <eight :form="form" @up="up('7')" @onSubmit="onSubmit" @teSubmit="teSubmit" 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. page5: '',
  65. },
  66. },
  67. };
  68. },
  69. async created() {
  70. await this.search();
  71. },
  72. methods: {
  73. ...achieveApply(['fetch', 'update']),
  74. async search() {
  75. if (this.id) {
  76. let res = await this.fetch(this.id);
  77. if (this.$checkRes(res)) {
  78. this.$set(this, 'form', res.data);
  79. }
  80. }
  81. },
  82. back() {
  83. this.$router.push({ path: '/adminCate' });
  84. },
  85. // 提交
  86. async onSubmit({ data }) {
  87. data.status = '6';
  88. let res = await this.update(data);
  89. if (this.$checkRes(res)) {
  90. this.$message({
  91. message: '信息归档成功',
  92. type: 'success',
  93. });
  94. this.back();
  95. }
  96. },
  97. // 临时保存
  98. async teSubmit({ data }) {
  99. let res = await this.update(data);
  100. if (this.$checkRes(res)) {
  101. this.$message({
  102. message: '信息临时保存成功',
  103. type: 'success',
  104. });
  105. this.search();
  106. // this.back();
  107. }
  108. },
  109. // 上一步
  110. up(type) {
  111. this.active = parseInt(type);
  112. },
  113. // 下一步
  114. next(type) {
  115. this.active = parseInt(type);
  116. },
  117. },
  118. computed: {
  119. ...mapState(['user']),
  120. id() {
  121. return this.$route.query.id;
  122. },
  123. },
  124. metaInfo() {
  125. return { title: this.$route.meta.title };
  126. },
  127. watch: {},
  128. };
  129. </script>
  130. <style lang="less" scoped>
  131. .main {
  132. .top {
  133. text-align: right;
  134. margin: 0 0 15px 0;
  135. }
  136. .down {
  137. .setp {
  138. margin: 0 0 10px 0;
  139. /deep/.el-step__title {
  140. font-size: 14px;
  141. line-height: 20px;
  142. padding: 15px 0 0 0;
  143. }
  144. }
  145. }
  146. }
  147. </style>