设备,能源板块接口和页面修改

master
maxw@mesnac.com 2 months ago
parent 97a0a890b1
commit 748315dab7

@ -71,6 +71,24 @@ public class DmsPlanInspect extends BaseEntity
private Long timeLimitHours;
private String routeName;
private Long hour;
private Long week;
public Long getHour()
{
return hour;
}
public void setHour(Long hour)
{
this.hour = hour;
}
public Long getWeek()
{
return week;
}
public void setWeek(Long week)
{
this.week = week;
}
public void setRouteName(String routeName) {
this.routeName = routeName;
}

@ -46,6 +46,8 @@ public class DmsPlanMaint extends BaseEntity
@Excel(name = "时限")
private Long timeLimit;
private Long hour;
private Long week;
@ -180,6 +182,22 @@ public class DmsPlanMaint extends BaseEntity
{
this.maintStatus = maintStatus;
}
public Long getHour()
{
return hour;
}
public void setHour(Long hour)
{
this.hour = hour;
}
public Long getWeek()
{
return week;
}
public void setWeek(Long week)
{
this.week = week;
}
public Long getMaintStatus()
{

@ -108,19 +108,21 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService
@Override
public int insertDmsPlanInspect(DmsPlanInspect dmsPlanInspect)
{
Long week = dmsPlanInspect.getWeek();
week += 1;
String planInspectCode = Seq.getId(Seq.planInspectSeqType, Seq.planInspectCode);
String cron = "* * "+dmsPlanInspect.getHour()+" ? * "+week;
SysJob job = new SysJob();
job.setJobName("点巡检计划编号" + planInspectCode + "工单任务");
job.setJobGroup("DEFAULT");
job.setInvokeTarget("ryTask.getDmsBillsInstance(\"" + planInspectCode + "\")");
job.setCronExpression(dmsPlanInspect.getCronExpression());
job.setCronExpression(cron);
job.setMisfirePolicy("1");
job.setConcurrent("1");
job.setStatus("1");
R<Integer> jobIdR = remoteJobService.add(SecurityConstants.INNER, job);
String time = dmsPlanInspect.getCronExpression();
String time = cron;
//通过cron表达式获取下一次执行时间
Date nextExecution = CronUtils.getNextExecution(time);
dmsPlanInspect.setPlanTime(nextExecution);

@ -89,19 +89,21 @@ public class DmsPlanMaintServiceImpl implements IDmsPlanMaintService {
@Transactional
@Override
public int insertDmsPlanMaint(DmsPlanMaint dmsPlanMaint) {
Long week = dmsPlanMaint.getWeek();
week += 1;
String planMaintCode = Seq.getId(Seq.planMaintSeqType, Seq.planMaintCode);
String cron = "* * "+dmsPlanMaint.getHour()+" ? * "+week;
SysJob job = new SysJob();
job.setJobName("保养计划编号" + planMaintCode + "工单任务");
job.setJobGroup("DEFAULT");
job.setInvokeTarget("ryTask.getDmsBillsMaint(\"" + planMaintCode + "\")");
job.setCronExpression(dmsPlanMaint.getCronExpression());
job.setCronExpression(cron);
job.setMisfirePolicy("1");
job.setConcurrent("1");
job.setStatus("1");
R<Integer> jobIdR = remoteJobService.add(SecurityConstants.INNER, job);
String time = dmsPlanMaint.getCronExpression();
String time = cron;
//通过cron表达式获取下一次执行时间
Date nextExecution = CronUtils.getNextExecution(time);
dmsPlanMaint.setMaintTime(nextExecution);

@ -1,6 +1,7 @@
package com.hw.dms.service.impl;
import java.util.List;
import java.util.concurrent.TimeUnit;
import com.hw.common.core.utils.DateUtils;
import com.hw.dms.domain.DmsRealtimeStatusHistory;
@ -80,10 +81,19 @@ public class DmsRealtimeStatusServiceImpl implements IDmsRealtimeStatusService {
@Override
public List<DmsRealtimeStatusHistory> history(DmsRealtimeStatusHistory history) {
List<DmsRealtimeStatusHistory> history1 = dmsRealtimeStatusMapper.history(history);
for (DmsRealtimeStatusHistory statusHistory : history1) {
if ("True".equals(statusHistory.getStatusCode())){
statusHistory.setStatusCode("是");
}
if ("False".equals(statusHistory.getStatusCode())){
statusHistory.setStatusCode("否");
}
}
Long count = dmsRealtimeStatusMapper.historyTimeCount(history);
int minutes = 1440;
long days = count/minutes;
history1.get(0).setTimeCount(days+" day");
long days = TimeUnit.MINUTES.toDays(count);
long hours = TimeUnit.MINUTES.toHours(count) - TimeUnit.DAYS.toHours(days);
long mins = TimeUnit.MINUTES.toMinutes(count) - TimeUnit.HOURS.toMinutes(TimeUnit.MINUTES.toHours(count));
history1.get(0).setTimeCount(days+" 天"+hours+" 小时"+mins+" 分钟");
return history1;
}

@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.inspect_status,
a.is_flag,
b.remark,
a.create_by,
b.create_by,
a.create_time,
a.update_by,
a.update_time,

@ -165,13 +165,13 @@
<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-item label="项目编号" prop="inspectProjectCode">
<el-input v-model="form.inspectProjectCode" placeholder="请输入项目编号" />
<el-input v-model="form.inspectProjectCode" placeholder="请输入项目编号,如a001" />
</el-form-item>
<el-form-item label="项目名称" prop="inspectProject">
<el-input v-model="form.inspectProject" placeholder="请输入巡检项目" />
<el-input v-model="form.inspectProject" placeholder="请输入巡检项目,如二楼巡检" />
</el-form-item>
<el-form-item label="记录方式" prop="recordMethod">
<el-input v-model="form.recordMethod" placeholder="请输入记录方式" />
<el-input v-model="form.recordMethod" placeholder="请输入记录方式,如手录" />
</el-form-item>
<el-form-item label="检查类型" prop="inspectProjectProperty">
<el-radio-group v-model="form.inspectProjectProperty">
@ -183,13 +183,13 @@
</el-radio-group>
</el-form-item>
<el-form-item label="上限" prop="upLimit">
<el-input v-model="form.upLimit" placeholder="请输入上限" />
<el-input v-model="form.upLimit" placeholder="定量时请输入上限" />
</el-form-item>
<el-form-item label="下限" prop="lowLimit">
<el-input v-model="form.lowLimit" placeholder="请输入下限" />
<el-input v-model="form.lowLimit" placeholder="定量时请输入下限" />
</el-form-item>
<el-form-item label="默认值" prop="defValue">
<el-input v-model="form.defValue" placeholder="请输入默认值" />
<el-input v-model="form.defValue" placeholder="定量时请输入默认值" />
</el-form-item>
<!-- <el-form-item label="是否标识1-是0-否" prop="isFlag">-->
<!-- <el-input v-model="form.isFlag" placeholder="请输入是否标识1-是0-否" />-->

@ -145,7 +145,7 @@
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="是否标识1-是0-否" align="center" prop="isFlag" />-->
<el-table-column label="备注" align="center" prop="remark" />
<!-- <el-table-column label="备注" align="center" prop="remark" />-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -178,10 +178,10 @@
<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-item label="线路编号" prop="routeCode">
<el-input v-model="form.routeCode" placeholder="请输入线路编号" />
<el-input v-model="form.routeCode" placeholder="请输入线路编号,如a001" />
</el-form-item>
<el-form-item label="线路名称" prop="routeName">
<el-input v-model="form.routeName" placeholder="请输入线路名称" />
<el-input v-model="form.routeName" placeholder="请输入线路名称,如二楼巡检路线" />
</el-form-item>
<!-- <el-form-item label="循环周期" prop="cyclePeriod">-->
<!-- <el-input v-model="form.cyclePeriod" placeholder="请输入循环周期" />-->
@ -220,9 +220,9 @@
<!-- <el-form-item label="是否标识1-是0-否" prop="isFlag">-->
<!-- <el-input v-model="form.isFlag" placeholder="请输入是否标识1-是0-否" />-->
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
<!-- <el-form-item label="备注" prop="remark">-->
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>

@ -154,13 +154,13 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="标准编号" prop="standardCode">
<el-input v-model="form.standardCode" placeholder="请输入标准编号" />
<el-input v-model="form.standardCode" placeholder="请输入标准编号,如a001" />
</el-form-item>
<el-form-item label="标准名称" prop="standardName">
<el-input v-model="form.standardName" placeholder="请输入标准名称" />
<el-input v-model="form.standardName" placeholder="请输入标准名称,如巡检标准" />
</el-form-item>
<el-form-item label="巡检目的" prop="inspectObjective">
<el-input v-model="form.inspectObjective" placeholder="请输入巡检目的" />
<el-input v-model="form.inspectObjective" placeholder="请输入巡检目的,如产线安全" />
</el-form-item>
<!-- <el-form-item label="巡检项目ID关联dms_base_inspect_project的inspect_project_id" prop="inspectProjectId">-->
<!-- <el-input v-model="form.inspectProjectId" placeholder="请输入巡检项目ID关联dms_base_inspect_project的inspect_project_id" />-->
@ -175,9 +175,9 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="检查项总数" prop="inspectItemCount">
<el-input v-model="form.inspectItemCount" placeholder="请输入检查项总数" />
</el-form-item>
<!-- <el-form-item label="检查项总数" prop="inspectItemCount">-->
<!-- <el-input v-model="form.inspectItemCount" placeholder="请输入检查项总数" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="是否标识1-是0-否" prop="isFlag">-->
<!-- <el-input v-model="form.isFlag" placeholder="请输入是否标识1-是0-否" />-->
<!-- </el-form-item>-->

@ -98,7 +98,7 @@
<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-item label="项目名称" prop="maintProjectName">
<el-input v-model="form.maintProjectName" placeholder="请输入项目名称" />
<el-input v-model="form.maintProjectName" placeholder="请输入项目名称,如提升机保养" />
</el-form-item>
<el-form-item label="项目描述" prop="maintProjectDesc">
<el-input v-model="form.maintProjectDesc" type="textarea" placeholder="请输入内容" />

@ -20,7 +20,7 @@
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="创建人" >
<el-input v-model="this.dmsBillsInstanceList[0].performer" disabled />
<el-input v-model="this.dmsBillsInstanceList[0].createBy" disabled />
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
@ -170,18 +170,18 @@
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="巡检标准" align="center" prop="standardName" />
<!-- <el-table-column label="操作描述" align="center" prop="operationDescription" />-->
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- style="float: none"-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-bell"-->
<!-- @click="getJump(scope.row)"-->
<!-- v-hasPermi="['dms:dmsInspectRouteDetail:edit']"-->
<!-- >查看详情</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
style="float: none"
size="mini"
type="text"
icon="el-icon-bell"
@click="getJump(scope.row)"
v-hasPermi="['dms:dmsInspectRouteDetail:edit']"
>查看详情</el-button>
</template>
</el-table-column>
</el-table>

@ -108,7 +108,7 @@
<!-- <el-table-column label="保养状态1-待保养2-保养中3-已完成" align="center" prop="maintStatus" />-->
<el-table-column label="保养状态" align="center" prop="maintStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_maint_status" :value="scope.row.maintStatus-1"/>
<dict-tag :options="dict.type.dms_maint_status" :value="scope.row.maintStatus"/>
</template>
</el-table-column>
<!-- <el-table-column label="保养完成率" align="center" prop="maintCompRate" />-->

@ -200,7 +200,7 @@
<!-- <el-input v-model="form.inspectRouteId" placeholder="请输入线路ID,关联dms_base_inspect_route的inspect_route_id" />-->
<!-- </el-form-item>-->
<el-form-item label="巡检步骤" prop="lineStep">
<el-input v-model="form.lineStep" placeholder="请输入巡检步骤" />
<el-input v-model="form.lineStep" placeholder="巡检步骤请输入数字" />
</el-form-item>
<!-- <el-form-item label="巡检设备ID关联dms_base_device_ledger的device_id" prop="deviceId">-->
<!-- <el-input v-model="form.deviceId" placeholder="请输入巡检设备ID关联dms_base_device_ledger的device_id" />-->

@ -211,10 +211,10 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="计划编号" prop="planInspectCode">
<el-input v-model="form.planInspectCode" placeholder="请输入计划编号" />
<el-input v-model="form.planInspectCode" placeholder="请输入计划编号,如a001" />
</el-form-item>
<el-form-item label="计划名称" prop="planInspectName">
<el-input v-model="form.planInspectName" placeholder="请输入计划名称" />
<el-input v-model="form.planInspectName" placeholder="请输入计划名称,如二楼巡检计划" />
</el-form-item>
<!-- <el-form-item label="巡检线路ID关联dm_base_inspect_route的inspect_route_id" prop="inspectRouteId">-->
<!-- <el-input v-model="form.inspectRouteId" placeholder="请输入巡检线路ID关联dm_base_inspect_route的inspect_route_id" />-->
@ -242,6 +242,16 @@
<el-input v-model="form.deviceAmount" placeholder="请输入设备总数" :disabled=true >
</el-input>
</el-form-item>
<el-form-item label="时间" prop="week">
<!-- <el-input-number v-model="form.hour" placeholder="请输入几点" :precision="0" :min="0" :max="23"/>-->
<!-- <el-input-number v-model="form.timeLimitHours" placeholder="请输入几日" :precision="0" :min="0" :max="31"/>-->
<el-input-number v-model="form.week" placeholder="请输入周几" :precision="0" :min="0" :max="7"/>
</el-form-item>
<el-form-item label="时间" prop="hour">
<el-input-number v-model="form.hour" placeholder="请输入几点" :precision="0" :min="0" :max="23"/>
<!-- <el-input-number v-model="form.timeLimitHours" placeholder="请输入几日" :precision="0" :min="0" :max="31"/>-->
<!-- <el-input-number v-model="form.week" placeholder="请输入周几" :precision="0" :min="0" :max="7"/>-->
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="时限" prop="timeLimitDays">
@ -372,6 +382,12 @@ export default {
cronExpression: [
{ required: true, message: "表达式不能为空", trigger: "blur" }
],
week: [
{ required: true, message: "定时计划周不能为空", trigger: "blur" }
],
hour: [
{ required: true, message: "定时计划时不能为空", trigger: "blur" }
],
}
};
},

@ -130,7 +130,7 @@
<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-item label="经验编号" prop="experienceCode">
<el-input v-model="form.experienceCode" placeholder="请输入经验编号" />
<el-input v-model="form.experienceCode" placeholder="请输入经验编号,如a001" />
</el-form-item>
<!-- <el-form-item label="设备类型ID关联dm_base_device_type的device_type_id" prop="deviceTypeId">-->
<!-- <el-input v-model="form.deviceTypeId" placeholder="请输入设备类型ID关联dm_base_device_type的device_type_id" />-->
@ -148,9 +148,9 @@
<el-form-item label="故障描述" prop="faultDescription">
<el-input v-model="form.faultDescription" placeholder="请输入故障描述" />
</el-form-item>
<el-form-item label="涉及操作" prop="designOperations">
<el-input v-model="form.designOperations" placeholder="请输入涉及操作" />
</el-form-item>
<!-- <el-form-item label="涉及操作" prop="designOperations">-->
<!-- <el-input v-model="form.designOperations" placeholder="请输入涉及操作" />-->
<!-- </el-form-item>-->
<el-form-item label="操作描述" prop="operationsDescription">
<el-input v-model="form.operationsDescription" placeholder="请输入操作描述" />
</el-form-item>
@ -245,15 +245,15 @@ export default {
form: {},
//
rules: {
deviceTypeId: [
{ required: true, message: "设备类型ID关联dm_base_device_type的device_type_id不能为空", trigger: "blur" }
],
// deviceTypeId: [
// { required: true, message: "IDdm_base_device_typedevice_type_id", trigger: "blur" }
// ],
isFlag: [
{ required: true, message: "是否标识1-是0-否不能为空", trigger: "blur" }
],
experienceCode: [
{ required: true, message: "经验编号不能为空", trigger: "blur" }
],
// experienceCode: [
// { required: true, message: "", trigger: "blur" }
// ],
}
};
},

@ -145,7 +145,7 @@
<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-item label="经验编号" prop="experienceCode">
<el-input v-model="form.experienceCode" placeholder="请输入经验编号" />
<el-input v-model="form.experienceCode" placeholder="请输入经验编号,如a001" />
</el-form-item>
<!-- <el-form-item label="设备类型ID关联dms_base_device_type的device_type_id" prop="deviceTypeId">-->
<!-- <el-input v-model="form.deviceTypeId" placeholder="请输入设备类型ID关联dms_base_device_type的device_type_id" />-->
@ -282,18 +282,18 @@ export default {
form: {},
//
rules: {
experienceCode: [
{ required: true, message: "经验编号不能为空", trigger: "blur" }
],
deviceTypeId: [
{ required: true, message: "设备类型不能为空", trigger: "blur" }
],
maintStationId: [
{ required: true, message: "保养部位不能为空", trigger: "blur" }
],
maintProtocol: [
{ required: true, message: "保养标准不能为空", trigger: "blur" }
],
// experienceCode: [
// { required: true, message: "", trigger: "blur" }
// ],
// deviceTypeId: [
// { required: true, message: "", trigger: "blur" }
// ],
// maintStationId: [
// { required: true, message: "", trigger: "blur" }
// ],
// maintProtocol: [
// { required: true, message: "", trigger: "blur" }
// ],
}
};
},

@ -169,16 +169,16 @@
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['dms:ledger:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['dms:ledger:export']"
>导出</el-button>
</el-col>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row>

@ -205,7 +205,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="保养组别" prop="maintGroup">
<el-input v-model="form.maintGroup" placeholder="请输入保养组别" />
<el-input v-model="form.maintGroup" placeholder="请输入保养组别,如A组" />
</el-form-item>
<el-form-item label="保养负责人" prop="maintSupervisor">
<el-input v-model="form.maintSupervisor" placeholder="请输入保养负责人" />
@ -230,6 +230,16 @@
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="时间" prop="week">
<!-- <el-input-number v-model="form.hour" placeholder="请输入几点" :precision="0" :min="0" :max="23"/>-->
<!-- <el-input-number v-model="form.timeLimitHours" placeholder="请输入几日" :precision="0" :min="0" :max="31"/>-->
<el-input-number v-model="form.week" placeholder="请输入周几" :precision="0" :min="0" :max="7"/>
</el-form-item>
<el-form-item label="时间" prop="hour">
<el-input-number v-model="form.hour" placeholder="请输入几点" :precision="0" :min="0" :max="23"/>
<!-- <el-input-number v-model="form.timeLimitHours" placeholder="请输入几日" :precision="0" :min="0" :max="31"/>-->
<!-- <el-input-number v-model="form.week" placeholder="请输入周几" :precision="0" :min="0" :max="7"/>-->
</el-form-item>
<el-form-item label="时限" prop="timeLimitDays">
<el-input-number v-model="form.timeLimitDays" placeholder="请输入天数" :precision="0" :min="0" :max="10000"/>
<el-input-number v-model="form.timeLimitHours" placeholder="请输入小时" :precision="0" :min="0" :max="23"/>小时
@ -349,6 +359,12 @@ export default {
cronExpression: [
{ required: true, message: "定时计划不能为空", trigger: "blur" }
],
week: [
{ required: true, message: "定时计划周不能为空", trigger: "blur" }
],
hour: [
{ required: true, message: "定时计划时不能为空", trigger: "blur" }
],
}
};
},

@ -0,0 +1,428 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备ID" prop="deviceId">
<el-input
v-model="queryParams.deviceId"
placeholder="请输入设备ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="停机原因" prop="shutReason">
<el-input
v-model="queryParams.shutReason"
placeholder="请输入停机原因"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="停机类型" prop="shutTypeId" >
<el-select v-model="queryParams.shutTypeId"
placeholder="请输入设备类型"
>
<el-option
v-for="item in shutTypeList"
:key="item.shutTypeId"
:label="item.shutTypeName"
:value="item.shutTypeId" />
</el-select>
</el-form-item>
<el-form-item label="停机时间" prop="shutBeginTime">
<el-date-picker clearable
v-model="queryParams.shutBeginTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择停机开始时间">
</el-date-picker>
</el-form-item>
<el-form-item><div>-</div></el-form-item>
<el-form-item label="" prop="shutEndTime">
<el-date-picker clearable
v-model="queryParams.shutEndTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择停机结束时间">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="停机时长" prop="shutTime">-->
<!-- <el-input-->
<!-- v-model="queryParams.shutTime"-->
<!-- placeholder="请输入停机时长"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="是否标识1-是2-否" prop="isFlag">-->
<!-- <el-input-->
<!-- v-model="queryParams.isFlag"-->
<!-- placeholder="请输入是否标识1-是2-否"-->
<!-- 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-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['dms:shutDown:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['dms:shutDown:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['dms:shutDown:remove']"
>删除</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['dms:shutDown:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
</el-row>
<el-table v-loading="loading" :data="shutDownList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键标识;scada上报的记录" align="center" prop="recordShutDownId" />-->
<el-table-column label="设备ID" align="center" prop="deviceId" />
<!-- <el-table-column label="设备名称" align="center" prop="deviceId" >-->
<!-- <template slot-scope="scope">-->
<!-- <span-->
<!-- v-for="(item, index) in ledgerList"-->
<!-- :key="index"-->
<!-- :value="item.ledgerList"-->
<!-- v-if="scope.row.deviceId == item.deviceId"-->
<!-- >-->
<!-- {{ item.deviceName }}-->
<!-- </span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="停机类型ID关联dm_base_shut_type的shut_type_id" align="center" prop="shutType" />-->
<el-table-column label="停机类型" align="center" prop="shutType" >
<template slot-scope="scope">
<span
v-for="(item, index) in shutTypeList"
:key="index"
:value="item.shutTypeList"
v-if="scope.row.shutType == item.shutTypeId"
>
{{ item.shutTypeName }}
</span>
</template>
</el-table-column>
<el-table-column label="停机原因" align="center" prop="shutReason" />
<el-table-column label="停机开始时间" align="center" prop="shutBeginTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.shutBeginTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="停机结束时间" align="center" prop="shutEndTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.shutEndTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="停机时长" align="center" prop="shutTime" />
<!-- <el-table-column label="是否标识1-是2-否" align="center" prop="isFlag" />-->
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['dms:shutDown:edit']"-->
<!-- >修改</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['dms:shutDown:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改停机记录对话框 -->
<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-item label="设备ID关联dms_base_device_ledger的device_id" prop="deviceId">-->
<!-- <el-input v-model="form.deviceId" placeholder="请输入设备ID关联dms_base_device_ledger的device_id" />-->
<!-- </el-form-item>-->
<el-form-item label="设备名称" prop="deviceId" >
<el-select v-model="form.deviceId" placeholder="请输入设备类型">
<el-option
v-for="item in ledgerList"
:key="item.deviceId"
:label="item.deviceName"
:value="item.deviceId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="停机类型" prop="shutType" >
<el-select v-model="form.shutType" placeholder="请选择停机类型">
<el-option
v-for="item in shutTypeList"
:key="item.shutTypeId"
:label="item.shutTypeName"
:value="item.shutTypeId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="停机原因" prop="shutReason">
<el-input v-model="form.shutReason" placeholder="请输入停机原因" />
</el-form-item>
<el-form-item label="停机开始时间" prop="shutBeginTime">
<el-date-picker clearable
v-model="form.shutBeginTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择停机开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="停机结束时间" prop="shutEndTime">
<el-date-picker clearable
v-model="form.shutEndTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择停机结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="停机时长" prop="shutTime">
<el-input v-model="form.shutTime" placeholder="请输入停机时长" />
</el-form-item>
<!-- <el-form-item label="是否标识1-是2-否" prop="isFlag">-->
<!-- <el-input v-model="form.isFlag" placeholder="请输入是否标识1-是2-否" />-->
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listShutDown, getShutDown, delShutDown, addShutDown, updateShutDown } from "@/api/dms/shutDown";
import { listShutType } from '@/api/dms/shutType'
import { listLedger } from '@/api/dms/ledger'
export default {
name: "ShutDown",
data() {
return {
ledgerList:[],
shutTypeList:[],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
shutDownList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceId: null,
shutType: null,
shutReason: null,
shutBeginTime: null,
shutEndTime: null,
shutTime: null,
isFlag: null,
},
//
form: {},
//
rules: {
deviceId: [
{ required: true, message: "设备ID不能为空", trigger: "blur" }
],
isFlag: [
{ required: true, message: "是否标识1-是2-否不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
this.getDevice();
this.getShutType();
},
methods: {
/** 查询停机类型信息列表 */
getShutType() {
listShutType(this.queryParams).then(response => {
console.log(response)
this.shutTypeList = response.rows;
});
},
//
getDevice(){
listLedger().then(response => {
// console.log(response)
this.ledgerList = response.rows;
})
},
/** 查询停机记录列表 */
getList() {
this.loading = true;
listShutDown(this.queryParams).then(response => {
this.shutDownList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
recordShutDownId: null,
deviceId: null,
shutType: null,
shutReason: null,
shutBeginTime: null,
shutEndTime: null,
shutTime: null,
isFlag: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.recordShutDownId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加停机记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const recordShutDownId = row.recordShutDownId || this.ids
getShutDown(recordShutDownId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改停机记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.recordShutDownId != null) {
updateShutDown(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addShutDown(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const recordShutDownIds = row.recordShutDownId || this.ids;
this.$modal.confirm('是否确认删除停机记录编号为"' + recordShutDownIds + '"的数据项?').then(function() {
return delShutDown(recordShutDownIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('dms/shutDown/export', {
...this.queryParams
}, `shutDown_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -154,7 +154,7 @@
<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-item label="标准编号" prop="maintStandardCode">
<el-input v-model="form.maintStandardCode" placeholder="请输入标准编号" />
<el-input v-model="form.maintStandardCode" placeholder="请输入标准编号,如a001" />
</el-form-item>
<!-- <el-form-item label="设备类型ID" prop="deviceTypeId">-->
<!-- <el-input v-model="form.deviceTypeId" placeholder="请输入设备类型ID关联dms_base_device_type的device_type_id" />-->
@ -170,10 +170,10 @@
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="保养标准" prop="maintProtocol">
<el-input v-model="form.maintProtocol" placeholder="请输入保养标准" />
<el-input v-model="form.maintProtocol" placeholder="请输入保养标准,如保养标准" />
</el-form-item>
<el-form-item label="操作描述" prop="operationDescription">
<el-input v-model="form.operationDescription" placeholder="请输入操作描述" />
<el-input v-model="form.operationDescription" placeholder="请输入操作描述,如保养提升机标准" />
</el-form-item>
<!-- <el-form-item label="是否标识1-是2-否" prop="isFlag">-->
<!-- <el-input v-model="form.isFlag" placeholder="请输入是否标识1-是2-否" />-->

@ -172,18 +172,18 @@
<!-- <el-form-item label="设备类型ID" prop="deviceTypeId">-->
<!-- <el-input v-model="form.deviceTypeId" placeholder="请输入设备类型ID" />-->
<!-- </el-form-item>-->
<el-form-item label="设备类型" prop="deviceTypeId" >
<el-select v-model="form.deviceTypeId" placeholder="请输入设备类型">
<el-option
v-for="item in devicetypeList"
:key="item.deviceTypeId"
:label="item.typeName"
:value="item.deviceTypeId">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="设备类型" prop="deviceTypeId" >-->
<!-- <el-select v-model="form.deviceTypeId" placeholder="请输入设备类型">-->
<!-- <el-option-->
<!-- v-for="item in devicetypeList"-->
<!-- :key="item.deviceTypeId"-->
<!-- :label="item.typeName"-->
<!-- :value="item.deviceTypeId">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="部位编号" prop="maintStationCode">
<el-input v-model="form.maintStationCode" placeholder="请输入部位编号" />
<el-input v-model="form.maintStationCode" placeholder="请输入部位编号,如a001" />
</el-form-item>
<!-- <el-form-item label="保养标准" prop="protocolCode">-->
<!-- <el-input v-model="form.protocolCode" placeholder="请输入保养标准" />-->

@ -156,7 +156,7 @@
<el-form-item label="能源类型" prop="energyType">
<el-radio-group v-model="form.energyType">
<el-radio
v-for="dict in dict.type.energy_type"
v-for="dict in dict.type.alarm_energy_type"
:key="dict.value"
:label="dict.value*1"
>{{dict.label}}</el-radio>
@ -229,7 +229,7 @@ import { listRule, getRule, delRule, addRule, updateRule } from "@/api/ems/base/
export default {
name: "Rule",
dicts: ['energy_type','trigger_rule'],
dicts: ['energy_type','trigger_rule','alarm_energy_type'],
data() {
return {
//

Loading…
Cancel
Save