diff --git a/src/api/eam/inspectionItem/index.ts b/src/api/eam/inspectionItem/index.ts new file mode 100644 index 000000000..a4b441c0c --- /dev/null +++ b/src/api/eam/inspectionItem/index.ts @@ -0,0 +1,57 @@ +import request from '@/config/axios' + +export interface InspectionItemVO { + id: number + content: string + equipmentParts: string + serialNumber: number + category: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询巡检项列表 +export const getInspectionItemPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/basic/inspection-item/senior', data }) + } else { + return await request.get({ url: `/eam/basic/inspection-item/page`, params }) + } +} + +// 查询巡检项详情 +export const getInspectionItem = async (id: number) => { + return await request.get({ url: `/eam/basic/inspection-item/get?id=` + id }) +} + +// 新增巡检项 +export const createInspectionItem = async (data: InspectionItemVO) => { + return await request.post({ url: `/eam/basic/inspection-item/create`, data }) +} + +// 修改巡检项 +export const updateInspectionItem = async (data: InspectionItemVO) => { + return await request.put({ url: `/eam/basic/inspection-item/update`, data }) +} + +// 删除巡检项 +export const deleteInspectionItem = async (id: number) => { + return await request.delete({ url: `/eam/basic/inspection-item/delete?id=` + id }) +} + +// 导出巡检项 Excel +export const exportInspectionItem = async (params) => { + return await request.download({ url: `/eam/basic/inspection-item/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/basic/inspection-item/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/eam/spotCheckItem/index.ts b/src/api/eam/spotCheckItem/index.ts new file mode 100644 index 000000000..0d2bac635 --- /dev/null +++ b/src/api/eam/spotCheckItem/index.ts @@ -0,0 +1,56 @@ +import request from '@/config/axios' + +export interface SpotCheckItemVO { + id: number + content: string + equipmentParts: string + serialNumber: number + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询点检项列表 +export const getSpotCheckItemPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/basic/spot-check-item/senior', data }) + } else { + return await request.get({ url: `/eam/basic/spot-check-item/page`, params }) + } +} + +// 查询点检项详情 +export const getSpotCheckItem = async (id: number) => { + return await request.get({ url: `/eam/basic/spot-check-item/get?id=` + id }) +} + +// 新增点检项 +export const createSpotCheckItem = async (data: SpotCheckItemVO) => { + return await request.post({ url: `/eam/basic/spot-check-item/create`, data }) +} + +// 修改点检项 +export const updateSpotCheckItem = async (data: SpotCheckItemVO) => { + return await request.put({ url: `/eam/basic/spot-check-item/update`, data }) +} + +// 删除点检项 +export const deleteSpotCheckItem = async (id: number) => { + return await request.delete({ url: `/eam/basic/spot-check-item/delete?id=` + id }) +} + +// 导出点检项 Excel +export const exportSpotCheckItem = async (params) => { + return await request.download({ url: `/eam/basic/spot-check-item/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/basic/spot-check-item/get-import-template' }) +} \ No newline at end of file diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 9d701ad18..b8a84e8e6 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -337,4 +337,8 @@ export enum DICT_TYPE { INTERFACE_STATUS = 'interfaceStatus', // 接口调用信息 接口状态 SYSTEM_DAY = 'system_day', // 系统天数 PURCHASE_INVOICE_ORDER_TYPE = 'purchase_invoice_order_type', // 发票采购订单类型 + + // ========== eam - 业务 - ========== + DEVICE_TYPE = 'device_type', // 设备类型 + } diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 408141d1d..bd999713c 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -269,7 +269,7 @@ export function mainListEnableBtn(option:any) { label: t(`ts.启用`).replace('ts.', ''), name: 'enable', hide: false, - type: 'danger', + type: 'success', color: '', link: true, // 文本展现按钮 hasPermi: '' diff --git a/src/views/eam/equipmentManufacturer/equipmentManufacturer.data.ts b/src/views/eam/equipmentManufacturer/equipmentManufacturer.data.ts index b2f57cff9..1050b4ee3 100644 --- a/src/views/eam/equipmentManufacturer/equipmentManufacturer.data.ts +++ b/src/views/eam/equipmentManufacturer/equipmentManufacturer.data.ts @@ -82,7 +82,10 @@ export const EquipmentManufacturer = useCrudSchemas(reactive([ label: '部门', field: 'departmentCode', sort: 'custom', - isSearch: true, + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, form: { component: 'TreeSelect', componentProps: { // 假设deptList是部门数据列表 @@ -105,28 +108,7 @@ export const EquipmentManufacturer = useCrudSchemas(reactive([ } } }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - isSearch: true, - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' - } - }, - search: { - component: 'Select', - }, - table: { - width: 110 - } - }, + { label: '操作', field: 'action', diff --git a/src/views/eam/equipmentSupplier/equipmentSupplier.data.ts b/src/views/eam/equipmentSupplier/equipmentSupplier.data.ts index 2aaf9e1d6..d4f9d4548 100644 --- a/src/views/eam/equipmentSupplier/equipmentSupplier.data.ts +++ b/src/views/eam/equipmentSupplier/equipmentSupplier.data.ts @@ -88,7 +88,10 @@ export const EquipmentSupplier = useCrudSchemas(reactive([ label: '部门', field: 'departmentCode', sort: 'custom', - isSearch: true, + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, form: { component: 'TreeSelect', componentProps: { // 假设deptList是部门数据列表 @@ -111,28 +114,7 @@ export const EquipmentSupplier = useCrudSchemas(reactive([ } } }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - isSearch: true, - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' - } - }, - search: { - component: 'Select', - }, - table: { - width: 110 - } - }, + { label: '操作', field: 'action', diff --git a/src/views/eam/inspectionItem/index.vue b/src/views/eam/inspectionItem/index.vue new file mode 100644 index 000000000..2b72fdde4 --- /dev/null +++ b/src/views/eam/inspectionItem/index.vue @@ -0,0 +1,272 @@ + + + diff --git a/src/views/eam/inspectionItem/inspectionItem.data.ts b/src/views/eam/inspectionItem/inspectionItem.data.ts new file mode 100644 index 000000000..1e310154e --- /dev/null +++ b/src/views/eam/inspectionItem/inspectionItem.data.ts @@ -0,0 +1,110 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import { handleTreeToComponentOptions } from '@/utils/tree' +import * as DeptApi from '@/api/system/dept' +const deptList = ref([]) // 树形结构 + +// 加载部门树(默认格式) +deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList()) + +// 表单校验 +export const InspectionItemRules = reactive({ + content: [required], + serialNumber: [required], + concurrencyStamp: [required], + type: [required], +}) + +export const InspectionItem = useCrudSchemas(reactive([ + + { + label: '巡检内容', + field: 'content', + sort: 'custom', + isSearch: true, + form: { + component: 'Input', + componentProps: { + type: 'textarea' + } + } + }, + { + label: '保养部位', + field: 'equipmentParts', + sort: 'custom', + isSearch: true + }, + { + label: '类别', + field: 'category', + sort: 'custom', + isSearch: true + }, + { + label: '序号', + field: 'serialNumber', + sort: 'custom', + isSearch: true, + fixed: 'left', + form: { + component:'InputNumber' + }, + }, + { + label: '来源于类型配置', + field: 'type', + sort: 'custom', + dictType: DICT_TYPE.DEVICE_TYPE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true, + form: { + component: 'Select' + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, + form: { + component: 'TreeSelect', + componentProps: { // 假设deptList是部门数据列表 + data: deptList, + placeholder: "请选择部门", + filterable: true, + // multiple: true, + } + } + }, + { + label: '是否启用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isTable: true, + isDetail: false, + isSearch: false, + isTableForm: false, + isForm: false, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/eam/spotCheckItem/index.vue b/src/views/eam/spotCheckItem/index.vue new file mode 100644 index 000000000..1f448a231 --- /dev/null +++ b/src/views/eam/spotCheckItem/index.vue @@ -0,0 +1,268 @@ + + + diff --git a/src/views/eam/spotCheckItem/spotCheckItem.data.ts b/src/views/eam/spotCheckItem/spotCheckItem.data.ts new file mode 100644 index 000000000..67902adfb --- /dev/null +++ b/src/views/eam/spotCheckItem/spotCheckItem.data.ts @@ -0,0 +1,104 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import { handleTreeToComponentOptions } from '@/utils/tree' +import * as DeptApi from '@/api/system/dept' +const deptList = ref([]) // 树形结构 + +// 加载部门树(默认格式) +deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList()) + +// 表单校验 +export const SpotCheckItemRules = reactive({ + content: [required], + serialNumber: [required], + concurrencyStamp: [required], + type: [required], +}) + +export const SpotCheckItem = useCrudSchemas(reactive([ + + { + label: '点检内容', + field: 'content', + sort: 'custom', + isSearch: true, + form: { + component: 'Input', + componentProps: { + type: 'textarea' + } + } + }, + { + label: '点检部位', + field: 'equipmentParts', + sort: 'custom', + isSearch: true + }, + { + label: '序号', + field: 'serialNumber', + sort: 'custom', + isSearch: true, + fixed: 'left', + form: { + component:'InputNumber' + }, + }, + { + label: '来源于类型配置', + field: 'type', + sort: 'custom', + dictType: DICT_TYPE.DEVICE_TYPE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true, + form: { + component: 'Select' + } + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, + form: { + component: 'TreeSelect', + componentProps: { // 假设deptList是部门数据列表 + data: deptList, + placeholder: "请选择部门", + filterable: true, + // multiple: true, + } + } + }, + { + label: '是否启用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isTable: true, + isDetail: false, + isSearch: false, + isTableForm: false, + isForm: false, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))