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.

356 lines
9.5 KiB

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