review.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div class="page-form-container cate-review">
  3. <div class="row">
  4. <div class="col">设备名称:</div>
  5. <div class="col">{{ cateData.name }}</div>
  6. </div>
  7. <div class="row">
  8. <div class="col">设备图片:</div>
  9. <div class="col">
  10. <el-image style="width: 120px; height: 120px" :src="cateData.image" :preview-src-list="[cateData.image]" />
  11. </div>
  12. </div>
  13. <div class="row">
  14. <div class="col">所属品牌:</div>
  15. <div class="col">{{ cateData.brandName }}</div>
  16. </div>
  17. <div class="row">
  18. <div class="col">相关参数:</div>
  19. <div class="col">
  20. <template v-for="(param, index) in cateData.paramList">
  21. <div :key="index" class="param">
  22. <div class="label">{{ param.paramName }}:</div>
  23. <div class="content">{{ param.paramContent }}</div>
  24. </div>
  25. </template>
  26. </div>
  27. </div>
  28. <el-form ref="auditForm" label-width="112px" :model="auditForm" :rules="rules">
  29. <el-form-item label="审核:">
  30. <el-radio-group v-model="auditForm.auditStatus">
  31. <el-radio :label="1">通过</el-radio>
  32. <el-radio :label="0">不通过</el-radio>
  33. </el-radio-group>
  34. </el-form-item>
  35. <el-form-item v-if="auditForm.auditStatus === 0" label="原因:" prop="invalidReason">
  36. <el-input v-model="auditForm.invalidReason" type="textarea" :rows="3" />
  37. </el-form-item>
  38. <el-form-item>
  39. <el-button type="info" @click="$_back">返回</el-button>
  40. <el-button type="primary" @click="submit">提交</el-button>
  41. </el-form-item>
  42. </el-form>
  43. </div>
  44. </template>
  45. <script>
  46. import { auditProductCate, fetchAuthProductFormData } from '@/api/product'
  47. import { mapGetters } from 'vuex'
  48. export default {
  49. data() {
  50. return {
  51. isLoading: false,
  52. auditForm: {
  53. auditBy: '', // 审核人id
  54. productTypeId: '', // 机构id
  55. auditStatus: 1, // 审核状态
  56. invalidReason: '' // 审核信息
  57. },
  58. rules: {
  59. invalidReason: { required: true, message: '不通过原因不能为空', tigger: 'blur' }
  60. },
  61. cateData: {}
  62. }
  63. },
  64. computed: {
  65. ...mapGetters(['authUserId'])
  66. },
  67. created() {
  68. this.getDetail()
  69. },
  70. methods: {
  71. // 数据回显
  72. async getDetail() {
  73. this.auditForm.productTypeId = this.$route.query.id
  74. // getAuthFormData({ authId: this.auditForm.authId }).then((res) => {
  75. // this.clubInfo = { ...this.clubInfo, ...res.data }
  76. // })
  77. try {
  78. const { data } = await fetchAuthProductFormData({ productTypeId: this.auditForm.productTypeId })
  79. this.cateData = data
  80. } catch (error) {
  81. console.log(error)
  82. }
  83. },
  84. async onAudit() {
  85. this.isLoading = true
  86. this.auditForm.auditBy = this.authUserId
  87. try {
  88. const res = await auditProductCate(this.auditForm)
  89. this.$message.success(res.data)
  90. this.$store.dispatch('tagsView/delView', this.$route)
  91. this.$router.back()
  92. } catch (error) {
  93. console.log(error)
  94. } finally {
  95. this.isLoading = false
  96. }
  97. },
  98. // 提交审核信息
  99. async submit() {
  100. try {
  101. await this.$refs.auditForm.validate()
  102. await this.onAudit()
  103. } catch (error) {
  104. console.log(error)
  105. }
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .row {
  112. display: flex;
  113. justify-content: flex-start;
  114. align-items: flex-start;
  115. margin-bottom: 25px;
  116. .col {
  117. font-size: 14px;
  118. color: #333;
  119. &:first-child {
  120. min-width: 100px;
  121. text-align: right;
  122. margin-right: 8px;
  123. font-weight: bold;
  124. color: #666;
  125. }
  126. .param {
  127. display: grid;
  128. grid-template-columns: repeat(2, 1fr);
  129. // grid-template-rows: repeat(2, 1fr);
  130. grid-column-gap: 0px;
  131. grid-row-gap: 0px;
  132. div {
  133. padding-bottom: 16px;
  134. text-align: left;
  135. &:first-child {
  136. text-align: right;
  137. }
  138. }
  139. }
  140. .el-image {
  141. margin-left: 12px;
  142. &:first-child {
  143. margin-left: 0;
  144. }
  145. }
  146. }
  147. }
  148. .el-button {
  149. width: 120px;
  150. }
  151. </style>