index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="page-wrap">
  3. <view class="item-row" v-for="(item, index) in enterpriseList" :key="index">
  4. <view class="wrap">
  5. <view class="name">{{ item.customerName }}</view>
  6. <view class="text">信用代码:{{ item.customerUsci || '--' }}</view>
  7. <view class="text">企业认证:{{ item.status }}</view>
  8. <view class="text">团队成员:{{ item.staffSize ? filterDict(item.staffSize, companySizeList) : '--' }}</view>
  9. </view>
  10. <button class="btn" @click="handleOpenInfo(item.customerId)">企业资料</button>
  11. <button class="btn">删除</button>
  12. </view>
  13. <button class="add-btn" @click="handleOpenAddEnterprise">+ 添加企业</button>
  14. </view>
  15. </template>
  16. <script>
  17. import systemService from '@/api/system.js';
  18. import enterpriseService from '@/api/enterprise.js';
  19. import { filterDict } from '@/utils/util.js';
  20. export default {
  21. data() {
  22. return {
  23. enterpriseList: [],
  24. companySizeList: []
  25. };
  26. },
  27. onLoad() {
  28. this.getSizeConfig();
  29. this.getEnterpriseList();
  30. uni.$on('onUpdateEnterprise', () => {
  31. this.getEnterpriseList();
  32. });
  33. },
  34. onPullDownRefresh(){
  35. this.getEnterpriseList()
  36. },
  37. methods: {
  38. // 获取企业列表
  39. async getEnterpriseList() {
  40. const { rows } = await enterpriseService.getEnterpriseList();
  41. this.enterpriseList = rows;
  42. uni.stopPullDownRefresh();
  43. },
  44. // 获取企业人员规模配置
  45. async getSizeConfig() {
  46. const { rows: companySizeList } = await systemService.getDict('biz_company_size');
  47. this.companySizeList = companySizeList;
  48. },
  49. handleOpenInfo(id) {
  50. uni.navigateTo({
  51. url: 'info?id=' + id
  52. });
  53. },
  54. handleOpenAddEnterprise() {
  55. uni.navigateTo({
  56. url: 'info'
  57. });
  58. },
  59. filterDict
  60. }
  61. };
  62. </script>
  63. <style lang="scss" scoped>
  64. .page-wrap {
  65. padding: 13.74rpx 0;
  66. }
  67. .item-row {
  68. background: #fff;
  69. margin-bottom: 13.74rpx;
  70. height: 178.57rpx;
  71. padding: 0 27.47rpx;
  72. box-sizing: border-box;
  73. display: flex;
  74. align-items: center;
  75. .wrap {
  76. flex: 1;
  77. }
  78. .name {
  79. font-size: 32.97rpx;
  80. white-space: nowrap;
  81. overflow: hidden;
  82. text-overflow: ellipsis;
  83. margin-bottom: 6.87rpx;
  84. }
  85. .text {
  86. font-size: 27.47rpx;
  87. color: #999;
  88. }
  89. .btn {
  90. background: none;
  91. border: none;
  92. font-size: 27.47rpx;
  93. color: #f97631;
  94. white-space: nowrap;
  95. padding: 0;
  96. margin-left: 13.74rpx;
  97. }
  98. }
  99. .add-btn {
  100. margin-top: 27.47rpx;
  101. font-size: 27.47rpx;
  102. color: #00bcd2;
  103. height: 82.42rpx;
  104. line-height: 82.42rpx;
  105. display: block;
  106. text-align: left;
  107. padding: 0 0 0 54.95rpx;
  108. background: #fff;
  109. border: none;
  110. border-radius: 13.74rpx;
  111. }
  112. </style>