paymentSettle.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <basic-container v-if="show">
  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="info"
  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-edit"
  32. size="small"
  33. @click.stop="editOpen(scope.row, 2)"
  34. >编辑
  35. </el-button>
  36. <el-button
  37. type="text"
  38. icon="el-icon-delete"
  39. size="small"
  40. @click.stop="rowDel(scope.row, scope.index)"
  41. >删除
  42. </el-button>
  43. </template>
  44. </avue-crud>
  45. </basic-container>
  46. <detail-page
  47. ref="detail"
  48. @goBack="goBack"
  49. :detailData="detailData"
  50. v-else
  51. ></detail-page>
  52. </template>
  53. <script>
  54. import option from "./configuration/mainList.json";
  55. import {getList ,remove} from "@/api/financialManagement/financialManagement"
  56. import detailPage from "./paymentSettleDetailsPage";
  57. export default {
  58. data() {
  59. return {
  60. loading : false,
  61. form: {},
  62. show:true,
  63. detailData:{},
  64. option: option,
  65. parentId:0,
  66. dataList: [],
  67. page: {
  68. pageSize: 10,
  69. pagerCount: 5,
  70. total: 0,
  71. },
  72. query:{}
  73. }
  74. },
  75. created() {
  76. if(this.$route.query.params){
  77. this.detailData={
  78. params:this.$route.query.params
  79. }
  80. this.show = false;
  81. this.$store.commit("PAY_IN_DETAIL");
  82. }
  83. },
  84. components:{
  85. detailPage
  86. },
  87. mounted() {
  88. option.height = window.innerHeight - 350 ;
  89. },
  90. methods: {
  91. //新单打开
  92. addReceipt(row){
  93. this.detailData = {
  94. id: row.id,
  95. status: 1
  96. };
  97. this.show = false;
  98. this.$store.commit("PAY_IN_DETAIL");
  99. },
  100. //编辑打开
  101. editOpen(row, status){
  102. this.detailData = {
  103. id: row.id,
  104. status: status
  105. };
  106. this.show = false;
  107. this.$store.commit("PAY_IN_DETAIL");
  108. },
  109. rowDel(row, index, done) {
  110. if(row.id){
  111. this.$confirm("确定将选择数据删除?", {
  112. confirmButtonText: "确定",
  113. cancelButtonText: "取消",
  114. type: "warning"
  115. }).then(() => {
  116. remove(row.id).then(res =>{
  117. if(res.data.success){
  118. this.$message.success("操作成功!");
  119. this.onLoad(this.page);
  120. }
  121. })
  122. });
  123. }
  124. },
  125. //点击搜索按钮触发
  126. searchChange(params, done) {
  127. this.query = params;
  128. this.page.currentPage = 1;
  129. this.onLoad(this.page, params);
  130. done()
  131. },
  132. searchReset() {
  133. console.log('1')
  134. },
  135. selectionChange() {
  136. console.log('1')
  137. },
  138. currentChange() {
  139. console.log('1')
  140. },
  141. sizeChange() {
  142. console.log('1')
  143. },
  144. refreshChange() {
  145. console.log('1')
  146. },
  147. onLoad(page, params = {}) {
  148. params.billType = "付费"
  149. this.loading = true
  150. getList(page.currentPage, page.pageSize,params).then(res =>{
  151. this.dataList = res.data.data.records
  152. this.page.total = res.data.data.total
  153. this.loading = false
  154. })
  155. },
  156. goBack() {
  157. this.detailData=this.$options.data().detailData
  158. this.show = true;
  159. }
  160. }
  161. }
  162. </script>
  163. <style scoped>
  164. </style>