enterpriseInfoItem.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view>
  3. <view class="font-md text-dark font-weight">企业信息</view>
  4. <view class="border-bottom py-2 d-flex j-sb">
  5. <view class="d-flex a-center w-100">
  6. <text class="text-primary">企业名称:</text>
  7. <song-data-picker class="flex-1" style="width: 100%;" @click.native="songClick" :clearIcon="false"
  8. :readonly="!(!readOnlyFlag && userData.enterpriseCadreFlag)" :localdata="companyColumn" placeholder="请选择企业"
  9. popup-title="请选择企业" @nodeclick="onnodeclick">
  10. <slot>
  11. <view class="d-flex a-center j-sb">
  12. <view class="">
  13. <text v-show="itemDate.companyName" class="text-secondary">{{itemDate.companyName}}</text>
  14. <text v-show="!itemDate.companyName" class="font-md" style="color: rgb(192, 196, 204);">请选择企业</text>
  15. </view>
  16. <u-icon v-if="!readOnlyFlag && userData.enterpriseCadreFlag" name="arrow-down" color="#666666 " size="20">
  17. </u-icon>
  18. </view>
  19. </slot>
  20. </song-data-picker>
  21. </view>
  22. </view>
  23. <view class="border-bottom py-2">
  24. <text class="text-primary">属地:</text>
  25. <text class="text-secondary">{{itemDate.areaChargeNameLabel}}</text>
  26. </view>
  27. <view class="border-bottom py-2">
  28. <text class="text-primary">企业负责人:</text>
  29. <text class="text-secondary">{{itemDate.userName}}</text>
  30. </view>
  31. <view class="border-bottom py-2">
  32. <text class="text-primary">负责人号码:</text>
  33. <text class="text-secondary">{{itemDate.userMobile}}</text>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {enterpriseVisit} from "@/api/dzf/enterpriseVisit.js";
  39. export default {
  40. props: {
  41. enterpriseInfoData: {
  42. type: Object,
  43. default: () => {}
  44. },
  45. readOnlyFlag: {
  46. type: Boolean,
  47. default: false
  48. },
  49. status: {
  50. type: String,
  51. default: ''
  52. },
  53. userInfo: {
  54. type: Object,
  55. default: () => {}
  56. }
  57. },
  58. data() {
  59. return {
  60. companyColumn: []
  61. }
  62. },
  63. computed: {
  64. itemDate() {
  65. return this.enterpriseInfoData
  66. },
  67. userData() {
  68. return this.userInfo
  69. }
  70. },
  71. mounted() {
  72. if (this.readOnlyFlag) return
  73. this.getCompanyList()
  74. },
  75. methods: {
  76. // 检索功能
  77. mySearchFn(searchList, searchWord) {
  78. // console.log(searchList)
  79. // console.log(searchWord)
  80. // if(!searchWord){
  81. // return searchList
  82. // }
  83. return searchList.filter(x => x.text.includes(searchWord));
  84. },
  85. // 获取挂钩干部企业列表
  86. async getCompanyList() {
  87. const data = await enterpriseVisit.fetchOwnManagerEnterprise()
  88. const tempData = (data || []).map(ele => {
  89. const obj = ele
  90. Object.assign(obj, {
  91. text: ele.companyName,
  92. value: ele.enterpriseId
  93. })
  94. return obj
  95. })
  96. this.companyColumn = data || []
  97. if (this.status) return
  98. this.$emit('updateCompanyInfo', tempData[0])
  99. },
  100. // 企业选择确认操作
  101. onnodeclick(ele) {
  102. console.log('ele', ele);
  103. this.$emit('updateCompanyInfo', ele)
  104. },
  105. // 问题类型--->点击
  106. songClick() {
  107. uni.hideKeyboard()
  108. },
  109. }
  110. }
  111. </script>
  112. <style>
  113. </style>