VisitReporDetails.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view>
  3. <view class="com-ul">
  4. <view class="com-li" v-for="(item, index) in visite_list" :key="index">
  5. <view class="cutomer-name clearfix">
  6. <view class="float_left ellipsis">
  7. <u-icon margin-left="10" name="account-fill" label-size="24" label-color="#2979ff" :label="item.name" color="#2979ff" size="28"></u-icon>
  8. </view>
  9. <view class="float_right staff-name">
  10. {{ staff_name}}
  11. <!-- <u-icon name="dianhua" color="#2d73ed" custom-prefix="custom-icon" /> -->
  12. </view>
  13. </view>
  14. <view class="cont">
  15. <view class="content">{{ item.content }}</view>
  16. <view v-if="item.picture" class="image-view"><image @click="previewImage(item.picture)" :src="item.picture" mode="aspectFill"></image></view>
  17. <view class="address clearfix">
  18. <view class="float_left">
  19. <block v-if="item.location">
  20. <u-icon name="map-fill" color="#6c6c6c" size="26"></u-icon>
  21. {{ item.location }}
  22. </block>
  23. <text v-else style="color: #999999;">无定位信息</text>
  24. </view>
  25. </view>
  26. <view class="time clearfix">
  27. <view class="float_left">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  28. <view v-if="item.managerMobile" class="float_right" @click="callPhone(item.managerMobile)">
  29. <!-- <u-icon @click="goPage(`/pagesT/customer/CommunicationLogsAdd?id=${item.id}`)"
  30. style="margin-right: 30rpx;" name="edit-pen-fill" color="#2d73ed" /> -->
  31. 客户电话:{{ item.managerMobile }}
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <u-loadmore :status="load_status" />
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. id: '',
  45. staff_name:'',
  46. visite_list: {},
  47. load_status: 'nomore',
  48. page: 1,
  49. pageSize: 10,
  50. total: 0
  51. };
  52. },
  53. onLoad(options) {
  54. this.id = options.id;
  55. this.staff_name = options.name;
  56. this.getCustomerVisitInfo();
  57. },
  58. onReachBottom() {
  59. if (this.total / this.pageSize > this.page) {
  60. this.page += 1;
  61. this.getCustomerVisitInfo();
  62. }
  63. },
  64. onPullDownRefresh() {
  65. this.page = 1;
  66. this.getCustomerVisitInfo();
  67. },
  68. methods: {
  69. previewImage(image) {
  70. // 预览图片
  71. uni.previewImage({
  72. urls: [image],
  73. longPressActions: {
  74. itemList: ['发送给朋友', '保存图片', '收藏'],
  75. success: function(data) {
  76. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  77. },
  78. fail: function(err) {
  79. console.log(err.errMsg);
  80. }
  81. }
  82. });
  83. },
  84. getCustomerVisitInfo() {
  85. this.load_status = 'loading';
  86. this.$u.api
  87. .getCustomerVisitInfo({
  88. staffId: this.id,
  89. page: this.page,
  90. pageSize: this.pageSize
  91. })
  92. .then(res => {
  93. uni.stopPullDownRefresh();
  94. if (this.page === 1) {
  95. this.visite_list = res.data;
  96. } else {
  97. this.visite_list = this.visite_list.concat(res.data);
  98. }
  99. this.total = res.pageTotal;
  100. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
  101. });
  102. },
  103. }
  104. };
  105. </script>
  106. <style lang="scss" scoped>
  107. .com-ul {
  108. .com-li {
  109. width: 710rpx;
  110. margin: 20rpx auto;
  111. background-color: #ffffff;
  112. padding: 20rpx 0;
  113. border-radius: 20rpx;
  114. .cutomer-name {
  115. padding-bottom: 10rpx;
  116. color: $uni-color-primary;
  117. font-size: 24rpx;
  118. .float_left {
  119. max-width: 540rpx;
  120. background-color: #ecf5ff;
  121. border-top-right-radius: 20rpx;
  122. border-bottom-right-radius: 20rpx;
  123. padding: 0 20rpx;
  124. line-height: 40rpx;
  125. }
  126. .staff-name {
  127. padding-right: 20rpx;
  128. line-height: 40rpx;
  129. }
  130. }
  131. .cont {
  132. padding: 0 20rpx;
  133. line-height: 36rpx;
  134. .content {
  135. padding-bottom: 10rpx;
  136. }
  137. .image-view {
  138. padding-bottom: 10rpx;
  139. image {
  140. width: 120rpx;
  141. height: 120rpx;
  142. border-radius: 10rpx;
  143. }
  144. }
  145. .address {
  146. padding-bottom: 10rpx;
  147. font-size: 24rpx;
  148. }
  149. .time {
  150. font-size: 24rpx;
  151. color: #999999;
  152. }
  153. }
  154. }
  155. }
  156. </style>