From d0e19c889e9ca3bc46f3757af7fce12e050ee188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=83=9C=E6=A5=A0?= <2792649152@qq.com> Date: Thu, 16 Nov 2023 13:18:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E6=8D=AE=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/switch/index.ts | 50 +++++ .../documentSetting/switch/index.vue | 211 ++++++++++++++++++ .../documentSetting/switch/switch.data.ts | 101 +++++++++ 3 files changed, 362 insertions(+) create mode 100644 src/api/wms/switch/index.ts create mode 100644 src/views/wms/basicDataManage/documentSetting/switch/index.vue create mode 100644 src/views/wms/basicDataManage/documentSetting/switch/switch.data.ts diff --git a/src/api/wms/switch/index.ts b/src/api/wms/switch/index.ts new file mode 100644 index 000000000..aeb11a1cb --- /dev/null +++ b/src/api/wms/switch/index.ts @@ -0,0 +1,50 @@ +import request from '@/config/axios' + +export interface SwitchVO { + id: number + code: string + description: string + effectiveSetValue: string + available: string +} + +// 查询单据开关列表 +export const getSwitchPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/switch/senior', data }) + } else { + return await request.get({ url: `/wms/switch/page`, params }) + } +} + +// 查询单据开关详情 +export const getSwitch = async (id: number) => { + return await request.get({ url: `/wms/switch/get?id=` + id }) +} + +// 新增单据开关 +export const createSwitch = async (data: SwitchVO) => { + return await request.post({ url: `/wms/switch/create`, data }) +} + +// 修改单据开关 +export const updateSwitch = async (data: SwitchVO) => { + return await request.put({ url: `/wms/switch/update`, data }) +} + +// 删除单据开关 +export const deleteSwitch = async (id: number) => { + return await request.delete({ url: `/wms/switch/delete?id=` + id }) +} + +// 导出单据开关 Excel +export const exportSwitch = async (params) => { + return await request.download({ url: `/wms/switch/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/switch/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/wms/basicDataManage/documentSetting/switch/index.vue b/src/views/wms/basicDataManage/documentSetting/switch/index.vue new file mode 100644 index 000000000..d7e56f5dc --- /dev/null +++ b/src/views/wms/basicDataManage/documentSetting/switch/index.vue @@ -0,0 +1,211 @@ + + + \ No newline at end of file diff --git a/src/views/wms/basicDataManage/documentSetting/switch/switch.data.ts b/src/views/wms/basicDataManage/documentSetting/switch/switch.data.ts new file mode 100644 index 000000000..016035092 --- /dev/null +++ b/src/views/wms/basicDataManage/documentSetting/switch/switch.data.ts @@ -0,0 +1,101 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' + +/** + * @returns {Array} 单据开关 + */ +export const Switch = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + isSearch: true, + table: { + width: 150, + fixed: 'left' + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '描述', + field: 'description', + sort: 'custom', + isSearch: true, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '有效设置值', + field: 'effectiveSetValue', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) + +// 表单校验 +export const SwitchRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' } + ], + description: [ + { required: true, message: '请输入描述', trigger: 'blur' } + ], + effectiveSetValue: [ + { required: true, message: '请选择是否有效', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) \ No newline at end of file