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

master
A0010407 1 year ago
parent e5b8733b22
commit 6548a2d8bc

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

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

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

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

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

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

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

Loading…
Cancel
Save