From b3140f06105d236e419fd71515776fde9d0c31d3 Mon Sep 17 00:00:00 2001 From: zhaoxuebing <1291173720@qq.com> Date: Fri, 6 Dec 2024 11:42:49 +0800 Subject: [PATCH] =?UTF-8?q?FWHL-61=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/spareitemLocation/index.ts | 53 ++++ .../spareitemLocation/index.vue | 244 ++++++++++++++++++ .../spareitemLocation.data.ts | 78 ++++++ 3 files changed, 375 insertions(+) create mode 100644 src/api/wms/spareitemLocation/index.ts create mode 100644 src/views/wms/basicDataManage/strategySetting/spareitemLocation/index.vue create mode 100644 src/views/wms/basicDataManage/strategySetting/spareitemLocation/spareitemLocation.data.ts diff --git a/src/api/wms/spareitemLocation/index.ts b/src/api/wms/spareitemLocation/index.ts new file mode 100644 index 000000000..5f5a2e81b --- /dev/null +++ b/src/api/wms/spareitemLocation/index.ts @@ -0,0 +1,53 @@ +import request from '@/config/axios' + +export interface SpareitemLocationVO { + itemCode: string + name: string + desc1: string + desc2: string + locationCode: string + locationName: string + available: string + remark: string +} + +// 查询维修备件默认库位列表 +export const getSpareitemLocationPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/spareitem-location/senior', data }) + } else { + return await request.get({ url: `/wms/spareitem-location/page`, params }) + } +} + +// 查询维修备件默认库位详情 +export const getSpareitemLocation = async (id: number) => { + return await request.get({ url: `/wms/spareitem-location/get?id=` + id }) +} + +// 新增维修备件默认库位 +export const createSpareitemLocation = async (data: SpareitemLocationVO) => { + return await request.post({ url: `/wms/spareitem-location/create`, data }) +} + +// 修改维修备件默认库位 +export const updateSpareitemLocation = async (data: SpareitemLocationVO) => { + return await request.put({ url: `/wms/spareitem-location/update`, data }) +} + +// 删除维修备件默认库位 +export const deleteSpareitemLocation = async (id: number) => { + return await request.delete({ url: `/wms/spareitem-location/delete?id=` + id }) +} + +// 导出维修备件默认库位 Excel +export const exportSpareitemLocation = async (params) => { + return await request.download({ url: `/wms/spareitem-location/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/spareitem-location/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/wms/basicDataManage/strategySetting/spareitemLocation/index.vue b/src/views/wms/basicDataManage/strategySetting/spareitemLocation/index.vue new file mode 100644 index 000000000..f5fb9f787 --- /dev/null +++ b/src/views/wms/basicDataManage/strategySetting/spareitemLocation/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/wms/basicDataManage/strategySetting/spareitemLocation/spareitemLocation.data.ts b/src/views/wms/basicDataManage/strategySetting/spareitemLocation/spareitemLocation.data.ts new file mode 100644 index 000000000..7f9355c21 --- /dev/null +++ b/src/views/wms/basicDataManage/strategySetting/spareitemLocation/spareitemLocation.data.ts @@ -0,0 +1,78 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const SpareitemLocationRules = reactive({ + itemCode: [required], + locationCode: [required], +}) + +export const SpareitemLocation = useCrudSchemas(reactive([ + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + }, + { + label: '描述1', + field: 'desc1', + sort: 'custom', + }, + { + label: '描述2', + field: 'desc2', + sort: 'custom', + }, + { + label: '库位代码', + field: 'locationCode', + sort: 'custom', + isSearch: true, + }, + { + label: '库位名称', + field: 'locationName', + sort: 'custom', + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + }, + { + 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, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))