contacts.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. onHide(options) {
  78. console.log(323232)
  79. },
  80. onShow() {
  81. console.log(111111)
  82. this.getContacts()
  83. // console.log('customerId', this.customerId)
  84. },
  85. mounted() {
  86. this.getContacts()
  87. },
  88. methods: {
  89. async getContacts() {
  90. let params = {
  91. custId: this.customerId,
  92. cuctName: this.cuctName,
  93. pageNum: 1,
  94. pageSize: 9999,
  95. }
  96. const [err, res] = await to(userApi.getContact(params))
  97. if (err) return
  98. if (res.code == 200) this.contactList = res.data.list || []
  99. },
  100. },
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .contact-main {
  105. height: 100%;
  106. .search-container {
  107. display: flex;
  108. align-items: center;
  109. padding-bottom: 20rpx;
  110. border-bottom: 1px solid #ccc;
  111. .search-input {
  112. flex: 1;
  113. }
  114. .search-btn {
  115. text-align: center;
  116. line-height: 60rpx;
  117. border-radius: 12rpx;
  118. width: 100rpx;
  119. height: 60rpx;
  120. font-size: 26rpx;
  121. margin: 0 0 0 12rpx;
  122. background: $u-primary;
  123. color: #ffffff;
  124. }
  125. }
  126. .todo-list {
  127. height: 100%;
  128. overflow: auto;
  129. padding: 20rpx 20rpx 0;
  130. .contact-item {
  131. padding: 20rpx;
  132. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  133. border-radius: 8px;
  134. margin: 30rpx 0;
  135. .label,
  136. .val {
  137. font-size: 28rpx;
  138. padding-bottom: 14rpx;
  139. }
  140. .label {
  141. color: #646464;
  142. }
  143. }
  144. }
  145. }
  146. </style>