contacts.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <!--
  2. * @Author: liuzhenlin 461480418@qq.ocm
  3. * @Date: 2023-02-16 11:31:40
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-02-16 11:47:42
  6. * @Description: file content
  7. * @FilePath: \oms\pages\customer\components\contacts.vue
  8. -->
  9. <template>
  10. <view class="contact-main">
  11. <view class="search-container">
  12. <view class="search-input">
  13. <u-input
  14. clearable
  15. placeholderStyle="font-size:26rpx"
  16. :customStyle="{ height: '66rpx' }"
  17. v-model="cuctName"
  18. prefixIcon="search"
  19. prefixIconStyle="font-size: 22px;color: #909399"
  20. placeholder="请输入姓名"
  21. shape="circle"
  22. border="surround"
  23. @change="change"></u-input>
  24. </view>
  25. <view class="search-btn" @click="getContacts()">搜索</view>
  26. </view>
  27. <view class="todo-list">
  28. <u-empty mode="list" v-if="contactList.length == 0"></u-empty>
  29. <view v-else v-for="(v, i) in contactList" :key="i">
  30. <view class="contact-item">
  31. <view class="flex_l">
  32. <view class="label">姓名:</view>
  33. <view class="val">{{ v.cuctName }}</view>
  34. </view>
  35. <view class="flex_l">
  36. <view class="label">职务:</view>
  37. <view class="val">{{ v.postion }}</view>
  38. </view>
  39. <view class="flex_l">
  40. <view class="label">电话:</view>
  41. <view class="val">{{ v.telephone }}</view>
  42. </view>
  43. <view class="flex_l">
  44. <view class="label">是否是决策人:</view>
  45. <view class="val">{{ v.isDecision == '10' ? '是' : '否' }}</view>
  46. </view>
  47. <view class="flex_l">
  48. <view class="label">微信:</view>
  49. <view class="val">{{ v.wechat }}</view>
  50. </view>
  51. <view class="flex_l">
  52. <view class="label">邮箱:</view>
  53. <view class="val">{{ v.email }}</view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import to from 'await-to-js'
  62. import userApi from '../../../api/system/user'
  63. export default {
  64. name: 'OmsCustomerDetail',
  65. props: {
  66. customerId: {
  67. type: [String, Number],
  68. default: '0',
  69. },
  70. },
  71. data() {
  72. return {
  73. cuctName: '',
  74. contactList: [],
  75. }
  76. },
  77. onShow() {
  78. this.getContacts()
  79. },
  80. mounted() {
  81. this.getContacts()
  82. },
  83. methods: {
  84. async getContacts() {
  85. let params = {
  86. custId: this.customerId,
  87. cuctName: this.cuctName,
  88. pageNum: 1,
  89. pageSize: 9999,
  90. }
  91. const [err, res] = await to(userApi.getContact(params))
  92. if (err) return
  93. if (res.code == 200) this.contactList = res.data.list || []
  94. },
  95. },
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .contact-main {
  100. height: 100%;
  101. .search-container {
  102. display: flex;
  103. align-items: center;
  104. padding-bottom: 20rpx;
  105. border-bottom: 1px solid #ccc;
  106. .search-input {
  107. flex: 1;
  108. }
  109. .search-btn {
  110. text-align: center;
  111. line-height: 60rpx;
  112. border-radius: 12rpx;
  113. width: 100rpx;
  114. height: 60rpx;
  115. font-size: 26rpx;
  116. margin: 0 0 0 12rpx;
  117. background: $u-primary;
  118. color: #ffffff;
  119. }
  120. }
  121. .todo-list {
  122. height: 100%;
  123. overflow: auto;
  124. padding: 20rpx 20rpx 0;
  125. .contact-item {
  126. padding: 20rpx;
  127. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  128. border-radius: 8px;
  129. margin: 30rpx 0;
  130. .label,
  131. .val {
  132. font-size: 28rpx;
  133. padding-bottom: 14rpx;
  134. }
  135. .label {
  136. color: #646464;
  137. }
  138. }
  139. }
  140. }
  141. </style>