AppointTest.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <div class="appoint_test">
  3. <el-dialog
  4. title="预约考试"
  5. :visible.sync="appointModal"
  6. width="600px"
  7. class="appoint-modal"
  8. :close-on-click-modal="false"
  9. :close-on-press-escape="false"
  10. :before-close="cancel"
  11. >
  12. <div v-if="appointItem.examApplyGoodsList && appointItem.examApplyGoodsList.length" class="appoint-modal">
  13. <div v-for="(appointChild, appointIndex) in appointItem.examApplyGoodsList" :key="appointIndex" class="appoint_item" >
  14. <div class="names">{{ appointChild.applyName }}</div>
  15. <div class="btns" @click="confirmAppoint(appointChild)">预约</div>
  16. </div>
  17. <!-- <el-radio
  18. v-for="(appointChild, appointIndex) in appointItem.examApplyGoodsList"
  19. v-model="applyId"
  20. :key="appointIndex"
  21. :label="appointChild.applyId"
  22. >
  23. {{ appointChild.applyName }}
  24. </el-radio> -->
  25. </div>
  26. <div v-else class="no_data">暂无考试预约~</div>
  27. <!-- <span slot="footer" class="dialog-footer">
  28. <el-button @click="cancel()">取 消</el-button>
  29. <el-button type="primary" @click="confirmAppoint">立即预约</el-button>
  30. </span> -->
  31. </el-dialog>
  32. </div>
  33. </template>
  34. <script>
  35. export default {
  36. name: 'appoint_test',
  37. props: {
  38. appointModal: {
  39. type: Boolean,
  40. default: false,
  41. },
  42. appointItem: {
  43. type: Object,
  44. default: () => {}
  45. },
  46. },
  47. data() {
  48. return {
  49. applyId: "",
  50. }
  51. },
  52. methods: {
  53. cancel() {
  54. this.$emit('update:appointModal', false)
  55. },
  56. confirmAppoint(item) {
  57. // if (!this.applyId) {
  58. // this.$message.warning("请选择要预约的考试");
  59. // return;
  60. // }
  61. var data = {
  62. goodsId: this.appointItem.goodsId,
  63. gradeId: this.appointItem.gradeId,
  64. applyId: item.applyId,
  65. orderGoodsId: this.appointItem.orderGoodsId,
  66. };
  67. this.$request.getApplysubscribe(data).then((res) => {
  68. this.$router.push({
  69. path: "/person-center/my-classhour/appointment",
  70. query: {
  71. goodsId: this.appointItem.goodsId,
  72. gradeId: this.appointItem.gradeId,
  73. orderGoodsId: this.appointItem.orderGoodsId,
  74. applyId: item.applyId,
  75. },
  76. });
  77. }).catch((err) => {
  78. this.$message({
  79. type: "warning",
  80. message: err.msg,
  81. });
  82. });
  83. },
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. .appoint_item {
  89. width: 100%;
  90. display: flex;
  91. align-items: center;
  92. justify-content: space-between;
  93. height: 84px;
  94. border-bottom: 1px solid #F0F0F0;
  95. .names {
  96. font-size: 14px;
  97. font-weight: 500;
  98. color: #303030;
  99. }
  100. .btns {
  101. width: 54px;
  102. height: 28px;
  103. line-height: 28px;
  104. text-align: center;
  105. background: #FFF5EC;
  106. border-radius: 4px;
  107. font-size: 12px;
  108. font-weight: 500;
  109. color: #F67205;
  110. cursor: pointer;
  111. }
  112. .no_data {
  113. text-align: center;
  114. font-size: 16px;
  115. margin-bottom: 20px;
  116. }
  117. }
  118. </style>