ManageEvaluation.vue 12 KB

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