江西小程序管理端
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.

314 lines
8.3 KiB

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