index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent v-show="showSearch">
  4. <el-form-item label="充值企业" prop="companyName">
  5. <el-input v-model="queryParams.companyName" placeholder="请输入充值企业" @keyup.enter.native="handleQuery" clearable />
  6. </el-form-item>
  7. <el-form-item label="充值编号" prop="nums">
  8. <el-input v-model="queryParams.nums" placeholder="请输入充值编号" @keyup.enter.native="handleQuery" class="inp" clearable />
  9. </el-form-item>
  10. <el-form-item label="充值状态" prop="state">
  11. <el-select v-model="queryParams.state" placeholder="充值状态" clearable style="width: 117px">
  12. <el-option value="0" label="待充值"></el-option>
  13. <el-option value="1" label="充值成功"></el-option>
  14. <el-option value="2" label="充值失败"></el-option>
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item label="申请日期">
  18. <el-date-picker v-model="dateRange" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false"></el-date-picker>
  19. </el-form-item>
  20. <el-form-item>
  21. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  22. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  23. </el-form-item>
  24. </el-form>
  25. <el-row :gutter="10" class="mb8">
  26. <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit', ids)" v-hasPermi="['work:recharge:edit']">审核</el-button>
  27. <el-button type="primary" icon="el-icon-download" @click="handleExport" v-hasPermi="['work:recharge:export']">导出</el-button>
  28. <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:recharge:remove']">删除{{ ids.length > 0 ? '(' + ids.length + ')' : '' }}</el-button>
  29. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  30. </el-row>
  31. <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
  32. <el-table-column type="selection" width="55" align="center" />
  33. <el-table-column label="充值企业" align="left" prop="companyName" />
  34. <el-table-column label="充值编号" align="center" prop="nums" width="170" />
  35. <el-table-column label="充值金额(元)" align="center" prop="money" width="130" />
  36. <el-table-column label="充值状态" align="center" width="110">
  37. <template slot-scope="scope">
  38. <el-tag type="danger" v-if="scope.row.state == 0">待充值</el-tag>
  39. <el-tag type="success" v-if="scope.row.state == 1">充值成功</el-tag>
  40. <el-popover placement="top-start" v-if="scope.row.state == 2" title="原因" width="200" trigger="hover" :content="scope.row.msg">
  41. <div slot="reference">
  42. <el-tag type="info">充值失败</el-tag>
  43. <i class="el-icon-warning"></i>
  44. </div>
  45. </el-popover>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="申请人" align="center" prop="opBy" width="130" />
  49. <el-table-column label="申请日期" align="center" prop="createTime" width="170" />
  50. <el-table-column label="操作" align="center" width="180">
  51. <template slot-scope="scope">
  52. <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-hasPermi="['work:recharge:list']">详情</el-button>
  53. <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:recharge:edit']" :disabled="scope.row.state != 0">审核</el-button>
  54. <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:recharge:remove']">删除</el-button>
  55. </template>
  56. </el-table-column>
  57. <template slot="empty">
  58. <el-empty></el-empty>
  59. </template>
  60. </el-table>
  61. <pagination v-if="response.total > 0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
  62. </div>
  63. </template>
  64. <script>
  65. import audit from './audit';
  66. export default {
  67. name: 'Recharge',
  68. data() {
  69. return {
  70. ids: [],
  71. showSearch: true,
  72. response: {},
  73. dateRange: [],
  74. queryParams: {
  75. pageNum: 1,
  76. pageSize: 10,
  77. companyName: null,
  78. state: null,
  79. nums: null,
  80. orderByColumn: 'r.id',
  81. isAsc: 'desc'
  82. }
  83. };
  84. },
  85. created() {
  86. this.getList();
  87. },
  88. methods: {
  89. getList() {
  90. if (this.dateRange) {
  91. this.queryParams.dateBegin = this.dateRange[0];
  92. this.queryParams.dateEnd = this.dateRange[1];
  93. }
  94. this.ajax({ url: '/work/recharge/list', data: this.queryParams }).then((response) => {
  95. this.response = response;
  96. });
  97. },
  98. handleQuery() {
  99. this.queryParams.pageNum = 1;
  100. this.getList();
  101. },
  102. resetQuery() {
  103. this.resetForm('queryForm');
  104. this.dateRange = [];
  105. this.handleQuery();
  106. },
  107. selects(rows) {
  108. this.ids = rows.map((item) => item.id);
  109. },
  110. op(tag, row) {
  111. if (tag == 'detail') {
  112. const id = row.id || this.ids[0];
  113. this.iframe({ obj: audit, param: { id: id, detail: true, companyName: row.companyName }, title: '充值详情', width: '40%', height: '70%' });
  114. }
  115. if (tag == 'edit') {
  116. const id = row.id || this.ids[0];
  117. this.iframe({ obj: audit, param: { id: id, companyName: row.companyName }, title: '充值确认', width: '40%', height: '70%' });
  118. }
  119. },
  120. del(row) {
  121. this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
  122. this.get({ url: '/work/recharge/remove/' + (row.id || this.ids) }).then((response) => {
  123. this.$modal.msgSuccess('删除成功');
  124. this.getList();
  125. });
  126. });
  127. },
  128. /** 导出按钮操作 */
  129. handleExport() {
  130. this.download('/work/recharge/export', { ...this.queryParams }, '充值明细.xlsx');
  131. }
  132. }
  133. };
  134. </script>