settleAccounts.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <basic-container>
  3. <avue-crud
  4. ref="crud"
  5. :data="data"
  6. :option="option"
  7. :page.sync="page"
  8. :table-loading="loading"
  9. :before-open="beforeOpen"
  10. @row-del="rowDel"
  11. @size-change="sizeChange"
  12. @current-change="currentChange"
  13. @search-change="searchChange"
  14. @refresh-change="refreshChange"
  15. @cell-dblclick="cellDblclick"
  16. @on-load="getList"
  17. @saveColumn="saveColumn"
  18. >
  19. <template slot-scope="{row,index}" slot="menuLeft">
  20. <el-button
  21. icon="el-icon-printer"
  22. size="small"
  23. type="primary"
  24. @click.stop="openReport()"
  25. >报 表
  26. </el-button>
  27. </template>
  28. <template slot-scope="scope" slot="menu">
  29. <el-button
  30. type="text"
  31. icon="el-icon-check"
  32. size="small"
  33. @click.stop="settleAccounts(scope.row, scope.index)"
  34. >结 算
  35. </el-button>
  36. </template>
  37. </avue-crud>
  38. </basic-container>
  39. </template>
  40. <script>
  41. import option from "./configuration/settleAccounts.json";
  42. import { getList } from "@/api/workManagement/mainProject";
  43. export default {
  44. data() {
  45. return {
  46. loading: false,
  47. data: [],
  48. option: option,
  49. page: {
  50. currentPage: 1,
  51. total: 0,
  52. pageSize: 10
  53. }
  54. };
  55. },
  56. mounted() {
  57. option.height = window.innerHeight - 340 ;
  58. },
  59. methods: {
  60. getList(page,params={flag:1}) {
  61. this.loading = true;
  62. getList(page.currentPage, page.pageSize,params).then(res =>{
  63. this.data = res.data.data.records
  64. this.page.total = res.data.data.total
  65. this.loading = false
  66. })
  67. },
  68. //结算
  69. settleAccounts(row){
  70. this.$router.push({
  71. path: "/settleAccounts_detailsPage",
  72. query: {id: row.id},
  73. });
  74. },
  75. searchChange(params, done) {
  76. this.getList(this.page, params);
  77. done();
  78. },
  79. sizeChange(val) {
  80. this.page.pageSize = val;
  81. this.getList();
  82. },
  83. currentChange(val) {
  84. this.page.currentPage = val;
  85. this.getList();
  86. },
  87. refreshChange() {
  88. this.page.currentPage = 1;
  89. this.getList();
  90. },
  91. //删除列表后面的删除按钮触发触发(row, index, done)
  92. rowDel(row, index, done) {
  93. this.$confirm("确定将选择数据删除?", {
  94. confirmButtonText: "确定",
  95. cancelButtonText: "取消",
  96. type: "warning"
  97. }).then(() => {
  98. this.$message({
  99. type: "success",
  100. message: "操作成功!"
  101. });
  102. // 数据回调进行刷新
  103. done(row);
  104. });
  105. },
  106. cellDblclick(row, column, cell, event) {
  107. console.log(row, column, cell, event);
  108. this.$refs.crud.rowEdit(row);
  109. },
  110. saveColumn(row, column) {
  111. console.log(row, column);
  112. },
  113. }
  114. };
  115. </script>
  116. <style></style>