review.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <div class="doctor-edit">
  3. <el-form ref="formRef" class="doctor-edit-form" label-width="140px" :model="formData" :rules="formRules">
  4. <el-form-item label="培训师姓名:">
  5. <span>{{ doctorInfo.doctorName }}</span>
  6. </el-form-item>
  7. <el-form-item label="从业资格证编号:">
  8. <span>{{ doctorInfo.certificateNo }}</span>
  9. </el-form-item>
  10. <el-form-item label="所在机构:" prop="clubName">
  11. <span>{{ doctorInfo.clubName }}</span>
  12. </el-form-item>
  13. <el-form-item label="培训师照片:" prop="doctorImage">
  14. <el-image
  15. style="width: 140px; height: 140px"
  16. :src="doctorInfo.doctorImage"
  17. :preview-src-list="doctorImgList"
  18. />
  19. </el-form-item>
  20. <el-form-item label="轮播图:" prop="banner">
  21. <el-image
  22. v-for="(image,index) in doctorInfo.bannerList"
  23. :key="index"
  24. style="width: 140px; height: 140px"
  25. :src="image"
  26. :preview-src-list="bannerImgList"
  27. />
  28. </el-form-item>
  29. <el-form-item label="操作培训师标签">
  30. <span v-text="doctorInfo.tagList.join()" />
  31. </el-form-item>
  32. <el-form-item label="自定义属性:" prop="paramList">
  33. <div class="device-section">
  34. <div v-for="(param, index) in doctorInfo.paramList" :key="index" class="section">
  35. <el-form label-width="90px">
  36. <el-form-item label="字段名称:">
  37. <span>{{ param.name }}</span>
  38. </el-form-item>
  39. <el-form-item label="字段内容:">
  40. <span>{{ param.content }}</span>
  41. </el-form-item>
  42. </el-form>
  43. </div>
  44. </div>
  45. </el-form-item>
  46. <!-- 审核表单 -->
  47. <el-form-item label="审核状态:">
  48. <el-radio-group v-model="formData.auditStatus">
  49. <el-radio :label="1">通过</el-radio>
  50. <el-radio :label="0">不通过</el-radio>
  51. </el-radio-group>
  52. </el-form-item>
  53. <el-form-item v-if="formData.auditStatus!==1" prop="invalidReason" label="原因:">
  54. <el-input v-model="formData.invalidReason" type="textarea" placeholder="请说明原因" />
  55. </el-form-item>
  56. <el-form-item>
  57. <el-button type="info" @click="$_back">返回</el-button>
  58. <el-button type="primary" @click="submit">提交</el-button>
  59. </el-form-item>
  60. </el-form>
  61. </div>
  62. </template>
  63. <script>
  64. import { mapGetters } from 'vuex'
  65. import { doctorFormData, doctorAudit } from '@/api/doctor'
  66. export default {
  67. data() {
  68. return {
  69. isRequest: true,
  70. doctorId: '',
  71. point: {},
  72. disabled: false,
  73. doctorInfo: {
  74. doctorName: '',
  75. certificateNo: '',
  76. clubName: '',
  77. bannerList: '',
  78. doctorImage: '',
  79. tagList: [],
  80. paramsList: []
  81. },
  82. formData: {
  83. auditBy: '', // 审核人id
  84. doctorId: '', // 商品id
  85. auditStatus: 1, // 商品审核状态
  86. invalidReason: '' // 审核信息
  87. },
  88. formRules: {
  89. invalidReason: { required: true, message: '不通过原因不能为空', tigger: 'blur' }
  90. },
  91. doctorImgList: [],
  92. bannerImgList: [],
  93. equipmentImgList: []
  94. }
  95. },
  96. computed: {
  97. ...mapGetters(['authUserId'])
  98. },
  99. created() {
  100. this.doctorId = this.formData.doctorId = parseInt(this.$route.query.id)
  101. this.initFormData()
  102. },
  103. methods: {
  104. // 表单数据回显
  105. initFormData() {
  106. doctorFormData({ doctorId: this.doctorId }).then(res => {
  107. this.setFormData(res.data)
  108. })
  109. },
  110. // 设置表单数据
  111. setFormData(data) {
  112. this.doctorInfo.doctorName = data.doctorName
  113. this.doctorInfo.certificateNo = data.certificateNo
  114. this.doctorInfo.clubName = data.clubName
  115. this.doctorInfo.bannerList = data.bannerList
  116. this.doctorInfo.doctorImage = data.doctorImage
  117. this.doctorInfo.tagList = data.tagList
  118. this.doctorInfo.paramList = data.paramList
  119. this.doctorImgList = [data.doctorImage]
  120. this.bannerImgList = data.bannerList
  121. },
  122. // 提交审核信息
  123. submit() {
  124. this.$refs.formRef.validate(valid => {
  125. if (valid) {
  126. this.isLoading = true
  127. // 指定审核人
  128. this.formData.auditBy = this.authUserId
  129. // 提交审核信息
  130. doctorAudit(this.formData).then(res => {
  131. if (res.code !== 0) return
  132. this.$message.success(res.data)
  133. this.$store.dispatch('tagsView/delView', this.$route)
  134. this.$router.back()
  135. }).finally(() => {
  136. this.isLoading = false
  137. })
  138. }
  139. })
  140. }
  141. }
  142. }
  143. </script>
  144. <style lang="scss" scoped>
  145. .doctor-edit{
  146. margin-bottom: 80px;
  147. }
  148. .doctor-edit-form {
  149. width: 650px;
  150. margin: 0 auto;
  151. margin-top: 80px;
  152. }
  153. .submit-btn {
  154. text-align: center;
  155. .el-button {
  156. width: 140px;
  157. }
  158. }
  159. .device-section {
  160. .section {
  161. position: relative;
  162. border: 1px solid #eee;
  163. padding: 25px 25px 0 16px;
  164. margin-bottom: 16px;
  165. .remove {
  166. position: absolute;
  167. right: 6px;
  168. top: 6px;
  169. font-size: 14px;
  170. cursor: pointer;
  171. background: #f56c6c;
  172. color: #fff;
  173. padding: 2px;
  174. border-radius: 50%;
  175. transition: all 0.2s;
  176. &:hover {
  177. background: red;
  178. }
  179. }
  180. }
  181. .el-form-item {
  182. padding-bottom: 25px;
  183. }
  184. }
  185. </style>