From 6f9a9ea8ae2cb305eae332a53b3b05ab24e7ce4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com> Date: Fri, 14 Jun 2024 15:16:29 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/sparePartsApplyMain/index.ts | 21 +- .../eam/sparePartsOutLocationDetail/index.ts | 61 +++ .../eam/sparePartsOutLocationMain/index.ts | 93 +++++ .../SparePartsOutLocation.data.ts | 300 ++++++++++++++ src/views/eam/sparepartsoutlocation/index.vue | 374 ++++++++++++++++++ 5 files changed, 847 insertions(+), 2 deletions(-) create mode 100644 src/api/eam/sparePartsOutLocationDetail/index.ts create mode 100644 src/api/eam/sparePartsOutLocationMain/index.ts create mode 100644 src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts create mode 100644 src/views/eam/sparepartsoutlocation/index.vue diff --git a/src/api/eam/sparePartsApplyMain/index.ts b/src/api/eam/sparePartsApplyMain/index.ts index c69234979..f2096f2d0 100644 --- a/src/api/eam/sparePartsApplyMain/index.ts +++ b/src/api/eam/sparePartsApplyMain/index.ts @@ -27,7 +27,7 @@ export interface SparePartsApplyMainVO { export const getSparePartsApplyMainPage = async (params) => { if (params.isSearch) { delete params.isSearch - const data = {...params} + const data = { ...params } return await request.post({ url: '/eam/spare-parts-apply-main/senior', data }) } else { return await request.get({ url: `/eam/spare-parts-apply-main/page`, params }) @@ -62,4 +62,21 @@ export const exportSparePartsApplyMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/spare-parts-apply-main/get-import-template' }) -} \ No newline at end of file +} + +// 撤回 +export const cancelSparePartsOutLocation = async (id) => { + return await request.get({ url: `/eam/spare-parts-apply-main/cancel?id=` + id }) +} +// 审核 +export const submitExamineSparePartsOutLocation = async (id) => { + return await request.get({ url: `/eam/spare-parts-apply-main/submitExamine?id=` + id }) +} +// 审核驳回 +export const rejectSparePartsOutLocation = async (id) => { + return await request.get({ url: `/eam/spare-parts-apply-main/reject?id=` + id }) +} +// 审核通过 +export const approveSparePartsOutLocation = async (data) => { + return await request.post({ url: `/eam/spare-parts-apply-main/approve`, data }) +} diff --git a/src/api/eam/sparePartsOutLocationDetail/index.ts b/src/api/eam/sparePartsOutLocationDetail/index.ts new file mode 100644 index 000000000..16b9fe4cc --- /dev/null +++ b/src/api/eam/sparePartsOutLocationDetail/index.ts @@ -0,0 +1,61 @@ +import request from '@/config/axios' + +export interface SparePartsOutLocationDetailVO { + id: number + number: string + masterId: number + sparePartsCode: string + isRadeIn: string + applyQty: number + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询备件入库记录子列表 +export const getSparePartsOutLocationDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = { ...params } + return await request.post({ url: '/eam/spare-parts-out-location-detail/senior', data }) + } else { + return await request.get({ url: `/eam/spare-parts-out-location-detail/page`, params }) + } +} + +// 查询备件入库记录子详情 +export const getSparePartsOutLocationDetail = async (id: number) => { + return await request.get({ url: `/eam/spare-parts-out-location-detail/get?id=` + id }) +} + +// 新增备件入库记录子 +export const createSparePartsOutLocationDetail = async (data: SparePartsOutLocationDetailVO) => { + return await request.post({ url: `/eam/spare-parts-out-location-detail/create`, data }) +} + +// 修改备件入库记录子 +export const updateSparePartsOutLocationDetail = async (data: SparePartsOutLocationDetailVO) => { + return await request.put({ url: `/eam/spare-parts-out-location-detail/update`, data }) +} + +// 删除备件入库记录子 +export const deleteSparePartsOutLocationDetail = async (id: number) => { + return await request.delete({ url: `/eam/spare-parts-out-location-detail/delete?id=` + id }) +} + +// 导出备件入库记录子 Excel +export const exportSparePartsOutLocationDetail = async (params) => { + return await request.download({ + url: `/eam/spare-parts-out-location-detail/export-excel`, + params + }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/spare-parts-out-location-detail/get-import-template' }) +} diff --git a/src/api/eam/sparePartsOutLocationMain/index.ts b/src/api/eam/sparePartsOutLocationMain/index.ts new file mode 100644 index 000000000..aa73d8cdc --- /dev/null +++ b/src/api/eam/sparePartsOutLocationMain/index.ts @@ -0,0 +1,93 @@ +import request from '@/config/axios' + +export interface SparePartsOutLocationMainVO { + id: number + number: string + theme: string + status: string + applyer: string + approver: number + approveContent: string + approveTime: Date + autoExamine: string + autoAgree: string + directCreateRecord: string + areaCode: string + locationCode: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询备件入库记录主列表 +export const getSparePartsOutLocationMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = { ...params } + return await request.post({ url: '/eam/spare-parts-out-location-main/senior', data }) + } else { + return await request.get({ url: `/eam/spare-parts-out-location-main/page`, params }) + } +} + +// 查询备件入库记录主详情 +export const getSparePartsOutLocationMain = async (id: number) => { + return await request.get({ url: `/eam/spare-parts-out-location-main/get?id=` + id }) +} + +// 新增备件入库记录主 +export const createSparePartsOutLocationMain = async (data: SparePartsOutLocationMainVO) => { + return await request.post({ url: `/eam/spare-parts-out-location-main/create`, data }) +} + +// 修改备件入库记录主 +export const updateSparePartsOutLocationMain = async (data: SparePartsOutLocationMainVO) => { + return await request.put({ url: `/eam/spare-parts-out-location-main/update`, data }) +} + +// 删除备件入库记录主 +export const deleteSparePartsOutLocationMain = async (id: number) => { + return await request.delete({ url: `/eam/spare-parts-out-location-main/delete?id=` + id }) +} + +// 导出备件入库记录主 Excel +export const exportSparePartsOutLocationMain = async (params) => { + if (params.isSearch) { + const data = { ...params } + return await request.downloadPost({ + url: `/eam/spare-parts-out-location-main/export-excel-senior`, + data + }) + } else { + return await request.download({ + url: `/eam/spare-parts-out-location-main/export-excel`, + params + }) + } +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/spare-parts-out-location-main/get-import-template' }) +} + +// 撤回 +export const cancelSparePartsOutLocation = async (id) => { + return await request.get({ url: `/eam/spare-parts-out-location-main/cancel?id=` + id }) +} +// 审核 +export const submitExamineSparePartsOutLocation = async (id) => { + return await request.get({ url: `/eam/spare-parts-out-location-main/submitExamine?id=` + id }) +} +// 审核驳回 +export const rejectSparePartsOutLocation = async (id) => { + return await request.get({ url: `/eam/spare-parts-out-location-main/reject?id=` + id }) +} +// 审核通过 +export const approveSparePartsOutLocation = async (data) => { + return await request.post({ url: `/eam/spare-parts-out-location-main/approve`, data }) +} diff --git a/src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts b/src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts new file mode 100644 index 000000000..e1747c8de --- /dev/null +++ b/src/views/eam/sparepartsoutlocation/SparePartsOutLocation.data.ts @@ -0,0 +1,300 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' + +import * as ItemAccountsApi from '@/api/eam/itemAccounts' +import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data' + +import { EquipmentAccounts } from '@/views/eam/equipmentAccounts/equipmentAccounts.data' +import * as EquipmentItemApi from '@/api/eam/equipmentAccounts' + +import { dateFormatter } from '@/utils/formatTime' + +export const SparePartsOutLocationMain = useCrudSchemas( + reactive([ + { + label: '申请编号', + field: 'number', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '描述', + field: 'description', + sort: 'custom', + isSearch: true + }, + { + label: '申领备件总价', + field: 'sumVal', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false + }, + { + label: '流程状态', + field: 'status', + sort: 'custom', + dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true, + form: { + component: 'Select' + } + }, + { + label: '申请人', + field: 'applyer', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false + }, + { + label: '审核人', + field: 'approver', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '审核内容', + field: 'approveContent', + sort: 'custom', + isSearch: true, + isTable: false, + isForm: false + }, + { + label: '审核时间', + field: 'approveTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: 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' + } + } + }, + { + label: '自动审核', + field: 'autoExamine', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false + }, + { + label: '自动通过', + field: 'autoAgree', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + sort: 'custom', + isSearch: false, + isTable: false, + isForm: false + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isTable: 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 + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } + ]) +) + +//表单校验 +export const SparePartsOutLocationMainRules = reactive({ + description: [{ required: true, message: '描述不能为空', trigger: 'change' }] +}) +/** + * @returns {Array} 备件申请子表 + */ +export const SparePartsOutLocationDetail = useCrudSchemas( + reactive([ + { + label: '备件编号', + field: 'sparePartsCode', + sort: 'custom', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件编号', // 输入框占位文本 + searchField: 'itemNumber', // 查询弹窗赋值字段 + 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: 'type', + dictType: DICT_TYPE.DEVICE_TYPE, + dictClass: 'string', + isTable: true, + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + tableForm: { + type: 'Select' + } + }, + { + label: '设备工装编号', + field: 'equipmentCode', + sort: 'custom', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchTitle: '设备信息', // 查询弹窗标题 + searchListPlaceholder: '请选择 设备编号', // 输入框占位文本 + searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类 + searchField: 'code', // 查询弹窗赋值字段 + searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法 + multiple: true, + searchCondition: [ + { + key: 'status', + value: 'NORMAL', + action: '==', + isSearch: true, + isMainValue: false + } + ] + } + }, + tableForm: { + isInpuFocusShow: true, + searchListPlaceholder: '请选择备件编号', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '备件信息', // 查询弹窗标题 + searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类 + searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'status', + value: 'NORMAL', + action: '==', + isSearch: true, + isMainValue: false + } + ] + } + }, + + { + label: '库存数量', + field: 'currentQty', + sort: 'custom', + isSearch: false, + tableForm: { + disabled: true + } + }, + { + label: '申领数量', + field: 'applyQty', + sort: 'custom', + isSearch: false + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 150, + fixed: 'right' + }, + isTableForm: false + } + ]) +) + +//表单校验 +export const SparePartsOutLocationDetailRules = reactive({ + applyQty: [{ required: true, message: '请输入标包数量', trigger: 'blur' }] +}) diff --git a/src/views/eam/sparepartsoutlocation/index.vue b/src/views/eam/sparepartsoutlocation/index.vue new file mode 100644 index 000000000..6b1cf7df3 --- /dev/null +++ b/src/views/eam/sparepartsoutlocation/index.vue @@ -0,0 +1,374 @@ + + +