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.

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