From 75bcd3274beab973957f0c5a69556ccf73d9e5fd Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Fri, 14 Feb 2025 14:56:28 +0800 Subject: [PATCH] =?UTF-8?q?SBBJ-812=E4=BF=9D=E5=85=BB=E9=A1=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/deviceMaintenanceConfig/index.vue | 428 ++++++++++++++++++ .../moldMaintenanceConfig.data.ts | 112 +++++ src/views/eam/basic/moldMaintenance/index.vue | 2 + .../moldMaintenance/moldMaintenance.data.ts | 92 ++-- .../eam/basic/moldMaintenanceConfig/index.vue | 8 +- .../moldMaintenanceConfig.data.ts | 12 +- 6 files changed, 600 insertions(+), 54 deletions(-) create mode 100644 src/views/eam/basic/deviceMaintenanceConfig/index.vue create mode 100644 src/views/eam/basic/deviceMaintenanceConfig/moldMaintenanceConfig.data.ts diff --git a/src/views/eam/basic/deviceMaintenanceConfig/index.vue b/src/views/eam/basic/deviceMaintenanceConfig/index.vue new file mode 100644 index 0000000..97df977 --- /dev/null +++ b/src/views/eam/basic/deviceMaintenanceConfig/index.vue @@ -0,0 +1,428 @@ + + + diff --git a/src/views/eam/basic/deviceMaintenanceConfig/moldMaintenanceConfig.data.ts b/src/views/eam/basic/deviceMaintenanceConfig/moldMaintenanceConfig.data.ts new file mode 100644 index 0000000..240ab00 --- /dev/null +++ b/src/views/eam/basic/deviceMaintenanceConfig/moldMaintenanceConfig.data.ts @@ -0,0 +1,112 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance' + +// 表单校验 +export const MoldMaintenanceConfigRules = reactive({ + deviceNumber: [required], + executionCycle: [required], +}) + +export const DeviceMOLD = useCrudSchemas(reactive([ + { + label: '编号', + field: 'number', + sort: 'custom', + isForm: false, + table: { + width: 180, + fixed: 'left' + }, + + }, + { + label: '名称', + field: 'name', + sort: 'custom', + }, + { + label: '规格型号', + field: 'specification', + sort: 'custom', + }, + +])) + +export const MoldMaintenanceConfig = useCrudSchemas(reactive([ + { + label: '设备编号', + field: 'deviceNumber', + sort: 'custom', + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择设备', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '设备信息', // 查询弹窗标题 + searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 + searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: "TRUE", + isMainValue: false + }, { + key: 'type', + value: "DEVICE", + isMainValue: false + } + ] + } + } + }, + { + label: '设备名称', + field: 'deviceName', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true + } + }, + }, + { + label: '保养周期', + field: 'executionCycle', + dictType: DICT_TYPE.EXECUTION_CYCLE, + dictClass: 'string', + sort: 'custom', + isSearch: false, + form: { + component: 'Select' + }, + }, + { + label: '类型', + field: 'type', + isTable: false, + isForm: false, + isSearch: false, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) + + diff --git a/src/views/eam/basic/moldMaintenance/index.vue b/src/views/eam/basic/moldMaintenance/index.vue index 3f45d3a..c27c230 100644 --- a/src/views/eam/basic/moldMaintenance/index.vue +++ b/src/views/eam/basic/moldMaintenance/index.vue @@ -235,6 +235,8 @@ const formsSuccess = async (formType,data) => { if (formType === 'create') { await MoldMaintenanceApi.createDeviceMoldItems(data) message.success(t('common.createSuccess')) + basicFormRef.value.dialogVisible = false + getList() } else { openDataNew.value = data if(judgeSame()){ diff --git a/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts b/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts index 2edb531..c4582e3 100644 --- a/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts +++ b/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts @@ -68,41 +68,41 @@ export const MoldMaintenance = useCrudSchemas(reactive([ sort: 'custom', isSearch: false, }, - { - label: '模具编号', - field: 'deviceNumber', - sort: 'custom', - isSearch: true, - form: { - // labelMessage: '信息提示说明!!!', - componentProps: { - isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择模具编号', // 输入框占位文本 - searchField: 'number', // 查询弹窗赋值字段 - searchTitle: '模具信息', // 查询弹窗标题 - searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 - searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 - searchCondition: [ - { - key: 'available', - value: "TRUE", - isMainValue: false - }, { - key: 'type', - value: "MOLD", - isMainValue: false - } - ] - } - } - }, - { - label: '模具名称', - field: 'deviceName', - sort: 'custom', - isSearch: true, - isForm: false, - }, + // { + // label: '模具编号', + // field: 'deviceNumber', + // sort: 'custom', + // isSearch: true, + // form: { + // // labelMessage: '信息提示说明!!!', + // componentProps: { + // isSearchList: true, // 开启查询弹窗 + // searchListPlaceholder: '请选择模具编号', // 输入框占位文本 + // searchField: 'number', // 查询弹窗赋值字段 + // searchTitle: '模具信息', // 查询弹窗标题 + // searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 + // searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 + // searchCondition: [ + // { + // key: 'available', + // value: "TRUE", + // isMainValue: false + // }, { + // key: 'type', + // value: "MOLD", + // isMainValue: false + // } + // ] + // } + // } + // }, + // { + // label: '模具名称', + // field: 'deviceName', + // sort: 'custom', + // isSearch: true, + // isForm: false, + // }, { label: '项类型', field: 'status', @@ -118,17 +118,17 @@ export const MoldMaintenance = useCrudSchemas(reactive([ } }, }, - { - label: '保养周期', - field: 'executionCycle', - dictType: DICT_TYPE.MOLD_EXECUTION_CYCLE, - dictClass: 'string', - sort: 'custom', - isSearch: false, - form: { - component: 'Select' - }, - }, + // { + // label: '保养周期', + // field: 'executionCycle', + // dictType: DICT_TYPE.MOLD_EXECUTION_CYCLE, + // dictClass: 'string', + // sort: 'custom', + // isSearch: false, + // form: { + // component: 'Select' + // }, + // }, // { // label: '涂装保养周期-月份', // field: 'executionCycleMonth', diff --git a/src/views/eam/basic/moldMaintenanceConfig/index.vue b/src/views/eam/basic/moldMaintenanceConfig/index.vue index 869ab7b..fd9fe89 100644 --- a/src/views/eam/basic/moldMaintenanceConfig/index.vue +++ b/src/views/eam/basic/moldMaintenanceConfig/index.vue @@ -101,7 +101,7 @@ import * as DeviceMaintenanceApi from '@/api/eam/basic/deviceMaintenance' // import { DeviceAccounts } from '@/views/eam/device/deviceAccounts/deviceAccounts.data' // import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' -defineOptions({ name: 'DeviceMoldMaintenanceConfig' }) +defineOptions({ name: 'MoldMaintenanceConfig' }) /** * tableForm方法 @@ -166,7 +166,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => // 主子数据 提交 const submitForm = async (formType, submitData) => { let data = {...submitData} - data.type = 'DEVICE' + data.type = 'MOLD' formRef.value.formLoading = true try { if (formType === 'create') { @@ -417,6 +417,10 @@ const deteleNewFuction =async (row)=>{ /** 初始化 **/ onMounted(async () => { + tableObject.params = { + available: 'TRUE', + type: 'MOLD' + } getList() importTemplateData.templateUrl = await MoldMaintenanceConfigApi.importTemplate() }) diff --git a/src/views/eam/basic/moldMaintenanceConfig/moldMaintenanceConfig.data.ts b/src/views/eam/basic/moldMaintenanceConfig/moldMaintenanceConfig.data.ts index 1021c6e..a8d170c 100644 --- a/src/views/eam/basic/moldMaintenanceConfig/moldMaintenanceConfig.data.ts +++ b/src/views/eam/basic/moldMaintenanceConfig/moldMaintenanceConfig.data.ts @@ -35,17 +35,17 @@ export const DeviceMOLD = useCrudSchemas(reactive([ export const MoldMaintenanceConfig = useCrudSchemas(reactive([ { - label: '设备编号', + label: '模具编号', field: 'deviceNumber', sort: 'custom', - isSearch: false, + isSearch: true, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择单号', // 输入框占位文本 + searchListPlaceholder: '请选择模具', // 输入框占位文本 searchField: 'number', // 查询弹窗赋值字段 - searchTitle: '单号信息', // 查询弹窗标题 + searchTitle: '模具信息', // 查询弹窗标题 searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类 searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法 searchCondition: [ @@ -55,7 +55,7 @@ export const MoldMaintenanceConfig = useCrudSchemas(reactive([ isMainValue: false }, { key: 'type', - value: "DEVICE", + value: "MOLD", isMainValue: false } ] @@ -63,7 +63,7 @@ export const MoldMaintenanceConfig = useCrudSchemas(reactive([ } }, { - label: '设备名称', + label: '模具名称', field: 'deviceName', sort: 'custom', isSearch: true,