vipBaseInfo.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <div class='vip-base'>
  3. <div class="left">
  4. <el-form label-position='right'
  5. label-width="120px"
  6. :model="topForm">
  7. <el-form-item label="指导老师">
  8. <el-input v-model="topForm.teacherCount"
  9. disabled></el-input>
  10. </el-form-item>
  11. <el-form-item label="科目名称">
  12. <el-input v-model="topForm.subject"
  13. disabled></el-input>
  14. </el-form-item>
  15. <el-form-item label="活动方案">
  16. <el-input v-model="topForm.active"
  17. disabled></el-input>
  18. </el-form-item>
  19. <el-form-item label="课程形式">
  20. <el-input v-model="topForm.status"
  21. disabled></el-input>
  22. </el-form-item>
  23. <el-form-item label="每班人数">
  24. <el-input v-model="topForm.classNum"
  25. disabled></el-input>
  26. </el-form-item>
  27. <el-form-item label="每课时长">
  28. <el-input v-model="topForm.classTime"
  29. disabled></el-input>
  30. </el-form-item>
  31. <el-form-item label="教学点名称">
  32. <el-input v-model="topForm.address"
  33. disabled></el-input>
  34. </el-form-item>
  35. <el-form-item label="线上课数">
  36. <el-input v-model="topForm.onlineClass"
  37. disabled></el-input>
  38. </el-form-item>
  39. <el-form-item label="线下课数">
  40. <el-input v-model="topForm.offlineClass"
  41. disabled></el-input>
  42. </el-form-item>
  43. <el-form-item label="报名开始时间">
  44. <el-input v-model="topForm.startTime"
  45. disabled></el-input>
  46. </el-form-item>
  47. <el-form-item label="报名结束时间">
  48. <el-input v-model="topForm.endTime"
  49. disabled></el-input>
  50. </el-form-item>
  51. </el-form>
  52. </div>
  53. <div class="right">
  54. <el-form label-position='right'
  55. label-width="120px"
  56. :model="rightForm">
  57. <el-form-item label="总课时数">
  58. <el-input v-model="rightForm.allClass"
  59. disabled></el-input>
  60. </el-form-item>
  61. <el-form-item label="课程单价(线上)">
  62. <el-input v-model="rightForm.onlineClass"
  63. type="number"
  64. :disabled='!isreset'></el-input>
  65. </el-form-item>
  66. <el-form-item label="课程单价(线下)">
  67. <el-input v-model="rightForm.offlineClass"
  68. type="number"
  69. :disabled='!isreset'></el-input>
  70. </el-form-item>
  71. <el-form-item label="课程总价">
  72. <el-input v-model="rightForm.allPrice"
  73. disabled></el-input>
  74. </el-form-item>
  75. <el-form-item label="当前课程进度">
  76. <el-input v-model="rightForm.progress"
  77. disabled></el-input>
  78. </el-form-item>
  79. </el-form>
  80. <el-button v-if="!isreset"
  81. v-permission="'vipGroupManage/updateVipBaseInfo'"
  82. class="resetBtn"
  83. type="primary"
  84. @click="resetPrice">修改</el-button>
  85. <el-button class="resetBtn"
  86. v-permission="'vipGroupManage/updateVipBaseInfo'"
  87. v-if="isreset"
  88. type="primary"
  89. @click="submitBtn">确定</el-button>
  90. </div>
  91. </div>
  92. </template>
  93. <script>
  94. import { getVipGroupDetail, findVipGroupStudents, leaveSchool, updateVipBaseInfo } from '@/api/vipSeting'
  95. export default {
  96. data () {
  97. return {
  98. topForm: {
  99. teacherCount: '',
  100. subject: '', // 科目名称
  101. active: '', // 活动名称
  102. status: '', //课程形式
  103. classNum: "", // 每班人数
  104. classTime: '', // 每课时长
  105. address: '', // 教学点名称
  106. onlineClass: '', //线上课数
  107. offlineClass: '', //线下课数
  108. startTime: '', // 报名开始时间
  109. endTime: ''
  110. },
  111. rightForm: {
  112. allClass: '',
  113. onlineClass: '',
  114. offlineClass: '',
  115. allPrice: '',
  116. progress: ''
  117. },
  118. tableList: [],
  119. isreset: false
  120. }
  121. }, mounted () {
  122. let id = this.$route.query.id;
  123. this.id = id;
  124. // 根据id 获取vip详情
  125. this.getVipGroupDetail(id);
  126. // 根据id 获取vip学员
  127. this.getStudents();
  128. },
  129. methods: {
  130. getVipGroupDetail (id) {
  131. getVipGroupDetail({ vipGroupId: id }).then(res => {
  132. if (res.code == 200) {
  133. /**
  134. * teacherCount: '',
  135. subject: '', // 科目名称
  136. active: '', // 活动名称
  137. status: '', //课程形式
  138. classNum: "", // 每班人数
  139. classTime: '', // 每课时长
  140. address: '', // 教学点名称
  141. onlineClass: '', //线上课数
  142. offlineClass: '', //线下课数
  143. startTime: '', // 报名开始时间
  144. *
  145. */
  146. this.topForm.teacherCount = res.data.userName;
  147. this.topForm.subject = res.data.subjectName //科目名称
  148. this.topForm.active = res.data.vipGroupActivityName;
  149. this.topForm.status = res.data.categoryName
  150. this.topForm.classNum = res.data.studentNum;
  151. // totalClassTimes; 总课时数
  152. this.topForm.classTime = res.data.singleClassMinutes;
  153. // 教学点
  154. this.topForm.address = res.data.teacherSchoolName
  155. this.topForm.onlineClass = res.data.onlineClassesNum;
  156. this.topForm.offlineClass = res.data.offlineClassesNum;
  157. // endTime
  158. this.topForm.startTime = res.data.registrationStartTime;
  159. this.topForm.endTime = res.data.paymentExpireDate;
  160. this.rightForm.allClass = res.data.totalClassTimes;
  161. this.rightForm.onlineClass = res.data.onlineClassesUnitPrice;
  162. this.rightForm.offlineClass = res.data.offlineClassesUnitPrice;
  163. this.rightForm.allPrice = res.data.totalPrice;
  164. this.rightForm.progress = res.data.currentClassTimes + '/' + res.data.totalClassTimes;
  165. this.$emit('getName', res.data.name);
  166. /**
  167. * allClass: '',
  168. onlineClass: '',
  169. offlineClass: '',
  170. allPrice: '',
  171. progress: ''
  172. */
  173. }
  174. });
  175. },
  176. getStudents () {
  177. findVipGroupStudents({ vipGroupId: this.id }).then(res => {
  178. if (res.code == 200) {
  179. this.tableList = res.data.rows;
  180. }
  181. })
  182. },
  183. leaveSchool (scope) {
  184. let studentId = scope.row.id;
  185. let vipGroupId = this.id;
  186. leaveSchool({ studentId, vipGroupId }).then(res => {
  187. if (res.code == 200) {
  188. this.$message.success('退学成功')
  189. scope._self.$refs[scope.$index].doClose();
  190. this.getStudents();
  191. }
  192. })
  193. },
  194. resetPrice () {
  195. this.isreset = true;
  196. },
  197. submitBtn () {
  198. // 提交
  199. /**
  200. * this.rightForm.onlineClass = res.data.onlineClassesUnitPrice;
  201. this.rightForm.offlineClass = res.data.offlineClassesUnitPrice;
  202. */
  203. let onlineClassesUnitPrice = this.rightForm.onlineClass;
  204. let offlineClassesUnitPrice = this.rightForm.offlineClass
  205. updateVipBaseInfo({ id: this.id, onlineClassesUnitPrice, offlineClassesUnitPrice }).then(res => {
  206. if (res.code == 200) {
  207. this.$message.success('修改成功')
  208. this.isreset = false;
  209. this.getVipGroupDetail(this.id);
  210. }
  211. })
  212. }
  213. },
  214. }
  215. </script>
  216. <style lang="scss" scoped>
  217. .vip-base {
  218. /deep/.el-select {
  219. width: 180px !important;
  220. }
  221. /deep/.el-date-editor.el-input,
  222. /deep/.el-date-editor.el-input__inner {
  223. width: 180px !important;
  224. }
  225. /deep/.el-input {
  226. width: 180px !important;
  227. }
  228. display: flex;
  229. flex-direction: row;
  230. justify-content: flex-start;
  231. .left {
  232. width: 400px;
  233. }
  234. .tableWrap {
  235. margin-top: 40px;
  236. h4 {
  237. font-size: 16px;
  238. font-weight: normal;
  239. margin-bottom: 20px;
  240. }
  241. }
  242. .right {
  243. clear: both;
  244. .resetBtn {
  245. margin-top: 30px;
  246. float: right;
  247. }
  248. }
  249. }
  250. </style>