Browse Source

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

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

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

@ -165,6 +165,19 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
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)
}

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

@ -1,5 +1,10 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
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({
@ -30,6 +35,29 @@ export const BasicMaintenanceOption = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
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: '描述',
field: 'describing',
@ -37,10 +65,16 @@ export const BasicMaintenanceOption = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
},
{
label: '项是否可修改默认是',
label: '项是否可修改',
field: 'isUpdated',
sort: 'custom',
dictType: DICT_TYPE.IS_UPDATED,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isTable: true,
isDetail: false,
isSearch: true,
isTableForm: false,
isForm: true,
form: {
component: 'Switch',
value: 'TRUE',
@ -50,12 +84,12 @@ export const BasicMaintenanceOption = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '保养项',
field: 'type',
sort: 'custom',
isSearch: true,
},
// {
// label: '保养项',
// field: 'type',
// sort: 'custom',
// isSearch: true,
// },
{
label: '创建时间',
field: 'createTime',
@ -103,14 +137,13 @@ export const BasicMaintenanceOption = useCrudSchemas(reactive<CrudSchema[]>([
label: '是否可用',
field: 'available',
sort: 'custom',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isTable: true,
isDetail: false,
isSearch: false,
isTableForm: false,
isForm: false,
},
{
label: '删除时间',

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

@ -165,6 +165,19 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
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)
}

Loading…
Cancel
Save