2024-2-28 设备模块故障信息格式修改+故障报修图片展示优化

master
A0010407 1 year ago
parent e5b8733b22
commit 6548a2d8bc

@ -1,5 +1,4 @@
<template>
<el-tabs type="border-card">
<el-tab-pane label="故障类型">
<ItemFaultType></ItemFaultType>
@ -14,7 +13,6 @@
<ItemFaultMeasures></ItemFaultMeasures>
</el-tab-pane>
</el-tabs>
</template>
<script>
@ -25,36 +23,45 @@ import ItemFaultMeasures from "./itemFaultMeasures.vue";
export default {
name: "FaultInformation",
components: { ItemFaultType , ItemFaultReason , ItemFaultDescription , ItemFaultMeasures },
components: {
ItemFaultType,
ItemFaultReason,
ItemFaultDescription,
ItemFaultMeasures,
},
data() {
return {
//
pickerOptions: {
shortcuts: [{
text: '最近一周',
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: '最近一个月',
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: '最近三个月',
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]);
}
}]
picker.$emit("pick", [start, end]);
},
},
],
},
//
loading: true,
@ -97,16 +104,10 @@ export default {
//
form: {},
//
rules: {
}
rules: {},
};
},
created() {
},
methods: {
}
created() {},
methods: {},
};
</script>

@ -1,6 +1,13 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="98px"
>
<el-form-item label-width="100px" label="故障描述编码" prop="faultCode">
<el-input
v-model="queryParams.faultCode"
@ -10,7 +17,11 @@
/>
</el-form-item>
<el-form-item label="故障描述类型" prop="faultType">
<el-select v-model="queryParams.faultType" placeholder="请选择故障描述类型" clearable>
<el-select
v-model="queryParams.faultType"
placeholder="请选择故障描述类型"
clearable
>
<el-option
v-for="dict in dict.type.device_fault_type"
:key="dict.value"
@ -46,7 +57,8 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="更新人" prop="updateBy">
@ -68,12 +80,21 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
:picker-options="pickerOptions"
>
</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-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>
@ -86,7 +107,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['device:faultDescription:add']"
>新增</el-button>
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -97,7 +119,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:faultDescription:edit']"
>修改</el-button>
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -108,7 +131,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device:faultDescriptionn:remove']"
>删除</el-button>
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -118,36 +142,103 @@
size="mini"
@click="handleExport"
v-hasPermi="['device:faultDescription:export']"
>导出</el-button>
>导出</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="faultList" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="faultList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column v-if="false" label="主键" align="center" prop="faultId" />
<el-table-column width="150" label="故障描述编码" align="center" prop="faultCode" />
<el-table-column width="150" label="故障描述类型" align="center" prop="faultType" >
<el-table-column
width="60"
align="center"
label="序号"
type="index"
></el-table-column>
<el-table-column
v-if="false"
label="主键"
align="center"
prop="faultId"
/>
<el-table-column
width="150"
label="故障描述编码"
align="center"
prop="faultCode"
/>
<el-table-column
width="150"
label="故障描述类型"
align="center"
prop="faultType"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.device_fault_type" :value="scope.row.faultType"/>
<dict-tag
:options="dict.type.device_fault_type"
:value="scope.row.faultType"
/>
</template>
</el-table-column>
<el-table-column width="150" label="故障描述" align="center" prop="faultSubclass" />
<el-table-column width="180" label="备注" align="center" prop="faultRemark" />
<el-table-column width="100" label="创建人" align="center" prop="createBy" />
<el-table-column width="180" label="创建时间" align="center" prop="createTime">
<el-table-column
width="150"
label="故障描述"
align="center"
prop="faultSubclass"
/>
<el-table-column
width="180"
label="备注"
align="center"
prop="faultRemark"
/>
<el-table-column
width="100"
label="创建人"
align="center"
prop="createBy"
/>
<el-table-column
width="180"
label="创建时间"
align="center"
prop="createTime"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column width="100" label="更新人" align="center" prop="updateBy" />
<el-table-column width="180" label="更新时间" align="center" prop="updateTime">
<el-table-column
width="100"
label="更新人"
align="center"
prop="updateBy"
/>
<el-table-column
width="180"
label="更新时间"
align="center"
prop="updateTime"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.updateTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column width="180" label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<el-table-column
width="180"
label="操作"
align="center"
class-name="small-padding fixed-width"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
@ -155,14 +246,16 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['device:faultDescription:edit']"
>修改</el-button>
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:faultDescription:remove']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -179,10 +272,19 @@
<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 v-if="false" label="故障描述编码" prop="faultCode">
<el-input v-model="form.faultCode" placeholder="请输入故障描述编码" style="width: 300px"/>
<el-input
v-model="form.faultCode"
placeholder="请输入故障描述编码"
style="width: 300px"
/>
</el-form-item>
<el-form-item label="故障描述" prop="faultType">
<el-select v-model="form.faultType" placeholder="请选择故障描述" clearable style="width: 300px">
<el-select
v-model="form.faultType"
placeholder="请选择故障描述"
clearable
style="width: 300px"
>
<el-option
v-for="dict in dict.type.device_fault_type"
:key="dict.value"
@ -192,10 +294,18 @@
</el-select>
</el-form-item>
<el-form-item label="故障子类" prop="faultSubclass">
<el-input v-model="form.faultSubclass" placeholder="请输入故障子类" style="width: 300px"/>
<el-input
v-model="form.faultSubclass"
placeholder="请输入故障子类"
style="width: 300px"
/>
</el-form-item>
<el-form-item label="备注" prop="faultRemark">
<el-input v-model="form.faultRemark" placeholder="请输入备注" style="width: 300px"/>
<el-input
v-model="form.faultRemark"
placeholder="请输入备注"
style="width: 300px"
/>
</el-form-item>
<el-form-item v-if="false" label="工厂编码" prop="factoryCode">
<el-input v-model="form.factoryCode" placeholder="请输入工厂编码" />
@ -222,42 +332,52 @@
</template>
<script>
import { listFaultDescription, getFaultDescription, delFaultDescription, addFaultDescription, updateFaultDescription } from "@/api/device/faultDescription";
import {
listFaultDescription,
getFaultDescription,
delFaultDescription,
addFaultDescription,
updateFaultDescription,
} from "@/api/device/faultDescription";
export default {
name: "FaultType",
dicts: ['device_fault_description'],
dicts: ["device_fault_description"],
data() {
return {
//
faultCategory: null,
//
pickerOptions: {
shortcuts: [{
text: '最近一周',
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: '最近一个月',
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: '最近三个月',
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]);
}
}]
picker.$emit("pick", [start, end]);
},
},
],
},
//
loading: true,
@ -302,8 +422,7 @@ export default {
//
form: {},
//
rules: {
}
rules: {},
};
},
created() {
@ -314,7 +433,7 @@ export default {
getList() {
this.loading = true;
this.queryParams.faultCategory = "des";
listFaultDescription(this.queryParams).then(response => {
listFaultDescription(this.queryParams).then((response) => {
this.faultList = response.rows;
this.total = response.total;
this.loading = false;
@ -341,7 +460,7 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
};
this.resetForm("form");
},
@ -360,9 +479,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.faultId)
this.single = selection.length!==1
this.multiple = !selection.length
this.ids = selection.map((item) => item.faultId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -373,8 +492,8 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const faultId = row.faultId || this.ids
getFaultDescription(faultId).then(response => {
const faultId = row.faultId || this.ids;
getFaultDescription(faultId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改故障描述维护";
@ -382,10 +501,10 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.faultId != null) {
updateFaultDescription(this.form).then(response => {
updateFaultDescription(this.form).then((response) => {
if (response.code != 500) {
this.$modal.msgSuccess("修改成功");
this.open = false;
@ -393,7 +512,7 @@ export default {
}
});
} else {
addFaultDescription(this.form).then(response => {
addFaultDescription(this.form).then((response) => {
if (response.code != 500) {
this.$modal.msgSuccess("新增成功");
this.open = false;
@ -407,18 +526,18 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const faultIds = row.faultId || this.ids;
var faultCodes = '';
var faultCodes = "";
//
for (let i = 0; i < this.faultList.length; i++) {
for (let j = 0; j < faultIds.length; j++) {
if (faultIds[j] == this.faultList[i].faultId) {
faultCodes = faultCodes + this.faultList[i].faultCode + ',';
faultCodes = faultCodes + this.faultList[i].faultCode + ",";
}
}
}
if (faultCodes == '') {
if (faultCodes == "") {
for (let i = 0; i < this.faultList.length; i++) {
if (faultIds == this.faultList[i].faultId) {
faultCodes = this.faultList[i].faultCode;
@ -426,19 +545,27 @@ export default {
}
}
this.$modal.confirm('是否确认删除故障描述维护编号为"' + faultCodes + '"的数据项?').then(function() {
this.$modal
.confirm('是否确认删除故障描述维护编号为"' + faultCodes + '"的数据项?')
.then(function () {
return delFaultDescription(faultIds);
}).then(() => {
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('device/faultDescription/export', {
...this.queryParams
}, `faultType_${new Date().getTime()}.xlsx`)
}
}
this.download(
"device/faultDescription/export",
{
...this.queryParams,
},
`faultType_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

@ -1,6 +1,13 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="98px"
>
<el-form-item label-width="100px" label="故障措施编码" prop="faultCode">
<el-input
v-model="queryParams.faultCode"
@ -10,7 +17,11 @@
/>
</el-form-item>
<el-form-item label="故障措施类型" prop="faultType">
<el-select v-model="queryParams.faultType" placeholder="请选择故障措施类型" clearable>
<el-select
v-model="queryParams.faultType"
placeholder="请选择故障措施类型"
clearable
>
<el-option
v-for="dict in dict.type.device_fault_measures"
:key="dict.value"
@ -46,7 +57,8 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
@ -59,12 +71,21 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
:picker-options="pickerOptions"
>
</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-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>
@ -77,7 +98,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['device:faultMeasures:add']"
>新增</el-button>
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -88,7 +110,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:faultMeasures:edit']"
>修改</el-button>
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -99,7 +122,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device:faultMeasures:remove']"
>删除</el-button>
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -109,36 +133,103 @@
size="mini"
@click="handleExport"
v-hasPermi="['device:faultMeasures:export']"
>导出</el-button>
>导出</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="faultList" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="faultList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column v-if="false" label="主键" align="center" prop="faultId" />
<el-table-column width="150" label="故障措施编码" align="center" prop="faultCode" />
<el-table-column width="150" label="故障措施类型" align="center" prop="faultType" >
<el-table-column
width="60"
align="center"
label="序号"
type="index"
></el-table-column>
<el-table-column
v-if="false"
label="主键"
align="center"
prop="faultId"
/>
<el-table-column
width="150"
label="故障措施编码"
align="center"
prop="faultCode"
/>
<el-table-column
width="150"
label="故障措施类型"
align="center"
prop="faultType"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.device_fault_measures" :value="scope.row.faultType"/>
<dict-tag
:options="dict.type.device_fault_measures"
:value="scope.row.faultType"
/>
</template>
</el-table-column>
<el-table-column width="150" label="故障措施" align="center" prop="faultSubclass" />
<el-table-column width="180" label="备注" align="center" prop="faultRemark" />
<el-table-column width="100" label="创建人" align="center" prop="createBy" />
<el-table-column width="180" label="创建时间" align="center" prop="createTime">
<el-table-column
width="150"
label="故障措施"
align="center"
prop="faultSubclass"
/>
<el-table-column
width="180"
label="备注"
align="center"
prop="faultRemark"
/>
<el-table-column
width="100"
label="创建人"
align="center"
prop="createBy"
/>
<el-table-column
width="180"
label="创建时间"
align="center"
prop="createTime"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column width="100" label="更新人" align="center" prop="updateBy" />
<el-table-column width="180" label="更新时间" align="center" prop="updateTime">
<el-table-column
width="100"
label="更新人"
align="center"
prop="updateBy"
/>
<el-table-column
width="180"
label="更新时间"
align="center"
prop="updateTime"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.updateTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column width="180" label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<el-table-column
width="180"
label="操作"
align="center"
class-name="small-padding fixed-width"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
@ -146,14 +237,16 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['device:faultMeasures:edit']"
>修改</el-button>
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:faultMeasures:remove']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -170,10 +263,19 @@
<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 v-if="false" label="故障措施编码" prop="faultCode">
<el-input v-model="form.faultCode" placeholder="请输入故障措施编码" style="width: 300px"/>
<el-input
v-model="form.faultCode"
placeholder="请输入故障措施编码"
style="width: 300px"
/>
</el-form-item>
<el-form-item label="故障措施" prop="faultType">
<el-select v-model="form.faultType" placeholder="请选择故障措施" clearable style="width: 300px">
<el-select
v-model="form.faultType"
placeholder="请选择故障措施"
clearable
style="width: 300px"
>
<el-option
v-for="dict in dict.type.device_fault_measures"
:key="dict.value"
@ -183,10 +285,18 @@
</el-select>
</el-form-item>
<el-form-item label="故障子类" prop="faultSubclass">
<el-input v-model="form.faultSubclass" placeholder="请输入故障子类" style="width: 300px"/>
<el-input
v-model="form.faultSubclass"
placeholder="请输入故障子类"
style="width: 300px"
/>
</el-form-item>
<el-form-item label="备注" prop="faultRemark">
<el-input v-model="form.faultRemark" placeholder="请输入备注" style="width: 300px"/>
<el-input
v-model="form.faultRemark"
placeholder="请输入备注"
style="width: 300px"
/>
</el-form-item>
<el-form-item v-if="false" label="工厂编码" prop="factoryCode">
<el-input v-model="form.factoryCode" placeholder="请输入工厂编码" />
@ -213,40 +323,50 @@
</template>
<script>
import { listFaultMeasures, getFaultMeasures, delFaultMeasures, addFaultMeasures, updateFaultMeasures } from "@/api/device/faultMeasures";
import {
listFaultMeasures,
getFaultMeasures,
delFaultMeasures,
addFaultMeasures,
updateFaultMeasures,
} from "@/api/device/faultMeasures";
export default {
name: "FaultType",
dicts: ['device_fault_measures'],
dicts: ["device_fault_measures"],
data() {
return {
//
pickerOptions: {
shortcuts: [{
text: '最近一周',
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: '最近一个月',
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: '最近三个月',
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]);
}
}]
picker.$emit("pick", [start, end]);
},
},
],
},
//
loading: true,
@ -289,8 +409,7 @@ export default {
//
form: {},
//
rules: {
}
rules: {},
};
},
created() {
@ -300,7 +419,7 @@ export default {
/** 查询故障措施维护列表 */
getList() {
this.loading = true;
listFaultMeasures(this.queryParams).then(response => {
listFaultMeasures(this.queryParams).then((response) => {
this.faultList = response.rows;
this.total = response.total;
this.loading = false;
@ -327,7 +446,7 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
};
this.resetForm("form");
},
@ -346,9 +465,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.faultId)
this.single = selection.length!==1
this.multiple = !selection.length
this.ids = selection.map((item) => item.faultId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -359,8 +478,8 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const faultId = row.faultId || this.ids
getFaultMeasures(faultId).then(response => {
const faultId = row.faultId || this.ids;
getFaultMeasures(faultId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改故障措施维护";
@ -368,10 +487,10 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.faultId != null) {
updateFaultMeasures(this.form).then(response => {
updateFaultMeasures(this.form).then((response) => {
if (response.code != 500) {
this.$modal.msgSuccess("修改成功");
this.open = false;
@ -379,7 +498,7 @@ export default {
}
});
} else {
addFaultMeasures(this.form).then(response => {
addFaultMeasures(this.form).then((response) => {
if (response.code != 500) {
this.$modal.msgSuccess("新增成功");
this.open = false;
@ -393,18 +512,18 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const faultIds = row.faultId || this.ids;
var faultCodes = '';
var faultCodes = "";
//
for (let i = 0; i < this.faultList.length; i++) {
for (let j = 0; j < faultIds.length; j++) {
if (faultIds[j] == this.faultList[i].faultId) {
faultCodes = faultCodes + this.faultList[i].faultCode + ',';
faultCodes = faultCodes + this.faultList[i].faultCode + ",";
}
}
}
if (faultCodes == '') {
if (faultCodes == "") {
for (let i = 0; i < this.faultList.length; i++) {
if (faultIds == this.faultList[i].faultId) {
faultCodes = this.faultList[i].faultCode;
@ -412,19 +531,27 @@ export default {
}
}
this.$modal.confirm('是否确认删除故障措施维护编号为"' + faultCodes + '"的数据项?').then(function() {
this.$modal
.confirm('是否确认删除故障措施维护编号为"' + faultCodes + '"的数据项?')
.then(function () {
return delFaultMeasures(faultIds);
}).then(() => {
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('device/faultMeasures/export', {
...this.queryParams
}, `faultType_${new Date().getTime()}.xlsx`)
}
}
this.download(
"device/faultMeasures/export",
{
...this.queryParams,
},
`faultType_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

@ -1,6 +1,13 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="98px"
>
<el-form-item label="故障原因编码" prop="faultCode">
<el-input
style="width: 150px"
@ -11,7 +18,12 @@
/>
</el-form-item>
<el-form-item label="故障原因类型" prop="faultType">
<el-select v-model="queryParams.faultType" placeholder="请选择原因类型" clearable style="width: 150px">
<el-select
v-model="queryParams.faultType"
placeholder="请选择原因类型"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.device_fault_reason"
:key="dict.value"
@ -59,7 +71,8 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
@ -72,12 +85,21 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
:picker-options="pickerOptions"
>
</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-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>
@ -90,7 +112,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['device:faultReason:add']"
>新增</el-button>
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -101,7 +124,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:faultReason:edit']"
>修改</el-button>
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -112,7 +136,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device:faultReason:remove']"
>删除</el-button>
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -122,37 +147,109 @@
size="mini"
@click="handleExport"
v-hasPermi="['device:faultReason:export']"
>导出</el-button>
>导出</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="faultList" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="faultList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column v-if="false" label="主键" align="center" prop="faultId" />
<el-table-column width="150" label="故障原因编码" align="center" prop="faultCode" />
<el-table-column width="150" label="故障原因类型" align="center" prop="faultType" >
<el-table-column
width="60"
align="center"
label="序号"
type="index"
></el-table-column>
<el-table-column
v-if="false"
label="主键"
align="center"
prop="faultId"
/>
<el-table-column
width="150"
label="故障原因编码"
align="center"
prop="faultCode"
/>
<el-table-column
width="150"
label="故障原因类型"
align="center"
prop="faultType"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.device_fault_reason" :value="scope.row.faultType"/>
<dict-tag
:options="dict.type.device_fault_reason"
:value="scope.row.faultType"
/>
</template>
</el-table-column>
<el-table-column width="200" label="故障原因" align="center" prop="faultSubclass" />
<el-table-column width="180" label="备注" align="center" prop="faultRemark" />
<el-table-column v-if="false" label="删除标志" align="center" prop="delFlag" />
<el-table-column width="100" label="创建人" align="center" prop="createBy" />
<el-table-column width="180" label="创建时间" align="center" prop="createTime">
<el-table-column
width="200"
label="故障原因"
align="center"
prop="faultSubclass"
/>
<el-table-column
width="180"
label="备注"
align="center"
prop="faultRemark"
/>
<el-table-column
v-if="false"
label="删除标志"
align="center"
prop="delFlag"
/>
<el-table-column
width="100"
label="创建人"
align="center"
prop="createBy"
/>
<el-table-column
width="180"
label="创建时间"
align="center"
prop="createTime"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column width="100" label="更新人" align="center" prop="updateBy" />
<el-table-column width="180" label="更新时间" align="center" prop="updateTime">
<el-table-column
width="100"
label="更新人"
align="center"
prop="updateBy"
/>
<el-table-column
width="180"
label="更新时间"
align="center"
prop="updateTime"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.updateTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column width="180" label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<el-table-column
width="180"
label="操作"
align="center"
class-name="small-padding fixed-width"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
@ -160,14 +257,16 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['device:faultReason:edit']"
>修改</el-button>
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:faultReason:remove']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -184,10 +283,19 @@
<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 v-if="false" label="故障原因编码" prop="faultCode">
<el-input v-model="form.faultCode" placeholder="请输入故障原因编码" style="width: 300px"/>
<el-input
v-model="form.faultCode"
placeholder="请输入故障原因编码"
style="width: 300px"
/>
</el-form-item>
<el-form-item label="故障原因" prop="faultType">
<el-select v-model="form.faultType" placeholder="请选择故障原因" clearable style="width: 300px">
<el-select
v-model="form.faultType"
placeholder="请选择故障原因"
clearable
style="width: 300px"
>
<el-option
v-for="dict in dict.type.device_fault_reason"
:key="dict.value"
@ -197,10 +305,18 @@
</el-select>
</el-form-item>
<el-form-item label="故障子类" prop="faultSubclass">
<el-input v-model="form.faultSubclass" placeholder="请输入故障子类" style="width: 300px"/>
<el-input
v-model="form.faultSubclass"
placeholder="请输入故障子类"
style="width: 300px"
/>
</el-form-item>
<el-form-item label="备注" prop="faultRemark">
<el-input v-model="form.faultRemark" placeholder="请输入备注" style="width: 300px"/>
<el-input
v-model="form.faultRemark"
placeholder="请输入备注"
style="width: 300px"
/>
</el-form-item>
<el-form-item v-if="false" label="工厂编码" prop="factoryCode">
<el-input v-model="form.factoryCode" placeholder="请输入工厂编码" />
@ -227,40 +343,50 @@
</template>
<script>
import { listFaultReason, getFaultReason, delFaultReason, addFaultReason, updateFaultReason } from "@/api/device/faultReason";
import {
listFaultReason,
getFaultReason,
delFaultReason,
addFaultReason,
updateFaultReason,
} from "@/api/device/faultReason";
export default {
name: "FaultType",
dicts: ['device_fault_reason'],
dicts: ["device_fault_reason"],
data() {
return {
//
pickerOptions: {
shortcuts: [{
text: '最近一周',
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: '最近一个月',
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: '最近三个月',
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]);
}
}]
picker.$emit("pick", [start, end]);
},
},
],
},
//
loading: true,
@ -303,8 +429,7 @@ export default {
//
form: {},
//
rules: {
}
rules: {},
};
},
created() {
@ -314,7 +439,7 @@ export default {
/** 查询故障原因维护列表 */
getList() {
this.loading = true;
listFaultReason(this.queryParams).then(response => {
listFaultReason(this.queryParams).then((response) => {
this.faultList = response.rows;
this.total = response.total;
this.loading = false;
@ -341,7 +466,7 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
};
this.resetForm("form");
},
@ -360,9 +485,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.faultId)
this.single = selection.length!==1
this.multiple = !selection.length
this.ids = selection.map((item) => item.faultId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -373,8 +498,8 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const faultId = row.faultId || this.ids
getFaultReason(faultId).then(response => {
const faultId = row.faultId || this.ids;
getFaultReason(faultId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改故障原因维护";
@ -382,10 +507,10 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.faultId != null) {
updateFaultReason(this.form).then(response => {
updateFaultReason(this.form).then((response) => {
if (response.code != 500) {
this.$modal.msgSuccess("修改成功");
this.open = false;
@ -393,7 +518,7 @@ export default {
}
});
} else {
addFaultReason(this.form).then(response => {
addFaultReason(this.form).then((response) => {
if (response.code != 500) {
this.$modal.msgSuccess("新增成功");
this.open = false;
@ -407,18 +532,18 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const faultIds = row.faultId || this.ids;
var faultCodes = '';
var faultCodes = "";
//
for (let i = 0; i < this.faultList.length; i++) {
for (let j = 0; j < faultIds.length; j++) {
if (faultIds[j] == this.faultList[i].faultId) {
faultCodes = faultCodes + this.faultList[i].faultCode + ',';
faultCodes = faultCodes + this.faultList[i].faultCode + ",";
}
}
}
if (faultCodes == '') {
if (faultCodes == "") {
for (let i = 0; i < this.faultList.length; i++) {
if (faultIds == this.faultList[i].faultId) {
faultCodes = this.faultList[i].faultCode;
@ -426,19 +551,27 @@ export default {
}
}
this.$modal.confirm('是否确认删除故障原因维护编号为"' + faultCodes + '"的数据项?').then(function() {
this.$modal
.confirm('是否确认删除故障原因维护编号为"' + faultCodes + '"的数据项?')
.then(function () {
return delFaultReason(faultIds);
}).then(() => {
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('device/faultReason/export', {
...this.queryParams
}, `faultType_${new Date().getTime()}.xlsx`)
}
}
this.download(
"device/faultReason/export",
{
...this.queryParams,
},
`faultType_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

@ -1,6 +1,13 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label-width="100px" label="故障类型编码" prop="faultCode">
<el-input
v-model="queryParams.faultCode"
@ -11,7 +18,12 @@
/>
</el-form-item>
<el-form-item label="故障类型" prop="faultType">
<el-select v-model="queryParams.faultType" placeholder="请选择故障类型" clearable style="width: 180px">
<el-select
v-model="queryParams.faultType"
placeholder="请选择故障类型"
clearable
style="width: 180px"
>
<el-option
v-for="dict in dict.type.device_fault_type"
:key="dict.value"
@ -107,7 +119,8 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
@ -120,12 +133,21 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
:picker-options="pickerOptions"
>
</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-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>
@ -138,7 +160,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['device:faultType:add']"
>新增</el-button>
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -149,7 +172,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:faultType:edit']"
>修改</el-button>
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -160,7 +184,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device:faultType:remove']"
>删除</el-button>
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -170,41 +195,133 @@
size="mini"
@click="handleExport"
v-hasPermi="['device:faultType:export']"
>导出</el-button>
>导出</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="faultList" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="faultList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column v-if="false" label="主键" align="center" prop="faultId" />
<el-table-column width="150" label="故障类型编码" align="center" prop="faultCode" />
<el-table-column width="150" label="故障类型" align="center" prop="faultType" >
<el-table-column
width="60"
align="center"
label="序号"
type="index"
></el-table-column>
<el-table-column
v-if="false"
label="主键"
align="center"
prop="faultId"
/>
<el-table-column
width="150"
label="故障类型编码"
align="center"
prop="faultCode"
/>
<el-table-column
width="150"
label="故障类型"
align="center"
prop="faultType"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.device_fault_type" :value="scope.row.faultType"/>
<dict-tag
:options="dict.type.device_fault_type"
:value="scope.row.faultType"
/>
</template>
</el-table-column>
<el-table-column width="150" label="故障子类" align="center" prop="faultSubclass" />
<el-table-column width="180" label="备注" align="center" prop="faultRemark" />
<el-table-column v-if="false" label="工厂编码" align="center" prop="factoryCode" />
<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 v-if="false" label="删除标志" align="center" prop="delFlag" />
<el-table-column width="100" label="创建人" align="center" prop="createBy" />
<el-table-column width="180" label="创建时间" align="center" prop="createTime">
<el-table-column
width="150"
label="故障子类"
align="center"
prop="faultSubclass"
/>
<el-table-column
width="180"
label="备注"
align="center"
prop="faultRemark"
/>
<el-table-column
v-if="false"
label="工厂编码"
align="center"
prop="factoryCode"
/>
<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
v-if="false"
label="删除标志"
align="center"
prop="delFlag"
/>
<el-table-column
width="100"
label="创建人"
align="center"
prop="createBy"
/>
<el-table-column
width="180"
label="创建时间"
align="center"
prop="createTime"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column width="100" label="更新人" align="center" prop="updateBy" />
<el-table-column width="180" label="更新时间" align="center" prop="updateTime">
<el-table-column
width="100"
label="更新人"
align="center"
prop="updateBy"
/>
<el-table-column
width="180"
label="更新时间"
align="center"
prop="updateTime"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.updateTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column width="180" label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<el-table-column
width="180"
label="操作"
align="center"
class-name="small-padding fixed-width"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
@ -212,14 +329,16 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['device:faultType:edit']"
>修改</el-button>
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:faultType:remove']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -235,11 +354,21 @@
<!-- 添加或修改故障类型维护对话框 -->
<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 v-if="false" label="故障类型编码" prop="faultCode" style="width: 300px">
<el-form-item
v-if="false"
label="故障类型编码"
prop="faultCode"
style="width: 300px"
>
<el-input v-model="form.faultCode" placeholder="请输入故障类型编码" />
</el-form-item>
<el-form-item label="故障类型" prop="faultType">
<el-select v-model="form.faultType" placeholder="请选择故障类型" clearable style="width: 300px">
<el-select
v-model="form.faultType"
placeholder="请选择故障类型"
clearable
style="width: 300px"
>
<el-option
v-for="dict in dict.type.device_fault_type"
:key="dict.value"
@ -249,10 +378,18 @@
</el-select>
</el-form-item>
<el-form-item label="故障子类" prop="faultSubclass">
<el-input v-model="form.faultSubclass" placeholder="请输入故障子类" style="width: 300px"/>
<el-input
v-model="form.faultSubclass"
placeholder="请输入故障子类"
style="width: 300px"
/>
</el-form-item>
<el-form-item label="备注" prop="faultRemark">
<el-input v-model="form.faultRemark" placeholder="请输入备注" style="width: 300px"/>
<el-input
v-model="form.faultRemark"
placeholder="请输入备注"
style="width: 300px"
/>
</el-form-item>
<el-form-item v-if="false" label="工厂编码" prop="factoryCode">
<el-input v-model="form.factoryCode" placeholder="请输入工厂编码" />
@ -279,40 +416,50 @@
</template>
<script>
import { listFaultType, getFaultType, delFaultType, addFaultType, updateFaultType } from "@/api/device/faultType";
import {
listFaultType,
getFaultType,
delFaultType,
addFaultType,
updateFaultType,
} from "@/api/device/faultType";
export default {
name: "FaultType",
dicts: ['device_fault_type'],
dicts: ["device_fault_type"],
data() {
return {
//
pickerOptions: {
shortcuts: [{
text: '最近一周',
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: '最近一个月',
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: '最近三个月',
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]);
}
}]
picker.$emit("pick", [start, end]);
},
},
],
},
//
loading: true,
@ -355,8 +502,7 @@ export default {
//
form: {},
//
rules: {
}
rules: {},
};
},
created() {
@ -366,7 +512,7 @@ export default {
/** 查询故障类型维护列表 */
getList() {
this.loading = true;
listFaultType(this.queryParams).then(response => {
listFaultType(this.queryParams).then((response) => {
this.faultList = response.rows;
this.total = response.total;
this.loading = false;
@ -393,7 +539,7 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
};
this.resetForm("form");
},
@ -412,9 +558,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.faultId)
this.single = selection.length!==1
this.multiple = !selection.length
this.ids = selection.map((item) => item.faultId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -425,8 +571,8 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const faultId = row.faultId || this.ids
getFaultType(faultId).then(response => {
const faultId = row.faultId || this.ids;
getFaultType(faultId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改故障类型维护";
@ -434,10 +580,10 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.faultId != null) {
updateFaultType(this.form).then(response => {
updateFaultType(this.form).then((response) => {
if (response.code != 500) {
this.$modal.msgSuccess("修改成功");
this.open = false;
@ -445,7 +591,7 @@ export default {
}
});
} else {
addFaultType(this.form).then(response => {
addFaultType(this.form).then((response) => {
if (response.code != 500) {
this.$modal.msgSuccess("新增成功");
this.open = false;
@ -459,18 +605,18 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const faultIds = row.faultId || this.ids;
var faultCodes = '';
var faultCodes = "";
//
for (let i = 0; i < this.faultList.length; i++) {
for (let j = 0; j < faultIds.length; j++) {
if (faultIds[j] == this.faultList[i].faultId) {
faultCodes = faultCodes + this.faultList[i].faultCode + ',';
faultCodes = faultCodes + this.faultList[i].faultCode + ",";
}
}
}
if (faultCodes == '') {
if (faultCodes == "") {
for (let i = 0; i < this.faultList.length; i++) {
if (faultIds == this.faultList[i].faultId) {
faultCodes = this.faultList[i].faultCode;
@ -478,19 +624,27 @@ export default {
}
}
this.$modal.confirm('是否确认删除故障类型维护编号为"' + faultCodes + '"的数据项?').then(function() {
this.$modal
.confirm('是否确认删除故障类型维护编号为"' + faultCodes + '"的数据项?')
.then(function () {
return delFaultType(faultIds);
}).then(() => {
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('device/faultType/export', {
...this.queryParams
}, `faultType_${new Date().getTime()}.xlsx`)
}
}
this.download(
"device/faultType/export",
{
...this.queryParams,
},
`faultType_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

@ -257,7 +257,6 @@ export default {
});
},
/** 查询分类下拉树结构 */
getEquipmentType() {
getEquipmentTypeList().then((response) => {
@ -291,7 +290,7 @@ export default {
this.queryParams.equipmentTypeCode = null;
this.resetForm("queryForm");
this.queryParams.pageNum = 1;
this.getList()
this.getList();
},
//

@ -207,6 +207,7 @@
align="center"
prop="orderDesc"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="故障时间"
@ -218,7 +219,10 @@
<span>{{ parseTime(scope.row.orderBreakdownTime) }}</span>
</template>
</el-table-column>
<el-table-column label="报修来源" align="center" prop="orderSource" />
<el-table-column
label="报修来源"
align="center"
prop="orderSource" />
<el-table-column
label="报修时间"
align="center"
@ -240,6 +244,7 @@
align="center"
prop="orderRepairmanName"
width="150"
:show-overflow-tooltip="true"
/>
<el-table-column
label="联系方式"
@ -247,14 +252,22 @@
prop="orderConnection"
width="120"
/>
<el-table-column label="处理状态" align="center" prop="orderStatus" />
<el-table-column
label="处理状态"
align="center"
prop="orderStatus" />
<el-table-column
label="报修去向"
align="center"
prop="repairDestination"
width="120"
/>
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column
label="创建人"
align="center"
prop="createBy"
:show-overflow-tooltip="true"
/>
<el-table-column
label="创建时间"
align="center"
@ -362,7 +375,12 @@
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="检查项信息" v-if="checkList != null">
<el-table :data="checkList" border style="width: 100%" :span-method="objectSpanMethod">
<el-table
:data="checkList"
border
style="width: 100%"
:span-method="objectSpanMethod"
>
<el-table-column prop="itemTypeName" label="检查类型" width="100">
</el-table-column>
<el-table-column prop="itemName" label="检查项名称" width="160">
@ -705,7 +723,12 @@
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="检查项信息" v-if="checkList != null">
<el-table :data="checkList" border style="width: 100%" :span-method="objectSpanMethod">
<el-table
:data="checkList"
border
style="width: 100%"
:span-method="objectSpanMethod"
>
<el-table-column prop="itemTypeName" label="检查类型" width="100">
</el-table-column>
<el-table-column prop="itemName" label="检查项名称" width="160">
@ -1045,16 +1068,23 @@
:contentStyle="CS"
:label-style="LSP"
>
<div class="view_picture_body">
<el-image
v-for="(item, index) in urlLists"
:key="index"
:src="item"
></el-image
></el-descriptions-item>
></el-image>
</div>
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="检查项信息" v-if="checkList != null">
<el-table :data="checkList" border style="width: 100%" :span-method="objectSpanMethod">
<el-table
:data="checkList"
border
style="width: 100%"
:span-method="objectSpanMethod"
>
<el-table-column prop="itemTypeName" label="检查类型" width="100">
</el-table-column>
<el-table-column prop="itemName" label="检查项名称" width="160">
@ -1330,8 +1360,6 @@ export default {
second
);
}
console.log(time);
console.log(nowDate(time));
this.form.workPlanTime = nowDate(time);
},
/** 查询维修措施列表 */
@ -1531,7 +1559,6 @@ export default {
});
this.checkList = standards;
console.log(this.checkList);
}
this.openView = true;
@ -1543,7 +1570,6 @@ export default {
this.reset();
const orderId = row.orderId || this.ids;
getMaintenanceTeamList(this.queryParams).then((response) => {
console.log(response.rows);
this.teamOption = response.rows;
});
getFaultReport(orderId).then((response) => {
@ -1609,7 +1635,6 @@ export default {
});
this.checkList = standards;
console.log(this.checkList);
}
if (
@ -1655,7 +1680,6 @@ export default {
if (Array.isArray(this.form.fileList)) {
this.form.fileList = this.listToString(this.form.fileList);
}
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.orderId != null) {
@ -1757,7 +1781,6 @@ export default {
}
}
},
},
};
</script>
@ -1767,4 +1790,9 @@ export default {
height: 400px;
overflow-y: auto;
}
.view_picture_body {
height: 300px;
overflow-y: auto;
}
</style>

Loading…
Cancel
Save