settleAccounts.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <basic-container v-if="show">
  3. <avue-crud
  4. ref="crud"
  5. :data="data"
  6. :option="option"
  7. :page.sync="page"
  8. :search.sync="search"
  9. :table-loading="loading"
  10. @row-del="rowDel"
  11. @size-change="sizeChange"
  12. @current-change="currentChange"
  13. @search-change="searchChange"
  14. @refresh-change="refreshChange"
  15. @on-load="getList"
  16. @saveColumn="saveColumn"
  17. >
  18. <template slot="corpIdSearch">
  19. <select-component
  20. v-model="search.corpId"
  21. :configuration="configuration"
  22. ></select-component>
  23. </template>
  24. <template slot-scope="{row,index}" slot="menuLeft">
  25. <el-button
  26. icon="el-icon-printer"
  27. size="small"
  28. type="primary"
  29. @click.stop=""
  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="settleAccounts(scope.row, scope.index)"
  39. >编 辑
  40. </el-button>
  41. </template>
  42. </avue-crud>
  43. </basic-container>
  44. <detail-page
  45. ref="detail"
  46. @goBack="goBack"
  47. :detailData="detailData"
  48. v-else
  49. ></detail-page>
  50. </template>
  51. <script>
  52. import option from "./configuration/settleAccounts.json";
  53. import { getList } from "@/api/workManagement/mainProject";
  54. import detailPage from "./settleAccountsDetailsPage.vue";
  55. export default {
  56. data() {
  57. return {
  58. loading: false,
  59. show:true,
  60. detailData:{},
  61. data: [],
  62. option: option,
  63. search:{},
  64. configuration:{
  65. multipleChoices:false,
  66. multiple:false,
  67. disabled:false,
  68. searchShow:true,
  69. collapseTags:false,
  70. clearable:true,
  71. placeholder:'请点击右边按钮选择',
  72. dicData:[]
  73. },
  74. page: {
  75. currentPage: 1,
  76. total: 0,
  77. pageSize: 10
  78. }
  79. };
  80. },
  81. components:{
  82. detailPage
  83. },
  84. mounted() {
  85. // option.height = window.innerHeight - 340 ;
  86. },
  87. methods: {
  88. getList(page,params={}) {
  89. this.loading = true;
  90. params.flag = 1;
  91. if(params){
  92. if (params.createTime != undefined) { //发货
  93. params.createStartDate = params.createTime[0]+ " " + "00:00:00";
  94. params.createEndDate = params.createTime[1] + " " + "23:59:59";
  95. this.$delete(params,'createTime')
  96. }
  97. }
  98. getList(page.currentPage, page.pageSize,params).then(res =>{
  99. this.data = res.data.data.records
  100. this.page.total = res.data.data.total
  101. this.loading = false
  102. })
  103. },
  104. //结算
  105. settleAccounts(row){
  106. this.detailData = {
  107. id: row.id
  108. };
  109. this.show = false;
  110. },
  111. searchChange(params, done) {
  112. this.getList(this.page, params);
  113. done();
  114. },
  115. sizeChange(val) {
  116. this.page.pageSize = val;
  117. this.getList();
  118. },
  119. currentChange(val) {
  120. this.page.currentPage = val;
  121. this.getList();
  122. },
  123. refreshChange() {
  124. this.page.currentPage = 1;
  125. this.getList();
  126. },
  127. //删除列表后面的删除按钮触发触发(row, index, done)
  128. rowDel(row, index, done) {
  129. this.$confirm("确定将选择数据删除?", {
  130. confirmButtonText: "确定",
  131. cancelButtonText: "取消",
  132. type: "warning"
  133. }).then(() => {
  134. this.$message({
  135. type: "success",
  136. message: "操作成功!"
  137. });
  138. // 数据回调进行刷新
  139. done(row);
  140. });
  141. },
  142. saveColumn(row, column) {
  143. console.log(row, column);
  144. },
  145. goBack() {
  146. this.detailData=this.$options.data().detailData
  147. this.show = true;
  148. },
  149. }
  150. };
  151. </script>
  152. <style></style>