| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <template>
- <div>
- <!-- <el-row :gutter="10" style="margin-bottom: 0px;">
- <el-col :span="24">
- <basic-container>
- <avue-form :option="searchOption" v-model="searchForm" @submit="handleImportSubmit">
- </avue-form>
- </basic-container>
- </el-col>
- </el-row> -->
- <el-row :gutter="10" style="margin-bottom: 0px;">
- <el-col :span="24">
- <basic-container>
- <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud"
- v-model="form" :permission="permissionList" @search-change="searchChange"
- @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
- @size-change="sizeChange" @refresh-change="refreshChange" @before-open="beforeOpen"
- @sort-change="sortChange" @cell-click="cellClick" @on-load="onLoad">
- </avue-crud>
- </basic-container>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import { getWaterUseConsumerYearCountPage } from "@/api/business/count/count";
- import { mapGetters } from "vuex";
- export default {
- data() {
- return {
- form: {},
- selectionList: [],
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- },
- searchForm: {
- tm: '',
- },
- searchOption: {
- submitText: '查询',
- column: [
- {
- label: "统计年月",
- prop: "tm",
- type: "date",
- span: 6,
- format: 'yyyy年MM月',
- valueFormat: 'yyyy-MM-dd',
- }
- ]
- },
- option: {
- height: 'auto',
- calcHeight: 30,
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- border: true,
- index: true,
- selection: true,
- viewBtn: false,
- dialogClickModal: false,
- menu: false,
- column: [
- {
- label: "取用水户编码",
- prop: "wiuCd",
- }, {
- label: "取用水户名称",
- prop: "wiuNm",
- }, {
- label: "年份",
- prop: "tm",
- search: true,
- type: "date",
- format: 'yyyy年',
- valueFormat: 'yyyy-MM-dd HH:mm:ss',
- }, {
- label: "累计用水量",
- prop: "accw",
- },
- ]
- },
- data: []
- };
- },
- computed: {
- ...mapGetters(["userInfo", "permission"]),
- permissionList() {
- return {
- addBtn: false,
- viewBtn: false,
- delBtn: false,
- editBtn: false
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids.join(",");
- }
- },
- mounted() {
- this.searchForm.countTime = new Date();
- },
- props: {
- wiuCd: {
- type: [String],
- required: true
- },
- },
- methods: {
- init() {
- this.onLoad(this.page);
- },
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
- },
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- selectionClear() {
- this.selectionList = [];
- this.$refs.crud.toggleSelection();
- },
- currentChange(currentPage) {
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize) {
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- this.loading = true;
- params['wiuCd'] = this.wiuCd;
- console.log("wiu " + JSON.stringify(params))
- getWaterUseConsumerYearCountPage(
- page.currentPage,
- page.pageSize,
- Object.assign(params, this.sort, this.query)
- ).then((res) => {
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- this.loading = false;
- this.selectionClear();
- });
- }
- }
- };
- </script>
- <style></style>
|