classify.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <container title="商品分类">
  3. <template v-slot:btn>
  4. <el-button type="primary" @click="dialogVisible = true"
  5. >添加分类</el-button
  6. >
  7. <el-button @click="batchDel">批量删除</el-button>
  8. </template>
  9. <search-box-new
  10. :formData="formData"
  11. :formList="formList"
  12. @search="search"
  13. @init="init"
  14. />
  15. <table-list
  16. ref="tableList"
  17. :tableSets="tableSet"
  18. :tableData="tableData"
  19. :navText="navText"
  20. rowKey="id"
  21. :loading="loading"
  22. >
  23. <template slot="status" slot-scope="props">
  24. <el-switch
  25. v-model="props.scope.row.status"
  26. active-color="#13ce66"
  27. inactive-color="#ff4949"
  28. :active-value="1"
  29. :inactive-value="0"
  30. @change="statusChange($event, props.scope.row)"
  31. >
  32. </el-switch>
  33. </template>
  34. <template slot="btn" slot-scope="props">
  35. <el-button type="text" @click="handelClick(2, props.scope.row.tpId)"
  36. >编辑</el-button
  37. >
  38. <el-button type="text" @click="resetPass(props.scope.row.tpId)"
  39. >添加</el-button
  40. >
  41. <el-button type="text" @click="handelDel(props.scope.row.tpId)"
  42. >删除</el-button
  43. >
  44. </template>
  45. </table-list>
  46. <pagination
  47. :total="total"
  48. :pageSize.sync="formData.pageSize"
  49. :currentPage.sync="formData.pageNum"
  50. @search="search"
  51. />
  52. <class-set-dlg :dialogVisible.sync="dialogVisible"></class-set-dlg>
  53. </container>
  54. </template>
  55. <script>
  56. import ClassSetDlg from "./components/ClassSetDlg";
  57. export default {
  58. name: "SaasMemberRecord",
  59. data() {
  60. return {
  61. loading: false,
  62. navText: {
  63. index: 0,
  64. num: true,
  65. choice: true,
  66. addHide: true,
  67. openCheckMore: true,
  68. custom: false,
  69. },
  70. formData: {},
  71. tableSet: [
  72. {
  73. label: "分类名称",
  74. prop: "tpName",
  75. },
  76. {
  77. label: "启动状态",
  78. prop: "tpName",
  79. scope: "solt",
  80. soltName: "status",
  81. },
  82. {
  83. label: "创建时间",
  84. prop: "tpName",
  85. },
  86. ],
  87. tableData: [{}],
  88. total: 0,
  89. formList: [
  90. {
  91. prop: "name",
  92. placeholder: "请输分类名称",
  93. },
  94. ],
  95. dialogVisible: true,
  96. };
  97. },
  98. mounted() {},
  99. methods: {
  100. search(v) {
  101. console.log(this.formData, 789);
  102. },
  103. init() {
  104. this.search();
  105. },
  106. del(id) {
  107. this.$confirm("确定删除吗?", "提示", {
  108. confirmButtonText: "确定",
  109. cancelButtonText: "取消",
  110. type: "warning",
  111. })
  112. .then(() => {})
  113. .catch(() => {});
  114. },
  115. resetPass(id) {
  116. this.$confirm("确定恢复为初始密码吗?", "提示", {
  117. confirmButtonText: "确定",
  118. cancelButtonText: "取消",
  119. type: "warning",
  120. })
  121. .then(() => {})
  122. .catch(() => {});
  123. },
  124. batchDel() {
  125. let len = this.$refs.tableList.allCheckData.length;
  126. if (!len) {
  127. return this.$message.warning("请先勾选店员");
  128. }
  129. this.$confirm(`此操作将永久删除所勾选的${len}条店员, 是否继续?`, "提示", {
  130. confirmButtonText: "确定",
  131. cancelButtonText: "取消",
  132. type: "warning",
  133. })
  134. .then(() => {
  135. const ids = this.$refs.tableList.allCheckData.map(
  136. (item) => item.moduleExamId
  137. );
  138. moduleVolumeBatchDel({
  139. status: -1,
  140. ids,
  141. }).then((res) => {
  142. this.$message.success("批量删除成功");
  143. this.$refs.tableList.clearMoreActive();
  144. this.search(1);
  145. });
  146. })
  147. .catch(() => {});
  148. },
  149. statusChange(e, row) {
  150. // this.$api
  151. // .editmallstore({ storeId: row.storeId, status: e })
  152. // .then((res) => {
  153. // this.$message.success("操作成功");
  154. // row.status = e;
  155. // })
  156. // .catch(() => {
  157. // return (row.status = e ? 0 : 1);
  158. // });
  159. },
  160. },
  161. components: { ClassSetDlg },
  162. };
  163. </script>
  164. <style lang="scss" scoped></style>