paymentRequest.vue 3.9 KB

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