AgencyDetail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <div class="create-container">
  3. <div class="create-body" v-loading="loading" style="width: 100%">
  4. <div class="title" v-if="this.type == 0">测评机构信息</div>
  5. <div class="title" v-else>入驻品牌机构信息</div>
  6. <el-form :model="authentication" ref="authentication" label-width="12%" class="demo-report">
  7. <el-form-item prop="agencyPhoto" label="机构logo">
  8. <span>
  9. <el-image
  10. style="width: 100px;"
  11. :src="authentication.agencyPhoto==null?defaultValue.image:authentication.agencyPhoto"
  12. fit="scale-down"></el-image>
  13. </span>
  14. </el-form-item>
  15. <el-form-item label="机构名称" prop="evaluationAgencyName">
  16. <span>{{authentication.evaluationAgencyName}}</span>
  17. </el-form-item>
  18. <el-form-item label="法人名称" prop="legalPersonName">
  19. <span>{{authentication.legalPersonName}}</span>
  20. </el-form-item>
  21. <!-- <el-form-item label="认证状态" prop="name">-->
  22. <!-- <el-tag :type="authentication.authStatus.style">{{authentication.authStatus.text}}</el-tag>-->
  23. <!-- </el-form-item>-->
  24. <el-form-item label="地址" prop="address"
  25. v-if="this.authentication.address != null && this.authentication.address != ''">
  26. <span>{{authentication.address}}</span>
  27. </el-form-item>
  28. <!-- <el-form-item label="测评机构能力" prop="evaluationAgencyAbilityList">-->
  29. <!-- <span v-for="(item,index) in authentication.evaluationAgencyAbilityList"-->
  30. <!-- :key="index"><span class="badge">{{item}}</span></span>-->
  31. <!-- </el-form-item>-->
  32. <!-- <el-form-item label="测评机构资源" prop="evaluationAgencyResourceList">-->
  33. <!-- <span v-for="item in authentication.evaluationAgencyResourceList" :key="item.id">-->
  34. <!-- 资源类型:{{item.type}};&nbsp;&nbsp;资源名称:{{item.name}};&nbsp;&nbsp;资源总量:{{item.totalNum}};&nbsp;&nbsp;可用资源:{{item.availableNum}}<br/>-->
  35. <!-- </span>-->
  36. <!-- </el-form-item>-->
  37. <el-form-item label="接包数量" prop="taskCount" v-if="this.type == 0">
  38. <span>{{authentication.taskCount}}</span>
  39. </el-form-item>
  40. <el-form-item label="认证时间" prop="checkTime">
  41. <span>{{dateFormat(new Date(authentication.checkTime),'yyyy-MM-dd HH:mm:ss')}}</span>
  42. </el-form-item>
  43. <el-form-item>
  44. <div class="btn btn-medium btn-info" @click="back()">返回</div>
  45. </el-form-item>
  46. </el-form>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import Http from '@/js/http.js'
  52. import Apis from '@/js/api.js'
  53. import {notify} from '@/constants/index'
  54. import {
  55. getAllReportTypes,
  56. defaultValue,
  57. storageGet,
  58. getAgencyAuthInfoCommon,
  59. getAllAgencyResourceTypes,
  60. getAllServiceTypes,
  61. } from '@/js/index'
  62. export default {
  63. name: 'AgencyDetail',
  64. components: {},
  65. data() {
  66. return {
  67. user: {},
  68. loading: false,
  69. type: 0,
  70. userId: 0,
  71. resourceTypes: [],
  72. serviceTypes: [],
  73. defaultValue:defaultValue,
  74. authentication: {
  75. mobile: '',
  76. evaluationAgencyName: '',
  77. // bankAccount: '',
  78. address: '',
  79. evaluationAgencyAbilityList: [],
  80. evaluationAgencyResourceList: [],
  81. authStatus: {},
  82. legalPersonName: '',
  83. checkTime: '',
  84. agencyPhoto: defaultValue.image,
  85. explain: '',
  86. taskCount: 0
  87. },
  88. }
  89. },
  90. mounted() {
  91. this.$nextTick(() => {
  92. this.init()
  93. })
  94. },
  95. methods: {
  96. init() {
  97. this.userId = this.$route.params.id
  98. this.type = this.$route.params.type
  99. this.setServiceTypes()
  100. this.setResourceTypes()
  101. this.getAuthInfo()
  102. },
  103. back() {
  104. this.$router.go(-1);
  105. },
  106. //加载数据
  107. getAuthInfo() {
  108. this.showLoading()
  109. getAgencyAuthInfoCommon(this.userId, this.getAuthInfoSuccess, this.getAuthInfoFail)
  110. },
  111. getAuthInfoSuccess(res) {
  112. this.hideLoading()
  113. this.authentication.agencyPhoto = res.data.agencyPhoto == null ? defaultValue.image : res.data.agencyPhoto
  114. this.authentication.evaluationAgencyName = res.data.evaluationAgencyName == null ? '暂未填写' : res.data.evaluationAgencyName
  115. this.authentication.evaluationAgencyAbilityList = res.data.evaluationAgencyAbilityList == null ? [] : res.data.evaluationAgencyAbilityList
  116. this.authentication.evaluationAgencyResourceList = res.data.evaluationAgencyResourceList == null ? [] : res.data.evaluationAgencyResourceList
  117. // this.authentication.bankAccount = res.data.bankAccount == null ? '暂未填写' : res.data.bankAccount
  118. this.authentication.address = res.data.address == null ? '暂未填写' : res.data.address
  119. this.authentication.authStatus = res.data.authStatus
  120. this.authentication.legalPersonName = res.data.legalPersonName == null ? '暂未填写' : res.data.legalPersonName
  121. // this.authentication.explain = res.data.explain
  122. this.authentication.taskCount = res.data.taskCount
  123. this.authentication.checkTime = res.data.checkTime
  124. },
  125. getAuthInfoFail(error) {
  126. this.hideLoading()
  127. notify('error', '加载认证信息失败:' + error.data)
  128. },
  129. //设置测试类型
  130. setServiceTypes() {
  131. getAllServiceTypes().then((res) => {
  132. this.serviceTypes = res
  133. }).catch((error) => {
  134. notify('error', '机构能力加载失败')
  135. })
  136. },
  137. //设置机构资源类型
  138. setResourceTypes() {
  139. this.resourceTypes = getAllAgencyResourceTypes()
  140. },
  141. setUserInfo() {
  142. this.user = storageGet('user')
  143. },
  144. showLoading() {
  145. this.loading = true
  146. },
  147. hideLoading() {
  148. this.loading = false
  149. },
  150. dateFormat (date, format) {
  151. date = new Date(date)
  152. let o = {
  153. 'M+' : date.getMonth() + 1, //month
  154. 'd+' : date.getDate(), //day
  155. 'H+' : date.getHours(), //hour+8小时
  156. 'm+' : date.getMinutes(), //minute
  157. 's+' : date.getSeconds(), //second
  158. 'q+' : Math.floor((date.getMonth() + 3) / 3), //quarter
  159. 'S' : date.getMilliseconds() //millisecond
  160. }
  161. if (/(y+)/.test(format)){
  162. format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
  163. }
  164. for (let k in o)
  165. if (new RegExp('(' + k + ')').test(format))
  166. format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length));
  167. return format;
  168. }
  169. },
  170. watch: {
  171. agencyType(val) {
  172. this.agencyType = val
  173. }
  174. }
  175. }
  176. </script>
  177. <style>
  178. .demo {
  179. font-size: 32px;
  180. }
  181. </style>