index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <search-table @search="reload"></search-table>
  5. <!-- 数据表格 -->
  6. <ele-pro-table
  7. ref="table"
  8. :columns="columns"
  9. :datasource="datasource"
  10. height="calc(100vh - 325px)"
  11. full-height="calc(100vh - 116px)"
  12. tool-class="ele-toolbar-form"
  13. :selection.sync="selection"
  14. cache-key="eomContactPageTable">
  15. <!-- 表头工具栏 -->
  16. <template v-slot:toolbar>
  17. <el-button
  18. size="small"
  19. type="primary"
  20. icon="el-icon-plus"
  21. class="ele-btn-icon"
  22. @click="handleAddOrEdit('','add')"
  23. >
  24. 新建
  25. </el-button>
  26. <el-button
  27. size="small"
  28. type="danger"
  29. el-icon-delete
  30. class="ele-btn-icon"
  31. @click="allDelBtn"
  32. :disabled="selection?.length === 0"
  33. >
  34. 批量删除
  35. </el-button>
  36. </template>
  37. <!-- 操作 -->
  38. <template v-slot:action="{row}">
  39. <el-link
  40. type="primary"
  41. :underline="false"
  42. icon="el-icon-edit"
  43. @click="handleAddOrEdit(row,'update')">
  44. 修改
  45. </el-link>
  46. <el-popconfirm
  47. class="ele-action"
  48. title="确定要删除此信息吗?"
  49. @confirm="remove([row.id])"
  50. >
  51. <template v-slot:reference>
  52. <el-link
  53. type="danger"
  54. :underline="false"
  55. icon="el-icon-delete"
  56. >
  57. 删除
  58. </el-link>
  59. </template>
  60. </el-popconfirm>
  61. </template>
  62. <template v-slot:applyUserName="{row}">
  63. <el-link
  64. type="primary"
  65. :underline="false"
  66. @click="handleDetail(row,'view')"
  67. >
  68. {{ row.applyUserName }}
  69. </el-link>
  70. </template>
  71. </ele-pro-table>
  72. </el-card>
  73. <!-- 多选删除弹窗 -->
  74. <pop-modal
  75. :visible.sync="delVisible"
  76. content="是否确定删除?"
  77. @done="commitBtn"/>
  78. <add-or-edit-dialog :add-or-edit-dialog-flag.sync="addOrEditDialogFlag" ref="addOrEditDialogRef"
  79. v-if="addOrEditDialogFlag" @reload="reload"></add-or-edit-dialog>
  80. </div>
  81. </template>
  82. <script>
  83. import popModal from '@/components/pop-modal';
  84. import dictMixins from "@/mixins/dictMixins";
  85. import addOrEditDialog from "./components/addOrEditDialog.vue";
  86. import searchTable from "./components/searchTable.vue";
  87. import {
  88. settlementAccountPageListAPI,
  89. settlementAccountRemoveAPI,
  90. settlementAccountSubmit
  91. } from "@/api/financialManage/settlementAccount";
  92. export default {
  93. mixins: [dictMixins],
  94. components: {
  95. popModal,
  96. addOrEditDialog,
  97. searchTable
  98. },
  99. data() {
  100. return {
  101. // 加载状态
  102. loading: false,
  103. delVisible: false,
  104. addOrEditDialogFlag: false,
  105. selection: [],
  106. };
  107. },
  108. computed: {
  109. columns() {
  110. return [
  111. {
  112. width: 45,
  113. type: 'selection',
  114. columnKey: 'selection',
  115. align: 'center'
  116. },
  117. {
  118. width: 60,
  119. label: '序号',
  120. type: 'index',
  121. columnKey: 'index',
  122. align: 'center',
  123. },
  124. {
  125. minWidth: 80,
  126. prop: 'type',
  127. label: '类型',
  128. slot: 'type',
  129. align: 'center',
  130. showOverflowTooltip: true,
  131. formatter: (row, column) => {
  132. return row.type == 1 ? '现金' : '银行卡';
  133. }
  134. },
  135. {
  136. minWidth: 200,
  137. prop: 'account',
  138. label: '银行账户',
  139. align: 'center',
  140. slot: 'account',
  141. showOverflowTooltip: true
  142. },
  143. {
  144. minWidth: 200,
  145. prop: 'bankName',
  146. label: '银行名称',
  147. slot: 'bankName',
  148. align: 'center',
  149. showOverflowTooltip: true
  150. },
  151. {
  152. minWidth: 200,
  153. prop: 'branchName',
  154. label: '开户行名称',
  155. slot: 'branchName',
  156. align: 'center',
  157. showOverflowTooltip: true
  158. },
  159. {
  160. minWidth: 80,
  161. prop: 'enabled',
  162. label: '是否启用',
  163. align: 'center',
  164. slot: 'modelType',
  165. showOverflowTooltip: true,
  166. formatter: (row, column) => {
  167. return row.enabled ? '启用' : '禁用';
  168. }
  169. },
  170. {
  171. minWidth: 100,
  172. prop: 'createTime',
  173. label: '创建时间',
  174. align: 'center',
  175. slot: 'createTime',
  176. showOverflowTooltip: true
  177. },
  178. {
  179. columnKey: 'action',
  180. label: '操作',
  181. width: 120,
  182. align: 'center',
  183. resizable: false,
  184. slot: 'action',
  185. showOverflowTooltip: true,
  186. fixed: 'right'
  187. }
  188. ]
  189. }
  190. },
  191. created() {
  192. },
  193. methods: {
  194. //新增、修改
  195. handleAddOrEdit(row = {}, type) {
  196. this.addOrEditDialogFlag = true
  197. this.$nextTick(() => {
  198. this.$refs.addOrEditDialogRef.init(row, type)
  199. })
  200. },
  201. //新增、修改
  202. handleDetail(row = {}, type) {
  203. this.detailDialogFlag = true
  204. this.$nextTick(() => {
  205. this.$refs.detailDialogRef.init(row, type)
  206. })
  207. },
  208. /* 表格数据源 */
  209. datasource({page, limit, where, order}) {
  210. return settlementAccountPageListAPI({
  211. pageNum: page,
  212. size: limit,
  213. ...where
  214. });
  215. },
  216. /* 刷新表格 */
  217. reload(where={}) {
  218. console.log(1111);
  219. this.$refs.table.reload({page: 1, where});
  220. },
  221. //批量删除
  222. allDelBtn() {
  223. if (this.selection.length === 0) return;
  224. let flag = this.selection.some(item => [1, 2].includes(item.approvalStatus))
  225. if (flag) return this.$message.warning('抱歉已审核、审核中的数据不能删除,请检查')
  226. this.delVisible = true;
  227. },
  228. commitBtn() {
  229. const dataId = this.selection.map((v) => v.id);
  230. settlementAccountRemoveAPI(dataId).then((res) => {
  231. this.$message.success('删除成功!');
  232. this.reload();
  233. });
  234. },
  235. remove(row) {
  236. settlementAccountRemoveAPI(row).then((res) => {
  237. this.$message.success('删除成功!');
  238. this.reload();
  239. });
  240. },
  241. sub(res) {
  242. settlementAccountSubmit({
  243. businessId: res.id
  244. })
  245. .then((res) => {
  246. this.$message.success('提交成功');
  247. this.reload();
  248. })
  249. .catch((e) => {
  250. this.$message.error(e.message);
  251. });
  252. },
  253. }
  254. };
  255. </script>
  256. <style lang="scss" scoped>
  257. :deep(.el-link--inner) {
  258. margin-left: 0px !important;
  259. }
  260. .sys-organization-list {
  261. height: calc(100vh - 264px);
  262. box-sizing: border-box;
  263. border-width: 1px;
  264. border-style: solid;
  265. overflow: auto;
  266. }
  267. .sys-organization-list :deep(.el-tree-node__content) {
  268. height: 40px;
  269. & > .el-tree-node__expand-icon {
  270. margin-left: 10px;
  271. }
  272. }
  273. </style>