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.
 
 
 
 
 
 

239 lines
5.6 KiB

  1. <template>
  2. <view class="page">
  3. <view class="mainpage" :class="sideOpen ? 'show' : ''" style="padding-top: 40px;">
  4. <!-- <l-customlist-banner></l-customlist-banner> -->
  5. <view class="records">共 {{ records }} 条数据</view>
  6. <l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="data">
  7. <l-customlist :tips="loadState" showTips>
  8. <view class="pageBox customlist-item" showDelete="true" v-for="(item, ind) in data" :key="item.MakeDate" @click="tapClick(item)">
  9. <view class="">
  10. <text>学年:</text>
  11. {{ item.AcademicYearNo }}
  12. </view>
  13. <view class="">
  14. <text>学期:</text>
  15. {{ item.Semester }}
  16. </view>
  17. <view class="">
  18. <text>课程名称:</text>
  19. {{ item.LessonName }}
  20. </view>
  21. <view class="">
  22. <text>上课节次:</text>
  23. {{ jieci(item.LessonSection) }}
  24. </view>
  25. <view class="">
  26. <text>上课时间:</text>
  27. {{ item.LessonTime }}
  28. </view>
  29. <view class="">
  30. <text>学分:</text>
  31. {{ item.StudyScore }}
  32. </view>
  33. <view class="">
  34. <text>教师姓名:</text>
  35. {{ item.EmpName }}
  36. </view>
  37. <view class="">
  38. <text>教室名称:</text>
  39. {{ item.ClassRoomNo }}
  40. </view>
  41. <view class="">
  42. <text>人数上限:</text>
  43. {{ item.StuNumMax }}
  44. </view>
  45. <view class="">
  46. <text>已报名人数:</text>
  47. {{ item.StuNumOfApplyPre }}
  48. </view>
  49. <view class="pageType">{{ typePd(item.StatusPre) }}</view>
  50. <view class="delbtn" @click.stop="delTap(item)">取消报名</view>
  51. </view>
  52. </l-customlist>
  53. </l-scroll-list>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. weekChina: ['一', '二', '三', '四', '五', '六', '日'],
  62. user: null,
  63. data: [],
  64. total: 1,
  65. records: 0,
  66. ready: false,
  67. page: 1,
  68. rows: 10,
  69. multipleData: null,
  70. sideOpen: false,
  71. loadState: '向下翻以加载更多'
  72. };
  73. },
  74. onUnload() {
  75. this.OFF('OpenLessonPlanOfElectiveStudentPre');
  76. },
  77. methods: {
  78. init() {
  79. this.ON('OpenLessonPlanOfElectiveStudentPre', this.refreshList);
  80. // 拉取加载列表和数据源
  81. Promise.all([() => {}]);
  82. var _this = this;
  83. this.user = this.GET_GLOBAL('loginUser');
  84. this.fetchList();
  85. this.ready = true;
  86. },
  87. // 拉取列表
  88. async fetchList() {
  89. if (this.page > this.total) {
  90. return;
  91. }
  92. let _this = this;
  93. let _postParam = {
  94. pagination: {
  95. rows: _this.rows,
  96. page: _this.page,
  97. sidx: 'LessonNo',
  98. sord: 'asc'
  99. },
  100. queryJson: '{}'
  101. };
  102. if (true) {
  103. _postParam.queryJson = JSON.stringify({
  104. StuNo: _this.user.account,
  105. StuMajorNo: _this.user.majorno,
  106. StuGrade: _this.user.grade
  107. });
  108. }
  109. _this.LOADING('加载数据中…')
  110. _this.HTTP_GET('learun/EducationalAdministration/OpenLessonPlanOfElectiveStudent/pagelist', _postParam, '加载数据时出错').then(res => {
  111. _this.HIDE_LOADING();
  112. // console.log(res);
  113. this.data = this.data.concat(res.rows);
  114. _this.total = res.total;
  115. _this.records = res.records;
  116. this.page = res.page + 1;
  117. this.loadState = res.page >= res.total ? '已加载所有项目' : '向下翻以加载更多';
  118. // console.log(_this.data);
  119. });
  120. },
  121. // 列表下拉
  122. pullDown() {
  123. this.refreshList().then(() => {
  124. this.$refs.data.stopPullDown();
  125. });
  126. },
  127. async refreshList() {
  128. this.page = 1;
  129. this.total = 1;
  130. this.data = [];
  131. this.fetchList();
  132. },
  133. tapClick(data) {
  134. this.NAV_TO('./from', data.Id, true);
  135. },
  136. delTap (item) {
  137. // console.log(item)
  138. let _this = this;
  139. this.CONFIRM('数字化校园提示', '确定要取消报名吗?', true).then( res => {
  140. if(res){
  141. let _postData = {
  142. keyValue: item.Id,
  143. StuNo: _this.user.account
  144. }
  145. _this.LOADING('正在取消报名…')
  146. console.log(123);
  147. _this.HTTP_POST(
  148. 'learun/EducationalAdministration/OpenLessonPlanOfElectiveStudent/CancelPre',
  149. _postData,
  150. '加载数据时出错'
  151. ).then( (data) => {
  152. _this.HIDE_LOADING()
  153. console.log(data)
  154. if (data) {// 成功
  155. _this.TOAST('取消报名成功!');
  156. this.refreshList()
  157. // item.pageType =
  158. }
  159. })
  160. }
  161. })
  162. }
  163. },
  164. computed: {
  165. jieci() {
  166. return str => {
  167. let ls = '';
  168. if (str.indexOf(',') == -1) ls = '星期' + this.weekChina[str.slice(0, 1) - 1] + '第' + str.slice(1) + '节';
  169. else ls = '星期' + this.weekChina[str.slice(0, 1) - 1] + '第' + str.slice(1, 2) + '、' + str.slice(4) + '节';
  170. return ls;
  171. };
  172. },
  173. typePd() {
  174. return num => {
  175. let txt = '';
  176. if (num == 1) {
  177. txt = '审核中';
  178. } else if (num == 2) {
  179. txt = '报名成功';
  180. } else if (num == 3) {
  181. txt = '报名失败';
  182. } else {
  183. txt = '未报名';
  184. }
  185. return txt;
  186. };
  187. }
  188. },
  189. created() {
  190. this.init();
  191. }
  192. };
  193. </script>
  194. <style lang="less" scoped>
  195. @import '~@/common/css/sidepage.less';
  196. @import '~@/common/css/customlist.less';
  197. .page {
  198. background-color: #fff;
  199. }
  200. .page-content {
  201. margin-top: 39px;
  202. }
  203. .records {
  204. color: #8f8f94;
  205. background: #ffffff;
  206. padding: 10px 12px;
  207. width: 100%;
  208. vertical-align: middle;
  209. border-bottom: 0.5px solid #ddd;
  210. position: fixed;
  211. top: var(--window-top);
  212. z-index: 1024;
  213. border-bottom: 0.5px solid #ddd;
  214. height: 40px;
  215. width: 100%;
  216. box-shadow: 0 0.5px 3px rgba(0, 0, 0, 0.1);
  217. // background: #f1f1f1;
  218. }
  219. .pageBox {
  220. // margin-top: 34px;
  221. padding: 5px 15px;
  222. line-height: 24px;
  223. border-bottom: 5px solid #f5f5f5;
  224. }
  225. .delbtn {
  226. position: absolute;
  227. right: 15px;
  228. bottom: 7px;
  229. padding: 3px 10px;
  230. background: #dd524d;
  231. color: #fff;
  232. border-radius: 3px;
  233. }
  234. </style>