|
|
@ -65,10 +65,9 @@ |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<el-table :data="maintenanceItemData" style="width: 100%; height: 80%"> |
|
|
|
<el-table :data="maintenanceItemData" style="width: 100%; height: 200px"> |
|
|
|
<el-table-column prop="itemCode" label="保养项ID" /> |
|
|
|
<el-table-column prop="itemName" label="保养名称" /> |
|
|
|
<!-- <el-table-column prop="equipmentParts" label="保养部位" />--> |
|
|
|
<el-table-column prop="isSelectd" label="" width="150" > |
|
|
|
<template #header> |
|
|
|
<span>是否必选(默认是)</span> |
|
|
@ -101,6 +100,11 @@ import { SearchTable } from '@/components/SearchTable' |
|
|
|
import { BasicMaintenanceItemSelectSet} from "@/views/eam/maintenanceItemSelectSet/maintenanceItemSelectSet.data"; |
|
|
|
import * as maintenanceItemSelectSetApi from "@/api/eam/maintenanceItemSelectSet"; |
|
|
|
import {ElInput} from "element-plus"; |
|
|
|
import {ref} from "vue"; |
|
|
|
import { |
|
|
|
getMaintenanceItemSelectSetList, |
|
|
|
getRalMaintenanceOptionItemList |
|
|
|
} from "@/api/eam/maintenanceItemSelectSet"; |
|
|
|
|
|
|
|
defineOptions({ name: 'TeamForm' }) |
|
|
|
|
|
|
@ -119,6 +123,7 @@ const isDisabled = ref(false) |
|
|
|
const InputRef = ref<InstanceType<typeof ElInput>>() |
|
|
|
//保养项相关参数 |
|
|
|
const maintenanceItemData = ref([]) |
|
|
|
const itemsId = ref('') |
|
|
|
|
|
|
|
const itemData = ref({ |
|
|
|
id: '', |
|
|
@ -159,8 +164,6 @@ const basicFormRef = ref() // 表单 Ref |
|
|
|
|
|
|
|
/** 删除巡检项 */ |
|
|
|
const handleClose = (id: string) => { |
|
|
|
console.log(id) |
|
|
|
console.log(tags) |
|
|
|
const index = tags.value.findIndex(tag => tag.selectId === id); |
|
|
|
if (index !== -1) { |
|
|
|
tags.value.splice(index, 1); |
|
|
@ -209,7 +212,6 @@ const addItemCommon = (multiple,field) => { |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
|
nextTick?.(async () => { |
|
|
|
if (formField === 'baoYangItem') { |
|
|
|
let itemsId = ''; |
|
|
|
//选择集ID赋值 |
|
|
|
val.forEach(item => { |
|
|
|
const isExist = tags.value.some(tag => tag.id === item.id); |
|
|
@ -220,18 +222,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
tags.value = []; |
|
|
|
tags.value.push(newItem); |
|
|
|
} |
|
|
|
itemsId = item.itemCode; |
|
|
|
itemsId.value = item.itemCode; |
|
|
|
}); |
|
|
|
maintenanceItemData.value = [] |
|
|
|
let query = { |
|
|
|
itemsId: itemsId.value |
|
|
|
} |
|
|
|
let res = await maintenanceItemSelectSetApi.getMaintenanceItemSelectSetList(query); |
|
|
|
//保养项赋值 |
|
|
|
try { |
|
|
|
formLoading.value = true; |
|
|
|
maintenanceItemData.value = []; |
|
|
|
for (const item of itemsId.split(",")) { |
|
|
|
let res = await request.get({url: `/eam/basic/maintenance-item/get?id=` + item}) |
|
|
|
for (const item of res) { |
|
|
|
const newItem = {}; |
|
|
|
newItem['itemCode'] = res.id; |
|
|
|
newItem['itemName'] = res.name; |
|
|
|
newItem['equipmentParts'] = res.equipmentParts; |
|
|
|
newItem['itemCode'] = item.id; |
|
|
|
newItem['itemName'] = item.name; |
|
|
|
newItem['equipmentParts'] = item.equipmentParts; |
|
|
|
newItem['isSelectd'] = true; |
|
|
|
maintenanceItemData.value.push(newItem); |
|
|
|
} |
|
|
@ -277,7 +282,7 @@ const open = async (type: string, row?: object) => { |
|
|
|
formLoading.value = false |
|
|
|
} |
|
|
|
//添加保养项 |
|
|
|
let res = await request.get({url: `/eam/relation-maintenance-option-item/getList?optionCode=` + row.code}) |
|
|
|
let res = await maintenanceItemSelectSetApi.getRalMaintenanceOptionItemList(row.code); |
|
|
|
try { |
|
|
|
maintenanceItemData.value = []; |
|
|
|
formLoading.value = true; |
|
|
|