questionBankDialog.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <div>
  3. <BaseDialog
  4. width="990px"
  5. :isShow.sync="isDialog"
  6. title="题库记录"
  7. :isShowFooter="false"
  8. @close="close"
  9. >
  10. <div style="max-height: 600px; overflow-y: auto;padding: 3px;">
  11. <table-list
  12. rowKey="id"
  13. ref="tableList"
  14. :tableSets="tableSet"
  15. :tableData="tableData"
  16. :navText="navText"
  17. :loading="loading"
  18. >
  19. <template slot="customize">
  20. <el-button type="warning" @click="openAddDialog"> 新增 </el-button>
  21. </template>
  22. <template slot="btn" slot-scope="props">
  23. <el-button type="text" @click="del(props.scope.row)"
  24. >删除</el-button
  25. >
  26. </template>
  27. </table-list>
  28. </div>
  29. <!-- 新增弹窗 -->
  30. <addQuestionBankDialog ref="addQuestionBankDialog" @refresh="refresh()" />
  31. </BaseDialog>
  32. </div>
  33. </template>
  34. <script>
  35. import tableList from "@/components/tableList";
  36. import addQuestionBankDialog from "./addQuestionBankDialog.vue";
  37. export default {
  38. components: { tableList, addQuestionBankDialog },
  39. data() {
  40. return {
  41. isDialog: false,
  42. loading: false,
  43. navText: {
  44. title: "开通记录",
  45. index: 0,
  46. ch: "条",
  47. addHide: true,
  48. custom: false,
  49. },
  50. tableSet: [
  51. {
  52. label: "",
  53. prop: "sign",
  54. hidden: true,
  55. },
  56. {
  57. label: "姓名",
  58. prop: "userName",
  59. hidden: true,
  60. },
  61. {
  62. label: "身份证号",
  63. prop: "userCard",
  64. hidden: true,
  65. width: "180"
  66. },
  67. {
  68. label: "教育类型",
  69. prop: "eduName",
  70. hidden: true,
  71. },
  72. {
  73. label: "业务层次",
  74. prop: "businessName",
  75. hidden: true,
  76. width: "300"
  77. },
  78. {
  79. label: "专业",
  80. prop: "majorName",
  81. hidden: true,
  82. },
  83. {
  84. label: "开通日期",
  85. prop: "openDate",
  86. scope: "aTimeList",
  87. hidden: true,
  88. isDiszing: true,
  89. width: "180"
  90. },
  91. ],
  92. tableData: [],
  93. total: 0,
  94. };
  95. },
  96. mounted() {},
  97. methods: {
  98. openBoxs(row, type) {
  99. this.isDialog = true;
  100. this.ruleForm = {
  101. orderGoodsId: row.orderGoodsId,
  102. orderSn: row.orderSn,
  103. userCard: row.userCard,
  104. userName: row.userName,
  105. }
  106. this.search()
  107. },
  108. close() {
  109. this.ruleForm = {};
  110. },
  111. openAddDialog() {
  112. this.$refs.addQuestionBankDialog.openBoxs(this.ruleForm)
  113. },
  114. search(v) {
  115. this.loading = true;
  116. this.$api
  117. .orderQuestionBankList(this.ruleForm)
  118. .then((res) => {
  119. this.tableData = res.data;
  120. this.navText.index = res.data?.length;
  121. })
  122. .finally(() => {
  123. this.loading = false;
  124. });
  125. },
  126. refresh() {
  127. this.$emit("refresh");
  128. this.search();
  129. },
  130. del(v) {
  131. this.$confirm("确定删除此内容?", "提示", {
  132. confirmButtonText: "确定",
  133. cancelButtonText: "取消",
  134. type: "warning",
  135. })
  136. .then(() => {
  137. this.$api
  138. .delOrderQuestionBank(v.id)
  139. .then((res) => {
  140. this.$message.success("删除成功");
  141. this.search();
  142. });
  143. })
  144. .catch(() => {});
  145. },
  146. },
  147. };
  148. </script>
  149. <style lang="scss" scoped>
  150. .text {
  151. white-space: pre-wrap;
  152. overflow-wrap: break-word;
  153. }
  154. </style>