feat(ems): 增加日期范围查询功能

- 在多个页面中添加日期范围选择器,支持开始日期和结束日期的选择- 后端 mapper 文件中增加对日期范围查询的支持
-优化查询逻辑,优先使用日期范围进行筛选
- 调整表格样式,增加行hover效果
boardTest
zch 3 weeks ago
parent 943558fac3
commit c45b197de6

@ -36,7 +36,7 @@ $base-sub-menu-background:#000c17;
$base-sub-menu-hover:#001528; $base-sub-menu-hover:#001528;
*/ */
$base-sidebar-width: 200px; $base-sidebar-width: 290px;
// the :export directive is the magic sauce for webpack // the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass

@ -1,93 +1,104 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="日期" prop="date"> <!-- <el-form-item label="日期" prop="date">-->
<el-input <!-- <el-input-->
v-model="queryParams.date" <!-- v-model="queryParams.date"-->
placeholder="请输入日期" <!-- placeholder="请输入日期"-->
clearable <!-- clearable-->
@keyup.enter.native="handleQuery" <!-- @keyup.enter.native="handleQuery"-->
/> <!-- />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="位置" prop="location"> <el-form-item label="记录时间">
<el-input <el-date-picker
v-model="queryParams.location" v-model="daterange"
placeholder="请输入位置" style="width: 340px"
clearable value-format="yyyy/MM/dd"
@keyup.enter.native="handleQuery" type="daterange"
/> range-separator="-"
</el-form-item> start-placeholder="开始时间"
<el-form-item label="科室值班" prop="dailyDutySupervisor"> end-placeholder="结束时间"
<el-input ></el-date-picker>
v-model="queryParams.dailyDutySupervisor" </el-form-item>
placeholder="请输入当日值班长" <!-- <el-form-item label="位置" prop="location">
clearable <el-input
@keyup.enter.native="handleQuery" v-model="queryParams.location"
/> placeholder="请输入位置"
</el-form-item> clearable
<el-form-item label="外包值班" prop="tendaDailyDutySupervisor"> @keyup.enter.native="handleQuery"
<el-input />
v-model="queryParams.tendaDailyDutySupervisor" </el-form-item>
placeholder="请输入天达当日值班长" <el-form-item label="科室值班" prop="dailyDutySupervisor">
clearable <el-input
@keyup.enter.native="handleQuery" v-model="queryParams.dailyDutySupervisor"
/> placeholder="请输入当日值班长"
</el-form-item> clearable
<el-form-item label="故障情况" prop="faultSituation"> @keyup.enter.native="handleQuery"
<el-input />
v-model="queryParams.faultSituation" </el-form-item>
placeholder="请输入故障情况" <el-form-item label="外包值班" prop="tendaDailyDutySupervisor">
clearable <el-input
@keyup.enter.native="handleQuery" v-model="queryParams.tendaDailyDutySupervisor"
/> placeholder="请输入天达当日值班长"
</el-form-item> clearable
<el-form-item label="处置措施" prop="handlingMeasures"> @keyup.enter.native="handleQuery"
<el-input />
v-model="queryParams.handlingMeasures" </el-form-item>
placeholder="请输入处置措施" <el-form-item label="故障情况" prop="faultSituation">
clearable <el-input
@keyup.enter.native="handleQuery" v-model="queryParams.faultSituation"
/> placeholder="请输入故障情况"
</el-form-item> clearable
<el-form-item label="故障类型" prop="faultType"> @keyup.enter.native="handleQuery"
<el-select v-model="queryParams.faultType" placeholder="请选择故障类型" clearable> />
<el-option </el-form-item>
v-for="dict in dict.type.${dictType}" <el-form-item label="处置措施" prop="handlingMeasures">
:key="dict.value" <el-input
:label="dict.label" v-model="queryParams.handlingMeasures"
:value="dict.value" placeholder="请输入处置措施"
/> clearable
</el-select> @keyup.enter.native="handleQuery"
</el-form-item> />
<el-form-item label="故障发生时间" prop="faultOccurrenceTime"> </el-form-item>
<el-input <el-form-item label="故障类型" prop="faultType">
v-model="queryParams.faultOccurrenceTime" <el-select v-model="queryParams.faultType" placeholder="请选择故障类型" clearable>
placeholder="请输入故障发生时间" <el-option
clearable v-for="dict in dict.type.${dictType}"
@keyup.enter.native="handleQuery" :key="dict.value"
/> :label="dict.label"
</el-form-item> :value="dict.value"
<el-form-item label="处置完毕时间" prop="handlingCompletionTime"> />
<el-input </el-select>
v-model="queryParams.handlingCompletionTime" </el-form-item>
placeholder="请输入处置完毕时间" <el-form-item label="故障发生时间" prop="faultOccurrenceTime">
clearable <el-input
@keyup.enter.native="handleQuery" v-model="queryParams.faultOccurrenceTime"
/> placeholder="请输入故障发生时间"
</el-form-item> clearable
<el-form-item label="处置时长" prop="handlingDuration"> @keyup.enter.native="handleQuery"
<el-input />
v-model="queryParams.handlingDuration" </el-form-item>
placeholder="请输入处置时长" <el-form-item label="处置完毕时间" prop="handlingCompletionTime">
clearable <el-input
@keyup.enter.native="handleQuery" v-model="queryParams.handlingCompletionTime"
/> placeholder="请输入处置完毕时间"
</el-form-item> clearable
<el-form-item> @keyup.enter.native="handleQuery"
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> />
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> </el-form-item>
</el-form-item> <el-form-item label="处置时长" prop="handlingDuration">
</el-form> --> <el-input
v-model="queryParams.handlingDuration"
placeholder="请输入处置时长"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<!-- 操作提示 --> <!-- 操作提示 -->
<!-- <el-alert <!-- <el-alert
@ -169,7 +180,7 @@
:data="dailyFaultRecordList" :data="dailyFaultRecordList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@row-contextmenu="handleRowContextMenu" @row-contextmenu="handleRowContextMenu"
class="fault-record-table" class="el-table--enable-row-hover fault-record-table"
tooltip-effect="dark" tooltip-effect="dark"
:header-cell-style="{ backgroundColor: '#f5f7fa', color: '#606266' }" :header-cell-style="{ backgroundColor: '#f5f7fa', color: '#606266' }"
> >
@ -402,6 +413,7 @@
mixins: [clearAllMixin], mixins: [clearAllMixin],
data() { data() {
return { return {
daterange:[],
// //
loading: true, loading: true,
// //
@ -424,17 +436,18 @@
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
date: null, date: null,
location: null, location: null,
dailyDutySupervisor: null, dailyDutySupervisor: null,
tendaDailyDutySupervisor: null, tendaDailyDutySupervisor: null,
faultSituation: null, faultSituation: null,
handlingMeasures: null, handlingMeasures: null,
faultType: null, faultType: null,
faultOccurrenceTime: null, faultOccurrenceTime: null,
handlingCompletionTime: null, handlingCompletionTime: null,
handlingDuration: null, handlingDuration: null,
remarks: null remarks: null,
params: {}
}, },
// //
form: {}, form: {},
@ -484,7 +497,7 @@
this.getList(); this.getList();
this.upload.url = process.env.VUE_APP_BASE_API + "/ems/info/dailyFaultRecord/importData"; this.upload.url = process.env.VUE_APP_BASE_API + "/ems/info/dailyFaultRecord/importData";
this.upload.headers = { Authorization: "Bearer " + this.$store.getters.token }; this.upload.headers = { Authorization: "Bearer " + this.$store.getters.token };
// //
this.clearAllConfig = { this.clearAllConfig = {
moduleKey: 'dailyFaultRecord', moduleKey: 'dailyFaultRecord',
@ -504,6 +517,21 @@
/** 查询日常故障记录列表 */ /** 查询日常故障记录列表 */
getList() { getList() {
this.loading = true; this.loading = true;
//
if (!this.queryParams.params) {
this.queryParams.params = {};
}
if (this.daterange && this.daterange.length === 2) {
this.queryParams.params.beginDate = this.daterange[0];
this.queryParams.params.endDate = this.daterange[1];
} else {
//
delete this.queryParams.params.beginDate;
delete this.queryParams.params.endDate;
}
listDailyFaultRecord(this.queryParams).then(response => { listDailyFaultRecord(this.queryParams).then(response => {
this.dailyFaultRecordList = response.rows; this.dailyFaultRecordList = response.rows;
this.total = response.total; this.total = response.total;
@ -540,6 +568,7 @@
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.daterange = [];
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
@ -795,4 +824,9 @@
display: none !important; display: none !important;
} }
} }
.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
background-color: #0264f7;
color: #fff;
}
</style> </style>

@ -1,5 +1,23 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="故障日期">
<el-date-picker
v-model="daterange"
style="width: 340px"
value-format="yyyy/MM/dd"
type="daterange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="故障日期" prop="faultDate"> <el-form-item label="故障日期" prop="faultDate">
<el-input <el-input
@ -349,6 +367,7 @@
mixins: [clearAllMixin], mixins: [clearAllMixin],
data() { data() {
return { return {
daterange: [],
// //
loading: true, loading: true,
// //
@ -371,16 +390,17 @@
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
faultDate: null, faultDate: null,
faultLocation: null, faultLocation: null,
handlingPersonnel: null, handlingPersonnel: null,
faultPhenomenonAndCause: null, faultPhenomenonAndCause: null,
faultSituationHandling: null, faultSituationHandling: null,
impact: null, impact: null,
faultOccurrenceTime: null, faultOccurrenceTime: null,
handlingDuration: null, handlingDuration: null,
mainComponentsRepaired: null, mainComponentsRepaired: null,
remarks: null remarks: null,
params: {}
}, },
// //
form: {}, form: {},
@ -450,6 +470,21 @@
/** 查询故障处置记录列表 */ /** 查询故障处置记录列表 */
getList() { getList() {
this.loading = true; this.loading = true;
//
if (!this.queryParams.params) {
this.queryParams.params = {};
}
if (this.daterange && this.daterange.length === 2) {
this.queryParams.params.beginDate = this.daterange[0];
this.queryParams.params.endDate = this.daterange[1];
} else {
//
delete this.queryParams.params.beginDate;
delete this.queryParams.params.endDate;
}
listFaultHandlingRecord(this.queryParams).then(response => { listFaultHandlingRecord(this.queryParams).then(response => {
this.faultHandlingRecordList = response.rows; this.faultHandlingRecordList = response.rows;
this.total = response.total; this.total = response.total;
@ -485,6 +520,7 @@
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.daterange = [];
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },

@ -1,6 +1,17 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="登记日期">
<el-date-picker
v-model="daterange"
style="width: 340px"
value-format="yyyy/MM/dd"
type="daterange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
></el-date-picker>
</el-form-item>
<!-- <el-form-item label="日期" prop="date">--> <!-- <el-form-item label="日期" prop="date">-->
<!-- <el-input--> <!-- <el-input-->
<!-- v-model="queryParams.date"--> <!-- v-model="queryParams.date"-->
@ -366,6 +377,7 @@
mixins: [clearAllMixin], mixins: [clearAllMixin],
data() { data() {
return { return {
daterange: [],
// //
clearAllConfig: { clearAllConfig: {
moduleKey: 'sparePartsRegistration', moduleKey: 'sparePartsRegistration',
@ -396,13 +408,14 @@
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
date: null, date: null,
sparePartsName: null, sparePartsName: null,
wasteQuantity: null, wasteQuantity: null,
storageLocation: null, storageLocation: null,
registrar: null, registrar: null,
warehouseConfirmation: null, warehouseConfirmation: null,
remarks: null remarks: null,
params: {}
}, },
// //
form: {}, form: {},
@ -464,6 +477,21 @@
/** 查询动力能源部行输科废旧备件登记列表 */ /** 查询动力能源部行输科废旧备件登记列表 */
getList() { getList() {
this.loading = true; this.loading = true;
//
if (!this.queryParams.params) {
this.queryParams.params = {};
}
if (this.daterange && this.daterange.length === 2) {
this.queryParams.params.beginDate = this.daterange[0];
this.queryParams.params.endDate = this.daterange[1];
} else {
//
delete this.queryParams.params.beginDate;
delete this.queryParams.params.endDate;
}
listSparePartsRegistration(this.queryParams).then(response => { listSparePartsRegistration(this.queryParams).then(response => {
this.sparePartsRegistrationList = response.rows; this.sparePartsRegistrationList = response.rows;
this.total = response.total; this.total = response.total;
@ -496,6 +524,7 @@
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.daterange = [];
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },

@ -1,14 +1,25 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="日期" prop="date"> <el-form-item label="使用日期">
<el-date-picker
v-model="daterange"
style="width: 340px"
value-format="yyyy/MM/dd"
type="daterange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
></el-date-picker>
</el-form-item>
<!-- <el-form-item label="日期" prop="date">
<el-input <el-input
v-model="queryParams.date" v-model="queryParams.date"
placeholder="请输入日期" placeholder="请输入日期"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item> -->
<el-form-item label="备件名称" prop="sparePartName"> <el-form-item label="备件名称" prop="sparePartName">
<el-input <el-input
v-model="queryParams.sparePartName" v-model="queryParams.sparePartName"
@ -423,6 +434,7 @@
mixins: [clearAllMixin], mixins: [clearAllMixin],
data() { data() {
return { return {
daterange: [],
// //
clearAllConfig: { clearAllConfig: {
moduleKey: 'sparePartsUsageRecord', moduleKey: 'sparePartsUsageRecord',
@ -453,18 +465,19 @@
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
date: null, date: null,
sparePartName: null, sparePartName: null,
sparePartModel: null, sparePartModel: null,
quantityUsed: null, quantityUsed: null,
remainingQuantity: null, remainingQuantity: null,
issuingWarehouse: null, issuingWarehouse: null,
replacementLocation: null, replacementLocation: null,
personReceived: null, personReceived: null,
warehouseManagerConfirmation: null, warehouseManagerConfirmation: null,
inventoryStatus: null, inventoryStatus: null,
departmentWarehouse: null, departmentWarehouse: null,
remarks: null remarks: null,
params: {}
}, },
// //
form: {}, form: {},
@ -529,6 +542,21 @@
/** 查询动力能源部行输科备件领用更换记录列表 */ /** 查询动力能源部行输科备件领用更换记录列表 */
getList() { getList() {
this.loading = true; this.loading = true;
//
if (!this.queryParams.params) {
this.queryParams.params = {};
}
if (this.daterange && this.daterange.length === 2) {
this.queryParams.params.beginDate = this.daterange[0];
this.queryParams.params.endDate = this.daterange[1];
} else {
//
delete this.queryParams.params.beginDate;
delete this.queryParams.params.endDate;
}
listSparePartsUsageRecord(this.queryParams).then(response => { listSparePartsUsageRecord(this.queryParams).then(response => {
this.sparePartsUsageRecordList = response.rows; this.sparePartsUsageRecordList = response.rows;
this.total = response.total; this.total = response.total;
@ -566,6 +594,7 @@
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.daterange = [];
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },

@ -1,5 +1,23 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="作业日期">
<el-date-picker
v-model="daterange"
style="width: 340px"
value-format="yyyy/MM/dd"
type="daterange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="日期" prop="date"> <el-form-item label="日期" prop="date">
<el-input <el-input
@ -481,6 +499,7 @@
mixins: [clearAllMixin], mixins: [clearAllMixin],
data() { data() {
return { return {
daterange: [],
// //
clearAllConfig: { clearAllConfig: {
moduleKey: 'supervisionChecklist', moduleKey: 'supervisionChecklist',
@ -509,22 +528,23 @@
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
date: null, date: null,
jobCategory: null, jobCategory: null,
jobUnit: null, jobUnit: null,
jobName: null, jobName: null,
jobRisk: null, jobRisk: null,
riskControlMeasures: null, riskControlMeasures: null,
supervisionLevel: null, supervisionLevel: null,
supervisionImplementation: null, supervisionImplementation: null,
jobDepartment: null, jobDepartment: null,
regulatoryPersonnel: null, regulatoryPersonnel: null,
inspectionPersonnel: null, inspectionPersonnel: null,
problemsFound: null, problemsFound: null,
outsourcingUnitResponsiblePerson: null, outsourcingUnitResponsiblePerson: null,
workOrderChangeContent: null, workOrderChangeContent: null,
isWorkOrderClosedLoop: null, isWorkOrderClosedLoop: null,
remarks: null remarks: null,
params: {}
}, },
// //
form: {}, form: {},
@ -589,6 +609,21 @@
/** 查询动力能源部监督检查清单列表 */ /** 查询动力能源部监督检查清单列表 */
getList() { getList() {
this.loading = true; this.loading = true;
//
if (!this.queryParams.params) {
this.queryParams.params = {};
}
if (this.daterange && this.daterange.length === 2) {
this.queryParams.params.beginDate = this.daterange[0];
this.queryParams.params.endDate = this.daterange[1];
} else {
//
delete this.queryParams.params.beginDate;
delete this.queryParams.params.endDate;
}
listSupervisionChecklist(this.queryParams).then(response => { listSupervisionChecklist(this.queryParams).then(response => {
this.supervisionChecklistList = response.rows; this.supervisionChecklistList = response.rows;
this.total = response.total; this.total = response.total;
@ -630,6 +665,7 @@
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.daterange = [];
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },

Loading…
Cancel
Save