完好率init、设备选择逻辑新增组线

yangwl
wws 12 months ago
parent 93f58e6a69
commit 5aa016a080

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询设备运行记录列表
export function listOperation(query) {
return request({
url: '/device/operation/list',
method: 'get',
params: query
});
}
// 查询设备运行记录详细
export function getOperation(id) {
return request({
url: '/device/operation/' + id,
method: 'get'
});
}
// 新增设备运行记录
export function addOperation(data) {
return request({
url: '/device/operation',
method: 'post',
data: data
});
}
// 修改设备运行记录
export function updateOperation(data) {
return request({
url: '/device/operation',
method: 'put',
data: data
});
}
// 删除设备运行记录
export function delOperation(id) {
return request({
url: '/device/operation/' + id,
method: 'delete'
});
}

@ -43,6 +43,14 @@ export function getEquList(equQuery) {
});
}
// 获取设备组线信息
export function getGroupLine() {
return request({
url: '/device/inspectionPlan/getGroupLine',
method: 'get'
});
}
// 查询计划列表
export function listPlan(query) {
return request({

@ -539,11 +539,21 @@
<el-dialog
title="选择设备"
:visible.sync="selectEqu"
width="50%"
width="1100px"
append-to-body
>
<el-form :model="equipmentQuery" ref="queryBPForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="组线" prop="groupLine">
<el-select v-model="equipmentQuery.groupLine" placeholder="请选择组线">
<el-option
v-for="group in groupLineList"
:key="group.equipmentCode"
:label="group.equipmentName"
:value="group.equipmentCode"
/>
</el-select>
</el-form-item>
<el-form-item label="设备编码">
<el-input
v-model="equipmentQuery.equipmentCode"
@ -645,7 +655,7 @@ import {
updatePlan,
getEquList,
formatEquItem,
getPersonList, getWorkCenter, initUpdatePlanInfo
getPersonList, getWorkCenter, initUpdatePlanInfo, getGroupLine
} from "@/api/device/plan";
import plan from "@/views/plan/plan/index.vue";
@ -654,6 +664,8 @@ export default {
dicts: ['device_loop_type', 'sys_normal_disable'],
data() {
return {
// 线
groupLineList:[],
//
planLoading:false,
// list
@ -678,6 +690,7 @@ export default {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:null,
pageNum: 1,
pageSize: 10,
},
@ -903,7 +916,21 @@ export default {
},
//
selectEquBtn() {
this.equipmentQuery = {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:null,
pageNum: 1,
pageSize: 10,
};
// 线
getGroupLine().then(response => {
this.groupLineList = response.data;
this.equipmentQuery.groupLine = response.data[0].equipmentCode;
this.getEquList();
})
this.selectEqu = true;
},
//
@ -1032,6 +1059,7 @@ export default {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:this.groupLineList[0].equipmentCode,
pageNum: 1,
pageSize: 10,
};

@ -0,0 +1,494 @@
<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="车间" prop="workshop">
<el-input
v-model="queryParams.workshop"
placeholder="请输入车间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="组线" prop="groupLine">
<el-input
v-model="queryParams.groupLine"
placeholder="请输入组线"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备" prop="equipmentName">
<el-input
v-model="queryParams.equipmentName"
placeholder="请输入设备"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备编码" prop="equipmentCode">
<el-input
v-model="queryParams.equipmentCode"
placeholder="请输入设备编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="故障时间" prop="faultTime">
<el-input
v-model="queryParams.faultTime"
placeholder="请输入故障时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="实际运行时间;运行时间-故障时间" prop="actualOperationTime">
<el-input
v-model="queryParams.actualOperationTime"
placeholder="请输入实际运行时间;运行时间-故障时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="运行时间" prop="operationTime">
<el-input
v-model="queryParams.operationTime"
placeholder="请输入运行时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="故障率" prop="failureRate">
<el-input
v-model="queryParams.failureRate"
placeholder="请输入故障率"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="故障描述" prop="failureDescription">
<el-input
v-model="queryParams.failureDescription"
placeholder="请输入故障描述"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="原因分析" prop="reasonAnalyze">
<el-input
v-model="queryParams.reasonAnalyze"
placeholder="请输入原因分析"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="处理方式" prop="handlingMethod">
<el-input
v-model="queryParams.handlingMethod"
placeholder="请输入处理方式"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维修人" prop="repairPerson">
<el-input
v-model="queryParams.repairPerson"
placeholder="请输入维修人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备状态描述" prop="equStatusDes">
<el-input
v-model="queryParams.equStatusDes"
placeholder="请输入设备状态描述"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="更换备件" prop="replaceSpare">
<el-input
v-model="queryParams.replaceSpare"
placeholder="请输入更换备件"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工厂" prop="factoryCode">
<el-input
v-model="queryParams.factoryCode"
placeholder="请输入工厂"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备用字段1" prop="attr1">
<el-input
v-model="queryParams.attr1"
placeholder="请输入备用字段1"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备用字段2" prop="attr2">
<el-input
v-model="queryParams.attr2"
placeholder="请输入备用字段2"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备用字段3" prop="attr3">
<el-input
v-model="queryParams.attr3"
placeholder="请输入备用字段3"
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="['device:operation: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="['device:operation: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="['device:operation: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="['device:operation:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="operationList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="车间" align="center" prop="workshop" />
<el-table-column label="组线" align="center" prop="groupLine" />
<el-table-column label="设备" align="center" prop="equipmentName" />
<el-table-column label="设备编码" align="center" prop="equipmentCode" />
<el-table-column label="故障时间" align="center" prop="faultTime" />
<el-table-column label="实际运行时间;运行时间-故障时间" align="center" prop="actualOperationTime" />
<el-table-column label="运行时间" align="center" prop="operationTime" />
<el-table-column label="故障率" align="center" prop="failureRate" />
<el-table-column label="故障描述" align="center" prop="failureDescription" />
<el-table-column label="原因分析" align="center" prop="reasonAnalyze" />
<el-table-column label="处理方式" align="center" prop="handlingMethod" />
<el-table-column label="维修人" align="center" prop="repairPerson" />
<el-table-column label="设备状态描述" align="center" prop="equStatusDes" />
<el-table-column label="更换备件" align="center" prop="replaceSpare" />
<el-table-column label="工厂" align="center" prop="factoryCode" />
<el-table-column label="备用字段1" align="center" prop="attr1" />
<el-table-column label="备用字段2" align="center" prop="attr2" />
<el-table-column label="备用字段3" align="center" prop="attr3" />
<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="['device:operation:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:operation: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="车间" prop="workshop">
<el-input v-model="form.workshop" placeholder="请输入车间" />
</el-form-item>
<el-form-item label="组线" prop="groupLine">
<el-input v-model="form.groupLine" placeholder="请输入组线" />
</el-form-item>
<el-form-item label="设备" prop="equipmentName">
<el-input v-model="form.equipmentName" placeholder="请输入设备" />
</el-form-item>
<el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="form.equipmentCode" placeholder="请输入设备编码" />
</el-form-item>
<el-form-item label="故障时间" prop="faultTime">
<el-input v-model="form.faultTime" placeholder="请输入故障时间" />
</el-form-item>
<el-form-item label="实际运行时间;运行时间-故障时间" prop="actualOperationTime">
<el-input v-model="form.actualOperationTime" placeholder="请输入实际运行时间;运行时间-故障时间" />
</el-form-item>
<el-form-item label="运行时间" prop="operationTime">
<el-input v-model="form.operationTime" placeholder="请输入运行时间" />
</el-form-item>
<el-form-item label="故障率" prop="failureRate">
<el-input v-model="form.failureRate" placeholder="请输入故障率" />
</el-form-item>
<el-form-item label="故障描述" prop="failureDescription">
<el-input v-model="form.failureDescription" placeholder="请输入故障描述" />
</el-form-item>
<el-form-item label="原因分析" prop="reasonAnalyze">
<el-input v-model="form.reasonAnalyze" placeholder="请输入原因分析" />
</el-form-item>
<el-form-item label="处理方式" prop="handlingMethod">
<el-input v-model="form.handlingMethod" placeholder="请输入处理方式" />
</el-form-item>
<el-form-item label="维修人" prop="repairPerson">
<el-input v-model="form.repairPerson" placeholder="请输入维修人" />
</el-form-item>
<el-form-item label="设备状态描述" prop="equStatusDes">
<el-input v-model="form.equStatusDes" placeholder="请输入设备状态描述" />
</el-form-item>
<el-form-item label="更换备件" prop="replaceSpare">
<el-input v-model="form.replaceSpare" placeholder="请输入更换备件" />
</el-form-item>
<el-form-item label="工厂" prop="factoryCode">
<el-input v-model="form.factoryCode" placeholder="请输入工厂" />
</el-form-item>
<el-form-item label="备用字段1" prop="attr1">
<el-input v-model="form.attr1" placeholder="请输入备用字段1" />
</el-form-item>
<el-form-item label="备用字段2" prop="attr2">
<el-input v-model="form.attr2" placeholder="请输入备用字段2" />
</el-form-item>
<el-form-item label="备用字段3" prop="attr3">
<el-input v-model="form.attr3" placeholder="请输入备用字段3" />
</el-form-item>
<el-form-item label="删除标识" prop="delFlag">
<el-input v-model="form.delFlag" 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 { listOperation, getOperation, delOperation, addOperation, updateOperation } from "@/api/device/operation";
export default {
name: "Operation",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
operationList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
workshop: null,
groupLine: null,
equipmentName: null,
equipmentCode: null,
faultTime: null,
actualOperationTime: null,
operationTime: null,
failureRate: null,
failureDescription: null,
reasonAnalyze: null,
handlingMethod: null,
repairPerson: null,
equStatusDes: null,
replaceSpare: null,
factoryCode: null,
attr1: null,
attr2: null,
attr3: null,
},
//
form: {},
//
rules: {
delFlag: [
{ required: true, message: "删除标识不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询设备运行记录列表 */
getList() {
this.loading = true;
listOperation(this.queryParams).then(response => {
this.operationList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
workshop: null,
groupLine: null,
equipmentName: null,
equipmentCode: null,
faultTime: null,
actualOperationTime: null,
operationTime: null,
failureRate: null,
failureDescription: null,
reasonAnalyze: null,
handlingMethod: null,
repairPerson: null,
equStatusDes: null,
replaceSpare: null,
factoryCode: null,
attr1: null,
attr2: null,
attr3: null,
delFlag: 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.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备运行记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getOperation(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备运行记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateOperation(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addOperation(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除设备运行记录编号为"' + ids + '"的数据项?').then(function() {
return delOperation(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('device/operation/export', {
...this.queryParams
}, `operation_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -567,11 +567,21 @@
border
title="选择设备"
:visible.sync="selectEqu"
width="50%"
width="1100px"
append-to-body
>
<el-form :model="equipmentQuery" ref="queryBPForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="组线" prop="groupLine">
<el-select v-model="equipmentQuery.groupLine" placeholder="请选择组线">
<el-option
v-for="group in groupLineList"
:key="group.equipmentCode"
:label="group.equipmentName"
:value="group.equipmentCode"
/>
</el-select>
</el-form-item>
<el-form-item label="设备编码">
<el-input
v-model="equipmentQuery.equipmentCode"
@ -676,7 +686,7 @@ import {
import {
addPlan,
delPlan,
getEquList,
getEquList, getGroupLine,
getPersonList,
getWorkCenter,
initUpdatePlanInfo, listPlan,
@ -688,6 +698,8 @@ export default {
dicts: ['device_loop_type', 'sys_normal_disable','device_yes_no'],
data() {
return {
// 线
groupLineList:[],
//
rules: {},
//
@ -742,6 +754,7 @@ export default {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:null,
pageNum: 1,
pageSize: 10,
},
@ -948,7 +961,21 @@ export default {
},
//
selectEquBtn() {
this.equipmentQuery = {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:null,
pageNum: 1,
pageSize: 10,
};
// 线
getGroupLine().then(response => {
this.groupLineList = response.data;
this.equipmentQuery.groupLine = response.data[0].equipmentCode;
this.getEquList();
})
this.selectEqu = true;
},
//
@ -1077,6 +1104,7 @@ export default {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:this.groupLineList[0].equipmentCode,
pageNum: 1,
pageSize: 10,
};

@ -617,11 +617,21 @@
<el-dialog
title="选择设备"
:visible.sync="selectEqu"
width="800px"
width="1100px"
append-to-body
>
<el-form :model="equipmentQuery" ref="queryBPForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="组线" prop="groupLine">
<el-select v-model="equipmentQuery.groupLine" placeholder="请选择组线">
<el-option
v-for="group in groupLineList"
:key="group.equipmentCode"
:label="group.equipmentName"
:value="group.equipmentCode"
/>
</el-select>
</el-form-item>
<el-form-item label="设备编码">
<el-input
v-model="equipmentQuery.equipmentCode"
@ -1170,7 +1180,7 @@ import {
updateUpkeepOrder, subInspect
} from "@/api/device/upkeepOrder";
import {formatEquItem, formatEquItemNoCondition, querySpareList} from "@/api/device/upkeepPlan";
import {getEquList, getPersonList, getWorkCenter} from "@/api/device/plan";
import {getEquList, getGroupLine, getPersonList, getWorkCenter} from "@/api/device/plan";
import {delDeviceOrder, getDeviceOrder, listDeviceOrder, updateDeviceOrder} from "@/api/device/deviceOrder";
import {getInspectionWork, updateInspectionWork} from "@/api/device/inspectionWork";
@ -1179,6 +1189,8 @@ export default {
dicts: ['device_order_status', 'device_loop_type','device_reach_standard','device_upkeep_type','device_inspect_status'],
data() {
return {
// 线
groupLineList:[],
// list
spareOnList:[],
//
@ -1291,6 +1303,7 @@ export default {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:null,
pageNum: 1,
pageSize: 10,
},
@ -1414,6 +1427,7 @@ export default {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:this.groupLineList[0].equipmentCode,
pageNum: 1,
pageSize: 10,
};
@ -1663,7 +1677,21 @@ export default {
},
//
selectEquBtn() {
this.equipmentQuery = {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:null,
pageNum: 1,
pageSize: 10,
};
// 线
getGroupLine().then(response => {
this.groupLineList = response.data;
this.equipmentQuery.groupLine = response.data[0].equipmentCode;
this.getEquList();
})
this.selectEqu = true;
},
//

@ -597,11 +597,21 @@
<el-dialog
title="选择设备"
:visible.sync="selectEqu"
width="50%"
width="1100px"
append-to-body
>
<el-form :model="equipmentQuery" ref="queryBPForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="组线" prop="groupLine">
<el-select v-model="equipmentQuery.groupLine" placeholder="请选择组线">
<el-option
v-for="group in groupLineList"
:key="group.equipmentCode"
:label="group.equipmentName"
:value="group.equipmentCode"
/>
</el-select>
</el-form-item>
<el-form-item label="设备编码">
<el-input
v-model="equipmentQuery.equipmentCode"
@ -878,7 +888,7 @@ import {
import {
addPlan,
delPlan,
getEquList,
getEquList, getGroupLine,
getPersonList,
getWorkCenter,
initUpdatePlanInfo,
@ -890,6 +900,8 @@ export default {
dicts: ['device_loop_type', 'sys_normal_disable','device_upkeep_type'],
data() {
return {
// 线
groupLineList:[],
// list
spareOnList:[],
//
@ -969,6 +981,7 @@ export default {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:null,
pageNum: 1,
pageSize: 10,
},
@ -1438,7 +1451,21 @@ export default {
},
//
selectEquBtn() {
this.equipmentQuery = {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:null,
pageNum: 1,
pageSize: 10,
};
// 线
getGroupLine().then(response => {
this.groupLineList = response.data;
this.equipmentQuery.groupLine = response.data[0].equipmentCode;
this.getEquList();
})
this.selectEqu = true;
},
//
@ -1561,6 +1588,7 @@ export default {
equipmentCode: null,
equipmentName: null,
workshopCode: null,
groupLine:this.groupLineList[0].equipmentCode,
pageNum: 1,
pageSize: 10,
};

Loading…
Cancel
Save