CommunicationLogs.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <view>
  3. <view class="keyword-view clearfix">
  4. <view class="float_left">
  5. <u-search
  6. disabled
  7. @search="searchConfirm()"
  8. :show-action="false"
  9. :clearabled="true"
  10. placeholder="请选择客户"
  11. v-model="customer_name"
  12. @click="goPage('/pagesT/customer/selCustomer')"
  13. ></u-search>
  14. </view>
  15. <view class="float_right" @click="openSearch"><text class="custom-icon custom-icon-shaixuan"></text></view>
  16. </view>
  17. <view class="com-ul">
  18. <view class="com-li" v-for="(item, index) in order_list" :key="index">
  19. <view class="cutomer-name clearfix">
  20. <view class="float_left ellipsis">
  21. <u-icon margin-left="10" name="account-fill" label-size="24" label-color="#2979ff" :label="item.customerName" color="#2979ff" size="28"></u-icon>
  22. </view>
  23. <view class="float_right staff-name">
  24. {{ item.staffName }}
  25. <!-- <u-icon name="dianhua" color="#2d73ed" custom-prefix="custom-icon" /> -->
  26. </view>
  27. </view>
  28. <view class="cont">
  29. <view class="content">{{ item.content }}</view>
  30. <view v-if="item.picture" class="image-view"><image @click="previewImage(item.picture)" :src="item.picture" mode="aspectFill"></image></view>
  31. <view class="address clearfix">
  32. <view class="float_left">
  33. <block v-if="item.location">
  34. <u-icon name="map-fill" color="#6c6c6c" size="26"></u-icon>
  35. {{ item.location }}
  36. </block>
  37. <text v-else style="color: #999999;">无定位信息</text>
  38. </view>
  39. </view>
  40. <view class="time clearfix">
  41. <view class="float_left">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  42. <view v-if="item.managerMobile" class="float_right" @click="callPhone(item.managerMobile)">
  43. <!-- <u-icon @click="goPage(`/pagesT/customer/CommunicationLogsAdd?id=${item.id}`)"
  44. style="margin-right: 30rpx;" name="edit-pen-fill" color="#2d73ed" /> -->
  45. 客户电话:{{ item.managerMobile }}
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <u-loadmore :status="load_status" />
  52. <addBtn url="/pagesT/customer/CommunicationLogsAdd"></addBtn>
  53. <u-popup v-model="search_show" mode="right">
  54. <view class="search-pop">
  55. <view class="form-view">
  56. <u-form label-width="160rpx" label-position="left">
  57. <u-form-item label-position="top" label="下单日期">
  58. <view class="date-li">
  59. <picker mode="date" @change="bindDateStartChange">
  60. <text class="date-li">{{ search_data.start ? $u.timeFormat(search_data.start, 'yyyy-mm-dd') : '开始日期' }}</text>
  61. </picker>
  62. </view>
  63. <view class="date-line">-</view>
  64. <view class="date-li">
  65. <picker mode="date" @change="bindDateEndChange">
  66. <text class="date-li">{{ search_data.end ? $u.timeFormat(search_data.end, 'yyyy-mm-dd') : '结束日期' }}</text>
  67. </picker>
  68. </view>
  69. </u-form-item>
  70. </u-form>
  71. </view>
  72. <view class="search-btn">
  73. <view class="btn-li" @click="clearValue()">重置</view>
  74. <view class="btn-li" @click="getAllCustomerCommunication()">确定</view>
  75. </view>
  76. </view>
  77. </u-popup>
  78. </view>
  79. </template>
  80. <script>
  81. export default {
  82. data() {
  83. return {
  84. load_status: 'nomore',
  85. customerData: '',
  86. page: 1,
  87. pageSize: 10,
  88. total: 0,
  89. order_list: [],
  90. customer_name: '',
  91. customer_id: '',
  92. search_show: false,
  93. search_data: {
  94. start: '',
  95. end: ''
  96. }
  97. };
  98. },
  99. watch: {
  100. customerData(val) {
  101. if (val) {
  102. this.customer_name = val.name;
  103. this.customer_id = val.id;
  104. this.page = 1;
  105. this.getAllCustomerCommunication();
  106. }
  107. }
  108. },
  109. computed: {
  110. staffId() {
  111. return this.$store.state.userInfo.staffId;
  112. },
  113. isAdministrator() {
  114. return this.$store.state.access.isAdministrator;
  115. }
  116. },
  117. onShow() {
  118. this.getAllCustomerCommunication();
  119. },
  120. onPullDownRefresh() {
  121. this.page = 1;
  122. this.getAllCustomerCommunication();
  123. },
  124. onReachBottom() {
  125. if (this.total / this.pageSize > this.page) {
  126. this.page += 1;
  127. this.getAllCustomerCommunication();
  128. }
  129. },
  130. methods: {
  131. clearValue() {
  132. this.search_show = false;
  133. this.customer_name = '';
  134. this.customer_id = '';
  135. this.search_data = {
  136. start: '',
  137. end: ''
  138. };
  139. this.page = 1;
  140. this.getAllCustomerCommunication();
  141. },
  142. getAllCustomerCommunication() {
  143. this.search_show = false;
  144. let params = {
  145. page: this.page,
  146. pageSize: this.pageSize,
  147. customerId: this.customer_id,
  148. start: this.search_data.start,
  149. end: this.search_data.end
  150. };
  151. if (!this.isAdministrator) {
  152. params.staffId = this.staffId;
  153. }
  154. this.$u.api.getAllCustomerCommunication(params).then(res => {
  155. if (this.page === 1) {
  156. this.order_list = res.data;
  157. } else {
  158. this.order_list = this.order_list.concat(res.data);
  159. }
  160. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, res.pageTotal);
  161. this.total = res.pageTotal;
  162. });
  163. },
  164. previewImage(image) {
  165. // 预览图片
  166. uni.previewImage({
  167. urls: [image],
  168. longPressActions: {
  169. itemList: ['发送给朋友', '保存图片', '收藏'],
  170. success: function(data) {
  171. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  172. },
  173. fail: function(err) {
  174. console.log(err.errMsg);
  175. }
  176. }
  177. });
  178. },
  179. openSearch() {
  180. this.search_show = true;
  181. },
  182. bindDateStartChange(e) {
  183. this.search_data.start = this.$utils.timeByTimestamp(e.detail.value + ' 00:00:00');
  184. },
  185. bindDateEndChange(e) {
  186. this.search_data.end = this.$utils.timeByTimestamp(e.detail.value + ' 23:59:59');
  187. }
  188. }
  189. };
  190. </script>
  191. <style lang="scss" scoped>
  192. // .keyword-view {
  193. // position: fixed;
  194. // width: 100%;
  195. // top: 0;
  196. // left: 0;
  197. // padding: 20rpx 24rpx;
  198. // background-color: #ffffff;
  199. // z-index: 9;
  200. // .float_left {
  201. // width: 640rpx;
  202. // }
  203. // .float_right {
  204. // line-height: 64rpx;
  205. // width: 50rpx;
  206. // text-align: center;
  207. // color: #666666;
  208. // }
  209. // }
  210. .keyword-view {
  211. position: fixed;
  212. width: 100%;
  213. top: 0;
  214. left: 0;
  215. padding: 20rpx 24rpx;
  216. background-color: #ffffff;
  217. z-index: 9;
  218. .float_left {
  219. width: 640rpx;
  220. }
  221. .float_right {
  222. line-height: 64rpx;
  223. width: 50rpx;
  224. text-align: center;
  225. color: #666666;
  226. }
  227. }
  228. .com-ul {
  229. padding-top: 100rpx;
  230. .com-li {
  231. width: 710rpx;
  232. margin: 20rpx auto;
  233. background-color: #ffffff;
  234. padding: 20rpx 0;
  235. border-radius: 20rpx;
  236. .cutomer-name {
  237. padding-bottom: 10rpx;
  238. color: $uni-color-primary;
  239. font-size: 24rpx;
  240. .float_left {
  241. max-width: 540rpx;
  242. background-color: #ecf5ff;
  243. border-top-right-radius: 20rpx;
  244. border-bottom-right-radius: 20rpx;
  245. padding: 0 20rpx;
  246. line-height: 40rpx;
  247. }
  248. .staff-name {
  249. padding-right: 20rpx;
  250. line-height: 40rpx;
  251. }
  252. }
  253. .cont {
  254. padding: 0 20rpx;
  255. line-height: 36rpx;
  256. .content {
  257. padding-bottom: 10rpx;
  258. }
  259. .image-view {
  260. padding-bottom: 10rpx;
  261. image {
  262. width: 120rpx;
  263. height: 120rpx;
  264. border-radius: 10rpx;
  265. }
  266. }
  267. .address {
  268. padding-bottom: 10rpx;
  269. font-size: 24rpx;
  270. }
  271. .time {
  272. font-size: 24rpx;
  273. color: #999999;
  274. }
  275. }
  276. }
  277. }
  278. </style>