江西小程序管理端
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.

288 lines
7.1 KiB

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