tutorialRecord.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <template>
  2. <view class="box u-skeleton">
  3. <u-skeleton :loading="loading" :animation="true"></u-skeleton>
  4. <view style="display: flex;flex-direction: column;position: fixed;top: 0;left: 0;width: 100%;">
  5. <view class="tabbar">
  6. <u-dropdown>
  7. <u-dropdown-item v-model="tabIndex"
  8. :title="tabbar[tabIndex].label=='全部' ?'类型' : tabbar[tabIndex].label" :options="tabbar"
  9. @change="tabClick"></u-dropdown-item>
  10. <u-dropdown-item v-model="typeIndex"
  11. :title="typeArr[typeIndex].label=='全部' ?'状态' : typeArr[typeIndex].label" :options="typeArr"
  12. @change="typeClick"></u-dropdown-item>
  13. </u-dropdown>
  14. <view class="top">
  15. <view>
  16. <text>日期:</text>
  17. <u-picker v-model="startshow" mode="time" safe-area-inset-bottom="true" :show-time-tag="false"
  18. @confirm="start_confirm"></u-picker>
  19. <text style="margin-right: 5px;" @click="startshow = true">{{starttime}}</text>
  20. <u-icon name="close-circle-fill" size="30" @click="closeTime" color="#ccc"
  21. v-if="starttime!='请选择'"></u-icon>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="message" v-if="list.length>0">
  27. <view class="msg-li" v-for="(item,index) in list" :key="index">
  28. <view class="li-top">
  29. <text style="font-size: 15px;font-weight: bold;color: #333333;">{{item.lesson.name}}</text>
  30. <text class="status-text" v-if="item.status == 6"
  31. @click="lookCheckStep(item)">{{item.status_text}}</text>
  32. <text class="status-text-loading"
  33. v-if="item.status == 1 || item.status == 2 || item.status == 4"
  34. @click="lookCheckStep(item)">{{item.status_text}}</text>
  35. <text class="status-text-fail" v-if="item.status == 3 || item.status == 5"
  36. @click="lookCheckStep(item)">{{item.status_text}}</text>
  37. <text class="status-text-fail" v-if="item.status == 0 || item.status == 7"
  38. @click="lookCheckStep(item)">{{item.status_text}}</text>
  39. </view>
  40. <view class="li-center">
  41. <text>教师:{{item.schedule_data.teacher? item.schedule_data.teacher.name : '--'}} {{item.schedule_data.teacher ? item.schedule_data.teacher.username : '--'}}</text>
  42. <text>班级:{{item.schedule_data.grade.name}}</text>
  43. <text>原上课时间:{{item.schedule_data.day}} · 第{{item.schedule_data.week}}周 · {{item.schedule_data.week_index}} · {{item.schedule_data.time.name}}节</text>
  44. <text v-if="item.type == 2">调整后时间:{{item.migrate_data.day}} · 第{{item.migrate_data.week}}周 · {{item.migrate_data.week_index}} · {{item.migrate_data.time.name}}节</text>
  45. <text>申请类型:
  46. <text style="color: #ff4d4f;" v-if="item.type == 1">停课</text>
  47. <text style="color: #ffba00;" v-if="item.type == 2">调课</text>
  48. <text style="color: #3665FF;" v-if="item.type == 3">补课</text>
  49. </text>
  50. </view>
  51. <view class="li-bottom" @click="detail(item.id)">
  52. <text style="font-size: 13px;font-weight: 400;color: #333;">申请时间:{{item.created_at}}</text>
  53. <view>
  54. <text>查看详情</text>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="look-steps" @click="handleStep" v-if="!startshow">
  59. <image src="../../static/image/mine/icon_8.png" mode=""></image>
  60. </view>
  61. <u-loadmore :status="statuss" :load-text="loadText" icon="true" v-if="!tabShow && !show" />
  62. </view>
  63. <view class="empty" v-else style="padding-top: 110px;">
  64. <u-empty text="暂无记录~" mode="favor"></u-empty>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. startshow: false,
  73. starttime: '请选择',
  74. tabbar: [{
  75. label: '全部',
  76. value: 0
  77. },
  78. {
  79. label: '待院系审核',
  80. value: 1
  81. },
  82. {
  83. label: '待实验中心审核',
  84. value: 2
  85. },
  86. {
  87. label: '院系审核失败',
  88. value: 3
  89. },
  90. {
  91. label: '实验中心审核通过',
  92. value: 4
  93. },
  94. {
  95. label: '实验中心审核失败',
  96. value: 5
  97. },
  98. {
  99. label: '已完成',
  100. value: 6
  101. },
  102. ],
  103. tabIndex: 0,
  104. typeArr: [{
  105. label: '全部',
  106. value: 0
  107. },
  108. {
  109. label: '停课',
  110. value: 1
  111. },
  112. {
  113. label: '调课',
  114. value: 2
  115. },
  116. {
  117. label: '补课',
  118. value: 3
  119. },
  120. ],
  121. typeIndex: 0,
  122. show: false,
  123. tabShow: false,
  124. list: '',
  125. statuss: 'loadmore',
  126. loadText: {
  127. loadmore: '轻轻上拉',
  128. loading: '努力加载中',
  129. nomore: '实在没有了'
  130. },
  131. page: 1,
  132. meta: '',
  133. loading: true
  134. }
  135. },
  136. methods: {
  137. //查看流程
  138. handleStep() {
  139. uni.navigateTo({
  140. url: '/pages/record/handlesteps'
  141. })
  142. },
  143. //查看停调补课审核进度
  144. lookCheckStep(item) {
  145. console.log(11)
  146. uni.navigateTo({
  147. url: '/pages/index/checkStep?id=' + item.id + '&time=' + item.created_at + '&apply_name=' +
  148. (item.admin ? item.admin.name : '--')
  149. })
  150. },
  151. start_confirm(e) {
  152. //开始时间确认事件
  153. console.log(e, 'chufale')
  154. this.starttime = e.year + '-' + e.month + '-' + e.day
  155. this.lists()
  156. },
  157. closeTime() {
  158. this.starttime = '请选择'
  159. this.lists()
  160. },
  161. detail(id) {
  162. //查看详情事件
  163. uni.navigateTo({
  164. url: '/pages/record/tutorialDetail?id=' + id
  165. })
  166. },
  167. typeClick(index) {
  168. //选择类型点击事件
  169. this.typeIndex = index;
  170. this.show = false;
  171. this.lists()
  172. },
  173. tabClick(index) {
  174. this.tabIndex = index;
  175. this.tabShow = false;
  176. this.lists()
  177. },
  178. lists() {
  179. var data = {
  180. type: this.typeIndex == 0 ? '' : this.typeIndex,
  181. status: this.tabIndex == 0 ? '' : this.tabIndex,
  182. created_at: this.starttime == '请选择' ? '' : this.starttime
  183. }
  184. this.$u.get('/school/schedule/record', data).then(res => {
  185. console.log(res)
  186. var list = res.data.list;
  187. this.loading = false;
  188. this.meta = res.data.meta.pagination;
  189. if (res.data.list.length < 10) {
  190. this.statuss = 'nomore'
  191. }
  192. list.map((item) => {
  193. if (item.migrate_data != null) {
  194. switch (item.migrate_data.week_index) {
  195. case 0:
  196. item.migrate_data.week_index = '星期一'
  197. break
  198. case 1:
  199. item.migrate_data.week_index = '星期二'
  200. break
  201. case 2:
  202. item.migrate_data.week_index = '星期三'
  203. break
  204. case 3:
  205. item.migrate_data.week_index = '星期四'
  206. break
  207. case 4:
  208. item.migrate_data.week_index = '星期五'
  209. break
  210. case 5:
  211. item.migrate_data.week_index = '星期六'
  212. break
  213. case 6:
  214. item.migrate_data.week_index = '星期日'
  215. break
  216. }
  217. }
  218. switch (item.schedule_data.week_index) {
  219. case 0:
  220. item.schedule_data.week_index = '星期一'
  221. break
  222. case 1:
  223. item.schedule_data.week_index = '星期二'
  224. break
  225. case 2:
  226. item.schedule_data.week_index = '星期三'
  227. break
  228. case 3:
  229. item.schedule_data.week_index = '星期四'
  230. break
  231. case 4:
  232. item.schedule_data.week_index = '星期五'
  233. break
  234. case 5:
  235. item.schedule_data.week_index = '星期六'
  236. break
  237. case 6:
  238. item.schedule_data.week_index = '星期日'
  239. break
  240. }
  241. return item
  242. })
  243. this.list = res.data.list;
  244. })
  245. },
  246. // 获取弹出框选择的部门
  247. getValue(e) {
  248. console.log(e);
  249. },
  250. },
  251. onLoad() {
  252. console.log(11)
  253. this.lists()
  254. },
  255. onPullDownRefresh() {
  256. this.lists()
  257. this.page = 1;
  258. uni.stopPullDownRefresh()
  259. },
  260. onReachBottom() {
  261. this.statuss = 'loading';
  262. var page = this.page;
  263. if (page >= this.meta.total_pages) {
  264. this.statuss = 'nomore';
  265. } else {
  266. var data = {
  267. type: this.typeIndex == 0 ? '' : this.typeIndex,
  268. status: this.tabIndex == 0 ? '' : this.tabIndex,
  269. page: Number(page + 1)
  270. }
  271. this.$u.get('/school/schedule/record', data).then(res => {
  272. console.log(res)
  273. this.list = this.list.concat(res.data.list);
  274. this.page = ++page;
  275. })
  276. this.statuss = 'loading';
  277. }
  278. },
  279. }
  280. </script>
  281. <style lang="scss" scoped>
  282. .box {
  283. background: #F9F9F9;
  284. min-height: 100vh;
  285. padding-bottom: 30px;
  286. box-sizing: border-box;
  287. .top {
  288. box-sizing: border-box;
  289. display: flex;
  290. align-items: center;
  291. justify-content: space-between;
  292. position: absolute;
  293. right: 10px;
  294. z-index: 11;
  295. }
  296. .tabbar {
  297. width: 100%;
  298. height: 46px;
  299. background: #FFFFFF;
  300. display: flex;
  301. align-items: center;
  302. position: relative;
  303. }
  304. .message {
  305. width: 91.5%;
  306. display: flex;
  307. flex-direction: column;
  308. margin: 0 auto;
  309. padding-top: 46px;
  310. .msg-li {
  311. width: 100%;
  312. display: flex;
  313. flex-direction: column;
  314. padding: 12px 12px 9px 12px;
  315. box-sizing: border-box;
  316. background: white;
  317. margin-top: 12px;
  318. .li-top {
  319. width: 100%;
  320. display: flex;
  321. align-items: center;
  322. justify-content: space-between;
  323. padding-bottom: 12px;
  324. }
  325. .li-center {
  326. padding: 7px 0px 12px 0px;
  327. border-top: 1px solid #F2F2F2;
  328. border-bottom: 1px solid #F2F2F2;
  329. display: flex;
  330. flex-direction: column;
  331. justify-content: space-between;
  332. font-size: 13px;
  333. color: #333;
  334. font-weight: 400;
  335. box-sizing: content-box;
  336. text {
  337. padding-top: 5px;
  338. }
  339. }
  340. .li-bottom {
  341. display: flex;
  342. align-items: center;
  343. justify-content: space-between;
  344. margin-top: 9px;
  345. view {
  346. width: 64px;
  347. height: 28px;
  348. background: #3665FF;
  349. border-radius: 14px 14px 14px 14px;
  350. opacity: 1;
  351. display: flex;
  352. align-items: center;
  353. justify-content: center;
  354. font-size: 12px;
  355. color: #FFFFFF;
  356. font-weight: 400;
  357. }
  358. }
  359. }
  360. }
  361. }
  362. .status-text {
  363. font-size: 12px;
  364. font-weight: 400;
  365. color: #13ce66;
  366. }
  367. .status-text-loading {
  368. font-size: 12px;
  369. font-weight: 400;
  370. color: #ffba00;
  371. }
  372. .status-text-fail {
  373. font-size: 12px;
  374. font-weight: 400;
  375. color: #ff4d4f;
  376. }
  377. //审核流程
  378. .look-steps {
  379. position: fixed;
  380. height: 45px;
  381. width: 45px;
  382. line-height: 45px;
  383. border-radius: 50%;
  384. background-color: #3665FF;
  385. // border: solid 1px #3665FF;
  386. right: 30px;
  387. text-align: center;
  388. cursor: pointer;
  389. bottom: 18vh;
  390. image {
  391. margin-top: 5px;
  392. width: 30px;
  393. height: 30px;
  394. }
  395. }
  396. </style>