Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

238 righe
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('OpenLessonPlanOfElectiveStudent');
  76. },
  77. methods: {
  78. init() {
  79. this.ON('OpenLessonPlanOfElectiveStudent', 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. // console.log(_this.user)
  110. _this.LOADING('加载数据中…')
  111. _this.HTTP_GET('learun/EducationalAdministration/OpenLessonPlanOfElectiveStudent/pagelist', _postParam, '加载数据时出错').then(res => {
  112. _this.HIDE_LOADING();
  113. // console.log(res);
  114. this.data = this.data.concat(res.rows);
  115. _this.total = res.total;
  116. _this.records = res.records;
  117. this.page = res.page + 1;
  118. this.loadState = res.page >= res.total ? '已加载所有项目' : '向下翻以加载更多';
  119. // console.log(_this.data);
  120. });
  121. },
  122. // 列表下拉
  123. pullDown() {
  124. this.refreshList().then(() => {
  125. this.$refs.data.stopPullDown();
  126. });
  127. },
  128. async refreshList() {
  129. this.page = 1;
  130. this.total = 1;
  131. this.data = [];
  132. this.fetchList();
  133. },
  134. tapClick(data) {
  135. this.NAV_TO('./from', data.Id, true);
  136. },
  137. delTap (item) {
  138. // console.log(item)
  139. let _this = this;
  140. this.CONFIRM('数字化校园提示', '确定要取消报名吗?', true).then( res => {
  141. if(res){
  142. let _postData = {
  143. keyValue: item.Id,
  144. StuNo: _this.user.account
  145. }
  146. _this.LOADING('正在取消报名…')
  147. _this.HTTP_POST(
  148. 'learun/EducationalAdministration/OpenLessonPlanOfElectiveStudent/Cancel',
  149. _postData,
  150. '加载数据时出错'
  151. ).then( data => {
  152. _this.HIDE_LOADING()
  153. console.log(data)
  154. if (data) {// 成功
  155. this.TOAST('取消报名成功!');
  156. this.refreshList()
  157. }
  158. })
  159. }
  160. })
  161. }
  162. },
  163. computed: {
  164. jieci() {
  165. return str => {
  166. let ls = '';
  167. if (str.indexOf(',') == -1) ls = '星期' + this.weekChina[str.slice(0, 1) - 1] + '第' + str.slice(1) + '节';
  168. else ls = '星期' + this.weekChina[str.slice(0, 1) - 1] + '第' + str.slice(1, 2) + '、' + str.slice(4) + '节';
  169. return ls;
  170. };
  171. },
  172. typePd() {
  173. return num => {
  174. let txt = '';
  175. if (num == 1) {
  176. txt = '审核中';
  177. } else if (num == 2) {
  178. txt = '报名成功';
  179. } else if (num == 3) {
  180. txt = '报名失败';
  181. } else {
  182. txt = '未报名';
  183. }
  184. return txt;
  185. };
  186. }
  187. },
  188. created() {
  189. this.init();
  190. }
  191. };
  192. </script>
  193. <style lang="less" scoped>
  194. @import '~@/common/css/sidepage.less';
  195. @import '~@/common/css/customlist.less';
  196. .page {
  197. background-color: #fff;
  198. }
  199. .page-content {
  200. margin-top: 39px;
  201. }
  202. .records {
  203. color: #8f8f94;
  204. background: #ffffff;
  205. padding: 10px 12px;
  206. width: 100%;
  207. vertical-align: middle;
  208. border-bottom: 0.5px solid #ddd;
  209. position: fixed;
  210. top: var(--window-top);
  211. z-index: 1024;
  212. border-bottom: 0.5px solid #ddd;
  213. height: 40px;
  214. width: 100%;
  215. box-shadow: 0 0.5px 3px rgba(0, 0, 0, 0.1);
  216. // background: #f1f1f1;
  217. }
  218. .pageBox {
  219. // margin-top: 34px;
  220. padding: 5px 15px;
  221. line-height: 24px;
  222. border-bottom: 5px solid #f5f5f5;
  223. }
  224. .delbtn {
  225. position: absolute;
  226. right: 15px;
  227. bottom: 7px;
  228. padding: 3px 10px;
  229. background: #dd524d;
  230. color: #fff;
  231. border-radius: 3px;
  232. }
  233. </style>