ManageEvaluation.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <template>
  2. <div class="wrap">
  3. <div class="searchSection">
  4. <div class="searchDate">
  5. <div class="date startDate" @click="dateSection.status = true">
  6. 开始
  7. <span>{{dateSection.showStartDate}}</span>
  8. </div>-
  9. <div class="date endDate" @click="dateEndSection.status = true">
  10. 结束
  11. <span>{{dateEndSection.showEndDate}}</span>
  12. </div>
  13. </div>
  14. <!-- <div class="searchMore">
  15. 筛选<i class="arrowDown"></i>
  16. </div>-->
  17. <van-dropdown-menu active-color="#14928A">
  18. <van-dropdown-item title="筛选" ref="item" v-model="search.status">
  19. <!-- <div class="dropItem">
  20. <p class="dropTitle">评价类型</p>
  21. <div class="radioGroup">
  22. <span class="actived">月报</span>
  23. <span>课次评价</span>
  24. </div>
  25. </div>-->
  26. <div class="dropItem">
  27. <p class="dropTitle">评价进度</p>
  28. <div class="radioGroup">
  29. <span :class="search.hasReview==0?'actived':''" @click="search.hasReview=0">待完成</span>
  30. <span :class="search.hasReview==1?'actived':''" @click="search.hasReview=1">已完成</span>
  31. </div>
  32. </div>
  33. <div class="dropItem">
  34. <p class="dropTitle">提交作业</p>
  35. <div class="radioGroup">
  36. <span
  37. :class="search.hasHandHomework==1?'actived':''"
  38. @click="search.hasHandHomework=1"
  39. >是</span>
  40. <span
  41. :class="search.hasHandHomework==0?'actived':''"
  42. @click="search.hasHandHomework=0"
  43. >否</span>
  44. </div>
  45. </div>
  46. <div class="dropItem">
  47. <p class="dropTitle">完成双向沟通</p>
  48. <div class="radioGroup">
  49. <span :class="search.hasLiaison==1?'actived':''" @click="search.hasLiaison=1">是</span>
  50. <span :class="search.hasLiaison==0?'actived':''" @click="search.hasLiaison=0">否</span>
  51. </div>
  52. </div>
  53. <div class="btnGroup">
  54. <div class="btn btn-reset" @click="resetSerach">重置</div>
  55. <div class="btn btn-sure" @click="submitInfo">确定</div>
  56. </div>
  57. </van-dropdown-item>
  58. </van-dropdown-menu>
  59. </div>
  60. <!-- -->
  61. <!-- <van-pull-refresh v-model="refreshing" @refresh="onRefresh"> -->
  62. <div>
  63. <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getList" >
  64. <van-cell
  65. v-for="(item,index) in courseList"
  66. :key="index"
  67. class="cellGroup"
  68. :title="item.classDate | filterClass"
  69. title-class="sectionTitle"
  70. value-class="sectionValue"
  71. >
  72. <template solt="default">
  73. <p class="content van-ellipsis">{{ item.courseName }}</p>
  74. <van-button
  75. type="primary"
  76. round
  77. size="small"
  78. v-if="item.reviewId==0"
  79. @click="submitReview(item)"
  80. >提交评价</van-button>
  81. <van-button
  82. type="primary"
  83. round
  84. size="small"
  85. v-if="item.reviewId>0"
  86. @click="submitReview(item)"
  87. >修改评价</van-button>
  88. </template>
  89. </van-cell>
  90. </van-list>
  91. </div>
  92. <!-- </van-pull-refresh> -->
  93. <!-- -->
  94. <!-- <m-empty class="empty" v-else key="data" /> -->
  95. <!-- 日期开始弹窗 -->
  96. <van-popup position="bottom" v-model="dateSection.status">
  97. <van-datetime-picker
  98. v-model="dateSection.currentDate"
  99. type="date"
  100. :min-date="dateSection.minDate"
  101. :max-date="dateSection.maxDate"
  102. :formatter="formatter"
  103. @confirm="confirmStartTime()"
  104. @cancel="cancelTime()"
  105. />
  106. </van-popup>
  107. <!-- 日期结束弹窗 -->
  108. <van-popup position="bottom" v-model="dateEndSection.status">
  109. <van-datetime-picker
  110. v-model="dateEndSection.currentDate"
  111. type="date"
  112. :min-date="dateSection.minDate"
  113. :max-date="dateSection.maxDate"
  114. :formatter="formatter"
  115. @confirm="confirmEndTime()"
  116. @cancel="cancelTime()"
  117. />
  118. </van-popup>
  119. <van-popup position="bottom" v-model="search.status"></van-popup>
  120. </div>
  121. </template>
  122. <script>
  123. import MEmpty from "@/components/MEmpty";
  124. import { getPracticeGroup } from "@/api/teacher";
  125. export default {
  126. name: "teacherList",
  127. components: { MEmpty },
  128. data() {
  129. return {
  130. str: "2020-01-23 12:12:12",
  131. dateSection: {
  132. status: false,
  133. minDate: new Date(2020, 0, 1),
  134. maxDate: new Date(2025, 10, 1),
  135. currentDate: null,
  136. showStartDate: null
  137. },
  138. dateEndSection: {
  139. status: false,
  140. minDate: new Date(2020, 0, 1),
  141. maxDate: new Date(2025, 10, 1),
  142. currentDate: null,
  143. showEndDate: null
  144. },
  145. search: {
  146. status: false,
  147. hasReview: null,
  148. hasHandHomework: null,
  149. hasLiaison: null
  150. },
  151. courseList: [],
  152. loading: false,
  153. finished: false,
  154. refreshing: false,
  155. page: 1
  156. };
  157. },
  158. created() {
  159. let params = this.$route.query;
  160. if (params.Authorization) {
  161. localStorage.setItem("Authorization", decodeURI(params.Authorization));
  162. localStorage.setItem("userInfo", decodeURI(params.Authorization));
  163. }
  164. },
  165. mounted() {
  166. this.dateSection.currentDate = new Date();
  167. this.dateSection.showStartDate = this.timeFormat(
  168. this.dateSection.currentDate
  169. );
  170. this.dateEndSection.currentDate = new Date();
  171. this.dateEndSection.showEndDate = this.timeFormat(
  172. this.dateEndSection.currentDate
  173. );
  174. let evaluationList = sessionStorage.getItem('evaluationList');
  175. if(evaluationList) {
  176. this.search = JSON.parse(evaluationList);
  177. this.dateSection.showStartDate = this.timeFormat(
  178. new Date(this.search.startTime.replace(/-/g, '/'))
  179. );
  180. this.dateSection.currentDate = this.timeFormat(
  181. new Date(this.search.startTime.replace(/-/g, '/'))
  182. );
  183. this.dateEndSection.currentDate = this.timeFormat(
  184. new Date(this.search.endTime.replace(/-/g, '/'))
  185. );
  186. this.dateEndSection.showEndDate = this.timeFormat(
  187. new Date(this.search.endTime.replace(/-/g, '/'))
  188. );
  189. }
  190. },
  191. methods: {
  192. formatter(type, val) {
  193. if (type === "year") {
  194. return `${val}年`;
  195. } else if (type === "month") {
  196. return `${val}月`;
  197. } else if (type == "day") {
  198. return `${val}日`;
  199. }
  200. return val;
  201. },
  202. changeStartTime() {},
  203. confirmStartTime() {
  204. this.dateSection.showStartDate = this.timeFormat(
  205. this.dateSection.currentDate
  206. );
  207. this.onRefresh();
  208. this.dateSection.status = false;
  209. },
  210. confirmEndTime() {
  211. this.dateEndSection.showEndDate = this.timeFormat(
  212. this.dateEndSection.currentDate
  213. );
  214. this.onRefresh();
  215. this.dateEndSection.status = false;
  216. },
  217. cancelTime() {
  218. this.dateEndSection.status = false;
  219. this.dateSection.status = false;
  220. },
  221. timeFormat(time) {
  222. // 时间格式化 2019-09-08
  223. let year = time.getFullYear();
  224. let month = time.getMonth() + 1;
  225. let day = time.getDate();
  226. return year + "/" + month + "/" + day;
  227. },
  228. resetSerach() {
  229. this.search = {
  230. status: false,
  231. hasReview: null,
  232. hasHandHomework: null,
  233. hasLiaison: null
  234. };
  235. },
  236. submitInfo() {
  237. // 提交请求
  238. this.onRefresh();
  239. this.search.status = false;
  240. this.$refs.item.toggle();
  241. },
  242. getList() {
  243. this.loading = true;
  244. this.search.startTime =
  245. this.dateSection.showStartDate.replace(/\//g, "-") + " 00:00:00";
  246. (this.search.endTime =
  247. this.dateEndSection.showEndDate.replace(/\//g, "-") + " 23:59:59"),
  248. (this.search.page = this.page);
  249. this.search.rows = 20;
  250. // this.page++;
  251. getPracticeGroup(this.search).then(res => {
  252. let result = res.data
  253. this.loading = false
  254. if(result.code == 200) {
  255. sessionStorage.setItem('evaluationList',JSON.stringify(this.search));
  256. this.page = result.data.pageNo
  257. this.courseList = this.courseList.concat(result.data.rows)
  258. if(this.page >= result.data.totalPage) {
  259. this.finished = true
  260. }
  261. this.page++
  262. } else {
  263. this.finished = true
  264. }
  265. // 判断是否有数据
  266. // if(this.dataList.length <= 0) {
  267. // this.dataShow = false
  268. // }
  269. // if (res.data.code == 200) {
  270. // this.loading = false;
  271. // if (res.data.data.rows.length < 10) {
  272. // this.finished = true;
  273. // }
  274. // if (this.courseList.length > 0) {
  275. // this.courseList = this.courseList.concat(res.data.data.rows);
  276. // } else {
  277. // this.courseList = res.data.data.rows;
  278. // }
  279. // this.refreshing = false;
  280. // } else {
  281. // this.finished = true;
  282. // this.loading = false;
  283. // this.refreshing = false;
  284. // }
  285. });
  286. },
  287. onRefresh() {
  288. // 清空列表数据
  289. this.finished = false;
  290. this.page = 1;
  291. // 重新加载数据
  292. // 将 loading 设置为 true,表示处于加载状态
  293. this.loading = false;
  294. this.courseList = [];
  295. this.getList();
  296. },
  297. submitReview(item) {
  298. this.$router.push({
  299. path: "/courseEvaluation",
  300. query: { id: item.id, reviewId: item.reviewId,isInside:true }
  301. });
  302. }
  303. },
  304. filters: {
  305. filterClass(val) {
  306. return val.substring(0, 10);
  307. }
  308. }
  309. };
  310. </script>
  311. <style lang="less" scoped>
  312. @import url("../../assets/commonLess/variable.less");
  313. .wrap {
  314. height: 100vh;
  315. overflow-y: auto;
  316. overflow-x: hidden;
  317. background-color: #fff;
  318. }
  319. .searchSection {
  320. display: flex;
  321. justify-content: space-between;
  322. background: #fff;
  323. margin-bottom: 0.15rem;
  324. padding: 0 0.16rem;
  325. align-items: center;
  326. .searchDate {
  327. display: flex;
  328. color: #666666;
  329. height: auto;
  330. .startDate {
  331. margin-right: 0.05rem;
  332. }
  333. .endDate {
  334. margin-left: 0.05rem;
  335. }
  336. .date {
  337. padding: 0.02rem 0.06rem;
  338. border: 1px solid #e5e5e5;
  339. font-size: 0.14rem;
  340. color: #999999;
  341. span {
  342. padding-left: 0.04rem;
  343. font-size: 0.15rem;
  344. color: #666666;
  345. }
  346. }
  347. }
  348. /deep/.van-hairline--top-bottom::after,
  349. .van-hairline-unset--top-bottom::after {
  350. border-width: 0 0;
  351. }
  352. /deep/.van-dropdown-menu__title {
  353. font-size: 0.17rem;
  354. color: #1a1a1a;
  355. }
  356. .btnGroup {
  357. display: flex;
  358. margin-top: 0.15rem;
  359. .btn {
  360. width: 50%;
  361. text-align: center;
  362. font-size: 0.17rem;
  363. color: #000;
  364. padding: 0.12rem 0;
  365. }
  366. .btn-reset {
  367. background-color: #e1f6f4;
  368. color: #14928a;
  369. }
  370. .btn-sure {
  371. background-color: #14928a;
  372. color: #fff;
  373. }
  374. }
  375. .dropItem {
  376. padding: 0.1rem 0.16rem;
  377. .dropTitle {
  378. font-size: 0.17rem;
  379. color: #1a1a1a;
  380. }
  381. .radioGroup {
  382. display: flex;
  383. justify-content: space-between;
  384. padding-top: 0.1rem;
  385. span {
  386. color: #000000;
  387. background-color: #f4f4f4;
  388. width: 48%;
  389. padding: 0.1rem 0;
  390. text-align: center;
  391. border-radius: 2px;
  392. &.actived {
  393. color: #14928a;
  394. background: url("../../assets/images/audition/icon_check.png")
  395. no-repeat bottom right #e4f6f5;
  396. background-size: 0.2rem;
  397. }
  398. }
  399. }
  400. }
  401. }
  402. .cellGroup {
  403. padding: 0.16rem;
  404. }
  405. .sectionTitle {
  406. font-size: 0.16rem;
  407. color: #808080;
  408. align-items: center;
  409. display: flex;
  410. }
  411. .sectionValue {
  412. display: flex;
  413. width: 70%;
  414. flex: 1 auto;
  415. justify-content: space-between;
  416. align-items: center;
  417. height: auto !important;
  418. .content {
  419. font-size: 0.17rem;
  420. color: #1a1a1a;
  421. }
  422. .van-button {
  423. font-size: 0.14rem;
  424. background-color: #14928a;
  425. padding: 0 0.12rem;
  426. min-width: 0.88rem;
  427. }
  428. }
  429. /deep/.van-cell__title {
  430. font-size: 0.14rem;
  431. color: @mFontColor;
  432. flex: 1 auto;
  433. }
  434. .logo {
  435. width: 0.35rem;
  436. height: 0.35rem;
  437. margin-right: 0.12rem;
  438. border-radius: 100%;
  439. }
  440. .input-cell {
  441. padding: 0.12rem 0.16rem 0.2rem;
  442. .van-radio {
  443. justify-content: flex-end;
  444. }
  445. }
  446. /deep/.van-cell__value {
  447. height: 0.2rem;
  448. }
  449. /deep/.van-radio__icon .van-icon {
  450. border-color: @sFontColor;
  451. }
  452. /deep/.van-radio__icon--checked {
  453. .van-icon {
  454. border-color: @orangeColor;
  455. background: @orangeColor;
  456. }
  457. }
  458. .van-tag {
  459. margin-left: 0.08rem;
  460. }
  461. .button-group {
  462. margin: 0.3rem 0.26rem 0.2rem;
  463. .van-button--primary {
  464. background: @mColor;
  465. border: 1px solid @mColor;
  466. font-size: 0.18rem;
  467. }
  468. }
  469. </style>