feat: add personnel type and time range search to inspection report
This commit is contained in:
@@ -16,6 +16,30 @@
|
|||||||
<el-form-item label="巡检人" prop="inspectorId">
|
<el-form-item label="巡检人" prop="inspectorId">
|
||||||
<el-input v-model="queryParams.inspectorId" placeholder="输入巡检人姓名"></el-input>
|
<el-input v-model="queryParams.inspectorId" placeholder="输入巡检人姓名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="人员类型" prop="inspectionPointType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.inspectionPointType"
|
||||||
|
placeholder="请选择人员类型"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in inspection_point_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
@@ -77,6 +101,7 @@ import { ref, reactive, toRefs, getCurrentInstance } from "vue";
|
|||||||
|
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true);
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
const { inspection_point_type } = proxy.useDict("inspection_point_type");
|
||||||
|
|
||||||
// 三套柱状数据:总计 / 本月 / 本日(巡检点统计)
|
// 三套柱状数据:总计 / 本月 / 本日(巡检点统计)
|
||||||
const histogramTotalData = ref({ xAxis: [], seriesData: [] });
|
const histogramTotalData = ref({ xAxis: [], seriesData: [] });
|
||||||
@@ -93,26 +118,24 @@ const totalUser = ref(0);
|
|||||||
const monthPoint = ref(0);
|
const monthPoint = ref(0);
|
||||||
const monthUser = ref(0);
|
const monthUser = ref(0);
|
||||||
|
|
||||||
// const daterangeOccurTime = ref([]);
|
const dateRange = ref([]);
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
queryParams: {
|
queryParams: {
|
||||||
startTime: null,
|
startTime: null,
|
||||||
endTime: null,
|
endTime: null,
|
||||||
inspectionPoint: '',
|
inspectionPoint: '',
|
||||||
inspectorId: ''
|
inspectorId: '',
|
||||||
|
inspectionPointType: null
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams } = toRefs(data);
|
const { queryParams } = toRefs(data);
|
||||||
|
|
||||||
function getList() {
|
function getList() {
|
||||||
queryParams.value = {
|
const params = proxy.addDateRange(queryParams.value, dateRange.value);
|
||||||
inspectionPoint: data.queryParams.inspectionPoint,
|
|
||||||
inspectorId: data.queryParams.inspectorId
|
|
||||||
};
|
|
||||||
// 巡检点统计(三合一:总/月/日)
|
// 巡检点统计(三合一:总/月/日)
|
||||||
pointStats3(queryParams.value).then(res => {
|
pointStats3(params).then((res) => {
|
||||||
const d = res.data || {};
|
const d = res.data || {};
|
||||||
const total = d.total || { xAxis: [], seriesData: [] };
|
const total = d.total || { xAxis: [], seriesData: [] };
|
||||||
const month = d.month || { xAxis: [], seriesData: [] };
|
const month = d.month || { xAxis: [], seriesData: [] };
|
||||||
@@ -125,7 +148,7 @@ function getList() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 巡检人统计(三合一:总/月/日)
|
// 巡检人统计(三合一:总/月/日)
|
||||||
inspectorStats3(queryParams.value).then(res=>{
|
inspectorStats3(params).then((res) => {
|
||||||
const d = res.data || {};
|
const d = res.data || {};
|
||||||
inspectorTotalData.value = (d.total || []).map(i=>({ name:i.name, value:i.value }));
|
inspectorTotalData.value = (d.total || []).map(i=>({ name:i.name, value:i.value }));
|
||||||
inspectorMonthData.value = (d.month || []).map(i=>({ name:i.name, value:i.value }));
|
inspectorMonthData.value = (d.month || []).map(i=>({ name:i.name, value:i.value }));
|
||||||
@@ -143,6 +166,7 @@ function handleQuery() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user