reportInfo.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <view class="content">
  3. <!-- <view class="filter-box">
  4. <u-search placeholder="请输入关键字" v-model="filterText" @search="setFilterText" @custom="setFilterText"></u-search>
  5. </view> -->
  6. <template v-if="tabList[0].tableList.length">
  7. <scroll-view scroll-y class="scroll-box" @scrolltolower="handleLoadMore" :refresher-enabled="true"
  8. :refresher-triggered="triggered" :refresher-threshold="100" refresher-background="white" @refresherrefresh="onRefresh"
  9. @refresherrestore="onRestore">
  10. <u-card :show-head="false" :foot-border-top="false" margin="10px 15px" borderRadius="40" :foot-style="{padding: '0 10px 5px 0'}" v-for="(site, index2) in tabList[0].tableList"
  11. :key="index2" class="card-box">
  12. <view slot="body" class="card-content">
  13. <view class="student-info">
  14. <view style="width: 100%;margin-bottom: 5px;">
  15. <text class="info-name" style="margin-right: 10px;">{{site.studentName}}</text>
  16. <text class="info-name" style="margin-right: 10px;">{{site.parentName}}</text>
  17. <text class="info-name">{{site.saleName}}</text>
  18. </view>
  19. <view class="info-phone">{{site.studentPhone}}</view>
  20. <view class="info-phone" v-if="getType == 3">生日: {{site.birthday}}</view>
  21. <view class="info-phone" v-if="getType == 4">预约时间: {{site.recordTime}}</view>
  22. </view>
  23. </view>
  24. <view slot="foot" style="text-align: right;" v-if="getType == 1">
  25. <u-button type="warning" :ripple="true" shape="circle" :custom-style="handleCustomStyle" size="mini" @click="handleRecordClick(site.id)">追踪信息</u-button>
  26. </view>
  27. </u-card>
  28. <u-divider v-if="item.isOver" bg-color="transparent" :style="{paddingTop : tabList[0].tableList.length == 0 ? '10px' : ''}">没有更多了</u-divider>
  29. </scroll-view>
  30. </template>
  31. <template v-else>
  32. <u-empty mode="data"></u-empty>
  33. </template>
  34. <!-- 追踪记录 -->
  35. <u-popup v-model="recordShow" mode="center" border-radius="30" width="600rpx" height="500px" >
  36. <view class="common-title">追踪记录</view>
  37. <view class="menber-box" style="overflow-y: auto;height:390px;">
  38. <template v-if="recordList.legnth">
  39. <view style="padding:5px; border-bottom:1px solid #aaa;" v-for="(item,index) in recordList">
  40. <view>{{ item.content }}</view>
  41. <view>{{ item.createTime }}</view>
  42. </view>
  43. </template>
  44. <template v-else>
  45. <u-empty mode="data"></u-empty>
  46. </template>
  47. </view>
  48. <view class="button-box">
  49. <u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="recordShow = false">确定</u-button>
  50. </view>
  51. </u-popup>
  52. <u-top-tips ref="uTips"></u-top-tips>
  53. </view>
  54. </template>
  55. <script>
  56. import {
  57. mapGetters
  58. } from 'vuex'
  59. const NET = require('@/utils/request')
  60. const API = require('@/config/api')
  61. export default {
  62. computed: {
  63. ...mapGetters([
  64. 'customStyle',
  65. 'handleCustomStyle',
  66. ])
  67. },
  68. data() {
  69. return {
  70. getType: 0,
  71. customerId: '',
  72. // filterText: '',
  73. triggered: false,
  74. tabList: [
  75. {
  76. name: '未联系',
  77. isOver: false,
  78. pageIndex: 1,
  79. filterText: '',
  80. type: 1,
  81. tableList: [],
  82. }],
  83. // 追踪记录
  84. recordShow: false,
  85. recordList: []
  86. }
  87. },
  88. onLoad(options) {
  89. this.getType = options.type
  90. uni.setNavigationBarTitle({
  91. title: options.navTitle
  92. });
  93. },
  94. onShow() {
  95. this.tabList = Object.assign([], this.$options.data().tabList)
  96. this.getTableList()
  97. },
  98. onReady() {},
  99. methods: {
  100. // 获取列表数据
  101. getTableList() {
  102. let rUrl = ''
  103. switch (parseInt(this.getType)) {
  104. case 1:
  105. rUrl = API.estrangedList
  106. break
  107. case 3:
  108. rUrl = API.birthdayRemind
  109. break
  110. case 4:
  111. rUrl = API.oneWeekAppointment
  112. break
  113. }
  114. NET.request(rUrl, {
  115. page: this.tabList[0].pageIndex,
  116. size: 10,
  117. }, 'POST').then(res => {
  118. this.triggered = false
  119. this.tabList[0].tableList = res.data.row
  120. })
  121. },
  122. // 查看追踪记录
  123. handleRecordClick(id) {
  124. NET.request(API.findResourceRecordList, {
  125. id,
  126. page: this.tabList[0].pageIndex,
  127. size: 10}, 'POST').then(res=> {
  128. if(res.status == 10000) {
  129. this.recordShow = true
  130. this.recordList = res.data
  131. } else {
  132. this.$refs.uTips.show({
  133. title: res.message,
  134. type: 'warning',
  135. })
  136. }
  137. })
  138. },
  139. // 设置过滤字段
  140. setFilterText(value) {
  141. this.tabList[0].filterText = value
  142. this.onRefresh()
  143. },
  144. // 下拉刷新
  145. onRefresh() {
  146. if (!this.triggered) {
  147. this.triggered = true
  148. this.tabList[0].isOver = false
  149. this.tabList[0].pageIndex = 1
  150. this.tabList[0].tableList = []
  151. this.getTableList()
  152. }
  153. },
  154. // 重置下拉刷新状态
  155. onRestore() {
  156. this.triggered = false
  157. },
  158. // 懒加载
  159. handleLoadMore() {
  160. if (!this.tabList[0].isOver) {
  161. this.tabList[0].pageIndex++
  162. this.getTableList()
  163. }
  164. }
  165. },
  166. }
  167. </script>
  168. <style>
  169. page {
  170. width: 100%;
  171. height: 100%;
  172. background-color: #f7f7f7;
  173. }
  174. </style>
  175. <style lang="scss" scoped>
  176. @import "@/static/css/themes.scss";
  177. .content {
  178. width: 100%;
  179. float: left;
  180. .filter-box {
  181. height: 48px;
  182. padding: 10px 15px;
  183. background-color: #FFFFFF;
  184. }
  185. .swiper-box {
  186. height: calc(100vh - 82px);
  187. .swiper-item {
  188. height: calc(100vh - 82px);
  189. .scroll-box {
  190. width: 100%;
  191. height: calc(100vh - 82px);
  192. .card-box {
  193. .card-content {
  194. display: flex;
  195. align-items: center;
  196. .student-info {
  197. flex: 1;
  198. .info-name {
  199. // width: 64px;
  200. // float: left;
  201. line-height: 28px;
  202. font-size: 14px;
  203. font-weight: bold;
  204. }
  205. .info-type {
  206. padding: 0 10px;
  207. margin-top: 3px;
  208. border-radius: 20px;
  209. float: left;
  210. line-height: 20px;
  211. font-size: 10px;
  212. color: #FFFFFF;
  213. background-color: #999999;
  214. }
  215. .info-type-active {
  216. background-color: $mainColor;
  217. }
  218. .info-phone {
  219. font-size: 12px;
  220. color: #999999;
  221. }
  222. }
  223. }
  224. }
  225. }
  226. }
  227. }
  228. }
  229. .menber-box {
  230. width: 100%;
  231. // float: left;
  232. padding: 10px 15px;
  233. margin-bottom: 10px;
  234. .menber-col {
  235. width: 100%;
  236. padding: 15px;
  237. margin-bottom: 10px;
  238. display: inline-block;
  239. background-color: #FFFFFF;
  240. border-radius: 15px;
  241. box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
  242. position: relative;
  243. overflow: hidden;
  244. box-sizing: border-box;
  245. .menber-label {
  246. width: 100%;
  247. margin-bottom: 5px;
  248. float: left;
  249. font-size: 14px;
  250. // line-height: 20px;
  251. }
  252. .menber-num {
  253. width: 100%;
  254. float: left;
  255. font-size: 26px;
  256. line-height: 28px;
  257. color: $mainColor;
  258. }
  259. .menber-icon {
  260. font-size: 100px;
  261. color: $mainColor;
  262. position: absolute;
  263. right: -5px;
  264. bottom: -30px;
  265. opacity: 0.5;
  266. }
  267. }
  268. }
  269. .common-title {
  270. width:100%;
  271. text-align: center;
  272. font-size: 20px;
  273. margin: 10px 0;
  274. }
  275. .fix-add-icon {
  276. position: fixed;
  277. bottom: 15px;
  278. right: 15px;
  279. }
  280. .button-box {
  281. // width: 100%;
  282. padding: 10px 15px;
  283. box-sizing: border-box;
  284. }
  285. </style>