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.

354 lines
9.3 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
9 months ago
6 months ago
9 months ago
9 months ago
9 months ago
6 months ago
6 months ago
6 months ago
9 months ago
6 months ago
9 months ago
9 months ago
6 months ago
9 months ago
9 months ago
6 months ago
9 months ago
6 months ago
9 months ago
9 months 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. <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}}</view>
  42. <view class="lab">累计学员数量</view>
  43. </view>
  44. <view class="statisticsItem">
  45. <view class="val">{{count.todayCount}}</view>
  46. <view class="lab">今日新增学员</view>
  47. </view>
  48. <view class="statisticsItem" v-if="identity=='校长'">
  49. <view class="val">{{count.todayDropoutCount}}</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. this.studentOwnerFn()
  149. },
  150. onLoad() {
  151. this.params.schoolId = this.vuex_schoolId
  152. this.studentRecordPageFn()
  153. this.schoolClass()
  154. this.needSignFn()
  155. let nowTime = new Date()*1
  156. // 一个月的时间戳
  157. const oneMonthMilliseconds = 30 * 24 * 60 * 60 * 1000;
  158. this.minDate = parseInt( nowTime - oneMonthMilliseconds )
  159. this.maxDate = parseInt( nowTime + oneMonthMilliseconds )
  160. },
  161. onPullDownRefresh() {
  162. this.studentRecordPageFn()
  163. this.studentOwnerFn()
  164. this.listInit()
  165. },
  166. methods: {
  167. goSignPage() {
  168. this.showSign = false
  169. this.$goPage('/pages/userCenter/signature/signature')
  170. },
  171. // 是不是需要签
  172. async needSignFn() {
  173. const {data: res} = await needSign()
  174. if(res) {
  175. this.showSign = true
  176. }
  177. },
  178. searchFn(val) {
  179. this.params.name = val
  180. this.listInit()
  181. },
  182. async studentOwnerFn() {
  183. const {data: res} = await studentOwner()
  184. this.count = res
  185. console.log(res)
  186. },
  187. cancelDate() {
  188. this.showDatePicker=false
  189. this.params.applyDateTime = ''
  190. this.screen.timer = '报名时间'
  191. this.listInit()
  192. },
  193. confirmDatePicker(val) {
  194. this.showDatePicker = false
  195. console.log(val)
  196. this.params.applyDateTime = this.screen.timer = val[0]
  197. this.listInit()
  198. },
  199. closeCalendar() {
  200. this.showDatePicker = false
  201. this.params.applyDateTime = ''
  202. this.screen.timer = '报名时间'
  203. this.listInit()
  204. },
  205. confirmCar(val) {
  206. let item = val.value[0]
  207. this.params.trainType = this.screen.car = item.lab
  208. if(this.screen.car=='全部车型') this.params.trainType = ''
  209. this.showCar = false
  210. this.listInit()
  211. },
  212. confirmClass(val) {
  213. let item = val.value[0]
  214. this.screen.className = item.name
  215. this.params.schoolClassId = item.id
  216. this.showClass = false
  217. this.listInit()
  218. },
  219. // 获取班型
  220. async schoolClass() {
  221. const {data: res} = await schoolClass({id: this.vuex_schoolId,pageNo: 1,pageSize: 100})
  222. this.classArr = [res]
  223. this.classArr[0].unshift({name: '全部班型', id: 0})
  224. console.log(this.classArr)
  225. },
  226. listInit() {
  227. this.params.pageNo = 1
  228. this.list = []
  229. this.status = 'loading'
  230. this.studentRecordPageFn()
  231. },
  232. async studentRecordPageFn() {
  233. let obj = {}
  234. for(let key in this.params) {
  235. if(this.params[key]) obj[key] = this.params[key]
  236. }
  237. // if(obj.applyDateTime) obj.applyDateTime = obj.applyDateTime + ' 00:00:00'
  238. const {data: res} = await studentRecordPage(obj)
  239. this.params.pageNo ++
  240. this.list.push(...res.list)
  241. this.total = res.total
  242. if(this.list.length>=this.total) this.status = 'nomore'
  243. }
  244. }
  245. }
  246. </script>
  247. <style lang="scss" scoped>
  248. .pad {
  249. padding-bottom: 110rpx;
  250. }
  251. .card {
  252. padding: 0 28rpx;
  253. margin-bottom: 24rpx;
  254. }
  255. .searchBox {
  256. padding: 0rpx 0 24rpx 0;
  257. }
  258. .h2 {
  259. font-size: 32rpx;
  260. font-weight: 500;
  261. color: $themC;
  262. padding-top: 26rpx;
  263. }
  264. .addStudent {
  265. padding: 10rpx 0 30rpx 0;
  266. font-size: 28rpx;
  267. color: $themC;
  268. text-align: center;
  269. }
  270. .statistics {
  271. display: flex;
  272. height: 170rpx;
  273. .statisticsItem {
  274. display: flex;
  275. align-items: center;
  276. justify-content: center;
  277. flex-direction: column;
  278. flex: 1;
  279. .val {
  280. font-weight: 600;
  281. font-size: 56rpx;
  282. color: $themC;
  283. position: relative;
  284. &::before {
  285. content: '个';
  286. position: absolute;
  287. right: -30rpx;
  288. bottom: 10rpx;
  289. font-size: 24rpx;
  290. font-weight: 400;
  291. }
  292. }
  293. .lab {
  294. font-size: 28rpx;
  295. color: #999;
  296. // margin-top: 20rpx;
  297. }
  298. }
  299. }
  300. .screen_row {
  301. display: flex;
  302. margin-bottom: 24rpx;
  303. width: 100%;
  304. justify-content: space-between;
  305. .selectItem {
  306. display: flex;
  307. padding: 0 16rpx;
  308. border: 2rpx solid rgba(25,137,250,0.3);
  309. height: 60rpx;
  310. border-radius: 16rpx;
  311. background-color: #FFFFFF;
  312. line-height: 60rpx;
  313. align-items: center;
  314. width: 29%;
  315. .text {
  316. color: $themC;
  317. flex: 1;
  318. text-align: center;
  319. font-size: 26rpx;
  320. }
  321. .downIcon {
  322. width: 24rpx;
  323. }
  324. }
  325. }
  326. .signbox {
  327. padding: 40rpx 50rpx;
  328. text-align: center;
  329. font-size: 28rpx;
  330. color: #333;
  331. .tit {
  332. padding: 30rpx 0 60rpx 0;
  333. color: $themC;
  334. font-weight: 700;
  335. }
  336. .btnBg {
  337. width: 370rpx;
  338. margin: auto;
  339. }
  340. }
  341. </style>