完好率统计报表、设备运行记录定时任务

yangwl
wws 11 months ago
parent 5816985501
commit 946e15378c

@ -33,7 +33,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="故障时间" prop="faultTime"> <el-form-item v-if="false" label="故障时间" prop="faultTime">
<el-input <el-input
v-model="queryParams.faultTime" v-model="queryParams.faultTime"
placeholder="请输入故障时间" placeholder="请输入故障时间"
@ -41,7 +41,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="实际运行时间;运行时间-故障时间" prop="actualOperationTime"> <el-form-item v-if="false" label="实际运行时间;运行时间-故障时间" prop="actualOperationTime">
<el-input <el-input
v-model="queryParams.actualOperationTime" v-model="queryParams.actualOperationTime"
placeholder="请输入实际运行时间;运行时间-故障时间" placeholder="请输入实际运行时间;运行时间-故障时间"
@ -49,7 +49,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="运行时间" prop="operationTime"> <el-form-item v-if="false" label="运行时间" prop="operationTime">
<el-input <el-input
v-model="queryParams.operationTime" v-model="queryParams.operationTime"
placeholder="请输入运行时间" placeholder="请输入运行时间"
@ -57,7 +57,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="故障率" prop="failureRate"> <el-form-item v-if="false" label="故障率" prop="failureRate">
<el-input <el-input
v-model="queryParams.failureRate" v-model="queryParams.failureRate"
placeholder="请输入故障率" placeholder="请输入故障率"
@ -65,7 +65,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="故障描述" prop="failureDescription"> <el-form-item v-if="false" label="故障描述" prop="failureDescription">
<el-input <el-input
v-model="queryParams.failureDescription" v-model="queryParams.failureDescription"
placeholder="请输入故障描述" placeholder="请输入故障描述"
@ -73,7 +73,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="原因分析" prop="reasonAnalyze"> <el-form-item v-if="false" label="原因分析" prop="reasonAnalyze">
<el-input <el-input
v-model="queryParams.reasonAnalyze" v-model="queryParams.reasonAnalyze"
placeholder="请输入原因分析" placeholder="请输入原因分析"
@ -81,7 +81,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="处理方式" prop="handlingMethod"> <el-form-item v-if="false" label="处理方式" prop="handlingMethod">
<el-input <el-input
v-model="queryParams.handlingMethod" v-model="queryParams.handlingMethod"
placeholder="请输入处理方式" placeholder="请输入处理方式"
@ -97,7 +97,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="设备状态描述" prop="equStatusDes"> <el-form-item v-if="false" label="设备状态描述" prop="equStatusDes">
<el-input <el-input
v-model="queryParams.equStatusDes" v-model="queryParams.equStatusDes"
placeholder="请输入设备状态描述" placeholder="请输入设备状态描述"
@ -105,7 +105,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="更换备件" prop="replaceSpare"> <el-form-item v-if="false" label="更换备件" prop="replaceSpare">
<el-input <el-input
v-model="queryParams.replaceSpare" v-model="queryParams.replaceSpare"
placeholder="请输入更换备件" placeholder="请输入更换备件"
@ -113,7 +113,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="工厂" prop="factoryCode"> <el-form-item v-if="false" label="工厂" prop="factoryCode">
<el-input <el-input
v-model="queryParams.factoryCode" v-model="queryParams.factoryCode"
placeholder="请输入工厂" placeholder="请输入工厂"
@ -121,7 +121,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="备用字段1" prop="attr1"> <el-form-item v-if="false" label="备用字段1" prop="attr1">
<el-input <el-input
v-model="queryParams.attr1" v-model="queryParams.attr1"
placeholder="请输入备用字段1" placeholder="请输入备用字段1"
@ -129,7 +129,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="备用字段2" prop="attr2"> <el-form-item v-if="false" label="备用字段2" prop="attr2">
<el-input <el-input
v-model="queryParams.attr2" v-model="queryParams.attr2"
placeholder="请输入备用字段2" placeholder="请输入备用字段2"
@ -137,7 +137,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="备用字段3" prop="attr3"> <el-form-item v-if="false" label="备用字段3" prop="attr3">
<el-input <el-input
v-model="queryParams.attr3" v-model="queryParams.attr3"
placeholder="请输入备用字段3" placeholder="请输入备用字段3"
@ -145,13 +145,26 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="日期" prop="createTime">
<el-date-picker
v-model="queryParams.createTimeArray"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <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-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row v-if="false" :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
@ -199,26 +212,32 @@
<el-table v-loading="loading" :data="operationList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="operationList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" /> <el-table-column v-if="false" label="主键" align="center" prop="id" />
<el-table-column label="车间" align="center" prop="workshop" /> <el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column label="组线" align="center" prop="groupLine" /> <el-table-column width="100" label="工厂" align="center" prop="factoryCode" />
<el-table-column label="设备" align="center" prop="equipmentName" /> <el-table-column width="120" label="日期" align="center" prop="createTime" >
<el-table-column label="设备编码" align="center" prop="equipmentCode" /> <template slot-scope="scope">
<el-table-column label="故障时间" align="center" prop="faultTime" /> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
<el-table-column label="实际运行时间;运行时间-故障时间" align="center" prop="actualOperationTime" /> </template>
<el-table-column label="运行时间" align="center" prop="operationTime" /> </el-table-column>
<el-table-column label="故障率" align="center" prop="failureRate" /> <el-table-column width="120" label="车间" align="center" prop="workshop" />
<el-table-column label="故障描述" align="center" prop="failureDescription" /> <el-table-column width="120" label="组线" align="center" prop="groupLine" />
<el-table-column label="原因分析" align="center" prop="reasonAnalyze" /> <el-table-column width="120" label="设备" align="center" prop="equipmentName" />
<el-table-column label="处理方式" align="center" prop="handlingMethod" /> <el-table-column width="120" label="设备编码" align="center" prop="equipmentCode" />
<el-table-column label="维修人" align="center" prop="repairPerson" /> <el-table-column width="100" label="故障时间" align="center" prop="faultTime" />
<el-table-column label="设备状态描述" align="center" prop="equStatusDes" /> <el-table-column width="100" label="实际运行时间" align="center" prop="actualOperationTime" />
<el-table-column label="更换备件" align="center" prop="replaceSpare" /> <el-table-column width="100" label="运行时间" align="center" prop="operationTime" />
<el-table-column label="工厂" align="center" prop="factoryCode" /> <el-table-column width="100" label="故障率" align="center" prop="failureRate" />
<el-table-column label="备用字段1" align="center" prop="attr1" /> <el-table-column width="200" label="故障描述" align="center" prop="failureDescription" />
<el-table-column label="备用字段2" align="center" prop="attr2" /> <el-table-column width="200" label="原因分析" align="center" prop="reasonAnalyze" />
<el-table-column label="备用字段3" align="center" prop="attr3" /> <el-table-column width="200" label="设备状态描述" align="center" prop="equStatusDes" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column width="200" label="处理方式" align="center" prop="handlingMethod" />
<el-table-column width="200" label="更换备件" align="center" prop="replaceSpare" />
<el-table-column width="100" label="维修人" align="center" prop="repairPerson" />
<el-table-column v-if="false" label="备用字段1" align="center" prop="attr1" />
<el-table-column v-if="false" label="备用字段2" align="center" prop="attr2" />
<el-table-column v-if="false" label="备用字段3" align="center" prop="attr3" />
<el-table-column width="120" label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -228,6 +247,7 @@
v-hasPermi="['device:operation:edit']" v-hasPermi="['device:operation:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
v-if="false"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@ -237,7 +257,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -248,62 +268,62 @@
<!-- 添加或修改设备运行记录对话框 --> <!-- 添加或修改设备运行记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="车间" prop="workshop"> <el-form-item v-if="false" label="车间" prop="workshop">
<el-input v-model="form.workshop" placeholder="请输入车间" /> <el-input v-model="form.workshop" placeholder="请输入车间" />
</el-form-item> </el-form-item>
<el-form-item label="组线" prop="groupLine"> <el-form-item v-if="false" label="组线" prop="groupLine">
<el-input v-model="form.groupLine" placeholder="请输入组线" /> <el-input v-model="form.groupLine" placeholder="请输入组线" />
</el-form-item> </el-form-item>
<el-form-item label="设备" prop="equipmentName"> <el-form-item label="设备" prop="equipmentName">
<el-input v-model="form.equipmentName" placeholder="请输入设备" /> <el-input v-model="form.equipmentName" placeholder="请输入设备" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="设备编码" prop="equipmentCode"> <el-form-item v-if="false" label="设备编码" prop="equipmentCode">
<el-input v-model="form.equipmentCode" placeholder="请输入设备编码" /> <el-input v-model="form.equipmentCode" placeholder="请输入设备编码" />
</el-form-item> </el-form-item>
<el-form-item label="故障时间" prop="faultTime"> <el-form-item label="故障时间" prop="faultTime">
<el-input v-model="form.faultTime" placeholder="请输入故障时间" /> <el-input v-model="form.faultTime" placeholder="请输入故障时间" />
</el-form-item> </el-form-item>
<el-form-item label="实际运行时间;运行时间-故障时间" prop="actualOperationTime"> <el-form-item label="实际运行时间" prop="actualOperationTime">
<el-input v-model="form.actualOperationTime" placeholder="请输入实际运行时间;运行时间-故障时间" /> <el-input v-model="form.actualOperationTime" placeholder="请输入实际运行时间;运行时间-故障时间" />
</el-form-item> </el-form-item>
<el-form-item label="运行时间" prop="operationTime"> <el-form-item label="运行时间" prop="operationTime">
<el-input v-model="form.operationTime" placeholder="请输入运行时间" /> <el-input v-model="form.operationTime" placeholder="请输入运行时间" />
</el-form-item> </el-form-item>
<el-form-item label="故障率" prop="failureRate"> <el-form-item v-if="false" label="故障率" prop="failureRate">
<el-input v-model="form.failureRate" placeholder="请输入故障率" /> <el-input v-model="form.failureRate" placeholder="请输入故障率" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="故障描述" prop="failureDescription"> <el-form-item label="故障描述" prop="failureDescription">
<el-input v-model="form.failureDescription" placeholder="请输入故障描述" /> <el-input v-model="form.failureDescription" placeholder="请输入故障描述" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="原因分析" prop="reasonAnalyze"> <el-form-item label="原因分析" prop="reasonAnalyze">
<el-input v-model="form.reasonAnalyze" placeholder="请输入原因分析" /> <el-input v-model="form.reasonAnalyze" placeholder="请输入原因分析" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="处理方式" prop="handlingMethod"> <el-form-item label="处理方式" prop="handlingMethod">
<el-input v-model="form.handlingMethod" placeholder="请输入处理方式" /> <el-input v-model="form.handlingMethod" placeholder="请输入处理方式" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="维修人" prop="repairPerson"> <el-form-item label="维修人" prop="repairPerson">
<el-input v-model="form.repairPerson" placeholder="请输入维修人" /> <el-input v-model="form.repairPerson" placeholder="请输入维修人" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="设备状态描述" prop="equStatusDes"> <el-form-item label="设备状态描述" prop="equStatusDes">
<el-input v-model="form.equStatusDes" placeholder="请输入设备状态描述" /> <el-input v-model="form.equStatusDes" placeholder="请输入设备状态描述" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="更换备件" prop="replaceSpare"> <el-form-item label="更换备件" prop="replaceSpare">
<el-input v-model="form.replaceSpare" placeholder="请输入更换备件" /> <el-input v-model="form.replaceSpare" placeholder="请输入更换备件" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="工厂" prop="factoryCode"> <el-form-item v-if="false" label="工厂" prop="factoryCode">
<el-input v-model="form.factoryCode" placeholder="请输入工厂" /> <el-input v-model="form.factoryCode" placeholder="请输入工厂" />
</el-form-item> </el-form-item>
<el-form-item label="备用字段1" prop="attr1"> <el-form-item v-if="false" label="备用字段1" prop="attr1">
<el-input v-model="form.attr1" placeholder="请输入备用字段1" /> <el-input v-model="form.attr1" placeholder="请输入备用字段1" />
</el-form-item> </el-form-item>
<el-form-item label="备用字段2" prop="attr2"> <el-form-item v-if="false" label="备用字段2" prop="attr2">
<el-input v-model="form.attr2" placeholder="请输入备用字段2" /> <el-input v-model="form.attr2" placeholder="请输入备用字段2" />
</el-form-item> </el-form-item>
<el-form-item label="备用字段3" prop="attr3"> <el-form-item v-if="false" label="备用字段3" prop="attr3">
<el-input v-model="form.attr3" placeholder="请输入备用字段3" /> <el-input v-model="form.attr3" placeholder="请输入备用字段3" />
</el-form-item> </el-form-item>
<el-form-item label="删除标识" prop="delFlag"> <el-form-item v-if="false" label="删除标识" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入删除标识" /> <el-input v-model="form.delFlag" placeholder="请输入删除标识" />
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -317,11 +337,40 @@
<script> <script>
import { listOperation, getOperation, delOperation, addOperation, updateOperation } from "@/api/device/operation"; import { listOperation, getOperation, delOperation, addOperation, updateOperation } from "@/api/device/operation";
import {parseTime} from "../../../utils/ruoyi";
export default { export default {
name: "Operation", name: "Operation",
data() { data() {
return { return {
//
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
// //
loading: true, loading: true,
// //
@ -362,6 +411,7 @@ export default {
attr1: null, attr1: null,
attr2: null, attr2: null,
attr3: null, attr3: null,
createTimeArray: [],
}, },
// //
form: {}, form: {},
@ -377,6 +427,7 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
parseTime,
/** 查询设备运行记录列表 */ /** 查询设备运行记录列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -417,7 +468,7 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -429,6 +480,8 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
//
this.queryParams.createTimeArray = [];
this.handleQuery(); this.handleQuery();
}, },
// //

Loading…
Cancel
Save