branchActive.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>
  5. 阶梯奖励
  6. </h2>
  7. <div class="m-core">
  8. <el-button
  9. type="primary"
  10. @click="openActive('create')"
  11. style="margin-bottom: 20px"
  12. v-permission="'/branchActiveOperationAdd'"
  13. >新建</el-button
  14. >
  15. <!-- 搜索类型 -->
  16. <save-form
  17. :inline="true"
  18. ref="searchForm"
  19. @submit.native.prevent
  20. @submit="onSearch"
  21. @reset="onReset"
  22. :model.sync="searchForm"
  23. >
  24. <el-form-item prop="search">
  25. <el-input
  26. type="text"
  27. v-model.trim="searchForm.search"
  28. @keyup.enter.native="getList"
  29. placeholder="分部活动名"
  30. ></el-input>
  31. </el-form-item>
  32. <el-form-item prop="rewardMode">
  33. <el-select
  34. v-model.trim="searchForm.rewardMode"
  35. clearable
  36. placeholder="分部活动类型"
  37. >
  38. <el-option
  39. v-for="(item, index) in rewardModeTypeList"
  40. :key="index"
  41. :label="item.label"
  42. :value="item.value"
  43. ></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item prop="teacherId">
  47. <el-select
  48. v-model.trim="searchForm.teacherId"
  49. clearable
  50. filterable
  51. placeholder="适用老师"
  52. >
  53. <el-option
  54. v-for="item in selects.teachers"
  55. :key="item.id"
  56. :label="item.realName"
  57. :value="item.id"
  58. ></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item prop="vipGroupCategoryId">
  62. <el-select
  63. v-model.trim="searchForm.vipGroupCategoryId"
  64. filterable
  65. clearable
  66. placeholder="课程类型"
  67. >
  68. <el-option
  69. v-for="item in selects.vipGroupCategory"
  70. :key="item.id"
  71. :label="item.name"
  72. :value="item.id"
  73. ></el-option>
  74. </el-select>
  75. </el-form-item>
  76. <el-form-item>
  77. <el-button native-type="submit" type="danger">搜索</el-button>
  78. <el-button native-type="reset" type="primary">重置</el-button>
  79. </el-form-item>
  80. </save-form>
  81. <!-- 列表 -->
  82. <div class="tableWrap">
  83. <el-table
  84. :data="tableList"
  85. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  86. >
  87. <el-table-column align="center" prop="name" label="分部活动名">
  88. <template slot-scope="scope">
  89. <copy-text>{{ scope.row.name }}</copy-text>
  90. </template>
  91. </el-table-column>
  92. <el-table-column
  93. align="center"
  94. prop="rewardMode"
  95. label="分部活动类型"
  96. >
  97. <template slot-scope="scope">
  98. {{ scope.row.rewardMode | rewardModeTypeFormat }}
  99. </template>
  100. </el-table-column>
  101. <el-table-column align="center" label="适用老师">
  102. <template slot-scope="scope">
  103. <span
  104. style="max-height: 68px; display: block"
  105. :title="scope.row.teacherNames | joinArray(',')"
  106. >{{ scope.row.teacherNames | joinArray(",") }}</span
  107. >
  108. </template>
  109. </el-table-column>
  110. <el-table-column
  111. align="center"
  112. prop="vipGroupCategoryNameList"
  113. label="课程类型"
  114. >
  115. </el-table-column>
  116. <el-table-column align="center" label="操作" width="100">
  117. <template slot-scope="scope">
  118. <el-button
  119. @click="openActive('update', scope.row)"
  120. v-permission="'/branchActiveOperationUpdate'"
  121. type="text"
  122. >修改</el-button
  123. >
  124. </template>
  125. </el-table-column>
  126. </el-table>
  127. <pagination
  128. :total.sync="pageInfo.total"
  129. :page.sync="pageInfo.page"
  130. :limit.sync="pageInfo.limit"
  131. sync
  132. :page-sizes="pageInfo.page_size"
  133. @pagination="getList"
  134. />
  135. </div>
  136. </div>
  137. </div>
  138. </template>
  139. <script>
  140. import pagination from "@/components/Pagination/index";
  141. import { courseScheduleRewards } from "@/api/systemManage";
  142. import { rewardModeTypeList } from "@/utils/searchArray";
  143. export default {
  144. name: "branchActive",
  145. components: { pagination },
  146. data() {
  147. return {
  148. rewardModeTypeList,
  149. searchForm: {
  150. search: null,
  151. rewardMode: null,
  152. vipGroupCategoryId: null,
  153. teacherId: null,
  154. },
  155. organId: null,
  156. tableList: [],
  157. pageInfo: {
  158. // 分页规则
  159. limit: 10, // 限制显示条数
  160. page: 1, // 当前页
  161. total: 0, // 总条数
  162. page_size: [10, 20, 40, 50], // 选择限制显示条数
  163. },
  164. };
  165. },
  166. mounted() {
  167. this.getList(); // 获取列表数据
  168. this.__init();
  169. },
  170. methods: {
  171. async __init() {
  172. // 获取类型
  173. this.$store.dispatch("setVipGroupCategory");
  174. this.$store.dispatch("setTeachers");
  175. },
  176. getList() {
  177. let params = this.searchForm;
  178. params.rows = this.pageInfo.limit;
  179. params.page = this.pageInfo.page;
  180. courseScheduleRewards(params).then((res) => {
  181. if (res.code == 200 && res.data) {
  182. this.tableList = res.data.rows;
  183. this.pageInfo.total = res.data.total;
  184. }
  185. });
  186. },
  187. openActive(type, row) {
  188. let params = {
  189. path: "/operateManager/branchActiveOperationAdd",
  190. query: {
  191. type: type,
  192. },
  193. };
  194. let tagTitle = "新建";
  195. if (row) {
  196. params.query.id = row.id;
  197. tagTitle = "修改";
  198. params.path='/operateManager/branchActiveOperation'
  199. }
  200. this.$router.push(params, (route) => {
  201. route.meta.title = tagTitle + "VIP分部活动";
  202. });
  203. },
  204. onFormClose(formName) {
  205. // 关闭弹窗重置验证
  206. this.$refs[formName].clearValidate();
  207. },
  208. onSearch() {
  209. this.$refs.searchForm.validate((valid) => {
  210. this.pageInfo.page = 1;
  211. this.getList();
  212. });
  213. },
  214. onReset() {
  215. this.$refs.searchForm.resetFields();
  216. this.onSearch();
  217. },
  218. },
  219. };
  220. </script>
  221. <style lang="scss">
  222. .el-vue-search-box-container {
  223. position: absolute !important;
  224. left: 10px;
  225. margin-top: 10px;
  226. z-index: 99999 !important;
  227. }
  228. </style>