diff --git a/src/api/eam/basic/item/index.ts b/src/api/eam/basic/item/index.ts index 35d3e10..eec07ff 100644 --- a/src/api/eam/basic/item/index.ts +++ b/src/api/eam/basic/item/index.ts @@ -78,3 +78,10 @@ export const getItemList = async (params) => { export const getItemNoPage = async (params) => { return await request.get({ url: `/eam/item/noPage`, params }) } + + + +export const getItemNotInAccountSenior = async (params) => { + const data = {...params} + return await request.post({ url: `/eam/item/getItemNotInAccountSenior`, data }) +} diff --git a/src/api/eam/basic/location/index.ts b/src/api/eam/basic/location/index.ts index 82ea6d7..6785906 100644 --- a/src/api/eam/basic/location/index.ts +++ b/src/api/eam/basic/location/index.ts @@ -59,3 +59,18 @@ export const selectPageByConditions = async (params) => { return await request.get({ url: `/eam/location/selectPageByConditions`, params }) } +// 不在台账中的库位 +export const getLocationNoInAccountPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: `/eam/location/getLocationNoInAccountSenior`, data }) + } else { + return await request.get({ url: `/eam/location/getLocationNoInAccountPage`, params }) + } + +} + + + + diff --git a/src/api/eam/item/replaceItemDes/index.ts b/src/api/eam/item/replaceItemDes/index.ts index 92cd7f2..a44beff 100644 --- a/src/api/eam/item/replaceItemDes/index.ts +++ b/src/api/eam/item/replaceItemDes/index.ts @@ -19,7 +19,7 @@ export const getReplaceItemDesPage = async (params) => { const data = {...params} return await request.post({ url: '/eam/attachment-file/senior', data }) } else { - return await request.get({ url: `/eam/attachment-file/page`, params }) + return await request.get({ url: `/eam/attachment-file/getGroupedAttachmentFiles`, params }) } } @@ -30,13 +30,14 @@ export const getReplaceItemDes = async (id: number) => { // 新增备件台账 export const createReplaceItemDes = async (data: AttachmentFileVO) => { - data.funcCode="Replace_Item_Des" - return await request.post({ url: `/eam/attachment-file/create`, data }) + data.funcCode = "Replace_Item_Des" + return await request.post({ url: `/eam/attachment-file/upload`, data }) } // 修改备件台账 export const updateReplaceItemDes = async (data: AttachmentFileVO) => { - return await request.put({ url: `/eam/attachment-file/update`, data }) + data.funcCode = "Replace_Item_Des" + return await request.post({ url: `/eam/attachment-file/upload`, data }) } // 删除备件台账 diff --git a/src/views/eam/basic/classType/classType.data.ts b/src/views/eam/basic/classType/classType.data.ts index dd8b0df..079e035 100644 --- a/src/views/eam/basic/classType/classType.data.ts +++ b/src/views/eam/basic/classType/classType.data.ts @@ -4,6 +4,7 @@ import * as deptApi from '@/api/system/dept' import * as roleApi from '@/api/system/role' import { Role } from '@/views/system/role/role.data' import { selectAllFactoryArea } from '@/api/system/dept' +import { useUserStore } from '@/store/modules/user' // 表单校验 export const ClassTypeRules = reactive({ workerRoleId: [required], @@ -11,9 +12,14 @@ export const ClassTypeRules = reactive({ type: [required], factoryAreaNumber: [required], }) +const userStore = useUserStore() const FactoryAreaNoPage = await deptApi.getDeptPage({'deptGroup':'factory'}) const roleList = await roleApi.getSimpleRoleList({}) const factoryList = await selectAllFactoryArea() +// 假设你想添加一个新的工厂区域 +// const factoryList = [...factoryListResult, { +// ...userStore.userSelfInfo.dept +// }] console.log('FactoryAreaNoPage',FactoryAreaNoPage); console.log('roleList',roleList); @@ -53,7 +59,7 @@ console.log('roleList',roleList); ])) export const ClassType = useCrudSchemas(reactive([ { - label: '维修工角色', + label: '维修工角色编号', field: 'workerRoleId', sort: 'custom', form: { @@ -79,7 +85,7 @@ export const ClassType = useCrudSchemas(reactive([ }, }, { - label: '工程师角色', + label: '工程师角色编号', field: 'engineerRoleId', sort: 'custom', form: { @@ -121,7 +127,7 @@ export const ClassType = useCrudSchemas(reactive([ sort: 'custom', }, { - label: '所属厂区', + label: '所属厂区编号', field: 'factoryAreaNumber', isSearch: true, sort: 'custom', diff --git a/src/views/eam/item/applicationRecord/applicationRecordMain.data.ts b/src/views/eam/item/applicationRecord/applicationRecordMain.data.ts index 8fdb114..b8f7d42 100644 --- a/src/views/eam/item/applicationRecord/applicationRecordMain.data.ts +++ b/src/views/eam/item/applicationRecord/applicationRecordMain.data.ts @@ -32,7 +32,11 @@ export const ApplicationRecordMain = useCrudSchemas(reactive([ table: { width: 180, }, - isForm: false + isForm: false, + detail: { + width: 180, + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, }, { label: '申领人', @@ -53,7 +57,10 @@ export const ApplicationRecordMain = useCrudSchemas(reactive([ table: { width: 180, }, - isForm: false + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, }, { label: '审批人', diff --git a/src/views/eam/item/itemAccounts/itemAccounts.data.ts b/src/views/eam/item/itemAccounts/itemAccounts.data.ts index 150b2a7..70c52d9 100644 --- a/src/views/eam/item/itemAccounts/itemAccounts.data.ts +++ b/src/views/eam/item/itemAccounts/itemAccounts.data.ts @@ -1,6 +1,11 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -import { formatDate } from '@/utils/formatTime' +import { Item, ItemRules } from '../../basic/item/item.data' +import * as ItemApi from '@/api/eam/basic/item' +import { LocationArea, LocationAreaRules } from '../../basic/locationArea/locationArea.data' +import * as LocationAreaApi from '@/api/eam/basic/locationArea' +import { Location, LocationRules } from '../../basic/location/location.data' +import * as LocationApi from '@/api/eam/basic/location' // 表单校验 export const ItemAccountsRules = reactive({ @@ -19,23 +24,60 @@ export const ItemAccounts = useCrudSchemas(reactive([ width: 180, fixed: 'left' }, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '备件', // 查询弹窗标题 + searchAllSchemas: Item.allSchemas, // 查询弹窗所需类 + searchPage: ItemApi.getItemNotInAccountSenior, // 查询弹窗所需分页方法 + searchCondition: [] + } + } }, - { - label: '库位编号', - field: 'locationNumber', + label: '库区编号', + field: 'areaNumber', sort: 'custom', table: { width: 110 }, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '备件', // 查询弹窗标题 + searchAllSchemas: LocationArea.allSchemas, // 查询弹窗所需类 + searchPage: LocationAreaApi.getLocationAreaPage, // 查询弹窗所需分页方法 + searchCondition: [] + } + } }, { - label: '库区编号', - field: 'areaNumber', + label: '库位编号', + field: 'locationNumber', sort: 'custom', table: { width: 110 }, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '备件', // 查询弹窗标题 + searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 + searchPage: LocationApi.getLocationNoInAccountPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'areaNumber', + value: 'areaNumber', + message: '请选择库区编号!', + isMainValue: true, // 拼接条件必须要 false 同时不能与 isMainValue: true 同用 // 前置添加必有,和isFormModel结合使用 + }] + } + } }, { label: '备件名称', diff --git a/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts b/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts index 52f64cf..6c58558 100644 --- a/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts +++ b/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts @@ -4,6 +4,7 @@ import { ItemAccounts } from '@/views/eam/item/itemAccounts/itemAccounts.data' import * as ItemAccountsApi from '@/api/eam/item/itemAccounts' import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance' import { validateHanset, validateEmail } from '@/utils/validator' +import Detail from '@/views/bpm/oa/leave/detail.vue' const { t } = useI18n() // 国际化 /** @@ -84,7 +85,11 @@ export const ItemApplyMain = useCrudSchemas(reactive([ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, - isForm: false + isForm: false, + detail: { + width: 180, + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, }, { diff --git a/src/views/eam/item/itemOutLocation/itemOutLocation.data.ts b/src/views/eam/item/itemOutLocation/itemOutLocation.data.ts index 8c24ae1..c15a94f 100644 --- a/src/views/eam/item/itemOutLocation/itemOutLocation.data.ts +++ b/src/views/eam/item/itemOutLocation/itemOutLocation.data.ts @@ -27,15 +27,6 @@ export const ItemOutLocation = useCrudSchemas(reactive([ width: 180, }, }, - { - label: '出库编号', - field: 'number', - sort: 'custom', - isSearch: true, - table: { - width: 180, - }, - }, { label: '库位编号', field: 'locationNumber', diff --git a/src/views/eam/item/replaceItemDes/index.vue b/src/views/eam/item/replaceItemDes/index.vue index 90d2203..c345482 100644 --- a/src/views/eam/item/replaceItemDes/index.vue +++ b/src/views/eam/item/replaceItemDes/index.vue @@ -123,12 +123,11 @@ /** 添加/修改操作 */ const basicFormRef = ref() - const openForm = (type : string, row ?: any) => { +const openForm = (type: string, row?: any) => { if (row&&row.filePathList && row.filePathList.length > 0) { row.filePathListView = row.filePathList.map((item) => { return { - name: item, - url: item + ...item } }) } @@ -136,19 +135,28 @@ } // form表单提交 - const formsSuccess = async (formType, data) => { - data.filePathList = data.filePathListView.map(item=>item.url) - console.log(formType) - if (formType === 'create') { - await ReplaceItemDesApi.createReplaceItemDes(data) - message.success(t('common.createSuccess')) - } else { - await ReplaceItemDesApi.updateReplaceItemDes(data) - message.success(t('common.updateSuccess')) - } - basicFormRef.value.dialogVisible = false - getList() +const formsSuccess = async (formType, data) => { + let paramData = { + ...data + } + + // 继续处理其他字段 + paramData.fileInfoList = paramData.filePathListView.map(item => item); + + // 删除不需要的字段 + delete paramData.filePathList; + delete paramData.filePathListView; + console.log(formType); + if (formType === 'create') { + await ReplaceItemDesApi.createReplaceItemDes(paramData); + message.success(t('common.createSuccess')); + } else { + await ReplaceItemDesApi.updateReplaceItemDes(paramData); + message.success(t('common.updateSuccess')); } + basicFormRef.value.dialogVisible = false; + getList(); +} /** 详情操作 */ const detailRef = ref()