index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div class="content-container">
  3. <vuescroll :ops="ops" style="height:100%">
  4. <el-card class="box-card m-bottom-15" shadow="never">
  5. <div slot="header" class="header">
  6. <span class="name">{{ viewData.hosName }}</span>
  7. <span>({{ viewData.hosCatId|hosCatFilter }})</span>
  8. <span>【{{ viewData.hosGrade|hosGradeFilter }}】</span>
  9. <el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-edit" @click="handleEdit()">编辑</el-button>
  10. </div>
  11. <el-form label-position="right" label-width="170px">
  12. <el-form-item label="统一社会信用代码:">{{ viewData.hosTyshxydm }}</el-form-item>
  13. </el-form>
  14. <el-form label-position="right" label-width="170px">
  15. <el-form-item label="注册地址:">{{ viewData.hosZcdz }}</el-form-item>
  16. </el-form>
  17. <el-form label-position="right" label-width="170px">
  18. <el-form-item label="地址:">
  19. <el-amap v-if="mapCenter" vid="hosProFileMap" style="width:40%;height:240px" zoom="12" :center="mapCenter" :amap-manager="amapManager">
  20. <el-amap-marker
  21. :center="mapCenter"
  22. :position="mapCenter"
  23. :title="mapCenter"
  24. />
  25. </el-amap>
  26. </el-form-item>
  27. </el-form>
  28. <el-form label-position="right" label-width="170px">
  29. <el-form-item label="生产经营地址:">{{ viewData.hosScjydz }}</el-form-item>
  30. </el-form>
  31. <el-form label-position="right" label-width="170px">
  32. <el-form-item label="介绍:">{{ viewData.hosIntro }}</el-form-item>
  33. </el-form>
  34. <el-form label-position="right" label-width="170px">
  35. <el-form-item label="官网地址:"><el-link :href="viewData.hosWebsite" target="_blank">{{ viewData.hosWebsite }}</el-link></el-form-item>
  36. </el-form>
  37. </el-card>
  38. <hos ref="EditHosInfo" @formSuccess="getData" />
  39. </vuescroll>
  40. </div>
  41. </template>
  42. <script>
  43. import Vuescroll from 'vuescroll'
  44. import { getHosProfile } from '@/api/hos/hosProfileApi'
  45. import Hos from './hos'
  46. import { AMapManager } from 'vue-amap'
  47. const amapManager = new AMapManager()
  48. import comMixins from '@/mixin/commonMethodMixin'
  49. export default {
  50. name: 'ToDoDetails',
  51. components: { Vuescroll, Hos },
  52. mixins: [comMixins],
  53. data() {
  54. return {
  55. mapCenter: false,
  56. amapManager,
  57. ops: {
  58. bar: {
  59. keepShow: false,
  60. background: 'rgba(144, 147, 153, 0.4)',
  61. onlyShowBarOnScroll: false
  62. }
  63. },
  64. viewData: {
  65. hosName: '', // 企业名称
  66. hosCatId: 1,
  67. hosTyshxydm: '', // 统一社会信用代码
  68. hosWzjd: '', // 位置经度
  69. hosWzwd: '', // 位置经度
  70. hosZcdz: '', // 注册地址
  71. hosScjydz: '', // 生产/经营地址
  72. hosGrade: 2, // 规模情况
  73. hosWebsite: '',
  74. hosIntro: ''
  75. }
  76. }
  77. },
  78. mounted() {
  79. this.getData()
  80. },
  81. methods: {
  82. // 编辑窗口
  83. getData() {
  84. getHosProfile().then((resp) => {
  85. const { code, msg, data } = resp
  86. if (code === 200) {
  87. if (!data) return
  88. this.viewData = data
  89. this.mapCenter = [data.hosWzjd, data.hosWzwd]
  90. } else {
  91. this.$message.error(msg)
  92. }
  93. }).catch((error) => {
  94. console.log(error)
  95. })
  96. },
  97. handleEdit() {
  98. this.$refs['EditHosInfo'].showModel()
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .content-container{
  105. height: calc(98vh - var(--navHeight));
  106. .header{
  107. font-size: 16px;
  108. font-weight: bold;
  109. color: #FFFFFF;
  110. .name{
  111. font-size: 20px;
  112. }
  113. }
  114. .hd-details {
  115. color: #FFFFFF;
  116. }
  117. p {
  118. color: #FFFFFF;
  119. font-size: 12px;
  120. margin: 0;
  121. padding: 0;
  122. line-height: 1.8;
  123. &.desc{
  124. font-size: 14px;
  125. }
  126. &.row{
  127. span{
  128. width: 33.3%;
  129. display: inline-block;
  130. text-align: left;
  131. }
  132. }
  133. }
  134. }
  135. </style>