后端

moneyaccount.vue 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
  4. <el-form-item>
  5. <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
  6. </el-form-item>
  7. <el-form-item>
  8. <el-button @click="getDataList()">查询</el-button>
  9. <el-button v-if="isAuth('generator:moneyaccount:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
  10. <el-button v-if="isAuth('generator:moneyaccount:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
  11. </el-form-item>
  12. </el-form>
  13. <el-table
  14. :data="dataList"
  15. border
  16. v-loading="dataListLoading"
  17. @selection-change="selectionChangeHandle"
  18. style="width: 100%;">
  19. <el-table-column
  20. type="selection"
  21. header-align="center"
  22. align="center"
  23. width="50">
  24. </el-table-column>
  25. <el-table-column
  26. prop="id"
  27. header-align="center"
  28. align="center"
  29. label="收款账户信息id">
  30. </el-table-column>
  31. <el-table-column
  32. prop="meetingId"
  33. header-align="center"
  34. align="center"
  35. label="会议id">
  36. </el-table-column>
  37. <el-table-column
  38. prop="name"
  39. header-align="center"
  40. align="center"
  41. label="账号名称">
  42. </el-table-column>
  43. <el-table-column
  44. prop="bank"
  45. header-align="center"
  46. align="center"
  47. label="开户银行">
  48. </el-table-column>
  49. <el-table-column
  50. prop="account"
  51. header-align="center"
  52. align="center"
  53. label="账号">
  54. </el-table-column>
  55. <el-table-column
  56. prop="createTime"
  57. header-align="center"
  58. align="center"
  59. label="创建时间">
  60. </el-table-column>
  61. <el-table-column
  62. prop="isDel"
  63. header-align="center"
  64. align="center"
  65. label="是否被删除 状态 0:正常 1:删除">
  66. </el-table-column>
  67. <el-table-column
  68. fixed="right"
  69. header-align="center"
  70. align="center"
  71. width="150"
  72. label="操作">
  73. <template slot-scope="scope">
  74. <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
  75. <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <el-pagination
  80. @size-change="sizeChangeHandle"
  81. @current-change="currentChangeHandle"
  82. :current-page="pageIndex"
  83. :page-sizes="[10, 20, 50, 100]"
  84. :page-size="pageSize"
  85. :total="totalPage"
  86. layout="total, sizes, prev, pager, next, jumper">
  87. </el-pagination>
  88. <!-- 弹窗, 新增 / 修改 -->
  89. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  90. </div>
  91. </template>
  92. <script>
  93. import AddOrUpdate from './moneyaccount-add-or-update'
  94. export default {
  95. data () {
  96. return {
  97. dataForm: {
  98. key: ''
  99. },
  100. dataList: [],
  101. pageIndex: 1,
  102. pageSize: 10,
  103. totalPage: 0,
  104. dataListLoading: false,
  105. dataListSelections: [],
  106. addOrUpdateVisible: false
  107. }
  108. },
  109. components: {
  110. AddOrUpdate
  111. },
  112. activated () {
  113. this.getDataList()
  114. },
  115. methods: {
  116. // 获取数据列表
  117. getDataList () {
  118. this.dataListLoading = true
  119. this.$http({
  120. url: this.$http.adornUrl('/generator/moneyaccount/list'),
  121. method: 'get',
  122. params: this.$http.adornParams({
  123. 'page': this.pageIndex,
  124. 'limit': this.pageSize,
  125. 'key': this.dataForm.key
  126. })
  127. }).then(({data}) => {
  128. if (data && data.code === 0) {
  129. this.dataList = data.page.list
  130. this.totalPage = data.page.totalCount
  131. } else {
  132. this.dataList = []
  133. this.totalPage = 0
  134. }
  135. this.dataListLoading = false
  136. })
  137. },
  138. // 每页数
  139. sizeChangeHandle (val) {
  140. this.pageSize = val
  141. this.pageIndex = 1
  142. this.getDataList()
  143. },
  144. // 当前页
  145. currentChangeHandle (val) {
  146. this.pageIndex = val
  147. this.getDataList()
  148. },
  149. // 多选
  150. selectionChangeHandle (val) {
  151. this.dataListSelections = val
  152. },
  153. // 新增 / 修改
  154. addOrUpdateHandle (id) {
  155. this.addOrUpdateVisible = true
  156. this.$nextTick(() => {
  157. this.$refs.addOrUpdate.init(id)
  158. })
  159. },
  160. // 删除
  161. deleteHandle (id) {
  162. var ids = id ? [id] : this.dataListSelections.map(item => {
  163. return item.id
  164. })
  165. this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
  166. confirmButtonText: '确定',
  167. cancelButtonText: '取消',
  168. type: 'warning'
  169. }).then(() => {
  170. this.$http({
  171. url: this.$http.adornUrl('/generator/moneyaccount/delete'),
  172. method: 'post',
  173. data: this.$http.adornData(ids, false)
  174. }).then(({data}) => {
  175. if (data && data.code === 0) {
  176. this.$message({
  177. message: '操作成功',
  178. type: 'success',
  179. duration: 1500,
  180. onClose: () => {
  181. this.getDataList()
  182. }
  183. })
  184. } else {
  185. this.$message.error(data.msg)
  186. }
  187. })
  188. })
  189. }
  190. }
  191. }
  192. </script>