consumerwaterflowyearcountdetail.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <div>
  3. <!-- <el-row :gutter="10" style="margin-bottom: 0px;">
  4. <el-col :span="24">
  5. <basic-container>
  6. <avue-form :option="searchOption" v-model="searchForm" @submit="handleImportSubmit">
  7. </avue-form>
  8. </basic-container>
  9. </el-col>
  10. </el-row> -->
  11. <el-row :gutter="10" style="margin-bottom: 0px;">
  12. <el-col :span="24">
  13. <basic-container>
  14. <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud"
  15. v-model="form" :permission="permissionList" @search-change="searchChange"
  16. @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
  17. @size-change="sizeChange" @refresh-change="refreshChange" @before-open="beforeOpen"
  18. @sort-change="sortChange" @cell-click="cellClick" @on-load="onLoad">
  19. </avue-crud>
  20. </basic-container>
  21. </el-col>
  22. </el-row>
  23. </div>
  24. </template>
  25. <script>
  26. import { getWaterUseConsumerYearCountPage } from "@/api/business/count/count";
  27. import { mapGetters } from "vuex";
  28. export default {
  29. data() {
  30. return {
  31. form: {},
  32. selectionList: [],
  33. query: {},
  34. loading: true,
  35. page: {
  36. pageSize: 10,
  37. currentPage: 1,
  38. total: 0,
  39. },
  40. searchForm: {
  41. tm: '',
  42. },
  43. searchOption: {
  44. submitText: '查询',
  45. column: [
  46. {
  47. label: "统计年月",
  48. prop: "tm",
  49. type: "date",
  50. span: 6,
  51. format: 'yyyy年MM月',
  52. valueFormat: 'yyyy-MM-dd',
  53. }
  54. ]
  55. },
  56. option: {
  57. height: 'auto',
  58. calcHeight: 30,
  59. tip: false,
  60. searchShow: true,
  61. searchMenuSpan: 6,
  62. border: true,
  63. index: true,
  64. selection: true,
  65. viewBtn: false,
  66. dialogClickModal: false,
  67. menu: false,
  68. column: [
  69. {
  70. label: "取用水户编码",
  71. prop: "wiuCd",
  72. }, {
  73. label: "取用水户名称",
  74. prop: "wiuNm",
  75. }, {
  76. label: "年份",
  77. prop: "tm",
  78. search: true,
  79. type: "date",
  80. format: 'yyyy年',
  81. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  82. }, {
  83. label: "累计用水量",
  84. prop: "accw",
  85. },
  86. ]
  87. },
  88. data: []
  89. };
  90. },
  91. computed: {
  92. ...mapGetters(["userInfo", "permission"]),
  93. permissionList() {
  94. return {
  95. addBtn: false,
  96. viewBtn: false,
  97. delBtn: false,
  98. editBtn: false
  99. };
  100. },
  101. ids() {
  102. let ids = [];
  103. this.selectionList.forEach(ele => {
  104. ids.push(ele.id);
  105. });
  106. return ids.join(",");
  107. }
  108. },
  109. mounted() {
  110. this.searchForm.countTime = new Date();
  111. },
  112. props: {
  113. wiuCd: {
  114. type: [String],
  115. required: true
  116. },
  117. },
  118. methods: {
  119. init() {
  120. this.onLoad(this.page);
  121. },
  122. searchReset() {
  123. this.query = {};
  124. this.onLoad(this.page);
  125. },
  126. searchChange(params, done) {
  127. this.query = params;
  128. this.page.currentPage = 1;
  129. this.onLoad(this.page, params);
  130. done();
  131. },
  132. selectionChange(list) {
  133. this.selectionList = list;
  134. },
  135. selectionClear() {
  136. this.selectionList = [];
  137. this.$refs.crud.toggleSelection();
  138. },
  139. currentChange(currentPage) {
  140. this.page.currentPage = currentPage;
  141. },
  142. sizeChange(pageSize) {
  143. this.page.pageSize = pageSize;
  144. },
  145. refreshChange() {
  146. this.onLoad(this.page, this.query);
  147. },
  148. onLoad(page, params = {}) {
  149. this.loading = true;
  150. params['wiuCd'] = this.wiuCd;
  151. console.log("wiu " + JSON.stringify(params))
  152. getWaterUseConsumerYearCountPage(
  153. page.currentPage,
  154. page.pageSize,
  155. Object.assign(params, this.sort, this.query)
  156. ).then((res) => {
  157. const data = res.data.data;
  158. this.page.total = data.total;
  159. this.data = data.records;
  160. this.loading = false;
  161. this.selectionClear();
  162. });
  163. }
  164. }
  165. };
  166. </script>
  167. <style></style>