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

1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
10 months ago
10 months ago
1 year ago
11 months ago
1 year ago
1 year ago
10 months ago
11 months ago
10 months ago
1 year ago
11 months ago
11 months ago
1 year ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
10 months ago
10 months ago
1 year ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
1 year ago
1 year ago
  1. <template>
  2. <view class="main">
  3. <view class="blueBg">
  4. <!-- <topNavbar title="预约记录"></topNavbar> -->
  5. <view class="pad">
  6. <view class="searchBox">
  7. <searchRow placeholder="搜索学员姓名、学员手机号" @searchFn="searchFn"></searchRow>
  8. </view>
  9. <view class="tabs">
  10. <view class="tab" @click="changeTab(0)" :class="{active: params.writtenoffStatus==0}">待核销</view>
  11. <view class="tab" @click="changeTab(1)" :class="{active: params.writtenoffStatus==1}">已核销</view>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="navs">
  16. <view class="nav" v-for="(item,index) in tabsList" :key="index" :class="{active: params.subject==item.id}" @click="changeNav(item)">{{ item.text }}</view>
  17. </view>
  18. <view class="pad">
  19. <view class="total_row">
  20. <view class="total"> <text v-if="total">{{total}}条记录</text></view>
  21. <view class="screen" @click="showDate=true">
  22. <view class="text"><text v-if="params.beginTime||params.trainType"></text> 筛选</view>
  23. <view class="icon">
  24. <image src="@/static/images/coach/screen.png" mode=""></image>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="card" @click="goPage" v-for="(item,index) in list" :key="index">
  29. <appointItem :item="item"/>
  30. </view>
  31. </view>
  32. <view style="padding-bottom: 100rpx;" v-if="list.length">
  33. <u-loadmore :status="status" />
  34. </view>
  35. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  36. <UserTab name ='预约记录'></UserTab>
  37. <u-popup :show="showDate" mode="bottom" :round="20" :closeable="true" :closeOnClickOverlay="true">
  38. <view class="popupBox">
  39. <view class="pad">
  40. <view class="car">
  41. <view class="h1">车型</view>
  42. <view class="car_row">
  43. <view class="carItem" @click="screenCarFn('C1')" :class="{active: screen.trainType=='C1'}">C1</view>
  44. <view class="carItem" @click="screenCarFn('C2')" :class="{active: screen.trainType=='C2'}">C2</view>
  45. </view>
  46. </view>
  47. <view class="car">
  48. <view class="h1" >日期</view>
  49. <view class="car_row border" @click="showDatePicker=true">
  50. <mySelect placeholder="请选择日期" :value="screen.screenDate"></mySelect>
  51. <u-icon name="arrow-down" :size="12" :color="'#ADADAD'" style="margin-left: 12rpx;"></u-icon>
  52. </view>
  53. </view>
  54. <view class="btn_row">
  55. <view class="btnBorder btn" @click="resetScreen">重置</view>
  56. <view class="btnBg btn" @click="screenSearch">确定</view>
  57. </view>
  58. </view>
  59. </view>
  60. </u-popup>
  61. <u-datetime-picker
  62. :show="showDatePicker"
  63. mode="date"
  64. :closeOnClickOverlay="true"
  65. :minDate="1587524800000"
  66. @confirm="confirmDatePicker"
  67. @cancel="showDatePicker=false"
  68. @close="showDatePicker=false"
  69. ></u-datetime-picker>
  70. </view>
  71. </template>
  72. <script>
  73. import { examSimulationPages } from '@/config/api.js'
  74. export default {
  75. data() {
  76. return {
  77. tabsList: [
  78. {id: 0, text: '全部'},
  79. {id: 2, text: '科目二'},
  80. {id: 3, text: '科目三'},
  81. ],
  82. showDate: false,
  83. showDatePicker: false,
  84. params: {
  85. pageNo: 1,
  86. pageSize: 20,
  87. coachId: 0,
  88. writtenoffStatus: 0,
  89. subject: 0,
  90. studentName: '',
  91. studentPhone: ''
  92. },
  93. screen: {
  94. trainType: '',
  95. screenDate: ''
  96. },
  97. list: [],
  98. status: 'loading',
  99. total: 20
  100. }
  101. },
  102. created() {
  103. this.params.coachId = this.vuex_userInfo.user.coachId
  104. // this.params.deptId = this.vuex_userInfo.user.deptId
  105. // this.examSimulationPagesFn()
  106. this.initList()
  107. },
  108. methods: {
  109. async examSimulationPagesFn() {
  110. let obj = Object.assign({},this.params)
  111. if(obj.subject==0) delete obj.subject
  112. const {data: res} = await examSimulationPages(obj)
  113. this.params.pageNo ++
  114. this.total = res.total
  115. this.list.push(...res.list)
  116. if(this.list.length>=this.total) this.status = 'nomore'
  117. console.log(res)
  118. },
  119. initList() {
  120. this.status = 'loading'
  121. this.list = []
  122. this.params.pageNo = 1
  123. this.examSimulationPagesFn()
  124. },
  125. changeTab(num) {
  126. this.params.writtenoffStatus = num
  127. this.initList()
  128. },
  129. changeNav(item) {
  130. this.params.subject = item.id
  131. this.initList()
  132. },
  133. goPage() {
  134. this.$goPage('/pages/recordEntry/examine/examineRecord/detail/detail')
  135. },
  136. confirmDatePicker(val) {
  137. this.screen.screenDate = this.$u.timeFormat(val.value, 'yyyy-mm-dd')
  138. this.showDatePicker = false
  139. },
  140. // 选择筛选日期
  141. selectDateClick(val) {
  142. console.log(val)
  143. this.showDate = false
  144. },
  145. screenCarFn(trainType) {
  146. this.screen.trainType = trainType
  147. },
  148. resetScreen() {
  149. this.screen.trainType = ''
  150. this.screen.screenDate = ''
  151. },
  152. // 筛选搜索
  153. screenSearch() {
  154. this.params.trainType = this.screen.trainType
  155. if(!this.screen.screenDate) {
  156. this.params.beginTime = ''
  157. this.params.endTime = ''
  158. }else {
  159. this.params.beginTime = this.screen.screenDate + ' 00:00:00'
  160. this.params.endTime = this.screen.screenDate + ' 23:59:59'
  161. }
  162. this.showDate = false
  163. this.initList()
  164. },
  165. searchFn(val) {
  166. if(uni.$u.test.mobile(val)) {
  167. this.params.studentPhone = val
  168. this.params.studentName = ''
  169. }else {
  170. this.params.studentName = val
  171. this.params.studentPhone = ''
  172. }
  173. this.initList()
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .popupBox {
  180. padding-bottom: 30rpx;
  181. .btn_row {
  182. padding-top: 20rpx;
  183. display: flex;
  184. justify-content: space-between;
  185. .btn {
  186. width: 48%;
  187. }
  188. }
  189. .car {
  190. margin-bottom: 20rpx;
  191. .h1 {
  192. line-height: 100rpx;
  193. }
  194. .car_row {
  195. display: flex;
  196. &.border {
  197. width: 300rpx;
  198. line-height: 70rpx;
  199. border: 1rpx solid #d8d8d8;
  200. border-radius: 10rpx;
  201. padding: 0 16rpx;
  202. justify-content: space-between;
  203. }
  204. .carItem {
  205. width: 130rpx;
  206. background: #f3f3f3;
  207. border-radius: 8rpx;
  208. text-align: center;
  209. line-height: 60rpx;
  210. color: #333;
  211. margin-right: 58rpx;
  212. &.active {
  213. background: $themC;
  214. color: #fff;
  215. }
  216. }
  217. }
  218. }
  219. }
  220. .main {
  221. width: 100%;
  222. min-height: 100vh;
  223. background: #f3f3f3;
  224. .blueBg {
  225. background: #1989FA;
  226. padding: 140rpx 0 20rpx 0;
  227. }
  228. .total_row {
  229. display: flex;
  230. justify-content: space-between;
  231. height: 82rpx;
  232. align-items: center;
  233. .total {
  234. font-size: 24rpx;
  235. color: #686B73;
  236. text-align: right;
  237. line-height: 82rpx;
  238. }
  239. .screen {
  240. display: flex;align-items: center;
  241. color: $themC;
  242. margin-left: 8rpx;
  243. font-size: 28rpx;
  244. .icon {
  245. width: 24rpx;
  246. height: 24rpx;
  247. }
  248. }
  249. }
  250. .card {
  251. padding: 0 20rpx;
  252. }
  253. }
  254. .searchBox {
  255. padding: 24rpx 0 20rpx 0;
  256. }
  257. .tabs {
  258. display: flex;
  259. width: 100%;
  260. height: 72rpx;
  261. background: #FFFFFF;
  262. border-radius: 16rpx;
  263. .tab {
  264. flex: 1;
  265. text-align: center;
  266. line-height: 72rpx;
  267. color: #ADADAD;
  268. font-size: 28rpx;
  269. &.active {
  270. background: rgba(25,137,250,0.1);
  271. border-radius: 16rpx;
  272. border: 2rpx solid #1989FA;
  273. color: $themC;
  274. font-weight: 600;
  275. }
  276. }
  277. }
  278. .navs {
  279. display: flex;
  280. justify-content: space-between;
  281. color: #fff;
  282. font-size: 28rpx;
  283. padding: 0rpx 108rpx 0rpx 130rpx;
  284. color: $themC;
  285. background: #fff;
  286. height: 100rpx;
  287. .nav {
  288. line-height: 100rpx;
  289. &.active {
  290. font-weight: 500;
  291. position: relative;
  292. &::before {
  293. position: absolute;
  294. left: 50%;
  295. transform: translateX(-50%);
  296. bottom: 20rpx;
  297. content: '';
  298. width: 56rpx;
  299. height: 6rpx;
  300. background: $themC;
  301. border-radius: 3rpx;
  302. }
  303. }
  304. }
  305. }
  306. </style>