reportInfo.vue 7.0 KB

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