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.

315 lines
8.3 KiB

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