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.

313 lines
8.1 KiB

8 months ago
5 months ago
8 months ago
8 months ago
8 months ago
8 months ago
5 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
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
8 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <view class=" pad">
  4. <view class="status_bar"></view>
  5. <view class="" style="height: 44rpx;"></view>
  6. <view class="searchBox">
  7. <searchRow placeholder="搜索学员姓名、学员手机号" @searchFn="searchFn"></searchRow>
  8. </view>
  9. <view class="card" style="margin-bottom: 20px;">
  10. <view class="myClass">
  11. <view class="leftTxt">我的排课</view>
  12. <view class="leftBtn" @click="$goPage('/pages/recordEntry/operate/mySchedule/mySchedule')">去管理</view>
  13. </view>
  14. </view>
  15. </view>
  16. <div class="pad">
  17. <view class="tabs">
  18. <view class="tab" v-for="(item,index) in tabArr" :key="index" :class="{active: params.status==item.id}"
  19. @click="changeTab(item)">{{ item.text }}</view>
  20. </view>
  21. <view class="screen_row">
  22. <view class="selectItem" @click="showSubject=true">
  23. <view class="text oneRowText">{{screen.subject}}</view>
  24. <view class="downIcon">
  25. <u-icon name="arrow-down"></u-icon>
  26. </view>
  27. </view>
  28. <view class="selectItem" @click="showCar=true">
  29. <view class="text oneRowText">{{screen.car}}</view>
  30. <view class="downIcon">
  31. <u-icon name="arrow-down"></u-icon>
  32. </view>
  33. </view>
  34. <view class="selectItem">
  35. <view class="text" @click="showDatePicker=true">{{screen.timer}}</view>
  36. <view class="downIcon">
  37. <u-icon name="arrow-down" v-if="screen.timer=='预约时间'" @click="showDatePicker=true"></u-icon>
  38. <u-icon name="close" :size="'28rpx'" v-else @click="cancelDate"></u-icon>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="list" v-if="list.length">
  43. <view class="card" v-for="(item,index) in list" :key="index">
  44. <appointItem-operate @click.native="$goPage('/pages/recordEntry/operate/detail/detail?id='+item.id)" :item="item"/>
  45. </view>
  46. </view>
  47. <!-- <nodata v-if="!list.length"></nodata> -->
  48. <view v-if="list.length">
  49. <u-loadmore :status="status" />
  50. </view>
  51. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  52. <UserTab name ='实操训练'></UserTab>
  53. </div>
  54. <u-calendar :show="showDatePicker" ref="calendar" @confirm="confirmDatePicker" @close="cancelDate" :minDate="minDate" :maxDate="maxDate"></u-calendar>
  55. <u-picker :show="showCar" :columns="carColumns" keyName="licnum" @confirm="confirmCar" @cancel="showCar=false" :closeOnClickOverlay="true" @close="showCar=false"></u-picker>
  56. <u-picker :show="showSubject" :columns="subjectTxt" keyName="lab" @confirm="confirmSubject" @cancel="showSubject=false" :closeOnClickOverlay="true" @close="showSubject=false"></u-picker>
  57. </view>
  58. </template>
  59. <script>
  60. import { bookingMasterPage, carPage} from '@/config/api.js'
  61. export default {
  62. data() {
  63. return {
  64. tabArr: [{
  65. text: '未签到',
  66. id: 0
  67. },
  68. {
  69. text: '已签到',
  70. id: 1
  71. },
  72. {
  73. text: '已签退',
  74. id: 2
  75. },
  76. ],//状态:0:未签到,1:已签到,2:已签退,3:已过期,9:已取消,示例值(2)
  77. currentTab: 1,
  78. screen: {
  79. subject: '训练科目',
  80. car: '预约车辆',
  81. timer: '预约时间'
  82. },
  83. status: 'loading',
  84. subjectTxt: [
  85. [
  86. {lab: '不限', id: 0},
  87. {lab: '科目二', id: 2},
  88. {lab: '科目三', id: 3},
  89. ]
  90. ],
  91. // :0:不限;2:科目二;3:科目三
  92. showDatePicker: false,
  93. showCar: false,
  94. showSubject: false,
  95. carColumns: [],
  96. params: {
  97. pageNo: 1,
  98. pageSize: 20,
  99. status: 0,
  100. carNumber: '',
  101. bookingTime: []
  102. },
  103. list: [],
  104. minDate: 0,
  105. maxDate: 0,
  106. }
  107. },
  108. onLoad() {
  109. console.log('我的页面')
  110. this.params.coachId = this.vuex_coachId
  111. this.carPageFn()
  112. // this.bookingMasterPageFn()
  113. let nowTime = new Date()*1
  114. // 一个月的时间戳
  115. const oneMonthMilliseconds = 30 * 24 * 60 * 60 * 1000;
  116. this.minDate = parseInt( nowTime - oneMonthMilliseconds )
  117. this.maxDate = parseInt( nowTime + oneMonthMilliseconds )
  118. },
  119. onShow() {
  120. uni.hideTabBar();
  121. this.initList()
  122. },
  123. onPullDownRefresh() {
  124. this.initList()
  125. },
  126. onReachBottom() {
  127. if(this.list<this.total) {
  128. this.initList()
  129. }
  130. },
  131. methods: {
  132. searchFn(val) {
  133. // isPhone = this. uni.$u.test.mobile(this.FormData.phone)
  134. if(/^\d+$/.test(val)) {
  135. // 电话搜索
  136. if( !this.$u.test.mobile(val)) return this.$u.toast('请输入正确的电话号码')
  137. this.params.studentName = ''
  138. this.params.studentPhone = val
  139. }else {
  140. // 学员姓名搜索
  141. this.params.studentPhone = ''
  142. this.params.studentName = val
  143. }
  144. this.status = 'loading'
  145. this.list = []
  146. this.params.pageNo = 1
  147. this.bookingMasterPageFn()
  148. },
  149. cancelDate() {
  150. this.showDatePicker=false
  151. this.params.bookingStartTime = ''
  152. this.params.bookingEndTime = ''
  153. this.screen.timer = '预约时间'
  154. this.initList()
  155. },
  156. async initList() {
  157. this.status = 'loading'
  158. this.list = []
  159. this.params.pageNo = 1
  160. this.params.studentName = ''
  161. this.params.studentPhone = ''
  162. this.bookingMasterPageFn()
  163. },
  164. async bookingMasterPageFn() {
  165. console.log(this.params)
  166. let obj = Object.assign({},this.params)
  167. console.log(obj.carNumber)
  168. if(obj.carNumber=='不限') delete obj.carNumber
  169. const {data: res } = await bookingMasterPage(obj)
  170. // uni.$u.http.get('/api/admin-api/business/booking/master/page', this.params ).then(res => {
  171. // console.log(res)
  172. // }).catch(err => {
  173. // })
  174. this.params.pageNo ++
  175. this.list.push(...res.list)
  176. this.total = res.total
  177. if(this.list.length>=this.total) this.status = 'nomore'
  178. console.log(res)
  179. },
  180. changeTab(item) {
  181. if(item.id==this.params.status) return
  182. this.params.status = item.id
  183. this.initList()
  184. },
  185. confirmDatePicker(val) {
  186. this.showDatePicker = false
  187. this.screen.timer = val[0]
  188. this.params.bookingStartTime = this.screen.timer+ ' 00:00:00'
  189. this.params.bookingEndTime = this.screen.timer+ ' 23:59:59'
  190. // this.params.bookingTime = [startTimer, bookingEndTimer]
  191. this.initList()
  192. },
  193. confirmCar(val) {
  194. let item = val.value[0]
  195. this.screen.car = item.licnum
  196. this.params.carNumber = item.licnum
  197. this.showCar = false
  198. this.initList()
  199. },
  200. confirmSubject(val) {
  201. let item = val.value[0]
  202. this.screen.subject = item.lab
  203. this.params.subject = item.id
  204. this.initList()
  205. this.showSubject = false
  206. },
  207. async carPageFn() {
  208. let obj = {
  209. pageNo: 1,
  210. pageSize: 40,
  211. schoolId: this.vuex_schoolId,
  212. coachId: this.vuex_coachId
  213. }
  214. const {data: res} = await carPage(obj)
  215. res.list.unshift({licnum: '不限', id: 0})
  216. this.carColumns = [res.list]
  217. },
  218. }
  219. }
  220. </script>
  221. <style lang="scss" scoped>
  222. .pageBgImg {
  223. padding-bottom: 130rpx;
  224. .searchBox {
  225. padding: 24rpx 0;
  226. }
  227. .card {
  228. padding: 0 28rpx;
  229. margin-bottom: 20rpx;
  230. .myClass {
  231. height: 108rpx;
  232. display: flex;
  233. justify-content: space-between;
  234. padding: 0 10rpx;
  235. align-items: center;
  236. .leftTxt {
  237. font-size: 32rpx;
  238. font-weight: 500;
  239. }
  240. .leftBtn {
  241. width: 192rpx;
  242. height: 60rpx;
  243. background: $themC; border-radius: 8rpx;
  244. line-height: 60rpx;
  245. text-align: center;
  246. font-weight: 500;
  247. color: #FFFFFF;
  248. }
  249. }
  250. }
  251. .tabs {
  252. height: 72rpx;
  253. background: #FFFFFF;
  254. border-radius: 16rpx;
  255. display: flex;
  256. line-height: 72rpx;
  257. text-align: center;
  258. color: #ADADAD;
  259. margin: -24rpx 0 24rpx 0;
  260. .tab {
  261. flex: 1;
  262. text-align: center;
  263. &.active {
  264. background: rgba(25, 137, 250, 0.1);
  265. border: 2rpx solid #1989FA;
  266. color: $themC;
  267. border-radius: 16rpx;
  268. }
  269. }
  270. }
  271. .screen_row {
  272. display: flex;
  273. margin-bottom: 24rpx;
  274. width: 100%;
  275. justify-content: space-between;
  276. .selectItem {
  277. display: flex;
  278. padding: 0 18rpx;
  279. border: 2rpx solid rgba(25,137,250,0.3);
  280. height: 60rpx;
  281. border-radius: 16rpx;
  282. background-color: #FFFFFF;
  283. line-height: 60rpx;
  284. align-items: center;
  285. width: 29%;
  286. .text {
  287. color: $themC;
  288. flex: 1;
  289. white-space: nowrap;
  290. text-align: center;
  291. }
  292. .downIcon {
  293. width: 24rpx;
  294. }
  295. }
  296. }
  297. .list {
  298. .card {
  299. appointitem-operate {}
  300. }
  301. }
  302. }
  303. </style>