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.

337 lines
9.1 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
5 months ago
8 months ago
5 months ago
8 months ago
8 months ago
5 months ago
8 months ago
8 months ago
5 months ago
8 months ago
5 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. <u-popup :show="showSign" mode="center" round="20rpx">
  97. <view class="box">
  98. <view class="tit">您还未上传签名请尽快上传!</view>
  99. <view class="btnBg" @click="goSignPage">去签名</view>
  100. </view>
  101. </u-popup>
  102. </view>
  103. </template>
  104. <script>
  105. import { imgUrl } from '@/config/site.config'
  106. import { studentRecordPage, schoolClass, studentOwner, needSign } from '@/config/api.js'
  107. // import topUserInfo from '../statistics/comp/topUserInfo.vue'
  108. export default {
  109. // components: { topUserInfo },
  110. data() {
  111. return {
  112. imgUrl: imgUrl+'indexTopBanner.png',
  113. backgroundSize: '100% 492rpx',
  114. screen: {
  115. timer: '报名时间',
  116. car: '全部车型',
  117. className: '全部班型'
  118. },
  119. showDatePicker: false,
  120. showCar: false,
  121. showClass: false,
  122. showSign: false,
  123. carArr: [
  124. [
  125. {lab: '全部车型',id: 0},
  126. {lab: 'C1',id: 1},
  127. {lab: 'C2',id: 2},
  128. ]
  129. ],
  130. classArr: [
  131. [
  132. {lab: '普通班型',id: 1},
  133. {lab: 'C2vip',id: 2},
  134. ]
  135. ],
  136. params: {
  137. "pageNo": 1, "pageSize": 10, status: 1, name: ''
  138. },
  139. total: 20,
  140. list: [],
  141. count: {},
  142. status: 'loading'
  143. }
  144. },
  145. onShow() {
  146. uni.hideTabBar();
  147. this.studentOwnerFn()
  148. },
  149. onLoad() {
  150. this.params.schoolId = this.vuex_schoolId
  151. this.studentRecordPageFn()
  152. this.schoolClass()
  153. this.needSignFn()
  154. let nowTime = new Date()*1
  155. // 一个月的时间戳
  156. const oneMonthMilliseconds = 30 * 24 * 60 * 60 * 1000;
  157. this.minDate = parseInt( nowTime - oneMonthMilliseconds )
  158. this.maxDate = parseInt( nowTime + oneMonthMilliseconds )
  159. },
  160. onPullDownRefresh() {
  161. this.studentRecordPageFn()
  162. this.studentOwnerFn()
  163. this.listInit()
  164. },
  165. methods: {
  166. goSignPage() {
  167. this.showSign = false
  168. this.$goPage('/pages/userCenter/signature/signature')
  169. },
  170. // 是不是需要签
  171. async needSignFn() {
  172. const {data: res} = await needSign()
  173. if(res) {
  174. this.showSign = true
  175. }
  176. },
  177. searchFn(val) {
  178. this.params.name = val
  179. this.listInit()
  180. },
  181. async studentOwnerFn() {
  182. const {data: res} = await studentOwner()
  183. this.count = res
  184. console.log(res)
  185. },
  186. cancelDate() {
  187. this.showDatePicker=false
  188. this.params.applyDateTime = ''
  189. this.screen.timer = '报名时间'
  190. this.listInit()
  191. },
  192. confirmDatePicker(val) {
  193. this.showDatePicker = false
  194. console.log(val)
  195. this.params.applyDateTime = this.screen.timer = val[0]
  196. this.listInit()
  197. },
  198. closeCalendar() {
  199. this.showDatePicker = false
  200. this.params.applyDateTime = ''
  201. this.screen.timer = '报名时间'
  202. this.listInit()
  203. },
  204. confirmCar(val) {
  205. let item = val.value[0]
  206. this.params.trainType = this.screen.car = item.lab
  207. if(this.screen.car=='全部车型') this.params.trainType = ''
  208. this.showCar = false
  209. this.listInit()
  210. },
  211. confirmClass(val) {
  212. let item = val.value[0]
  213. this.screen.className = item.name
  214. this.params.schoolClassId = item.id
  215. this.showClass = false
  216. this.listInit()
  217. },
  218. // 获取班型
  219. async schoolClass() {
  220. const {data: res} = await schoolClass({id: this.vuex_schoolId,pageNo: 1,pageSize: 100})
  221. this.classArr = [res]
  222. this.classArr[0].unshift({name: '全部班型', id: 0})
  223. console.log(this.classArr)
  224. },
  225. listInit() {
  226. this.params.pageNo = 1
  227. this.list = []
  228. this.status = 'loading'
  229. this.studentRecordPageFn()
  230. },
  231. async studentRecordPageFn() {
  232. let obj = {}
  233. for(let key in this.params) {
  234. if(this.params[key]) obj[key] = this.params[key]
  235. }
  236. // if(obj.applyDateTime) obj.applyDateTime = obj.applyDateTime + ' 00:00:00'
  237. const {data: res} = await studentRecordPage(obj)
  238. this.params.pageNo ++
  239. this.list.push(...res.list)
  240. this.total = res.total
  241. if(this.list.length>=this.total) this.status = 'nomore'
  242. }
  243. }
  244. }
  245. </script>
  246. <style lang="scss" scoped>
  247. .pad {
  248. padding-bottom: 110rpx;
  249. }
  250. .card {
  251. padding: 0 28rpx;
  252. margin-bottom: 24rpx;
  253. }
  254. .searchBox {
  255. padding: 0rpx 0 24rpx 0;
  256. }
  257. .h2 {
  258. font-size: 32rpx;
  259. font-weight: 500;
  260. color: $themC;
  261. padding-top: 26rpx;
  262. }
  263. .addStudent {
  264. padding: 10rpx 0 30rpx 0;
  265. font-size: 28rpx;
  266. color: $themC;
  267. text-align: center;
  268. }
  269. .statistics {
  270. display: flex;
  271. height: 170rpx;
  272. .statisticsItem {
  273. display: flex;
  274. align-items: center;
  275. justify-content: center;
  276. flex-direction: column;
  277. flex: 1;
  278. .val {
  279. font-weight: 600;
  280. font-size: 56rpx;
  281. color: $themC;
  282. position: relative;
  283. &::before {
  284. content: '个';
  285. position: absolute;
  286. right: -30rpx;
  287. bottom: 10rpx;
  288. font-size: 24rpx;
  289. font-weight: 400;
  290. }
  291. }
  292. .lab {
  293. font-size: 28rpx;
  294. color: #999;
  295. // margin-top: 20rpx;
  296. }
  297. }
  298. }
  299. .screen_row {
  300. display: flex;
  301. margin-bottom: 24rpx;
  302. width: 100%;
  303. justify-content: space-between;
  304. .selectItem {
  305. display: flex;
  306. padding: 0 16rpx;
  307. border: 2rpx solid rgba(25,137,250,0.3);
  308. height: 60rpx;
  309. border-radius: 16rpx;
  310. background-color: #FFFFFF;
  311. line-height: 60rpx;
  312. align-items: center;
  313. width: 29%;
  314. .text {
  315. color: $themC;
  316. flex: 1;
  317. text-align: center;
  318. font-size: 26rpx;
  319. }
  320. .downIcon {
  321. width: 24rpx;
  322. }
  323. }
  324. }
  325. </style>