ManageEvaluation.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <template>
  2. <div>
  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.getList();
  194. this.dateSection.status = false;
  195. },
  196. confirmEndTime() {
  197. this.dateEndSection.showEndDate = this.timeFormat(
  198. this.dateEndSection.currentDate
  199. );
  200. this.onRefresh();
  201. this.getList();
  202. this.dateEndSection.status = false;
  203. },
  204. cancelTime() {
  205. this.dateEndSection.status = false;
  206. this.dateSection.status = false;
  207. },
  208. timeFormat(time) {
  209. // 时间格式化 2019-09-08
  210. let year = time.getFullYear();
  211. let month = time.getMonth() + 1;
  212. let day = time.getDate();
  213. return year + "/" + month + "/" + day;
  214. },
  215. resetSerach() {
  216. this.search = {
  217. status: false,
  218. hasReview: null,
  219. hasHandHomework: null,
  220. hasLiaison: null
  221. };
  222. },
  223. submitInfo() {
  224. // 提交请求
  225. this.onRefresh();
  226. this.getList();
  227. this.search.status = false;
  228. this.$refs.item.toggle();
  229. },
  230. getList() {
  231. this.search.startTime =
  232. this.dateSection.showStartDate.replace(/\//g, "-") + " 00:00:00";
  233. (this.search.endTime =
  234. this.dateEndSection.showEndDate.replace(/\//g, "-") + " 23:59:59"),
  235. this.search.page=this.page;
  236. if (this.refreshing) {
  237. this.courseList = [];
  238. this.refreshing = false;
  239. }
  240. getPracticeGroup(this.search).then(res => {
  241. if (res.data.code == 200) {
  242. this.page++
  243. this.courseList = this.courseList.concat(res.data.data.rows)
  244. this.loading = false;
  245. if(res.data.data.rows.length == 0){
  246. this.finished = true;
  247. }
  248. }
  249. });
  250. },
  251. onRefresh() {
  252. // 清空列表数据
  253. this.finished = false;
  254. this.page = 1;
  255. // 重新加载数据
  256. // 将 loading 设置为 true,表示处于加载状态
  257. this.loading = true;
  258. this.getList();
  259. },
  260. submitReview(item) {
  261. this.$router.push({
  262. path: "/courseEvaluation",
  263. query: { id: item.id, reviewId: item.reviewId }
  264. });
  265. }
  266. },
  267. filters:{
  268. filterClass (val) {
  269. return val.substring(0,10)
  270. }
  271. }
  272. };
  273. </script>
  274. <style lang="less" scoped>
  275. @import url("../../assets/commonLess/variable.less");
  276. .searchSection {
  277. display: flex;
  278. justify-content: space-between;
  279. background: #fff;
  280. margin-bottom: 0.15rem;
  281. padding: 0 0.16rem;
  282. align-items: center;
  283. .searchDate {
  284. display: flex;
  285. color: #666666;
  286. height: auto;
  287. .startDate {
  288. margin-right: 0.05rem;
  289. }
  290. .endDate {
  291. margin-left: 0.05rem;
  292. }
  293. .date {
  294. padding: 0.02rem 0.06rem;
  295. border: 1px solid #e5e5e5;
  296. font-size: 0.14rem;
  297. color: #999999;
  298. span {
  299. padding-left: 0.04rem;
  300. font-size: 0.15rem;
  301. color: #666666;
  302. }
  303. }
  304. }
  305. /deep/.van-hairline--top-bottom::after,
  306. .van-hairline-unset--top-bottom::after {
  307. border-width: 0 0;
  308. }
  309. /deep/.van-dropdown-menu__title {
  310. font-size: 0.17rem;
  311. color: #1a1a1a;
  312. }
  313. .btnGroup {
  314. display: flex;
  315. margin-top: 0.15rem;
  316. .btn {
  317. width: 50%;
  318. text-align: center;
  319. font-size: 0.17rem;
  320. color: #000;
  321. padding: 0.12rem 0;
  322. }
  323. .btn-reset {
  324. background-color: #e1f6f4;
  325. color: #14928a;
  326. }
  327. .btn-sure {
  328. background-color: #14928a;
  329. color: #fff;
  330. }
  331. }
  332. .dropItem {
  333. padding: 0.1rem 0.16rem;
  334. .dropTitle {
  335. font-size: 0.17rem;
  336. color: #1a1a1a;
  337. }
  338. .radioGroup {
  339. display: flex;
  340. justify-content: space-between;
  341. padding-top: 0.1rem;
  342. span {
  343. color: #000000;
  344. background-color: #f4f4f4;
  345. width: 48%;
  346. padding: 0.1rem 0;
  347. text-align: center;
  348. border-radius: 2px;
  349. &.actived {
  350. color: #14928a;
  351. background: url("../../assets/images/audition/icon_check.png")
  352. no-repeat bottom right #e4f6f5;
  353. background-size: 0.2rem;
  354. }
  355. }
  356. }
  357. }
  358. }
  359. .cellGroup {
  360. padding: 0.16rem;
  361. }
  362. .sectionTitle {
  363. font-size: 0.16rem;
  364. color: #808080;
  365. align-items: center;
  366. display: flex;
  367. }
  368. .sectionValue {
  369. display: flex;
  370. width: 70%;
  371. flex: 1 auto;
  372. justify-content: space-between;
  373. align-items: center;
  374. height: auto !important;
  375. .content {
  376. font-size: 0.17rem;
  377. color: #1a1a1a;
  378. }
  379. .van-button {
  380. font-size: 0.14rem;
  381. background-color: #14928a;
  382. padding: 0 0.12rem;
  383. min-width: 0.88rem;
  384. }
  385. }
  386. /deep/.van-cell__title {
  387. font-size: 0.14rem;
  388. color: @mFontColor;
  389. flex: 1 auto;
  390. }
  391. .logo {
  392. width: 0.35rem;
  393. height: 0.35rem;
  394. margin-right: 0.12rem;
  395. border-radius: 100%;
  396. }
  397. .input-cell {
  398. padding: 0.12rem 0.16rem 0.2rem;
  399. .van-radio {
  400. justify-content: flex-end;
  401. }
  402. }
  403. /deep/.van-cell__value {
  404. height: 0.2rem;
  405. }
  406. /deep/.van-radio__icon .van-icon {
  407. border-color: @sFontColor;
  408. }
  409. /deep/.van-radio__icon--checked {
  410. .van-icon {
  411. border-color: @orangeColor;
  412. background: @orangeColor;
  413. }
  414. }
  415. .van-tag {
  416. margin-left: 0.08rem;
  417. }
  418. .button-group {
  419. margin: 0.3rem 0.26rem 0.2rem;
  420. .van-button--primary {
  421. background: @mColor;
  422. border: 1px solid @mColor;
  423. font-size: 0.18rem;
  424. }
  425. }
  426. </style>