You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

318 lines
8.4 KiB

9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
  1. <template>
  2. <view class="pageBg">
  3. <view class="pageBgImg pad" >
  4. <!-- <view class="pad" :style="{ background: `url(${imgUrl}) #f6f6f6 no-repeat`, backgroundSize: backgroundSize }" > -->
  5. <view class="status_bar"></view>
  6. <view class="" style="height: 30rpx;"></view>
  7. <!-- <view class="searchBox">
  8. <searchRow placeholder="搜索学员姓名、学员手机号"></searchRow>
  9. </view>
  10. <view class="card" v-if="identity=='实操教练'">
  11. <view class="addStudent">
  12. <view class="h2">我的学员</view>
  13. <view class="btnBg" @click="$goPage('/pages/recordEntry/student/addStudent/addStudent')">手动添加</view>
  14. </view>
  15. </view>
  16. <view class="card">
  17. <view class="statistics">
  18. <view class="statisticsItem">
  19. <view class="val">260</view>
  20. <view class="lab">累计学员数量</view>
  21. </view>
  22. <view class="statisticsItem">
  23. <view class="val">260</view>
  24. <view class="lab">今日新增学员</view>
  25. </view>
  26. <view class="statisticsItem" v-if="identity=='校长'">
  27. <view class="val">260</view>
  28. <view class="lab">今日退学学员</view>
  29. </view>
  30. </view>
  31. </view> -->
  32. <view class="searchBox" v-if="identity=='校长'">
  33. <searchRow placeholder="搜索学员姓名、学员手机号" @searchFn="searchFn"></searchRow>
  34. </view>
  35. <!-- <topUserInfo v-if="identity=='实操教练'"/> -->
  36. <view class="card">
  37. <view class="h2" v-if="identity=='实操教练'">我的学员</view>
  38. <view class="statistics">
  39. <view class="statisticsItem">
  40. <view class="val">{{count.accumulateCount}}</view>
  41. <view class="lab">累计学员数量</view>
  42. </view>
  43. <view class="statisticsItem">
  44. <view class="val">{{count.todayCount}}</view>
  45. <view class="lab">今日新增学员</view>
  46. </view>
  47. <view class="statisticsItem" v-if="identity=='校长'">
  48. <view class="val">{{count.todayDropoutCount}}</view>
  49. <view class="lab">今日退学学员</view>
  50. </view>
  51. </view>
  52. <view class="addStudent" @click="$goPage('/pages/recordEntry/student/addStudent/addStudent')" v-if="identity=='实操教练'">+ 添加学员</view>
  53. </view>
  54. <view class="screen_row">
  55. <view class="selectItem" @click="showDatePicker=true">
  56. <view class="text ">{{screen.timer}}</view>
  57. <view class="downIcon">
  58. <u-icon name="arrow-down" :size="'28rpx'"></u-icon>
  59. </view>
  60. </view>
  61. <view class="selectItem" @click="showCar=true">
  62. <view class="text oneRowText">{{screen.car}}</view>
  63. <view class="downIcon">
  64. <u-icon name="arrow-down" :size="'28rpx'"></u-icon>
  65. </view>
  66. </view>
  67. <view class="selectItem" @click="showClass=true">
  68. <view class="text oneRowText">{{screen.className}}</view>
  69. <view class="downIcon">
  70. <u-icon name="arrow-down" :size="'28rpx'"></u-icon>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="list">
  75. <view class="card" @click="$goPage('/pages/recordEntry/student/studentDetail/studentDetail?id='+item.id)" v-for="(item,index) in list" :key="index">
  76. <appointItem-student :item="item"/>
  77. </view>
  78. </view>
  79. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  80. <UserTab name ='学员'></UserTab>
  81. <!-- <u-datetime-picker
  82. :show="showDatePicker"
  83. mode="date"
  84. :minDate="1669341725000"
  85. :visibleItemCount="4"
  86. :closeOnClickOverlay="false"
  87. @confirm="confirmDatePicker"
  88. @cancel="cancelDate"
  89. cancelText="不限日期"
  90. ></u-datetime-picker> -->
  91. <u-calendar :show="showDatePicker" ref="calendar" @confirm="confirmDatePicker" @close="closeCalendar" :minDate="minDate" :maxDate="maxDate"></u-calendar>
  92. <u-picker :show="showCar" :columns="carArr" keyName="lab" @confirm="confirmCar" @cancel="showCar=false"></u-picker>
  93. <u-picker :show="showClass" :columns="classArr" keyName="name" @confirm="confirmClass" @cancel="showClass=false"></u-picker>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. import { imgUrl } from '@/config/site.config'
  99. import { studentRecordPage, schoolClass, studentOwner } from '@/config/api.js'
  100. // import topUserInfo from '../statistics/comp/topUserInfo.vue'
  101. export default {
  102. // components: { topUserInfo },
  103. data() {
  104. return {
  105. imgUrl: imgUrl+'indexTopBanner.png',
  106. backgroundSize: '100% 492rpx',
  107. screen: {
  108. timer: '报名时间',
  109. car: '全部车型',
  110. className: '全部班型'
  111. },
  112. showDatePicker: false,
  113. showCar: false,
  114. showClass: false,
  115. carArr: [
  116. [
  117. {lab: '全部车型',id: 0},
  118. {lab: 'C1',id: 1},
  119. {lab: 'C2',id: 2},
  120. ]
  121. ],
  122. classArr: [
  123. [
  124. {lab: '普通班型',id: 1},
  125. {lab: 'C2vip',id: 2},
  126. ]
  127. ],
  128. params: {
  129. "pageNo": 1, "pageSize": 10, status: 1, name: ''
  130. },
  131. total: 20,
  132. list: [],
  133. count: {},
  134. status: 'loading'
  135. }
  136. },
  137. onShow() {
  138. uni.hideTabBar();
  139. this.studentOwnerFn()
  140. },
  141. onLoad() {
  142. this.params.schoolId = this.vuex_schoolId
  143. this.studentRecordPageFn()
  144. this.schoolClass()
  145. let nowTime = new Date()*1
  146. // 一个月的时间戳
  147. const oneMonthMilliseconds = 30 * 24 * 60 * 60 * 1000;
  148. this.minDate = parseInt( nowTime - oneMonthMilliseconds )
  149. this.maxDate = parseInt( nowTime + oneMonthMilliseconds )
  150. },
  151. onPullDownRefresh() {
  152. this.studentRecordPageFn()
  153. this.studentOwnerFn()
  154. this.listInit()
  155. },
  156. methods: {
  157. searchFn(val) {
  158. this.params.name = val
  159. this.listInit()
  160. },
  161. async studentOwnerFn() {
  162. const {data: res} = await studentOwner()
  163. this.count = res
  164. console.log(res)
  165. },
  166. cancelDate() {
  167. this.showDatePicker=false
  168. this.params.applyDateTime = ''
  169. this.screen.timer = '预约时间'
  170. this.listInit()
  171. },
  172. confirmDatePicker(val) {
  173. this.showDatePicker = false
  174. console.log(val)
  175. this.params.applyDateTime = this.screen.timer = val[0]
  176. this.listInit()
  177. },
  178. closeCalendar() {
  179. this.showDatePicker = false
  180. this.params.applyDateTime = ''
  181. this.screen.timer = '报名时间'
  182. this.listInit()
  183. },
  184. confirmCar(val) {
  185. let item = val.value[0]
  186. this.params.trainType = this.screen.car = item.lab
  187. if(this.screen.car=='全部车型') this.params.trainType = ''
  188. this.showCar = false
  189. this.listInit()
  190. },
  191. confirmClass(val) {
  192. let item = val.value[0]
  193. this.screen.className = item.name
  194. this.params.schoolClassId = item.id
  195. this.showClass = false
  196. this.listInit()
  197. },
  198. // 获取班型
  199. async schoolClass() {
  200. const {data: res} = await schoolClass({id: this.vuex_schoolId,pageNo: 1,pageSize: 100})
  201. this.classArr = [res]
  202. this.classArr[0].unshift({name: '全部班型', id: 0})
  203. console.log(this.classArr)
  204. },
  205. listInit() {
  206. this.params.pageNo = 1
  207. this.list = []
  208. this.status = 'loading'
  209. this.studentRecordPageFn()
  210. },
  211. async studentRecordPageFn() {
  212. let obj = {}
  213. for(let key in this.params) {
  214. if(this.params[key]) obj[key] = this.params[key]
  215. }
  216. // if(obj.applyDateTime) obj.applyDateTime = obj.applyDateTime + ' 00:00:00'
  217. const {data: res} = await studentRecordPage(obj)
  218. this.params.pageNo ++
  219. this.list.push(...res.list)
  220. this.total = res.total
  221. if(this.list.length>=this.total) this.status = 'nomore'
  222. }
  223. }
  224. }
  225. </script>
  226. <style lang="scss" scoped>
  227. .pad {
  228. padding-bottom: 110rpx;
  229. }
  230. .card {
  231. padding: 0 28rpx;
  232. margin-bottom: 24rpx;
  233. }
  234. .searchBox {
  235. padding: 0rpx 0 24rpx 0;
  236. }
  237. .h2 {
  238. font-size: 32rpx;
  239. font-weight: 500;
  240. color: $themC;
  241. padding-top: 26rpx;
  242. }
  243. .addStudent {
  244. padding: 10rpx 0 30rpx 0;
  245. font-size: 28rpx;
  246. color: $themC;
  247. text-align: center;
  248. }
  249. .statistics {
  250. display: flex;
  251. height: 170rpx;
  252. .statisticsItem {
  253. display: flex;
  254. align-items: center;
  255. justify-content: center;
  256. flex-direction: column;
  257. flex: 1;
  258. .val {
  259. font-weight: 600;
  260. font-size: 56rpx;
  261. color: $themC;
  262. position: relative;
  263. &::before {
  264. content: '个';
  265. position: absolute;
  266. right: -30rpx;
  267. bottom: 10rpx;
  268. font-size: 24rpx;
  269. font-weight: 400;
  270. }
  271. }
  272. .lab {
  273. font-size: 28rpx;
  274. color: #999;
  275. // margin-top: 20rpx;
  276. }
  277. }
  278. }
  279. .screen_row {
  280. display: flex;
  281. margin-bottom: 24rpx;
  282. width: 100%;
  283. justify-content: space-between;
  284. .selectItem {
  285. display: flex;
  286. padding: 0 16rpx;
  287. border: 2rpx solid rgba(25,137,250,0.3);
  288. height: 60rpx;
  289. border-radius: 16rpx;
  290. background-color: #FFFFFF;
  291. line-height: 60rpx;
  292. align-items: center;
  293. width: 29%;
  294. .text {
  295. color: $themC;
  296. flex: 1;
  297. text-align: center;
  298. font-size: 26rpx;
  299. }
  300. .downIcon {
  301. width: 24rpx;
  302. }
  303. }
  304. }
  305. </style>