paymentSettle.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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. canem:""
  68. }],
  69. page: {
  70. pageSize: 10,
  71. pagerCount: 5,
  72. total: 0,
  73. },
  74. query:{}
  75. }
  76. },
  77. created() {
  78. if(this.$route.query.params){
  79. this.detailData={
  80. params:this.$route.query.params
  81. }
  82. this.show = false;
  83. this.$store.commit("PAY_IN_DETAIL");
  84. }
  85. },
  86. components:{
  87. detailPage
  88. },
  89. mounted() {
  90. option.height = window.innerHeight - 350 ;
  91. },
  92. methods: {
  93. //新单打开
  94. addReceipt(row){
  95. this.detailData = {
  96. id: row.id,
  97. status: 1
  98. };
  99. this.show = false;
  100. this.$store.commit("PAY_IN_DETAIL");
  101. },
  102. //编辑打开
  103. editOpen(row, status){
  104. this.detailData = {
  105. id: row.id,
  106. status: status
  107. };
  108. this.show = false;
  109. this.$store.commit("PAY_IN_DETAIL");
  110. },
  111. rowDel(row, index, done) {
  112. if(row.id){
  113. this.$confirm("确定将选择数据删除?", {
  114. confirmButtonText: "确定",
  115. cancelButtonText: "取消",
  116. type: "warning"
  117. }).then(() => {
  118. remove(row.id).then(res =>{
  119. if(res.data.success){
  120. this.$message.success("操作成功!");
  121. this.onLoad(this.page);
  122. }
  123. })
  124. });
  125. }
  126. },
  127. //点击搜索按钮触发
  128. searchChange(params, done) {
  129. this.query = params;
  130. this.page.currentPage = 1;
  131. this.onLoad(this.page, params);
  132. done()
  133. },
  134. searchReset() {
  135. console.log('1')
  136. },
  137. selectionChange() {
  138. console.log('1')
  139. },
  140. currentChange() {
  141. console.log('1')
  142. },
  143. sizeChange() {
  144. console.log('1')
  145. },
  146. refreshChange() {
  147. console.log('1')
  148. },
  149. onLoad(page, params = {}) {
  150. params.billType = "付费"
  151. this.loading = true
  152. getList(page.currentPage, page.pageSize,params).then(res =>{
  153. this.dataList = res.data.data.records
  154. this.page.total = res.data.data.total
  155. this.loading = false
  156. })
  157. },
  158. goBack() {
  159. this.detailData=this.$options.data().detailData
  160. this.show = true;
  161. }
  162. }
  163. }
  164. </script>
  165. <style scoped>
  166. </style>