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.

381 lines
10 KiB

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