Browse Source

EAM ——> 保养方案关联保养选择集

master_hella_20240701
gaojs 6 months ago
parent
commit
32dd917384
  1. 14
      src/views/eam/basicInspectionOption/basicInspectionOption.data.ts
  2. 13
      src/views/eam/basicInspectionOption/index.vue
  3. 63
      src/views/eam/basicMaintenanceOption/basicMaintenanceOption.data.ts
  4. 13
      src/views/eam/basicMaintenanceOption/index.vue

14
src/views/eam/basicInspectionOption/basicInspectionOption.data.ts

@ -43,7 +43,7 @@ export const BasicInspectionOption = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
componentProps: { componentProps: {
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchTitle: '巡检选择信息', // 查询弹窗标题 searchTitle: '巡检选择信息', // 查询弹窗标题
searchAllSchemas: InspectionItemSelectSet.allSchemas, // 查询弹窗所需类 searchAllSchemas: InspectionItemSelectSet.allSchemas, // 查询弹窗所需类
searchField: 'name', // 查询弹窗赋值字段 searchField: 'name', // 查询弹窗赋值字段
searchPage: ItemApi.getInspectionItemSelectSetPage, // 查询弹窗所需分页方法 searchPage: ItemApi.getInspectionItemSelectSetPage, // 查询弹窗所需分页方法
@ -84,12 +84,12 @@ export const BasicInspectionOption = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{ // {
label: '巡检项', // label: '巡检项',
field: 'type', // field: 'type',
sort: 'custom', // sort: 'custom',
isSearch: true, // isSearch: true,
}, // },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',

13
src/views/eam/basicInspectionOption/index.vue

@ -165,6 +165,19 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
if(type == "update"){
BasicInspectionOption.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = true
}
})
}else{
BasicInspectionOption.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }

63
src/views/eam/basicMaintenanceOption/basicMaintenanceOption.data.ts

@ -1,5 +1,10 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import {
BasicMaintenanceItemSelectSet
} from "@/views/eam/maintenanceItemSelectSet/maintenanceItemSelectSet.data";
import * as ItemApi from "@/api/eam/maintenanceItemSelectSet";
import {getBasicMaintenanceItemSelectSetPage} from "@/api/eam/maintenanceItemSelectSet";
// 表单校验 // 表单校验
export const BasicMaintenanceOptionRules = reactive({ export const BasicMaintenanceOptionRules = reactive({
@ -30,6 +35,29 @@ export const BasicMaintenanceOption = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
}, },
{
label: '选择集',
field: 'selectId',
sort: 'custom',
isDetail: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '保养选择集信息', // 查询弹窗标题
searchAllSchemas: BasicMaintenanceItemSelectSet.allSchemas, // 查询弹窗所需类
searchField: 'name', // 查询弹窗赋值字段
searchPage: ItemApi.getBasicMaintenanceItemSelectSetPage, // 查询弹窗所需分页方法
multiple:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
}]
}
}
},
{ {
label: '描述', label: '描述',
field: 'describing', field: 'describing',
@ -37,10 +65,16 @@ export const BasicMaintenanceOption = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
}, },
{ {
label: '项是否可修改默认是', label: '项是否可修改',
field: 'isUpdated', field: 'isUpdated',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.IS_UPDATED,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isTable: true,
isDetail: false,
isSearch: true, isSearch: true,
isTableForm: false,
isForm: true,
form: { form: {
component: 'Switch', component: 'Switch',
value: 'TRUE', value: 'TRUE',
@ -50,12 +84,12 @@ export const BasicMaintenanceOption = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{ // {
label: '保养项', // label: '保养项',
field: 'type', // field: 'type',
sort: 'custom', // sort: 'custom',
isSearch: true, // isSearch: true,
}, // },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
@ -103,14 +137,13 @@ export const BasicMaintenanceOption = useCrudSchemas(reactive<CrudSchema[]>([
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',
sort: 'custom', sort: 'custom',
form: { dictType: DICT_TYPE.TRUE_FALSE,
component: 'Switch', dictClass: 'string', // 默认都是字符串类型其他暂不考虑
value: 'TRUE', isTable: true,
componentProps: { isDetail: false,
inactiveValue: 'FALSE', isSearch: false,
activeValue: 'TRUE' isTableForm: false,
} isForm: false,
},
}, },
{ {
label: '删除时间', label: '删除时间',

13
src/views/eam/basicMaintenanceOption/index.vue

@ -165,6 +165,19 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
if(type == "update"){
BasicMaintenanceOption.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = true
}
})
}else{
BasicMaintenanceOption.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }

Loading…
Cancel
Save