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

yangwl
A0010407 10 months ago
parent 475b431018
commit 42a1c947c9

@ -312,7 +312,7 @@
<el-dialog
:title="title"
:visible.sync="openCheck"
width="1100px"
width="1200px"
append-to-body
v-if="openCheck"
>
@ -362,7 +362,9 @@
</el-descriptions>
</el-tab-pane>
<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>
<el-table-column prop="itemMethod" label="方法" width="100">
@ -393,7 +395,7 @@
</el-table-column>
<el-table-column prop="detailUnit" label="单位" width="45">
</el-table-column>
<el-table-column prop="picturePath" label="图片" w` idth="60">
<el-table-column prop="picturePath" label="图片" width="60">
<template slot-scope="scope">
<el-popover placement="right" width="300" trigger="hover">
<div class="standardUrl_body">
@ -637,12 +639,12 @@
<el-dialog
:title="title"
:visible.sync="viewCheck"
width="1100px"
width="1200px"
append-to-body
v-if="viewCheck"
>
<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-descriptions
:column="3"
@ -703,7 +705,9 @@
</el-descriptions>
</el-tab-pane>
<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>
<el-table-column prop="itemMethod" label="方法" width="100">
@ -990,7 +994,7 @@
<el-dialog
:title="title"
:visible.sync="openView"
width="1100px"
width="1200px"
append-to-body
v-if="openView"
>
@ -1040,7 +1044,9 @@
</el-descriptions>
</el-tab-pane>
<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>
<el-table-column prop="itemMethod" label="方法" width="100">
@ -1471,6 +1477,7 @@ export default {
if (item1 != null) {
item1.standardList.forEach((item) => {
var standard = {};
standard.itemTypeName = item1.itemTypeName;
standard.itemName = item1.itemName;
standard.itemMethod = item1.itemMethod;
standard.itemTools = item1.itemTools;
@ -1548,6 +1555,7 @@ export default {
if (item1 != null) {
item1.standardList.forEach((item) => {
var standard = {};
standard.itemTypeName = item1.itemTypeName;
standard.itemName = item1.itemName;
standard.itemMethod = item1.itemMethod;
standard.itemTools = item1.itemTools;
@ -1668,6 +1676,59 @@ export default {
`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>

@ -794,7 +794,7 @@
<el-dialog
:title="title"
:visible.sync="openWrite"
width="1100px"
width="1200px"
append-to-body
v-if="openWrite"
>
@ -883,10 +883,14 @@
</el-descriptions>
</el-tab-pane>
<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>
<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 prop="standardName" label="标准名称" width="150">
</el-table-column>
@ -905,7 +909,7 @@
width="110"
>
<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="0">不达标</el-radio>
</el-radio-group>
@ -934,10 +938,9 @@
</el-table-column>
<el-table-column prop="detailDownLimit" label="下限" width="50">
</el-table-column>
<el-table-column prop="detailUnit" label="单位" width="50">
</el-table-column>
<el-table-column prop="detailUnit" label="单位" width="40">
</el-table-column>
<el-table-column prop="picturePath" label="图片">
<el-table-column prop="picturePath" label="图片" width="60">
<template slot-scope="scope">
<el-popover placement="right" width="300" trigger="hover">
<div class="standardUrl_body">
@ -1124,14 +1127,14 @@ export default {
},
WLS: {
"text-align": "center",
width: "200px",
width: "225px",
},
CS: {
"text-align": "center",
},
LS: {
"text-align": "center",
width: "200px",
width: "225px",
},
//
LSP: {
@ -1495,8 +1498,12 @@ export default {
if (item1 != null) {
item1.standardList.forEach((item) => {
var standard = {};
standard.itemTypeName = item1.itemTypeName;
standard.itemName = item1.itemName;
standard.itemMethod = item1.itemMethod;
standard.itemTools = item1.itemTools;
standard.planLoop = item1.planLoop;
standard.planLoopType = item1.planLoopType;
standard.standardName = item.standardName;
standard.detailUpLimit = item.detailUpLimit;
standard.detailDownLimit = item.detailDownLimit;
@ -1514,8 +1521,10 @@ export default {
standardUrlLists.push(item2.fileAddress);
});
standard.standardUrlLists = standardUrlLists;
standards.push(standard);
} else {
standard.standardUrlLists = null;
}
standards.push(standard);
});
}
});
@ -1646,6 +1655,58 @@ export default {
` 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>

@ -342,13 +342,18 @@
<el-dialog
:title="title"
:visible.sync="openView"
width="1100px"
width="1200px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-tabs type="border-card">
<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="报修单编号">{{
form.orderCode
}}</el-descriptions-item>
@ -390,7 +395,11 @@
}}</el-descriptions-item>
</el-descriptions>
<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
v-for="(item, index) in urlBeforeLists"
:key="index"
@ -401,7 +410,12 @@
</el-tab-pane>
<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="维修工单号">{{
form.workCode
}}</el-descriptions-item>
@ -465,7 +479,12 @@
form.workReason
}}</el-descriptions-item>
</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-image
v-for="(item, index) in urlAfterLists"
@ -477,10 +496,14 @@
</el-tab-pane>
<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>
<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 prop="standardName" label="标准名称" width="150">
</el-table-column>
@ -499,7 +522,10 @@
width="110"
>
<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="0">不达标</el-radio>
</el-radio-group>
@ -528,10 +554,9 @@
</el-table-column>
<el-table-column prop="detailDownLimit" label="下限" width="50">
</el-table-column>
<el-table-column prop="detailUnit" label="单位" width="50">
</el-table-column>
<el-table-column prop="detailUnit" label="单位" width="40">
</el-table-column>
<el-table-column prop="picturePath" label="图片">
<el-table-column prop="picturePath" label="图片" width="60">
<template slot-scope="scope">
<el-popover placement="right" width="300" trigger="hover">
<div class="standardUrl_body">
@ -582,6 +607,7 @@ export default {
//
CS: {
"text-align": "center",
width: "200px",
},
LS: {
"text-align": "center",
@ -833,8 +859,12 @@ export default {
if (item1 != null) {
item1.standardList.forEach((item) => {
var standard = {};
standard.itemTypeName = item1.itemTypeName;
standard.itemName = item1.itemName;
standard.itemMethod = item1.itemMethod;
standard.itemTools = item1.itemTools;
standard.planLoop = item1.planLoop;
standard.planLoopType = item1.planLoopType;
standard.standardName = item.standardName;
standard.detailUpLimit = item.detailUpLimit;
standard.detailDownLimit = item.detailDownLimit;
@ -852,8 +882,10 @@ export default {
standardUrlLists.push(item2.fileAddress);
});
standard.standardUrlLists = standardUrlLists;
standards.push(standard);
} else {
standard.standardUrlLists = null;
}
standards.push(standard);
});
}
});
@ -879,6 +911,58 @@ export default {
` 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>

Loading…
Cancel
Save