reportInfo.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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==null?'无':site.studentName}}</text>
  16. <text class="info-name" style="margin-right: 10px;">{{site.parentName==null?'无':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. if(this.tabList[0].pageIndex==1){
  103. this.tabList[0].tableList=[]
  104. }
  105. let rUrl = ''
  106. switch (parseInt(this.getType)) {
  107. case 1:
  108. rUrl = API.estrangedList
  109. break
  110. case 3:
  111. rUrl = API.birthdayRemind
  112. break
  113. case 4:
  114. rUrl = API.oneWeekAppointment
  115. break
  116. }
  117. NET.request(rUrl, {
  118. page: this.tabList[0].pageIndex,
  119. size: 10,
  120. }, 'POST').then(res => {
  121. this.triggered = false
  122. this.tabList[0].tableList = this.tabList[0].tableList.concat(res.data.row)
  123. })
  124. },
  125. // 查看追踪记录
  126. handleRecordClick(id) {
  127. NET.request(API.findResourceRecordList, {
  128. id,
  129. page: this.tabList[0].pageIndex,
  130. size: 10}, 'POST').then(res=> {
  131. if(res.status == 10000) {
  132. this.recordShow = true
  133. this.recordList = res.data
  134. } else {
  135. this.$refs.uTips.show({
  136. title: res.message,
  137. type: 'warning',
  138. })
  139. }
  140. })
  141. },
  142. // 设置过滤字段
  143. setFilterText(value) {
  144. this.tabList[0].filterText = value
  145. this.onRefresh()
  146. },
  147. // 下拉刷新
  148. onRefresh() {
  149. if (!this.triggered) {
  150. this.triggered = true
  151. this.tabList[0].isOver = false
  152. this.tabList[0].pageIndex = 1
  153. this.tabList[0].tableList = []
  154. this.getTableList()
  155. }
  156. },
  157. // 重置下拉刷新状态
  158. onRestore() {
  159. this.triggered = false
  160. },
  161. // 懒加载
  162. handleLoadMore() {
  163. console.log(123123)
  164. if (!this.tabList[0].isOver) {
  165. this.tabList[0].pageIndex++
  166. this.getTableList()
  167. }
  168. }
  169. },
  170. }
  171. </script>
  172. <style>
  173. page {
  174. width: 100%;
  175. height: 100%;
  176. background-color: #f7f7f7;
  177. }
  178. </style>
  179. <style lang="scss" scoped>
  180. @import "@/static/css/themes.scss";
  181. .content {
  182. width: 100%;
  183. float: left;
  184. .filter-box {
  185. height: 48px;
  186. padding: 10px 15px;
  187. background-color: #FFFFFF;
  188. }
  189. .scroll-box {
  190. width: 100%;
  191. height: calc(100vh - 30px);
  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. .menber-box {
  228. width: 100%;
  229. // float: left;
  230. padding: 10px 15px;
  231. margin-bottom: 10px;
  232. .menber-col {
  233. width: 100%;
  234. padding: 15px;
  235. margin-bottom: 10px;
  236. display: inline-block;
  237. background-color: #FFFFFF;
  238. border-radius: 15px;
  239. box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
  240. position: relative;
  241. overflow: hidden;
  242. box-sizing: border-box;
  243. .menber-label {
  244. width: 100%;
  245. margin-bottom: 5px;
  246. float: left;
  247. font-size: 14px;
  248. // line-height: 20px;
  249. }
  250. .menber-num {
  251. width: 100%;
  252. float: left;
  253. font-size: 26px;
  254. line-height: 28px;
  255. color: $mainColor;
  256. }
  257. .menber-icon {
  258. font-size: 100px;
  259. color: $mainColor;
  260. position: absolute;
  261. right: -5px;
  262. bottom: -30px;
  263. opacity: 0.5;
  264. }
  265. }
  266. }
  267. .common-title {
  268. width:100%;
  269. text-align: center;
  270. font-size: 20px;
  271. margin: 10px 0;
  272. }
  273. .fix-add-icon {
  274. position: fixed;
  275. bottom: 15px;
  276. right: 15px;
  277. }
  278. .button-box {
  279. // width: 100%;
  280. padding: 10px 15px;
  281. box-sizing: border-box;
  282. }
  283. </style>