index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 './components/Hos.vue'
  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 { data } = resp
  86. this.viewData = data
  87. this.mapCenter = [data.hosWzjd, data.hosWzwd]
  88. }).catch((error) => {
  89. console.log(error)
  90. })
  91. },
  92. handleEdit() {
  93. this.$refs['EditHosInfo'].showModel()
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .content-container{
  100. height: calc(98vh - var(--navHeight));
  101. .header{
  102. font-size: 16px;
  103. font-weight: bold;
  104. color: #FFFFFF;
  105. .name{
  106. font-size: 20px;
  107. }
  108. }
  109. .hd-details {
  110. color: #FFFFFF;
  111. }
  112. p {
  113. color: #FFFFFF;
  114. font-size: 12px;
  115. margin: 0;
  116. padding: 0;
  117. line-height: 1.8;
  118. &.desc{
  119. font-size: 14px;
  120. }
  121. &.row{
  122. span{
  123. width: 33.3%;
  124. display: inline-block;
  125. text-align: left;
  126. }
  127. }
  128. }
  129. }
  130. </style>