index.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
  4. <el-form-item label="商户名称" prop="sellers">
  5. <el-input v-model="queryParams.discountSeller" placeholder="请输入商户名称" clearable @keyup.enter.native="handleQuery"/>
  6. </el-form-item>
  7. <el-form-item label="发行社区" prop="community">
  8. <el-select v-model="queryParams.community" placeholder="请选择">
  9. <el-option v-for="dict in dict.type.community" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  14. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  15. </el-form-item>
  16. </el-form>
  17. <el-table v-loading="loading" :data="writeOffList" show-summary>
  18. <el-table-column label="代金劵名称" align="center" prop="discountName" />
  19. <el-table-column label="商户名称" align="center" prop="discountSeller" />
  20. <el-table-column label="发行社区" align="center" prop="community" />
  21. <el-table-column label="发放数" align="center" prop="issuedCount" />
  22. <el-table-column label="兑换数" align="center" prop="collectCount" />
  23. <el-table-column label="核销数" align="center" prop="writeOffCount" />
  24. <el-table-column label="核销金额" align="center" prop="writeOffAmount" />
  25. </el-table>
  26. <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
  27. </div>
  28. </template>
  29. <script>
  30. import { writeOffQuery } from "@/api/stat/index";
  31. export default {
  32. name: "writeOff",
  33. dicts: ['community'],
  34. data() {
  35. return {
  36. // 遮罩层
  37. loading: false,
  38. // 总条数
  39. total: 0,
  40. // 活动管理表格数据
  41. writeOffList: [],
  42. // 查询参数
  43. queryParams: {
  44. pageNum: 1,
  45. pageSize: 10,
  46. }
  47. };
  48. },
  49. created() {
  50. this.getList();
  51. },
  52. methods: {
  53. /** 查询活动管理列表 */
  54. async getList() {
  55. this.loading = true;
  56. const res = await writeOffQuery(this.queryParams);
  57. this.writeOffList = res.data;
  58. this.total = res.total;
  59. this.loading = false;
  60. },
  61. /** 搜索按钮操作 */
  62. handleQuery() {
  63. this.queryParams.pageNum = 1;
  64. this.getList();
  65. },
  66. /** 重置按钮操作 */
  67. resetQuery() {
  68. this.resetForm("queryForm");
  69. this.handleQuery();
  70. },
  71. }
  72. };
  73. </script>