payment.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option"
  4. :data="dataList"
  5. ref="crud"
  6. v-model="form"
  7. :page.sync="page"
  8. :table-loading="loading"
  9. @search-change="searchChange"
  10. @search-reset="searchReset"
  11. @selection-change="selectionChange"
  12. @current-change="currentChange"
  13. @size-change="sizeChange"
  14. @refresh-change="refreshChange"
  15. @on-load="onLoad">
  16. <template slot="menuLeft">
  17. <el-button type="primary"
  18. size="small"
  19. icon="el-icon-plus"
  20. @click="addReceipt">新 单
  21. </el-button>
  22. <el-button size="small"
  23. type="success"
  24. @click.stop=""
  25. >复制新单
  26. </el-button>
  27. <el-button size="small"
  28. type="info"
  29. @click.stop="openReport()"
  30. >导出报表
  31. </el-button>
  32. </template>
  33. <template slot-scope="scope" slot="menu">
  34. <el-button
  35. type="text"
  36. icon="el-icon-edit"
  37. size="small"
  38. @click.stop="editOpen(scope.row, scope.index)"
  39. >编辑
  40. </el-button>
  41. <el-button
  42. type="text"
  43. icon="el-icon-delete"
  44. size="small"
  45. @click.stop="rowDel(scope.row, scope.index)"
  46. >删除
  47. </el-button>
  48. </template>
  49. </avue-crud>
  50. </basic-container>
  51. </template>
  52. <script>
  53. import option from "./configuration/paymentList.json";
  54. import {getList ,remove} from "@/api/financialManagement/financialManagement"
  55. export default {
  56. data() {
  57. return {
  58. loading : false,
  59. form: {},
  60. option: option,
  61. parentId:0,
  62. dataList: [{
  63. canem:""
  64. }],
  65. page: {
  66. pageSize: 10,
  67. pagerCount: 5,
  68. total: 0,
  69. },
  70. query:{}
  71. }
  72. },
  73. created() {
  74. },
  75. mounted() {
  76. option.height = window.innerHeight - 350 ;
  77. },
  78. methods: {
  79. //新单打开
  80. addReceipt(){
  81. this.$router.push({
  82. path: "/payment_detailsPage",
  83. query: {id: ''},
  84. });
  85. },
  86. //编辑打开
  87. editOpen(row, index){
  88. this.$router.push({
  89. path: "/payment_detailsPage",
  90. query: {id:row.id},
  91. });
  92. },
  93. rowDel(row, index, done) {
  94. if(row.id){
  95. this.$confirm("确定将选择数据删除?", {
  96. confirmButtonText: "确定",
  97. cancelButtonText: "取消",
  98. type: "warning"
  99. }).then(() => {
  100. remove(row.id).then(res =>{
  101. if(res.data.success){
  102. this.$message.success("操作成功!");
  103. this.onLoad(this.page);
  104. }
  105. })
  106. });
  107. }
  108. },
  109. //点击搜索按钮触发
  110. searchChange(params, done) {
  111. this.query = params;
  112. this.page.currentPage = 1;
  113. this.onLoad(this.page, params);
  114. done()
  115. },
  116. searchReset() {
  117. console.log('1')
  118. },
  119. selectionChange() {
  120. console.log('1')
  121. },
  122. currentChange() {
  123. console.log('1')
  124. },
  125. sizeChange() {
  126. console.log('1')
  127. },
  128. refreshChange() {
  129. console.log('1')
  130. },
  131. onLoad(page, params = {}) {
  132. params.billType = "付费"
  133. this.loading = true
  134. getList(page.currentPage, page.pageSize,params).then(res =>{
  135. this.dataList = res.data.data.records
  136. this.page.total = res.data.data.total
  137. this.loading = false
  138. })
  139. },
  140. }
  141. }
  142. </script>
  143. <style scoped>
  144. </style>