From d5c65d6dece8aff1db827fbbaf25ebb87b746659 Mon Sep 17 00:00:00 2001 From: chenfang Date: Thu, 18 Jul 2024 10:14:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8F=E4=BA=A7=E4=BB=B6=E5=A4=87=E4=BB=B6?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productionitemcodeSpareitemcode/index.ts | 50 ++++ .../productionitemcodeSpareitemcode/index.vue | 244 ++++++++++++++++++ .../productionitemcodeSpareitemcode.data.ts | 72 ++++++ 3 files changed, 366 insertions(+) create mode 100644 src/api/wms/productionitemcodeSpareitemcode/index.ts create mode 100644 src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/index.vue create mode 100644 src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts diff --git a/src/api/wms/productionitemcodeSpareitemcode/index.ts b/src/api/wms/productionitemcodeSpareitemcode/index.ts new file mode 100644 index 000000000..1bd325194 --- /dev/null +++ b/src/api/wms/productionitemcodeSpareitemcode/index.ts @@ -0,0 +1,50 @@ +import request from '@/config/axios' + +export interface ProductionitemcodeSpareitemcodeVO { + id: number + productionItemCode: string + spareItemCode: string + available: string + remark: string +} + +// 查询量产件备件关系列表 +export const getProductionitemcodeSpareitemcodePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/productionitemcode-spareitemcode/senior', data }) + } else { + return await request.get({ url: `/wms/productionitemcode-spareitemcode/page`, params }) + } +} + +// 查询量产件备件关系详情 +export const getProductionitemcodeSpareitemcode = async (id: number) => { + return await request.get({ url: `/wms/productionitemcode-spareitemcode/get?id=` + id }) +} + +// 新增量产件备件关系 +export const createProductionitemcodeSpareitemcode = async (data: ProductionitemcodeSpareitemcodeVO) => { + return await request.post({ url: `/wms/productionitemcode-spareitemcode/create`, data }) +} + +// 修改量产件备件关系 +export const updateProductionitemcodeSpareitemcode = async (data: ProductionitemcodeSpareitemcodeVO) => { + return await request.put({ url: `/wms/productionitemcode-spareitemcode/update`, data }) +} + +// 删除量产件备件关系 +export const deleteProductionitemcodeSpareitemcode = async (id: number) => { + return await request.delete({ url: `/wms/productionitemcode-spareitemcode/delete?id=` + id }) +} + +// 导出量产件备件关系 Excel +export const exportProductionitemcodeSpareitemcode = async (params) => { + return await request.download({ url: `/wms/productionitemcode-spareitemcode/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/productionitemcode-spareitemcode/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/index.vue b/src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/index.vue new file mode 100644 index 000000000..94a81bb16 --- /dev/null +++ b/src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts b/src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts new file mode 100644 index 000000000..2ebe01c0d --- /dev/null +++ b/src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts @@ -0,0 +1,72 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const ProductionitemcodeSpareitemcodeRules = reactive({ + productionItemCode: [required], + available: [required], +}) + +export const ProductionitemcodeSpareitemcode = useCrudSchemas(reactive([ + { + label: '量产件', + field: 'productionItemCode', + sort: 'custom', + isSearch: true, + }, + { + label: '备件', + field: 'spareItemCode', + sort: 'custom', + isSearch: true, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true, + }, + { + 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' + } + } +]))