doctorDetail.vue 5.8 KB

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