index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div id="">
  3. <search-box-new
  4. ref="searchBox"
  5. :formData="formData"
  6. :formList="formList"
  7. @search="search"
  8. @init="init"
  9. />
  10. <table-list
  11. rowKey="id"
  12. ref="tableList"
  13. :tableSets="tableSet"
  14. :tableData="tableData"
  15. :navText="navText"
  16. :loading="loading"
  17. >
  18. <template slot="customize">
  19. <el-button type="primary"> 会员卡开通 </el-button>
  20. <el-button type="primary"> 会员充值 </el-button>
  21. <el-button type="primary"> 会员恢复 </el-button>
  22. <el-button> 注销会员 </el-button>
  23. <el-button> 导出excel </el-button>
  24. </template>
  25. <template slot="btn" slot-scope="props">
  26. <el-button type="text" @click="addClick(props.scope.row)"
  27. >充值</el-button
  28. ><el-button type="text" @click="cancellation(props.scope.row)"
  29. >注销</el-button
  30. ><el-button type="text" @click="record(props.scope.row)"
  31. >记录</el-button
  32. >
  33. </template>
  34. </table-list>
  35. <pagination
  36. :total="total"
  37. :pageSize.sync="formData.pageSize"
  38. :currentPage.sync="formData.pageNum"
  39. @search="search"
  40. />
  41. <dislog
  42. :dialogVisible.sync="dialogVisible"
  43. @search="search"
  44. :activeData="activeData"
  45. ></dislog>
  46. <record
  47. :dialogVisible.sync="dialogRecordVisible"
  48. @search="search"
  49. :activeData="activeData"
  50. ></record>
  51. </div>
  52. </template>
  53. <script>
  54. import dislog from "./dislog.vue";
  55. import record from "./record.vue";
  56. import searchBoxNew from "@/components/searchBoxNew";
  57. import tableList from "@/components/tableList";
  58. import pagination from "@/components/pagination";
  59. export default {
  60. name: "",
  61. components: { searchBoxNew, tableList, pagination, dislog, record },
  62. data() {
  63. return {
  64. loading: false,
  65. navText: {
  66. title: "会员卡",
  67. index: 0,
  68. ch: "条",
  69. num: true,
  70. choice: false,
  71. addHide: true,
  72. custom: false,
  73. },
  74. formList: [
  75. {
  76. prop: "status",
  77. placeholder: "会员状态",
  78. scope: "select",
  79. options: [
  80. {
  81. label: "正常",
  82. value: 1,
  83. },
  84. {
  85. label: "注销",
  86. value: 2,
  87. },
  88. ],
  89. },
  90. {
  91. prop: "tenantid",
  92. placeholder: "输入手机号码/身份证号",
  93. },
  94. ],
  95. formData: {},
  96. tableSet: [
  97. {
  98. label: "会员状态",
  99. prop: "a",
  100. hidden: true,
  101. scope: "isOptions",
  102. options: [
  103. {
  104. label: "正常",
  105. value: 1,
  106. },
  107. {
  108. label: "注销",
  109. value: 2,
  110. },
  111. ],
  112. },
  113. {
  114. label: "会员来源",
  115. prop: "b",
  116. hidden: true,
  117. },
  118. {
  119. label: "关联机构",
  120. prop: "c",
  121. hidden: true,
  122. },
  123. {
  124. label: "姓名",
  125. prop: "d",
  126. hidden: true,
  127. },
  128. {
  129. label: "性别",
  130. prop: "e",
  131. hidden: true,
  132. },
  133. {
  134. label: "身份证号",
  135. prop: "f",
  136. hidden: true,
  137. },
  138. {
  139. label: "手机号码",
  140. prop: "g",
  141. hidden: true,
  142. },
  143. {
  144. label: "当前积分",
  145. prop: "h",
  146. hidden: true,
  147. },
  148. {
  149. label: "累计积分",
  150. prop: "i",
  151. hidden: true,
  152. },
  153. {
  154. label: "累计充值",
  155. prop: "j",
  156. hidden: true,
  157. },
  158. {
  159. label: "累计退款",
  160. prop: "k",
  161. hidden: true,
  162. },
  163. {
  164. label: "开通时间",
  165. prop: "l",
  166. hidden: true,
  167. scope: "aTimeList",
  168. },
  169. {
  170. label: "注销时间",
  171. prop: "n",
  172. hidden: true,
  173. scope: "aTimeList",
  174. },
  175. ],
  176. tableData: [],
  177. total: 0,
  178. dialogVisible: false,
  179. dialogRecordVisible: false,
  180. activeData: {},
  181. };
  182. },
  183. created() {
  184. this.search(2);
  185. },
  186. methods: {
  187. addClick(data) {
  188. this.activeData = data || {};
  189. this.dialogVisible = true;
  190. },
  191. search(v) {
  192. this.tableData = [
  193. {
  194. id: 1,
  195. a: 1,
  196. b: "云学堂",
  197. c: "广东中正科技公司",
  198. d: "张三",
  199. e: "男",
  200. f: "4408232023012332111",
  201. g: 13800138000,
  202. h: 100,
  203. i: 300,
  204. j: 200,
  205. k: 0,
  206. l: 1234567891,
  207. n: 1234567891,
  208. },
  209. ];
  210. // this.loading = true;
  211. // if (v === 2) {
  212. // this.formData = {
  213. // pageSize: 10,
  214. // pageNum: 1,
  215. // };
  216. // }
  217. // this.$api
  218. // .xxx(this.formData)
  219. // .then((res) => {
  220. // this.tableData = res.rows;
  221. // this.total = res.total;
  222. // this.navText.index = res.total;
  223. // })
  224. // .finally(() => {
  225. // this.loading = false;
  226. // });
  227. },
  228. init() {
  229. this.search(2);
  230. },
  231. //注销会员
  232. cancellation(row) {
  233. this.$alert("确定注销该会员吗?", "提示", {
  234. dangerouslyUseHTMLString: true,
  235. })
  236. .then(() => {})
  237. .catch(() => {});
  238. },
  239. record(data) {
  240. this.activeData = data || {};
  241. this.dialogRecordVisible = true;
  242. },
  243. },
  244. };
  245. </script>
  246. <style lang="scss" scoped></style>