|
@ -65,7 +65,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<el-table :data="inspectionItemData" style="width: 100%; height: 80%"> |
|
|
<el-table :data="inspectionItemData" style="width: 100%; height: 200px"> |
|
|
<el-table-column prop="itemCode" label="巡检项ID" /> |
|
|
<el-table-column prop="itemCode" label="巡检项ID" /> |
|
|
<el-table-column prop="itemName" label="巡检名称" /> |
|
|
<el-table-column prop="itemName" label="巡检名称" /> |
|
|
<el-table-column prop="isSelectd" label="" width="150" > |
|
|
<el-table-column prop="isSelectd" label="" width="150" > |
|
@ -83,15 +83,6 @@ |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
<el-pagination |
|
|
|
|
|
small |
|
|
|
|
|
:page-size="3" |
|
|
|
|
|
background |
|
|
|
|
|
layout="prev, pager, next" |
|
|
|
|
|
:total="5" |
|
|
|
|
|
class="mt-4" |
|
|
|
|
|
@current-change="handleGroupPageChange" |
|
|
|
|
|
/> |
|
|
|
|
|
<template #footer> |
|
|
<template #footer> |
|
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> |
|
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> |
|
|
<el-button @click="dialogVisible = false">取 消</el-button> |
|
|
<el-button @click="dialogVisible = false">取 消</el-button> |
|
@ -109,6 +100,7 @@ import { SearchTable } from '@/components/SearchTable' |
|
|
import { InspectionItemSelectSet} from "@/views/eam/inspectionItemSelectSet/inspectionItemSelectSet.data"; |
|
|
import { InspectionItemSelectSet} from "@/views/eam/inspectionItemSelectSet/inspectionItemSelectSet.data"; |
|
|
import * as inspectionItemItemSelectSetApi from "@/api/eam/inspectionItemSelectSet"; |
|
|
import * as inspectionItemItemSelectSetApi from "@/api/eam/inspectionItemSelectSet"; |
|
|
import {ElInput} from "element-plus"; |
|
|
import {ElInput} from "element-plus"; |
|
|
|
|
|
import {ref} from "vue"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'TeamForm' }) |
|
|
defineOptions({ name: 'TeamForm' }) |
|
@ -128,6 +120,7 @@ const isDisabled = ref(false) |
|
|
const InputRef = ref<InstanceType<typeof ElInput>>() |
|
|
const InputRef = ref<InstanceType<typeof ElInput>>() |
|
|
//巡检项相关参数 |
|
|
//巡检项相关参数 |
|
|
const inspectionItemData = ref([]) |
|
|
const inspectionItemData = ref([]) |
|
|
|
|
|
const itemsId = ref('') |
|
|
|
|
|
|
|
|
const itemData = ref({ |
|
|
const itemData = ref({ |
|
|
id: '', |
|
|
id: '', |
|
@ -216,7 +209,6 @@ const addItemCommon = (multiple,field) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
nextTick?.(async () => { |
|
|
nextTick?.(async () => { |
|
|
if (formField === 'xunJianItem') { |
|
|
if (formField === 'xunJianItem') { |
|
|
let itemsId = ''; |
|
|
|
|
|
//选择集ID赋值 |
|
|
//选择集ID赋值 |
|
|
val.forEach(item => { |
|
|
val.forEach(item => { |
|
|
const isExist = tags.value.some(tag => tag.id === item.id); |
|
|
const isExist = tags.value.some(tag => tag.id === item.id); |
|
@ -227,19 +219,22 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
tags.value = []; |
|
|
tags.value = []; |
|
|
tags.value.push(newItem); |
|
|
tags.value.push(newItem); |
|
|
} |
|
|
} |
|
|
itemsId = item.itemCode; |
|
|
itemsId.value = item.itemCode; |
|
|
}); |
|
|
}); |
|
|
|
|
|
inspectionItemData.value = []; |
|
|
|
|
|
let query = { |
|
|
|
|
|
itemsId: itemsId.value |
|
|
|
|
|
} |
|
|
|
|
|
let res = await inspectionItemItemSelectSetApi.getInspectionItemSelectSetList(query) |
|
|
|
|
|
|
|
|
//巡检项赋值 |
|
|
//巡检项赋值 |
|
|
try { |
|
|
try { |
|
|
formLoading.value = true; |
|
|
formLoading.value = true; |
|
|
inspectionItemData.value = []; |
|
|
for (const item of res) { |
|
|
for (const item of itemsId.split(",")) { |
|
|
|
|
|
let res = await request.get({url: `/eam/basic/inspection-item/get?id=` + item}) |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
const newItem = {}; |
|
|
const newItem = {}; |
|
|
newItem['itemCode'] = res.id; |
|
|
newItem['itemCode'] = item.id; |
|
|
newItem['itemName'] = res.name; |
|
|
newItem['itemName'] = item.name; |
|
|
newItem['equipmentParts'] = res.equipmentParts; |
|
|
newItem['equipmentParts'] = item.equipmentParts; |
|
|
newItem['isSelectd'] = true; |
|
|
newItem['isSelectd'] = true; |
|
|
inspectionItemData.value.push(newItem); |
|
|
inspectionItemData.value.push(newItem); |
|
|
} |
|
|
} |
|
@ -285,7 +280,7 @@ const open = async (type: string, row?: object) => { |
|
|
formLoading.value = false |
|
|
formLoading.value = false |
|
|
} |
|
|
} |
|
|
//添加巡检项 |
|
|
//添加巡检项 |
|
|
let res = await request.get({url: `/eam/relation-inspection-option-item/getList?optionCode=` + row.code}) |
|
|
let res = await inspectionItemItemSelectSetApi.getRalInspectionOptionItemList(row.code) |
|
|
try { |
|
|
try { |
|
|
inspectionItemData.value = []; |
|
|
inspectionItemData.value = []; |
|
|
formLoading.value = true; |
|
|
formLoading.value = true; |
|
@ -320,7 +315,6 @@ const submitForm = async () => { |
|
|
message.warning('巡检项最多10个'); |
|
|
message.warning('巡检项最多10个'); |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//赋值 巡检选择集ID |
|
|
//赋值 巡检选择集ID |
|
|
formData.value.selectId = tags.value[0].selectId |
|
|
formData.value.selectId = tags.value[0].selectId |
|
|
// 提交请求 |
|
|
// 提交请求 |
|
@ -328,7 +322,7 @@ const submitForm = async () => { |
|
|
try { |
|
|
try { |
|
|
if (formType.value === 'create') { |
|
|
if (formType.value === 'create') { |
|
|
for (var i = 0; i < inspectionItemData.value.length; i++) { |
|
|
for (var i = 0; i < inspectionItemData.value.length; i++) { |
|
|
inspectionItemData.value[i].optionCode = formData.value.code |
|
|
inspectionItemData.value[i].optionCode = formData.value.code |
|
|
} |
|
|
} |
|
|
formData.value.optionItem = inspectionItemData.value |
|
|
formData.value.optionItem = inspectionItemData.value |
|
|
//新增巡检方案 及 方案与项关系 |
|
|
//新增巡检方案 及 方案与项关系 |
|
|