From 256a7ba3ddf297b6604ff79f8f42a9d765795dc1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com>
Date: Tue, 6 Feb 2024 11:29:53 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E8=AE=BE=E7=BD=AE=E8=8F=9C?=
=?UTF-8?q?=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/wms/plansetting/index.ts | 57 ++++
.../documentSetting/plansetting/index.vue | 242 ++++++++++++++++
.../plansetting/plansetting.data.ts | 259 ++++++++++++++++++
3 files changed, 558 insertions(+)
create mode 100644 src/api/wms/plansetting/index.ts
create mode 100644 src/views/wms/basicDataManage/documentSetting/plansetting/index.vue
create mode 100644 src/views/wms/basicDataManage/documentSetting/plansetting/plansetting.data.ts
diff --git a/src/api/wms/plansetting/index.ts b/src/api/wms/plansetting/index.ts
new file mode 100644
index 000000000..28b3df1ee
--- /dev/null
+++ b/src/api/wms/plansetting/index.ts
@@ -0,0 +1,57 @@
+import request from '@/config/axios'
+
+export interface PlansettingVO {
+ id: number
+ code: string
+ requestMode: string
+ autoCommit: string
+ autoAgree: string
+ autoExecute: string
+ directCreateRecord: string
+ available: string
+ activeTime: Date
+ expireTime: Date
+ remark: string
+ concurrencyStamp: number
+}
+
+// 查询计划设置列表
+export const getPlansettingPage = async (params) => {
+ if (params.isSearch) {
+ delete params.isSearch
+ const data = {...params}
+ return await request.post({ url: '/wms/plansetting/senior', data })
+ } else {
+ return await request.get({ url: `/wms/plansetting/page`, params })
+ }
+}
+
+// 查询计划设置详情
+export const getPlansetting = async (id: number) => {
+ return await request.get({ url: `/wms/plansetting/get?id=` + id })
+}
+
+// 新增计划设置
+export const createPlansetting = async (data: PlansettingVO) => {
+ return await request.post({ url: `/wms/plansetting/create`, data })
+}
+
+// 修改计划设置
+export const updatePlansetting = async (data: PlansettingVO) => {
+ return await request.put({ url: `/wms/plansetting/update`, data })
+}
+
+// 删除计划设置
+export const deletePlansetting = async (id: number) => {
+ return await request.delete({ url: `/wms/plansetting/delete?id=` + id })
+}
+
+// 导出计划设置 Excel
+export const exportPlansetting = async (params) => {
+ return await request.download({ url: `/wms/plansetting/export-excel`, params })
+}
+
+// 下载用户导入模板
+export const importTemplate = () => {
+ return request.download({ url: '/wms/plansetting/get-import-template' })
+}
\ No newline at end of file
diff --git a/src/views/wms/basicDataManage/documentSetting/plansetting/index.vue b/src/views/wms/basicDataManage/documentSetting/plansetting/index.vue
new file mode 100644
index 000000000..db0555ea9
--- /dev/null
+++ b/src/views/wms/basicDataManage/documentSetting/plansetting/index.vue
@@ -0,0 +1,242 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.code }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/wms/basicDataManage/documentSetting/plansetting/plansetting.data.ts b/src/views/wms/basicDataManage/documentSetting/plansetting/plansetting.data.ts
new file mode 100644
index 000000000..88e08994d
--- /dev/null
+++ b/src/views/wms/basicDataManage/documentSetting/plansetting/plansetting.data.ts
@@ -0,0 +1,259 @@
+import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
+import { dateFormatter } from '@/utils/formatTime'
+const { t } = useI18n() // 国际化
+
+/**
+ * @returns {Array} 计划设置
+ */
+export const Plansetting = useCrudSchemas(reactive([
+ {
+ label: '代码',
+ field: 'code',
+ sort: 'custom',
+ table: {
+ width: 180,
+ fixed: 'left'
+ },
+ isSearch: true,
+ form: {
+ componentProps: {
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '申请模式',
+ field: 'requestMode',
+ dictType: DICT_TYPE.REQEUST_MODE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ componentProps: {
+ disabled: true
+ }
+ }
+ },
+ {
+ label: '自动提交',
+ field: 'autoCommit',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: 'TRUE',
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE'
+ }
+ },
+ },
+ {
+ label: '自动通过',
+ field: 'autoAgree',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: 'TRUE',
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE'
+ }
+ },
+ },
+ {
+ label: '自动执行',
+ field: 'autoExecute',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ form: {
+ component: 'Switch',
+ value: 'TRUE',
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: 'TRUE'
+ }
+ },
+ },
+ {
+ label: '跳过任务生成记录',
+ field: 'directCreateRecord',
+ dictType: DICT_TYPE.TRUE_FALSE,
+ dictClass: 'string',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'Switch',
+ value: 'TRUE',
+ componentProps: {
+ inactiveValue: 'FALSE',
+ activeValue: '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'
+ }
+ },
+ isTable: false,
+ isForm: false
+ },
+ {
+ label: '生效时间',
+ field: 'activeTime',
+ isTable: true,
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width:'100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ },
+ {
+ label: '失效时间',
+ field: 'expireTime',
+ isTable: true,
+ formatter: dateFormatter,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width:'100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ },
+ {
+ label: '创建时间',
+ field: 'createTime',
+ formatter: dateFormatter,
+ isTable: false,
+ isForm: false,
+ detail: {
+ dateFormat: 'YYYY-MM-DD HH:mm:ss'
+ },
+ sort: 'custom',
+ table: {
+ width: 180
+ },
+ form: {
+ component: 'DatePicker',
+ componentProps: {
+ style: {width:'100%'},
+ type: 'datetime',
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'x',
+ }
+ },
+ },
+ {
+ label: '备注',
+ field: 'remark',
+ isTable: true,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isSearch: true,
+ },
+ {
+ label: '创建者',
+ field: 'creator',
+ isTable: false,
+ isForm: false,
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ },
+ {
+ label: '操作',
+ field: 'action',
+ isDetail: false,
+ isForm: false ,
+ table: {
+ width: 150,
+ fixed: 'right'
+ }
+ }
+]))
+
+//表单校验
+export const PlansettingRules = reactive({
+ code: [
+ { required: true, message: '请输入代码', trigger: 'blur' },
+ { max: 50, message: '不得超过50个字符', trigger: 'blur' }
+ ],
+ requestMode: [
+ { required: true, message: '请选择申请模式', trigger: 'change' }
+ ],
+ autoCommit: [
+ { required: true, message: '请选择是否自动提交', trigger: 'change' }
+ ],
+ autoAgree: [
+ { required: true, message: '请选择是否自动通过', trigger: 'change' }
+ ],
+ autoExecute: [
+ { required: true, message: '请选择是否自动执行', trigger: 'change' }
+ ],
+ directCreateRecord: [
+ { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' }
+ ],
+ remark: [
+ { max: 50, message: '不得超过50个字符', trigger: 'blur' }
+ ],
+})
\ No newline at end of file