|
|
|
@ -325,17 +325,18 @@
|
|
|
|
|
<el-steps :active="inspectionPlanStep" finish-status="success" align-center>
|
|
|
|
|
<el-step title="巡检计划基本信息"></el-step>
|
|
|
|
|
<el-step title="选择设备、巡检项目"></el-step>
|
|
|
|
|
<el-step title="巡检人员"></el-step>
|
|
|
|
|
</el-steps>
|
|
|
|
|
<!-- 巡检计划基本信息 -->
|
|
|
|
|
<div class="my-step-body" v-if="this.inspectionPlanStep==0">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="计划名称" prop="faultCode">
|
|
|
|
|
<el-form-item label="计划名称">
|
|
|
|
|
<el-input v-model="form.planName" placeholder="请输入计划名称"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span=12 :offset="1">
|
|
|
|
|
<el-form-item label-width="100px" label="巡检执行时间" prop="faultCode">
|
|
|
|
|
<el-form-item label-width="100px" label="巡检执行时间">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="form.planTimeArray"
|
|
|
|
|
type="datetimerange"
|
|
|
|
@ -348,8 +349,8 @@
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<el-form-item label="循环周期" prop="faultCode">
|
|
|
|
|
<el-input v-model="form.planName" placeholder="请输入循环周期"/>
|
|
|
|
|
<el-form-item label="循环周期">
|
|
|
|
|
<el-input v-model="form.planLoop" placeholder="请输入循环周期"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="2">
|
|
|
|
@ -363,7 +364,7 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="6" :offset="1">
|
|
|
|
|
<el-form-item label-width="100px" label="计划状态" prop="faultCode">
|
|
|
|
|
<el-form-item label-width="100px" label="计划状态">
|
|
|
|
|
<el-select v-model="form.planStatus" placeholder="计划状态" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.sys_normal_disable"
|
|
|
|
@ -375,9 +376,9 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-row v-if="false">
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="巡检人员" prop="faultCode">
|
|
|
|
|
<el-form-item label="巡检人员">
|
|
|
|
|
<el-select v-model="form.planPerson" placeholder="请选择巡检人员" clearable>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -392,7 +393,7 @@
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="selectEqu = true">
|
|
|
|
|
@click="selectEquBtn">
|
|
|
|
|
选择设备
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
@ -413,7 +414,7 @@
|
|
|
|
|
width="180">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="InspectionItem"
|
|
|
|
|
prop="itemTempName"
|
|
|
|
|
label="巡检项"
|
|
|
|
|
width="300">
|
|
|
|
|
</el-table-column>
|
|
|
|
@ -422,8 +423,8 @@
|
|
|
|
|
label="操作"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button @click="editorItem = true" type="text" size="small">编辑</el-button>
|
|
|
|
|
<el-button type="text" size="small">删除</el-button>
|
|
|
|
|
<el-button @click="editorTheItem(scope.row)" type="text" size="small">编辑</el-button>
|
|
|
|
|
<el-button @click="delTheEquItem(scope.row)" type="text" size="small">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -434,10 +435,37 @@
|
|
|
|
|
width="50%"
|
|
|
|
|
append-to-body
|
|
|
|
|
>
|
|
|
|
|
<span>这是一段信息</span>
|
|
|
|
|
<!-- 编辑检查标准 -->
|
|
|
|
|
<el-table
|
|
|
|
|
:data="itemDetailList"
|
|
|
|
|
v-loading="detailLoading"
|
|
|
|
|
stripe
|
|
|
|
|
@selection-change="selectChangeEqu"
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column width="55" align="center"/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="itemName"
|
|
|
|
|
label="检查项">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="standardName"
|
|
|
|
|
label="检查标准">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="standardTypeName"
|
|
|
|
|
label="标准类型">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
fixed="right"
|
|
|
|
|
label="操作"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button @click="delStandard(scope.row)" type="text" size="small">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="editorItem = false">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="editorItem = false">确 定</el-button>
|
|
|
|
|
<el-button type="primary" @click="standardBtn">确 定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<!-- 选择设备弹窗 -->
|
|
|
|
@ -511,29 +539,56 @@
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 高级设置-弃用 -->
|
|
|
|
|
<!-- 巡检人员 -->
|
|
|
|
|
<div class="my-step-body" v-if="this.inspectionPlanStep==2">
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24" :offset="1">
|
|
|
|
|
<el-transfer
|
|
|
|
|
:titles="['人员','已选择人员']"
|
|
|
|
|
filterable
|
|
|
|
|
:filter-method="filterMethod"
|
|
|
|
|
filter-placeholder="请输入人员名称"
|
|
|
|
|
v-model="selectPersonList"
|
|
|
|
|
:data="personList">
|
|
|
|
|
</el-transfer>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button v-if="this.inspectionPlanStep>0" @click="stepLast">上一步</el-button>
|
|
|
|
|
<el-button v-if="this.inspectionPlanStep<1" @click="stepNext">下一步</el-button>
|
|
|
|
|
<el-button v-if="this.inspectionPlanStep==1" type="primary" @click="submitForm">提 交</el-button>
|
|
|
|
|
<el-button v-if="this.inspectionPlanStep<2" @click="stepNext">下一步</el-button>
|
|
|
|
|
<el-button v-if="this.inspectionPlanStep==2" type="primary" @click="submitForm">提 交</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {listPlan, getPlan, delPlan, addPlan, updatePlan, getEquList, formatEquItem} from "@/api/device/plan";
|
|
|
|
|
import {
|
|
|
|
|
listPlan,
|
|
|
|
|
getPlan,
|
|
|
|
|
delPlan,
|
|
|
|
|
addPlan,
|
|
|
|
|
updatePlan,
|
|
|
|
|
getEquList,
|
|
|
|
|
formatEquItem,
|
|
|
|
|
getPersonList
|
|
|
|
|
} from "@/api/device/plan";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "Plan",
|
|
|
|
|
dicts: ['device_loop_type', 'sys_normal_disable'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 巡检人员选择穿梭框
|
|
|
|
|
personList: [],
|
|
|
|
|
selectPersonList: [],
|
|
|
|
|
// 编辑检查标准list
|
|
|
|
|
itemDetailList:[],
|
|
|
|
|
// 编辑检查标准loading
|
|
|
|
|
detailLoading: false,
|
|
|
|
|
// 选中的设备信息
|
|
|
|
|
selectEquList: [],
|
|
|
|
|
// 设备信息loading
|
|
|
|
@ -639,8 +694,11 @@ export default {
|
|
|
|
|
planName: null,
|
|
|
|
|
planStatus: '0',
|
|
|
|
|
planPerson: null,
|
|
|
|
|
planLoop:null,
|
|
|
|
|
planTimeArray: [],
|
|
|
|
|
equipmentItem: [{equipmentCode: 123, itemList: [{itemCode: 111, itemDetail: [{detailCode: 222}]}]}],
|
|
|
|
|
equipmentItem: [],
|
|
|
|
|
personList: [],
|
|
|
|
|
planType: "inspection",
|
|
|
|
|
},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {}
|
|
|
|
@ -650,6 +708,79 @@ export default {
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 获取设备List-置入穿梭框信息
|
|
|
|
|
setPerson() {
|
|
|
|
|
getPersonList().then(response => {
|
|
|
|
|
for (let i = 0; i < response.data.length; i++) {
|
|
|
|
|
this.personList.push({
|
|
|
|
|
label: response.data[i].nickName + '(' + response.data[i].userName + ')',
|
|
|
|
|
key: response.data[i].userId,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 巡检人员穿梭框
|
|
|
|
|
filterMethod(query, item) {
|
|
|
|
|
return item.label.indexOf(query) > -1;
|
|
|
|
|
},
|
|
|
|
|
// 点击选择设备按钮
|
|
|
|
|
selectEquBtn() {
|
|
|
|
|
|
|
|
|
|
this.selectEqu = true;
|
|
|
|
|
},
|
|
|
|
|
// 编辑标准确认按钮
|
|
|
|
|
standardBtn() {
|
|
|
|
|
console.log("这里是你要确定的数据");
|
|
|
|
|
console.log(this.form.equipmentItem)
|
|
|
|
|
this.editorItem = false;
|
|
|
|
|
},
|
|
|
|
|
// 删除标准
|
|
|
|
|
delStandard(e) {
|
|
|
|
|
e.showFlag = false;
|
|
|
|
|
for (let i = 0; i < this.itemDetailList.length; i++) {
|
|
|
|
|
if (this.itemDetailList[i].detailCode == e.detailCode) {
|
|
|
|
|
this.itemDetailList[i].showFlag = false;
|
|
|
|
|
this.itemDetailList.splice(i,1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 点击编辑设备-巡检项目
|
|
|
|
|
editorTheItem(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
|
|
|
|
|
// 清除缓存
|
|
|
|
|
this.itemDetailList = [];
|
|
|
|
|
|
|
|
|
|
// 处理信息
|
|
|
|
|
for (let i = 0; i < e.equCheckItemList.length; i++) {
|
|
|
|
|
for (let j = 0; j < e.equCheckItemList[i].equCheckItemDetailList.length; j++) {
|
|
|
|
|
// 批量处理
|
|
|
|
|
e.equCheckItemList[i].equCheckItemDetailList[j].itemName = e.equCheckItemList[i].itemName;
|
|
|
|
|
// false不显示
|
|
|
|
|
if (e.equCheckItemList[i].equCheckItemDetailList[j].showFlag == false) {
|
|
|
|
|
e.equCheckItemList[i].equCheckItemDetailList.splice(j,1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 前端信息显示
|
|
|
|
|
if (e.equCheckItemList[i].equCheckItemDetailList[j].standardType == "qualitative") {
|
|
|
|
|
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定性";
|
|
|
|
|
}else {
|
|
|
|
|
e.equCheckItemList[i].equCheckItemDetailList[j].standardTypeName = "定量";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.itemDetailList.push(e.equCheckItemList[i].equCheckItemDetailList[j]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.editorItem = true;
|
|
|
|
|
},
|
|
|
|
|
// 删除设备-巡检项
|
|
|
|
|
delTheEquItem(e) {
|
|
|
|
|
console.log("删除")
|
|
|
|
|
console.log(e)
|
|
|
|
|
console.log(this.form.equipmentItem)
|
|
|
|
|
this.form.equipmentItem.splice(e.equipmentCode, 1)
|
|
|
|
|
},
|
|
|
|
|
// 选择设备确认按钮
|
|
|
|
|
confirmSelectEquBtn() {
|
|
|
|
|
// 查询是否已经选择过
|
|
|
|
@ -669,6 +800,12 @@ export default {
|
|
|
|
|
formatEquItem(this.selectEquList).then(response => {
|
|
|
|
|
console.log("开始格式化设备信息")
|
|
|
|
|
console.log(response)
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < response.data.length; i++) {
|
|
|
|
|
this.form.equipmentItem.push(response.data[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.selectEqu = false;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
@ -703,9 +840,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 步骤-下一步
|
|
|
|
|
stepNext() {
|
|
|
|
|
this.getEquList()
|
|
|
|
|
this.inspectionPlanStep++;
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
/** 查询计划列表 */
|
|
|
|
|
getList() {
|
|
|
|
@ -738,7 +873,7 @@ export default {
|
|
|
|
|
planPerson: null,
|
|
|
|
|
planStatus: '0',
|
|
|
|
|
planRestrict: null,
|
|
|
|
|
planType: null,
|
|
|
|
|
planType: "inspection",
|
|
|
|
|
planOutsource: null,
|
|
|
|
|
workCode: null,
|
|
|
|
|
factoryCode: null,
|
|
|
|
@ -753,7 +888,8 @@ export default {
|
|
|
|
|
createTimeArray: [],
|
|
|
|
|
updateTimeArray: [],
|
|
|
|
|
planTimeArray: [],
|
|
|
|
|
equipmentItem: [{equipmentCode: 123, itemList: [{itemCode: 111, itemDetail: [{detailCode: 222}]}]}],
|
|
|
|
|
equipmentItem: [],
|
|
|
|
|
personList: [],
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
@ -782,6 +918,11 @@ export default {
|
|
|
|
|
// 清除缓存
|
|
|
|
|
this.resetQuery();
|
|
|
|
|
this.queryEquipment = [];
|
|
|
|
|
this.inspectionPlanStep = 0;
|
|
|
|
|
this.selectPersonList = [];
|
|
|
|
|
|
|
|
|
|
this.getEquList();
|
|
|
|
|
this.setPerson();
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加计划";
|
|
|
|
|
},
|
|
|
|
@ -797,15 +938,55 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
// 检验
|
|
|
|
|
if (this.form.planName == null) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '计划名称不能为空!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.form.planLoop == null) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '循环周期不能为空!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.form.planLoopType == null) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择循环周期类型!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.form.planStatus == null) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择计划状态!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.form.planTimeArray.length == 0) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择计划执行时间!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.planId != null) {
|
|
|
|
|
this.form.personList = this.selectPersonList;
|
|
|
|
|
updatePlan(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.form.personList = this.selectPersonList;
|
|
|
|
|
addPlan(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
@ -844,4 +1025,7 @@ export default {
|
|
|
|
|
.my-step-body {
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
}
|
|
|
|
|
.el-transfer-panel {
|
|
|
|
|
width: 300px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|