|
|
@@ -31,10 +31,13 @@
|
|
|
<!-- 巡点检、保养设备 -->
|
|
|
<div class="maintain_equipment_info">
|
|
|
<HeaderTitle title="运行设备" size="16px"></HeaderTitle>
|
|
|
+ <div style="text-align: right; margin-bottom: 15px">
|
|
|
+ <el-button type="primary" @click="allSet">批量设置</el-button></div
|
|
|
+ >
|
|
|
<div class="maintain_equipment_info_content">
|
|
|
<div
|
|
|
class="equipment_item"
|
|
|
- v-for="item in infoData.planDeviceList"
|
|
|
+ v-for="(item, index) in infoData.planDeviceList"
|
|
|
:key="item.id"
|
|
|
>
|
|
|
<div class="equipment_info" v-if="item.substance">
|
|
|
@@ -69,7 +72,14 @@
|
|
|
</div>
|
|
|
<p>操作事项</p>
|
|
|
<div class="ruleMatters_box">
|
|
|
- <el-table :data="item.workItems" border>
|
|
|
+ <el-table
|
|
|
+ row-key="id"
|
|
|
+ :data="item.workItems"
|
|
|
+ border
|
|
|
+ :ref="'table' + index"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="55" align="center">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="序号" width="50">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.$index + 1 }}</span>
|
|
|
@@ -129,6 +139,7 @@
|
|
|
<el-select
|
|
|
v-model="scope.row.status"
|
|
|
placeholder="请选择"
|
|
|
+ @change="handleStatusChange(scope.row)"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
|
@@ -160,6 +171,26 @@
|
|
|
<el-button @click="cancel">返回</el-button>
|
|
|
<el-button type="primary" @click="submit">提交</el-button>
|
|
|
</div>
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="allVisible"
|
|
|
+ title="批量设置"
|
|
|
+ width="500px"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <el-select v-model="allData.status" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ :key="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <div slot="footer" class="footer">
|
|
|
+ <el-button @click="allVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="allSave">确认</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
@@ -174,18 +205,16 @@
|
|
|
data() {
|
|
|
return {
|
|
|
fullscreen: false,
|
|
|
+ allVisible: false,
|
|
|
time: [],
|
|
|
+ allData: { status: '' },
|
|
|
options: [
|
|
|
- {
|
|
|
- label: '未定义',
|
|
|
- value: 0
|
|
|
- },
|
|
|
{
|
|
|
label: '正常',
|
|
|
value: 1
|
|
|
},
|
|
|
{
|
|
|
- label: '缺陷',
|
|
|
+ label: '异常',
|
|
|
value: -1
|
|
|
}
|
|
|
],
|
|
|
@@ -194,6 +223,47 @@
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ allSet() {
|
|
|
+ this.multipleSelection = [];
|
|
|
+ this.infoData.planDeviceList.forEach((item, index) => {
|
|
|
+ this.multipleSelection = [
|
|
|
+ ...this.multipleSelection,
|
|
|
+ ...this.$refs['table' + index][0].selection
|
|
|
+ ];
|
|
|
+ });
|
|
|
+ if (!this.multipleSelection.length) {
|
|
|
+ this.$message.error('请选择至少一条记录');
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.allVisible = true;
|
|
|
+ },
|
|
|
+ allSave() {
|
|
|
+ this.allVisible = false;
|
|
|
+ this.multipleSelection.forEach((item, index) => {
|
|
|
+ this.$set(
|
|
|
+ this.multipleSelection[index],
|
|
|
+ 'status',
|
|
|
+ this.allData.status
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.multipleSelection[index],
|
|
|
+ 'result',
|
|
|
+ this.allData.status == '-1'
|
|
|
+ ? '异常'
|
|
|
+ : this.allData.status == '1'
|
|
|
+ ? '正常'
|
|
|
+ : ''
|
|
|
+ );
|
|
|
+ });
|
|
|
+ this.infoData.planDeviceList.forEach((item, index) => {
|
|
|
+ this.$refs['table' + index][0].clearSelection();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleStatusChange(row) {
|
|
|
+ row.result =
|
|
|
+ row.status == '-1' ? '异常' : row.status == '1' ? '正常' : '';
|
|
|
+ },
|
|
|
open(row) {
|
|
|
console.log(row);
|
|
|
this.getInfo(row);
|
|
|
@@ -230,7 +300,13 @@
|
|
|
// 表格数据
|
|
|
async getInfo(row) {
|
|
|
let res = await getById(row.planId);
|
|
|
- console.log(row);
|
|
|
+ res.data.planDeviceList.forEach((item, index) => {
|
|
|
+ item.workItems.forEach((item1, index1) => {
|
|
|
+ item1.status = 1;
|
|
|
+ item1.result = '正常';
|
|
|
+ item1.normal = '正常';
|
|
|
+ });
|
|
|
+ });
|
|
|
this.infoData = res.data;
|
|
|
this.infoData.workOrderId = row.id;
|
|
|
}
|