<!--
|
* @Author: elkers
|
* @Date: 2024-08-06 16:17:39
|
* @LastEditors: Liuyi candymxq888@outlook.com
|
* @LastEditTime: 2024-10-22 16:47:01
|
* @FilePath: \water-qinghe-web\src\views\meterReading\meterReadingRecord\index.vue
|
* @Description: 自动抄表 数据上报
|
-->
|
|
<script setup>
|
import meterReadingRecordApi from "@/api/meterReadingApi/meterReadingRecord";
|
import setPostParams from "../../../utils/searchParams.js";
|
|
const {proxy} = getCurrentInstance();
|
|
/**
|
* 搜索相关
|
*/
|
/** 搜索按钮操作 */
|
function handleQuery() {
|
getList({keywords: queryParam.value.name,dateString: queryParam.value.dateString})
|
}
|
|
/** 重置按钮操作 */
|
function resetQuery() {
|
proxy.resetForm("queryRef");
|
handleQuery();
|
}
|
|
/**
|
* Table表格权限数据列表相关
|
*/
|
const queryParam = ref({
|
name: '',
|
dateString:''
|
})
|
const pageParam = ref({
|
total: 0,
|
limit: 0,
|
page: 1,
|
})
|
const tableData = ref([]);
|
const inpTip = '请输入', selTip = '请输入';
|
let tableHeader = ref({
|
userName: "所属用户",
|
meterSn: '表号',
|
montAmount: '月扣除金额',
|
monthData: '月使用水量',
|
dateString:'日期'
|
})
|
/** 获取列表 */
|
const loading = ref(false)
|
|
async function getList(val) {
|
loading.value = true;
|
let postParam = setPostParams(val)
|
await meterReadingRecordApi().getByMonth(postParam).then((res) => {
|
tableData.value = res.data.list
|
pageParam.value.total = res.data.total
|
pageParam.value.limit = res.data.limit
|
pageParam.value.page = res.data.page
|
})
|
loading.value = false;
|
}
|
|
getList();
|
</script>
|
<template>
|
<div class="app-container">
|
<el-form :model="queryParam" ref="queryRef" :inline="true">
|
<el-form-item label="表号查询" prop="name">
|
<el-input
|
v-model="queryParam.name"
|
placeholder="请输入表号"
|
clearable
|
style="width: 200px"
|
@keyup.enter="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="日期查询" prop="dateString">
|
<el-date-picker
|
v-model="queryParam.dateString"
|
type="month"
|
placeholder="请选择年月"
|
format="YYYY-MM"
|
value-format="YYYY-MM"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
</el-form-item>
|
</el-form>
|
|
<!--表格及分页-->
|
<el-table v-loading="loading" :data="tableData">
|
<el-table-column
|
v-for="(item, key, index) of tableHeader"
|
:prop="key.toString()"
|
:label="item"
|
:key="index"
|
align="center"
|
:sortable="key.toString() == 'deductAmount' ? true : false"
|
>
|
<template #default="scope">
|
<div v-if="key.toString() == 'headImg'">
|
<img :src="scope.row.headImg" class="table-headImg"/>
|
</div>
|
</template>
|
</el-table-column>
|
</el-table>
|
<pagination
|
:total="pageParam.total"
|
v-model:page="pageParam.page"
|
v-model:limit="pageParam.limit"
|
:page-sizes="[10,20,30]"
|
@pagination="getList"
|
/>
|
</div>
|
</template>
|