diff --git a/src/api/eam/sparePartsInLocationRecordDetail/index.ts b/src/api/eam/sparePartsInLocationRecordDetail/index.ts index 55c8eba4a..9e4df6997 100644 --- a/src/api/eam/sparePartsInLocationRecordDetail/index.ts +++ b/src/api/eam/sparePartsInLocationRecordDetail/index.ts @@ -17,7 +17,7 @@ export interface SparePartsInLocationDetailRecordVO { } // 查询备件入库记录子列表 -export const getSparePartsInLocationDetailRecordPage = async (params) => { +export const getSparePartsInLocationRecordDetailPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} @@ -28,27 +28,27 @@ export const getSparePartsInLocationDetailRecordPage = async (params) => { } // 查询备件入库记录子详情 -export const getSparePartsInLocationDetailRecord = async (id: number) => { +export const getSparePartsInLocationRecordDetail = async (id: number) => { return await request.get({ url: `/eam/spare-parts-in-location-detail-record/get?id=` + id }) } // 新增备件入库记录子 -export const createSparePartsInLocationDetailRecord = async (data: SparePartsInLocationDetailRecordVO) => { +export const createSparePartsInLocationRecordDetail= async (data: SparePartsInLocationDetailRecordVO) => { return await request.post({ url: `/eam/spare-parts-in-location-detail-record/create`, data }) } // 修改备件入库记录子 -export const updateSparePartsInLocationDetailRecord = async (data: SparePartsInLocationDetailRecordVO) => { +export const updateSparePartsInLocationRecordDetail = async (data: SparePartsInLocationDetailRecordVO) => { return await request.put({ url: `/eam/spare-parts-in-location-detail-record/update`, data }) } // 删除备件入库记录子 -export const deleteSparePartsInLocationDetailRecord = async (id: number) => { +export const deleteSparePartsInLocationRecordDetail = async (id: number) => { return await request.delete({ url: `/eam/spare-parts-in-location-detail-record/delete?id=` + id }) } // 导出备件入库记录子 Excel -export const exportSparePartsInLocationDetailRecord = async (params) => { +export const exportSparePartsInLocationRecordDetail = async (params) => { return await request.download({ url: `/eam/spare-parts-in-location-detail-record/export-excel`, params }) } diff --git a/src/api/eam/sparePartsInLocationRecordMain/index.ts b/src/api/eam/sparePartsInLocationRecordMain/index.ts index 27ce7fb95..42c7616fe 100644 --- a/src/api/eam/sparePartsInLocationRecordMain/index.ts +++ b/src/api/eam/sparePartsInLocationRecordMain/index.ts @@ -24,7 +24,7 @@ export interface SparePartsInLocationMainRecordVO { } // 查询备件入库记录主列表 -export const getSparePartsInLocationMainRecordPage = async (params) => { +export const getSparePartsInLocationRecordMainPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = { ...params } @@ -35,31 +35,31 @@ export const getSparePartsInLocationMainRecordPage = async (params) => { } // 查询备件入库记录主详情 -export const getSparePartsInLocationMainRecord = async (id: number) => { +export const getSparePartsInLocationRecordMain = async (id: number) => { return await request.get({ url: `/eam/spare-parts-in-location-main-record/get?id=` + id }) } // 新增备件入库记录主 -export const createSparePartsInLocationMainRecord = async ( +export const createSparePartsInLocationRecordMain = async ( data: SparePartsInLocationMainRecordVO ) => { return await request.post({ url: `/eam/spare-parts-in-location-main-record/create`, data }) } // 修改备件入库记录主 -export const updateSparePartsInLocationMainRecord = async ( +export const updateSparePartsInLocationRecordMain = async ( data: SparePartsInLocationMainRecordVO ) => { return await request.put({ url: `/eam/spare-parts-in-location-main-record/update`, data }) } // 删除备件入库记录主 -export const deleteSparePartsInLocationMainRecord = async (id: number) => { +export const deleteSparePartsInLocationRecordMain= async (id: number) => { return await request.delete({ url: `/eam/spare-parts-in-location-main-record/delete?id=` + id }) } // 导出备件入库记录主 Excel -export const exportSparePartsInLocationMainRecord = async (params) => { +export const exportSparePartsInLocationRecordMain = async (params) => { return await request.download({ url: `/eam/spare-parts-in-location-main-record/export-excel`, params diff --git a/src/views/eam/sparePartsInLocationRecord/index.vue b/src/views/eam/sparePartsInLocationRecord/index.vue new file mode 100644 index 000000000..86aefd08e --- /dev/null +++ b/src/views/eam/sparePartsInLocationRecord/index.vue @@ -0,0 +1,137 @@ + + + diff --git a/src/views/eam/sparePartsInLocationRecord/sparePartsInLocationRecordMain.data.ts b/src/views/eam/sparePartsInLocationRecord/sparePartsInLocationRecordMain.data.ts new file mode 100644 index 000000000..c0d7b7b30 --- /dev/null +++ b/src/views/eam/sparePartsInLocationRecord/sparePartsInLocationRecordMain.data.ts @@ -0,0 +1,258 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as ItemAccountsApi from '@/api/eam/itemAccounts' +import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data' + + +// 表单校验 +export const SparePartsInLocationRecordMainRules = reactive({ + number: [required], + theme: [required], + type: [required], +}) +// 备件入库主表 +export const SparePartsInLocationRecordMain = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + isDetail:false, + }, + { + label: '编号', + field: 'number', + sort: 'custom', + isSearch: true, + isForm: false, + }, + { + label: '入库主题', + field: 'theme', + sort: 'custom', + isSearch: true, + },{ + label: '入库类型', + field: 'type', + sort: 'custom', + dictType: DICT_TYPE.PUT_IN_TYPE, + dictClass: 'string', + + }, + { + label: '流程状态', + field: 'status', + sort: 'custom', + isSearch: false, + isForm:false, + + dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM, + dictClass: 'string', + + }, + { + label: '入库申请人', + field: 'applyer', + sort: 'custom', + isSearch: false, + }, + { + label: '审核人', + field: 'approver', + sort: 'custom', + isSearch: false, + isForm:false + }, + { + label: '审核内容', + field: 'approveContent', + sort: 'custom', + isSearch: false, + isForm:false + }, + { + label: '审核时间', + field: 'approveTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isForm:false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + { + label: '入库时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + }, + + + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + }, +])) +// 备件入库子表 +export const SparePartsInLocationRecordDetailRules = reactive({ + number: [required], + masterId: [required], + locationCode: [required], + areaCode: [required], + sparePartsCode: [required], + applyQty: [required], +}) + +export const SparePartsInLocationRecordDetail = useCrudSchemas(reactive([ + { + label: '库位编号', + field: 'locationCode', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择库位编号', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '库位信息', // 查询弹窗标题 + + searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 + searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] + } + }, + tableForm: { + isInpuFocusShow: true, + searchListPlaceholder: '请选择备件编号', // 输入框占位文本 + searchField: 'itemNumber', // 查询弹窗赋值字段 + searchTitle: '备件信息', // 查询弹窗标题 + + searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类 + searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] + } + }, + { + label: '库区编号', + field: 'areaCode', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + }, + tableForm:{ + disabled: true + } + }, + { + label: '备件编号', + field: 'sparePartsCode', + sort: 'custom', + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + }, + tableForm:{ + disabled: true + } + }, + { + label: '库存数量', + field: 'currentQty', + sort: 'custom', + isSearch: false, + tableForm: { + disabled: true + }, + form:{ + componentProps:{ + disabled: true + } + }, + isDetail:false, + isTable:false + }, + { + label: '申领数量', + field: 'applyQty', + sort: 'custom', + isSearch: false + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + isTableForm:false + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true, + }, + +])) + +