设备页面优化+展示检查工具

yangwl
A0010407 10 months ago
parent 475b431018
commit 42a1c947c9

@ -312,7 +312,7 @@
<el-dialog <el-dialog
:title="title" :title="title"
:visible.sync="openCheck" :visible.sync="openCheck"
width="1100px" width="1200px"
append-to-body append-to-body
v-if="openCheck" v-if="openCheck"
> >
@ -362,7 +362,9 @@
</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%"> <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"> <el-table-column prop="itemName" label="检查项名称" width="160">
</el-table-column> </el-table-column>
<el-table-column prop="itemMethod" label="方法" width="100"> <el-table-column prop="itemMethod" label="方法" width="100">
@ -393,7 +395,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="detailUnit" label="单位" width="45"> <el-table-column prop="detailUnit" label="单位" width="45">
</el-table-column> </el-table-column>
<el-table-column prop="picturePath" label="图片" w` idth="60"> <el-table-column prop="picturePath" label="图片" width="60">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" width="300" trigger="hover"> <el-popover placement="right" width="300" trigger="hover">
<div class="standardUrl_body"> <div class="standardUrl_body">
@ -637,12 +639,12 @@
<el-dialog <el-dialog
:title="title" :title="title"
:visible.sync="viewCheck" :visible.sync="viewCheck"
width="1100px" width="1200px"
append-to-body append-to-body
v-if="viewCheck" v-if="viewCheck"
> >
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-tabs type="border-card" :key="new Date().getTime()"> <el-tabs type="border-card">
<el-tab-pane label="基本信息"> <el-tab-pane label="基本信息">
<el-descriptions <el-descriptions
:column="3" :column="3"
@ -703,7 +705,9 @@
</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%"> <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"> <el-table-column prop="itemName" label="检查项名称" width="160">
</el-table-column> </el-table-column>
<el-table-column prop="itemMethod" label="方法" width="100"> <el-table-column prop="itemMethod" label="方法" width="100">
@ -990,7 +994,7 @@
<el-dialog <el-dialog
:title="title" :title="title"
:visible.sync="openView" :visible.sync="openView"
width="1100px" width="1200px"
append-to-body append-to-body
v-if="openView" v-if="openView"
> >
@ -1040,7 +1044,9 @@
</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%"> <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"> <el-table-column prop="itemName" label="检查项名称" width="160">
</el-table-column> </el-table-column>
<el-table-column prop="itemMethod" label="方法" width="100"> <el-table-column prop="itemMethod" label="方法" width="100">
@ -1471,6 +1477,7 @@ export default {
if (item1 != null) { if (item1 != null) {
item1.standardList.forEach((item) => { item1.standardList.forEach((item) => {
var standard = {}; var standard = {};
standard.itemTypeName = item1.itemTypeName;
standard.itemName = item1.itemName; standard.itemName = item1.itemName;
standard.itemMethod = item1.itemMethod; standard.itemMethod = item1.itemMethod;
standard.itemTools = item1.itemTools; standard.itemTools = item1.itemTools;
@ -1490,7 +1497,7 @@ export default {
standardUrlLists.push(item2.fileAddress); standardUrlLists.push(item2.fileAddress);
}); });
standard.standardUrlLists = standardUrlLists; standard.standardUrlLists = standardUrlLists;
}else{ } else {
standard.standardUrlLists = null; standard.standardUrlLists = null;
} }
standards.push(standard); standards.push(standard);
@ -1548,6 +1555,7 @@ export default {
if (item1 != null) { if (item1 != null) {
item1.standardList.forEach((item) => { item1.standardList.forEach((item) => {
var standard = {}; var standard = {};
standard.itemTypeName = item1.itemTypeName;
standard.itemName = item1.itemName; standard.itemName = item1.itemName;
standard.itemMethod = item1.itemMethod; standard.itemMethod = item1.itemMethod;
standard.itemTools = item1.itemTools; standard.itemTools = item1.itemTools;
@ -1567,7 +1575,7 @@ export default {
standardUrlLists.push(item2.fileAddress); standardUrlLists.push(item2.fileAddress);
}); });
standard.standardUrlLists = standardUrlLists; standard.standardUrlLists = standardUrlLists;
}else{ } else {
standard.standardUrlLists = null; standard.standardUrlLists = null;
} }
standards.push(standard); standards.push(standard);
@ -1668,6 +1676,59 @@ export default {
`faultReport_${new Date().getTime()}.xlsx` `faultReport_${new Date().getTime()}.xlsx`
); );
}, },
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
//
const currentValue = row[column.property];
//
const preRow = this.checkList[rowIndex - 1];
const preValue = preRow ? preRow[column.property] : null;
//
if (currentValue === preValue) {
return { rowspan: 0, colspan: 0 };
} else {
//
let rowspan = 1;
for (let i = rowIndex + 1; i < this.checkList.length; i++) {
const nextRow = this.checkList[i];
const nextValue = nextRow[column.property];
if (nextValue === currentValue) {
rowspan++;
} else {
break;
}
}
return { rowspan, colspan: 1 };
}
}
if (columnIndex === 1) {
//
const currentValue = row[column.property];
//
const preRow = this.checkList[rowIndex - 1];
const preValue = preRow ? preRow[column.property] : null;
//
if (currentValue === preValue) {
return { rowspan: 0, colspan: 0 };
} else {
//
let rowspan = 1;
for (let i = rowIndex + 1; i < this.checkList.length; i++) {
const nextRow = this.checkList[i];
const nextValue = nextRow[column.property];
if (nextValue === currentValue) {
rowspan++;
} else {
break;
}
}
return { rowspan, colspan: 1 };
}
}
},
}, },
}; };
</script> </script>

@ -794,7 +794,7 @@
<el-dialog <el-dialog
:title="title" :title="title"
:visible.sync="openWrite" :visible.sync="openWrite"
width="1100px" width="1200px"
append-to-body append-to-body
v-if="openWrite" v-if="openWrite"
> >
@ -883,10 +883,14 @@
</el-descriptions> </el-descriptions>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="检查项信息"> <el-tab-pane label="检查项信息">
<el-table :data="detailList" border :contentStyle="CS" :label-style="LS"> <el-table :data="detailList" border :contentStyle="CS" :label-style="LS" :span-method="objectSpanMethod">
<el-table-column prop="itemTypeName" label="检查类型" width="100">
</el-table-column>
<el-table-column prop="itemName" label="检查项名称" width="150"> <el-table-column prop="itemName" label="检查项名称" width="150">
</el-table-column> </el-table-column>
<el-table-column prop="itemMethod" label="检查项方法" width="150"> <el-table-column prop="itemMethod" label="方法" width="150">
</el-table-column>
<el-table-column prop="itemTools" label="工具" width="50">
</el-table-column> </el-table-column>
<el-table-column prop="standardName" label="标准名称" width="150"> <el-table-column prop="standardName" label="标准名称" width="150">
</el-table-column> </el-table-column>
@ -905,7 +909,7 @@
width="110" width="110"
> >
<template scope="scope"> <template scope="scope">
<el-radio-group v-model="scope.row.repairReach"> <el-radio-group v-model="scope.row.repairReach" v-if="scope.row.standardType != 'quantify'">
<el-radio label="1">达标</el-radio> <el-radio label="1">达标</el-radio>
<el-radio label="0">不达标</el-radio> <el-radio label="0">不达标</el-radio>
</el-radio-group> </el-radio-group>
@ -934,10 +938,9 @@
</el-table-column> </el-table-column>
<el-table-column prop="detailDownLimit" label="下限" width="50"> <el-table-column prop="detailDownLimit" label="下限" width="50">
</el-table-column> </el-table-column>
<el-table-column prop="detailUnit" label="单位" width="50"> <el-table-column prop="detailUnit" label="单位" width="40">
</el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="picturePath" label="图片"> <el-table-column prop="picturePath" label="图片" width="60">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" width="300" trigger="hover"> <el-popover placement="right" width="300" trigger="hover">
<div class="standardUrl_body"> <div class="standardUrl_body">
@ -1124,14 +1127,14 @@ export default {
}, },
WLS: { WLS: {
"text-align": "center", "text-align": "center",
width: "200px", width: "225px",
}, },
CS: { CS: {
"text-align": "center", "text-align": "center",
}, },
LS: { LS: {
"text-align": "center", "text-align": "center",
width: "200px", width: "225px",
}, },
// //
LSP: { LSP: {
@ -1493,20 +1496,24 @@ export default {
this.detailList.forEach((item1) => { this.detailList.forEach((item1) => {
// //
if (item1 != null) { if (item1 != null) {
item1.standardList.forEach((item) => { item1.standardList.forEach((item) => {
var standard = {}; var standard = {};
standard.itemName = item1.itemName; standard.itemTypeName = item1.itemTypeName;
standard.itemMethod = item1.itemMethod; standard.itemName = item1.itemName;
standard.standardName = item.standardName; standard.itemMethod = item1.itemMethod;
standard.detailUpLimit = item.detailUpLimit; standard.itemTools = item1.itemTools;
standard.detailDownLimit = item.detailDownLimit; standard.planLoop = item1.planLoop;
standard.detailUnit = item.detailUnit; standard.planLoopType = item1.planLoopType;
standard.detailReach = item.detailReach; standard.standardName = item.standardName;
standard.actualValue = item.actualValue; standard.detailUpLimit = item.detailUpLimit;
// standard.detailDownLimit = item.detailDownLimit;
standard.repairValue = item.repairValue; standard.detailUnit = item.detailUnit;
standard.repairReach = item.repairReach; standard.detailReach = item.detailReach;
standard.standardType = item.standardType; standard.actualValue = item.actualValue;
//
standard.repairValue = item.repairValue;
standard.repairReach = item.repairReach;
standard.standardType = item.standardType;
// //
var standardUrlLists = []; var standardUrlLists = [];
if (item.picturePaths != null) { if (item.picturePaths != null) {
@ -1514,8 +1521,10 @@ export default {
standardUrlLists.push(item2.fileAddress); standardUrlLists.push(item2.fileAddress);
}); });
standard.standardUrlLists = standardUrlLists; standard.standardUrlLists = standardUrlLists;
standards.push(standard); } else {
standard.standardUrlLists = null;
} }
standards.push(standard);
}); });
} }
}); });
@ -1646,6 +1655,58 @@ export default {
` repairOrder_${new Date().getTime()}.xlsx` ` repairOrder_${new Date().getTime()}.xlsx`
); );
}, },
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
//
const currentValue = row[column.property];
//
const preRow = this.detailList[rowIndex - 1];
const preValue = preRow ? preRow[column.property] : null;
//
if (currentValue === preValue) {
return { rowspan: 0, colspan: 0 };
} else {
//
let rowspan = 1;
for (let i = rowIndex + 1; i < this.detailList.length; i++) {
const nextRow = this.detailList[i];
const nextValue = nextRow[column.property];
if (nextValue === currentValue) {
rowspan++;
} else {
break;
}
}
return { rowspan, colspan: 1 };
}
}
if (columnIndex === 1) {
//
const currentValue = row[column.property];
//
const preRow = this.detailList[rowIndex - 1];
const preValue = preRow ? preRow[column.property] : null;
//
if (currentValue === preValue) {
return { rowspan: 0, colspan: 0 };
} else {
//
let rowspan = 1;
for (let i = rowIndex + 1; i < this.detailList.length; i++) {
const nextRow = this.detailList[i];
const nextValue = nextRow[column.property];
if (nextValue === currentValue) {
rowspan++;
} else {
break;
}
}
return { rowspan, colspan: 1 };
}
}
},
}, },
}; };
</script> </script>

@ -342,13 +342,18 @@
<el-dialog <el-dialog
:title="title" :title="title"
:visible.sync="openView" :visible.sync="openView"
width="1100px" width="1200px"
append-to-body append-to-body
> >
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-tabs type="border-card"> <el-tabs type="border-card">
<el-tab-pane label="报修基本信息"> <el-tab-pane label="报修基本信息">
<el-descriptions :column="3" border :contentStyle="CS" :label-style="LS"> <el-descriptions
:column="3"
border
:contentStyle="CS"
:label-style="LS"
>
<el-descriptions-item label="报修单编号">{{ <el-descriptions-item label="报修单编号">{{
form.orderCode form.orderCode
}}</el-descriptions-item> }}</el-descriptions-item>
@ -390,7 +395,11 @@
}}</el-descriptions-item> }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions :column="1" border> <el-descriptions :column="1" border>
<el-descriptions-item label="维修前故障图片" :contentStyle="CS" :label-style="LS"> <el-descriptions-item
label="维修前故障图片"
:contentStyle="CS"
:label-style="LS"
>
<el-image <el-image
v-for="(item, index) in urlBeforeLists" v-for="(item, index) in urlBeforeLists"
:key="index" :key="index"
@ -401,7 +410,12 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="维修基本信息"> <el-tab-pane label="维修基本信息">
<el-descriptions :column="2" border :contentStyle="CS" :label-style="LS"> <el-descriptions
:column="2"
border
:contentStyle="CS"
:label-style="LS"
>
<el-descriptions-item label="维修工单号">{{ <el-descriptions-item label="维修工单号">{{
form.workCode form.workCode
}}</el-descriptions-item> }}</el-descriptions-item>
@ -465,7 +479,12 @@
form.workReason form.workReason
}}</el-descriptions-item> }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions :column="1" border :contentStyle="CS" :label-style="LS"> <el-descriptions
:column="1"
border
:contentStyle="CS"
:label-style="LS"
>
<el-descriptions-item label="维修后图片"> <el-descriptions-item label="维修后图片">
<el-image <el-image
v-for="(item, index) in urlAfterLists" v-for="(item, index) in urlAfterLists"
@ -477,10 +496,14 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="检查项信息"> <el-tab-pane label="检查项信息">
<el-table :data="detailList" border > <el-table :data="detailList" border :span-method="objectSpanMethod">
<el-table-column prop="itemTypeName" label="检查类型" width="100">
</el-table-column>
<el-table-column prop="itemName" label="检查项名称" width="150"> <el-table-column prop="itemName" label="检查项名称" width="150">
</el-table-column> </el-table-column>
<el-table-column prop="itemMethod" label="检查项方法" width="150"> <el-table-column prop="itemMethod" label="方法" width="150">
</el-table-column>
<el-table-column prop="itemTools" label="工具" width="50">
</el-table-column> </el-table-column>
<el-table-column prop="standardName" label="标准名称" width="150"> <el-table-column prop="standardName" label="标准名称" width="150">
</el-table-column> </el-table-column>
@ -499,7 +522,10 @@
width="110" width="110"
> >
<template scope="scope"> <template scope="scope">
<el-radio-group v-model="scope.row.repairReach"> <el-radio-group
v-model="scope.row.repairReach"
v-if="scope.row.standardType != 'quantify'"
>
<el-radio label="1">达标</el-radio> <el-radio label="1">达标</el-radio>
<el-radio label="0">不达标</el-radio> <el-radio label="0">不达标</el-radio>
</el-radio-group> </el-radio-group>
@ -528,10 +554,9 @@
</el-table-column> </el-table-column>
<el-table-column prop="detailDownLimit" label="下限" width="50"> <el-table-column prop="detailDownLimit" label="下限" width="50">
</el-table-column> </el-table-column>
<el-table-column prop="detailUnit" label="单位" width="50"> <el-table-column prop="detailUnit" label="单位" width="40">
</el-table-column> </el-table-column>
</el-table-column> <el-table-column prop="picturePath" label="图片" width="60">
<el-table-column prop="picturePath" label="图片">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" width="300" trigger="hover"> <el-popover placement="right" width="300" trigger="hover">
<div class="standardUrl_body"> <div class="standardUrl_body">
@ -551,7 +576,7 @@
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-form> </el-form>
@ -582,6 +607,7 @@ export default {
// //
CS: { CS: {
"text-align": "center", "text-align": "center",
width: "200px",
}, },
LS: { LS: {
"text-align": "center", "text-align": "center",
@ -616,7 +642,7 @@ export default {
openView: false, openView: false,
// //
queryParams: { queryParams: {
workStatus:"1", workStatus: "1",
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
orderId: null, orderId: null,
@ -831,20 +857,24 @@ export default {
this.detailList.forEach((item1) => { this.detailList.forEach((item1) => {
// //
if (item1 != null) { if (item1 != null) {
item1.standardList.forEach((item) => { item1.standardList.forEach((item) => {
var standard = {}; var standard = {};
standard.itemName = item1.itemName; standard.itemTypeName = item1.itemTypeName;
standard.itemMethod = item1.itemMethod; standard.itemName = item1.itemName;
standard.standardName = item.standardName; standard.itemMethod = item1.itemMethod;
standard.detailUpLimit = item.detailUpLimit; standard.itemTools = item1.itemTools;
standard.detailDownLimit = item.detailDownLimit; standard.planLoop = item1.planLoop;
standard.detailUnit = item.detailUnit; standard.planLoopType = item1.planLoopType;
standard.detailReach = item.detailReach; standard.standardName = item.standardName;
standard.actualValue = item.actualValue; standard.detailUpLimit = item.detailUpLimit;
// standard.detailDownLimit = item.detailDownLimit;
standard.repairValue = item.repairValue; standard.detailUnit = item.detailUnit;
standard.repairReach = item.repairReach; standard.detailReach = item.detailReach;
standard.standardType = item.standardType; standard.actualValue = item.actualValue;
//
standard.repairValue = item.repairValue;
standard.repairReach = item.repairReach;
standard.standardType = item.standardType;
// //
var standardUrlLists = []; var standardUrlLists = [];
if (item.picturePaths != null) { if (item.picturePaths != null) {
@ -852,8 +882,10 @@ export default {
standardUrlLists.push(item2.fileAddress); standardUrlLists.push(item2.fileAddress);
}); });
standard.standardUrlLists = standardUrlLists; standard.standardUrlLists = standardUrlLists;
standards.push(standard); } else {
standard.standardUrlLists = null;
} }
standards.push(standard);
}); });
} }
}); });
@ -879,6 +911,58 @@ export default {
` repairOrder_${new Date().getTime()}.xlsx` ` repairOrder_${new Date().getTime()}.xlsx`
); );
}, },
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
//
const currentValue = row[column.property];
//
const preRow = this.detailList[rowIndex - 1];
const preValue = preRow ? preRow[column.property] : null;
//
if (currentValue === preValue) {
return { rowspan: 0, colspan: 0 };
} else {
//
let rowspan = 1;
for (let i = rowIndex + 1; i < this.detailList.length; i++) {
const nextRow = this.detailList[i];
const nextValue = nextRow[column.property];
if (nextValue === currentValue) {
rowspan++;
} else {
break;
}
}
return { rowspan, colspan: 1 };
}
}
if (columnIndex === 1) {
//
const currentValue = row[column.property];
//
const preRow = this.detailList[rowIndex - 1];
const preValue = preRow ? preRow[column.property] : null;
//
if (currentValue === preValue) {
return { rowspan: 0, colspan: 0 };
} else {
//
let rowspan = 1;
for (let i = rowIndex + 1; i < this.detailList.length; i++) {
const nextRow = this.detailList[i];
const nextValue = nextRow[column.property];
if (nextValue === currentValue) {
rowspan++;
} else {
break;
}
}
return { rowspan, colspan: 1 };
}
}
},
}, },
}; };
</script> </script>

Loading…
Cancel
Save