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.
 
 
 
 
 
 

127 lines
3.4 KiB

  1. <template>
  2. <view class="page">
  3. <l-input title="学年" placeholder="请填写学年" :value="data.AcademicYearNo" disabled right />
  4. <l-input title="学期" placeholder="请填写学期" :value="data.Semester" disabled right />
  5. <l-input title="课程编号" placeholder="请填写课程编号" :value="data.LessonNo" disabled right />
  6. <l-input title="课程名称" placeholder="请填写课程名称" :value="data.LessonName" disabled right />
  7. <l-input title="建课教师" placeholder="请填写建课教师" :value="data.EmpNo" disabled right />
  8. <l-input title="建课学校" placeholder="请填写建课学校" :value="data.F_SchoolId" disabled right />
  9. <l-input title="已报人数" placeholder="请填写已报人数" :value="data.StuNumOfApply" disabled right />
  10. <view class="btn" @click="fromBtn" v-show="showFlag">报名</view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. keyValue: '', //列表页面传参
  18. data: {},
  19. param: {}, //列表页面传参-对象
  20. showFlag: true,
  21. // 数据源
  22. dataSource: {
  23. F_SchoolId: []
  24. },
  25. }
  26. },
  27. methods: {
  28. init() {
  29. //this.keyValue = this.GET_PARAM(); //获取页面传递参数
  30. // console.log(this.keyValue);
  31. this.param = this.GET_PARAM();
  32. //console.log(this.param);
  33. this.keyValue = this.param.keyValue;
  34. //审核中或者报名成功不显示报名按钮
  35. if (this.param.Status == 1 || this.param.Status == 2) {
  36. this.showFlag = false;
  37. }
  38. this.LOADING('加载数据中…');
  39. this.HTTP_GET('learun/LessonInfoOfElectiveOnline/form', this.keyValue, '加载数据时出错').then(res => {
  40. this.HIDE_LOADING();
  41. this.data = res.data;
  42. });
  43. },
  44. fromBtn() {
  45. var _postData = {}
  46. // let _this = this;
  47. let user = this.GET_GLOBAL('loginUser');;
  48. _postData.keyValue = this.keyValue;
  49. _postData.StuNo = user.account;
  50. this.LOADING('正在提交…');
  51. this.HTTP_POST('learun/LessonInfoOfElectiveOnline/SignInByMobile', _postData, '加载数据时出错').then((res, info,
  52. code) => {
  53. //console.log(res)
  54. if (res) { // 表单数据保存成功
  55. //判断队列结果
  56. let timer = setInterval(() => {
  57. this.HTTP_POST('learun/LessonInfoOfElectiveOnline/GetApplyResult', _postData,
  58. '报名状态').then(
  59. (dataresult) => {
  60. //console.log(dataresult)
  61. clearInterval(timer);
  62. if (!dataresult) return
  63. this.HIDE_LOADING();
  64. this.EMIT('LessonInfoOfElectiveOnline')
  65. this.TOAST(dataresult.msg);
  66. let timer2 = setTimeout(() => {
  67. clearTimeout(timer2);
  68. this.NAV_BACK();
  69. }, 2000);
  70. });
  71. }, 5000);
  72. }
  73. });
  74. }
  75. },
  76. created() {
  77. // 拉取加载列表和数据源
  78. Promise.all([
  79. this.FETCH_DATASOURCE('company').then(result => {
  80. this.dataSource.F_SchoolId = result.data.map(t => ({
  81. text: t.f_fullname,
  82. value: t.f_companyid
  83. }))
  84. }),
  85. () => {},
  86. ]);
  87. this.init()
  88. }
  89. }
  90. </script>
  91. <style lang="less" scoped>
  92. .txt {
  93. line-height: 24px;
  94. font-size: 15px;
  95. background-color: #fff;
  96. padding: 10px 0 10px 15px;
  97. }
  98. .page {
  99. background-color: #fff;
  100. padding-bottom: 1px;
  101. }
  102. /deep/ .cu-form-group uni-textarea {
  103. height: auto;
  104. }
  105. .remarks {
  106. border-bottom: 0.5px solid #eee;
  107. padding-bottom: 10px;
  108. }
  109. .remarks textarea {
  110. width: 100%;
  111. padding: 0 15px;
  112. }
  113. </style>