From 3fd1a93b0c0ae2e3a0f216e3a431518cee138094 Mon Sep 17 00:00:00 2001 From: XaoLi717 <144221124+XaoLi717@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:43:27 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B0=E5=BB=BA=E5=8D=A1=E9=A1=BF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Home/bgnr/bgyp/index.vue | 2 +- src/views/Home/clnr/clgl/index.vue | 2 +- src/views/Home/hynr/hygl/index.vue | 2 +- src/views/Home/jbgl/index.vue | 2 +- src/views/Home/kqnr/kqgl/index.vue | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/Home/bgnr/bgyp/index.vue b/src/views/Home/bgnr/bgyp/index.vue index 9f59bfb..e3cec3c 100644 --- a/src/views/Home/bgnr/bgyp/index.vue +++ b/src/views/Home/bgnr/bgyp/index.vue @@ -125,7 +125,6 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict' import {dateFormatter2} from '@/utils/formatTime' import download from '@/utils/download' import { BgypApi, BgypVO } from '@/api/home/bgyp' -import router from "@/router"; import * as LeaveApi from '@/api/bpm/leave' /** 办公用品管理 列表 */ @@ -170,6 +169,7 @@ const getList = async () => { } } +const router = useRouter() // 路由 /**发起操作 */ const handleCreate =async () => { await router.push({name: 'BgypCreate'}) diff --git a/src/views/Home/clnr/clgl/index.vue b/src/views/Home/clnr/clgl/index.vue index ee89ee4..bd2c3b0 100644 --- a/src/views/Home/clnr/clgl/index.vue +++ b/src/views/Home/clnr/clgl/index.vue @@ -161,7 +161,6 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict' import download from '@/utils/download' import { ClglApi, ClglVO } from '@/api/home/clgl' import ClglForm from './ClglForm.vue' -import router from "@/router"; import * as LeaveApi from '@/api/bpm/leave' import {dateFormatter2} from "@/utils/formatTime"; @@ -198,6 +197,7 @@ const queryParams = reactive({ const queryFormRef = ref() // 搜索的表单 const exportLoading = ref(false) // 导出的加载中 +const router = useRouter() // 路由 /**发起操作 */ const handleCreate =async () => { await router.push({name: 'ClglCreate'}) diff --git a/src/views/Home/hynr/hygl/index.vue b/src/views/Home/hynr/hygl/index.vue index 580be2c..c6ff744 100644 --- a/src/views/Home/hynr/hygl/index.vue +++ b/src/views/Home/hynr/hygl/index.vue @@ -171,7 +171,6 @@ import { dateFormatter2} from '@/utils/formatTime' import download from '@/utils/download' import { HyglApi, HyglVO } from '@/api/home/hygl' import * as LeaveApi from '@/api/bpm/leave' -import router from "@/router"; /** 会议管理 列表 */ defineOptions({ name: 'Hygl' }) @@ -234,6 +233,7 @@ const handleDetail = (row: LeaveApi.LeaveVO) => { }) } +const router = useRouter() // 路由 /**发起操作 */ const handleCreate = () => { router.push({ name: 'HyglCreate' }) diff --git a/src/views/Home/jbgl/index.vue b/src/views/Home/jbgl/index.vue index 15dadc2..e2141d1 100644 --- a/src/views/Home/jbgl/index.vue +++ b/src/views/Home/jbgl/index.vue @@ -156,7 +156,6 @@ import download from '@/utils/download' import { JbglApi, JbglVO } from '@/api/home/jbgl' import JbglForm from './JbglForm.vue' import * as LeaveApi from '@/api/bpm/leave' -import router from "@/router"; /** 加班管理 列表 */ defineOptions({ name: 'Jbgl' }) @@ -189,6 +188,7 @@ const queryParams = reactive({ const queryFormRef = ref() // 搜索的表单 const exportLoading = ref(false) // 导出的加载中 +const router = useRouter() // 路由 /**发起操作 */ const handleCreate = () => { router.push({ name: 'JbglCreate' }) diff --git a/src/views/Home/kqnr/kqgl/index.vue b/src/views/Home/kqnr/kqgl/index.vue index 8908bdb..8fe0513 100644 --- a/src/views/Home/kqnr/kqgl/index.vue +++ b/src/views/Home/kqnr/kqgl/index.vue @@ -193,7 +193,6 @@ import download from '@/utils/download' import { KqglApi, KqglVO } from '@/api/home/kqgl' import KqglForm from './KqglForm.vue' import * as LeaveApi from '@/api/bpm/leave' -import router from "@/router"; import {DICT_TYPE} from "@/utils/dict"; /** 考勤管理 列表 */ @@ -221,6 +220,7 @@ const queryParams = reactive({ const queryFormRef = ref() // 搜索的表单 const exportLoading = ref(false) // 导出的加载中 +const router = useRouter() // 路由 /**发起操作 */ const handleCreate = () => { router.push({ name: 'KqglCreate' }) From e769535672635f27505a3daa4ddc5d6a9591e38d Mon Sep 17 00:00:00 2001 From: XaoLi717 <144221124+XaoLi717@users.noreply.github.com> Date: Mon, 23 Dec 2024 13:42:44 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E6=89=80=E6=9C=89=E6=B5=81=E7=A8=8BDetai?= =?UTF-8?q?l=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Home/bgnr/bgyp/BgypDetail.vue | 71 +++++++++++++++++--- src/views/Home/clnr/clgl/ClglDetail.vue | 85 ++++++++++++++++++----- src/views/Home/hynr/hygl/HyglDetail.vue | 89 ++++++++++++++++++++----- src/views/Home/jbgl/JbglDetail.vue | 71 +++++++++++++++++--- src/views/Home/kqnr/kqgl/KqglDetail.vue | 59 +++++++++++++++- src/views/Home/xjgl/XjglDetail.vue | 72 +++++++++++++++++--- 6 files changed, 386 insertions(+), 61 deletions(-) diff --git a/src/views/Home/bgnr/bgyp/BgypDetail.vue b/src/views/Home/bgnr/bgyp/BgypDetail.vue index d4ec48e..0e341e9 100644 --- a/src/views/Home/bgnr/bgyp/BgypDetail.vue +++ b/src/views/Home/bgnr/bgyp/BgypDetail.vue @@ -26,25 +26,25 @@ - + - + - + @@ -53,7 +53,7 @@ - + @@ -63,22 +63,24 @@ type="date" value-format="x" placeholder="选择申请时间" - disabled + :disabled="!isEditable('usageDate')" /> - + diff --git a/src/views/Home/clnr/clgl/ClglDetail.vue b/src/views/Home/clnr/clgl/ClglDetail.vue index 0904aec..8734b45 100644 --- a/src/views/Home/clnr/clgl/ClglDetail.vue +++ b/src/views/Home/clnr/clgl/ClglDetail.vue @@ -25,15 +25,15 @@ - + - + {{ dict.label }} @@ -42,32 +42,32 @@ - + - + - + - + @@ -79,7 +79,7 @@ type="date" value-format="x" placeholder="选择用车开始时间" - disabled + :disabled="!isEditable('carStart')" /> @@ -90,7 +90,7 @@ type="date" value-format="x" placeholder="选择用车结束时间" - disabled + :disabled="!isEditable('carEnd')" /> @@ -98,29 +98,31 @@ - + - + - + - + diff --git a/src/views/Home/kqnr/kqgl/KqglDetail.vue b/src/views/Home/kqnr/kqgl/KqglDetail.vue index 57beb57..9a35923 100644 --- a/src/views/Home/kqnr/kqgl/KqglDetail.vue +++ b/src/views/Home/kqnr/kqgl/KqglDetail.vue @@ -11,7 +11,7 @@ v-loading="formLoading" > - + @@ -33,7 +33,7 @@ type="date" value-format="x" placeholder="选择考勤日期" - disabled + :disabled="!isEditable('date')" /> @@ -78,11 +78,13 @@ diff --git a/src/views/Home/xjgl/XjglCreate.vue b/src/views/Home/xjnr/xjgl/XjglCreate.vue similarity index 90% rename from src/views/Home/xjgl/XjglCreate.vue rename to src/views/Home/xjnr/xjgl/XjglCreate.vue index f75fe90..5d18dda 100644 --- a/src/views/Home/xjgl/XjglCreate.vue +++ b/src/views/Home/xjnr/xjgl/XjglCreate.vue @@ -100,6 +100,7 @@ @@ -122,7 +123,7 @@ import {CalendarApi} from "@/api/home/calendar"; import {Edit} from "@element-plus/icons-vue"; /** 销假管理 表单 */ -defineOptions({ name: 'XjglForm' }) +defineOptions({ name: 'XjglCreate' }) const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -275,10 +276,13 @@ const submitForm = async () => { data.startUserSelectAssignees = startUserSelectAssignees.value } - const curFullPath = currentRoute.value.fullPath + let curFullPath = currentRoute.value.fullPath if( curFullPath ) { data.curfullpath = curFullPath } + if (curFullPath.includes("?")) { + curFullPath = curFullPath.split("?")[0]; + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) if ( processKey) { data.processDefinitionKey = processKey @@ -294,10 +298,40 @@ const submitForm = async () => { formLoading.value = false } } + +const draftButton = ref(false) +const saveDraft = async () => { + // 校验表单 + await formRef.value.validate() + // 提交请求 + formLoading.value = true + try { + const data = formData.value as unknown as XjglVO + await XjglApi.saveDraft(data) + message.success(t('存为草稿成功!')) + // 关闭当前 Tab + delView(unref(currentRoute)) + await push({ name: 'Xjgl' }) + } finally { + formLoading.value = false + } +} + /** 打开弹窗 */ onMounted(async () => { await getUserInfo() - const curFullPath = currentRoute.value.fullPath + let curFullPath = currentRoute.value.fullPath + if (curFullPath.includes("?")) { + // 使用 URLSearchParams 提取查询参数 + const params = new URLSearchParams(curFullPath.split("?")[1]); + const id = params.get("id") ; + // 获取路径部分 + curFullPath = curFullPath.split("?")[0]; + if ( id != "") { + formData.value = await XjglApi.getXjgl(Number( id) ) + draftButton.value= true + } + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) if ( !processKey ) { diff --git a/src/views/Home/xjgl/XjglDetail.vue b/src/views/Home/xjnr/xjgl/XjglDetail.vue similarity index 100% rename from src/views/Home/xjgl/XjglDetail.vue rename to src/views/Home/xjnr/xjgl/XjglDetail.vue diff --git a/src/views/Home/xjgl/index.vue b/src/views/Home/xjnr/xjgl/index.vue similarity index 100% rename from src/views/Home/xjgl/index.vue rename to src/views/Home/xjnr/xjgl/index.vue From 6f61827bb59ccd08762b28d7a146511a9c0ca63d Mon Sep 17 00:00:00 2001 From: XaoLi717 <144221124+XaoLi717@users.noreply.github.com> Date: Tue, 24 Dec 2024 11:59:27 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E8=80=83=E5=8B=A4=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Home/xjnr/draft/{indexDraft.vue => indexDraftXjgl.vue} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/views/Home/xjnr/draft/{indexDraft.vue => indexDraftXjgl.vue} (100%) diff --git a/src/views/Home/xjnr/draft/indexDraft.vue b/src/views/Home/xjnr/draft/indexDraftXjgl.vue similarity index 100% rename from src/views/Home/xjnr/draft/indexDraft.vue rename to src/views/Home/xjnr/draft/indexDraftXjgl.vue From c16fd32699131351f069d5456be06ae27944d8b7 Mon Sep 17 00:00:00 2001 From: XaoLi717 <144221124+XaoLi717@users.noreply.github.com> Date: Tue, 24 Dec 2024 12:00:47 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E8=80=83=E5=8B=A4=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home/kqgl/index.ts | 8 + src/views/Home/kqnr/draft/indexDraftKqgl.vue | 209 +++++++++++++++++++ src/views/Home/kqnr/kqgl/KqglCreate.vue | 68 +++++- 3 files changed, 277 insertions(+), 8 deletions(-) create mode 100644 src/views/Home/kqnr/draft/indexDraftKqgl.vue diff --git a/src/api/home/kqgl/index.ts b/src/api/home/kqgl/index.ts index 82e1da3..5d841b4 100644 --- a/src/api/home/kqgl/index.ts +++ b/src/api/home/kqgl/index.ts @@ -45,4 +45,12 @@ export const KqglApi = { exportKqgl: async (params) => { return await request.download({ url: `/home/kqgl/export-excel`, params }) }, + // 保存为草稿 + saveDraft: async (data: KqglVO) => { + return await request.post({ url: `/home/kqgl/saveDraft`, data }) + }, +// 查询草稿 + getDraft: async (params: any) => { + return await request.get({ url: `/home/kqgl/draft`, params }) + }, } diff --git a/src/views/Home/kqnr/draft/indexDraftKqgl.vue b/src/views/Home/kqnr/draft/indexDraftKqgl.vue new file mode 100644 index 0000000..2fa804b --- /dev/null +++ b/src/views/Home/kqnr/draft/indexDraftKqgl.vue @@ -0,0 +1,209 @@ + + + diff --git a/src/views/Home/kqnr/kqgl/KqglCreate.vue b/src/views/Home/kqnr/kqgl/KqglCreate.vue index ae6d7a0..d2dfa66 100644 --- a/src/views/Home/kqnr/kqgl/KqglCreate.vue +++ b/src/views/Home/kqnr/kqgl/KqglCreate.vue @@ -76,6 +76,7 @@ @@ -297,6 +298,10 @@ const changeStatus = async ()=>{ } }; +//流程 +const { query } = useRoute() // 查询参数 +const queryId = query.id as unknown as number // 从 URL 传递过来的 id 编号 + /** 打开弹窗 设置时间戳为固定信息 */ const open = async () => { pop.value=false//每次打开渲染span @@ -306,9 +311,15 @@ const open = async () => { formLoading.value = true try { await getUserInfo() //获取当前用户,部门数据 - //创建的我就新建数据,还有新建标识,把标识传递过去 - await createUser() - await getList(dateKey.value) + // 通过queryId判断 草稿模式走草稿逻辑 新建模式走新建逻辑 + if (queryId){ + formData.value = await KqglApi.getKqgl(queryId) + await getList() //如果是修改那么我获取列表标识使用有的标识 + } else { + //创建的我就新建数据,还有新建标识,把标识传递过去 + await createUser() + await getList(dateKey.value) + } await changeStatus()//把字符串工作状态更改为数组 await getWorkDay()//获取工作日信息 } finally { @@ -336,19 +347,29 @@ const submitForm = async () => { data.startUserSelectAssignees = startUserSelectAssignees.value } - const curFullPath = currentRoute.value.fullPath + let curFullPath = currentRoute.value.fullPath if( curFullPath ) { data.curfullpath = curFullPath } + if (curFullPath.includes("?")) { + curFullPath = curFullPath.split("?")[0]; + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) if ( processKey) { data.processDefinitionKey = processKey } - data.date = dateKey.value //创建后提交的时候才会更新标识 - await KqglApi.createKqgl(data) - await updateUser() //提交的时候更新考勤数据 + // 提交的时候也是,因为草稿保存时key已经保存过了,所以草稿模式不需要再保存key,会覆盖原数据, + // 判断 新建模式就正常保存key + if (queryId){ + await KqglApi.createKqgl(data) + await updateUser() //提交的时候更新考勤数据 + }else { + data.date = dateKey.value //创建后提交的时候才会更新标识 + await KqglApi.createKqgl(data) + await updateUser() //提交的时候更新考勤数据 + } message.success(t('common.createSuccess')) delView(unref(currentRoute)) @@ -357,13 +378,44 @@ const submitForm = async () => { formLoading.value = false } } +const draftButton = ref(false) +const saveDraft = async () => { + // 校验表单 + await formRef.value.validate() + // 提交请求 + formLoading.value = true + try { + const data = formData.value as unknown as KqglVO + // 这里时考勤独有的需要保存一下key + data.date = dateKey.value //创建后提交的时候才会更新标识 + await KqglApi.saveDraft(data) + await updateUser() //提交的时候更新考勤数据 + message.success(t('存为草稿成功!')) + // 关闭当前 Tab + delView(unref(currentRoute)) + await push({ name: 'Kqgl' }) + } finally { + formLoading.value = false + } +} /** 初始化 */ onMounted(async () => { await open() - const curFullPath = currentRoute.value.fullPath + let curFullPath = currentRoute.value.fullPath + if (curFullPath.includes("?")) { + // 使用 URLSearchParams 提取查询参数 + const params = new URLSearchParams(curFullPath.split("?")[1]); + const id = params.get("id") ; + // 获取路径部分 + curFullPath = curFullPath.split("?")[0]; + if ( id != "") { + formData.value = await KqglApi.getKqgl(Number( id) ) + draftButton.value= true + } + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) if ( !processKey ) { From c67d05f72b551561ed4216fa1b51aed41a4961b1 Mon Sep 17 00:00:00 2001 From: XaoLi717 <144221124+XaoLi717@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:34:51 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=8A=A0=E7=8F=AD=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home/jbgl/index.ts | 8 + src/router/modules/remaining.ts | 12 +- src/views/Home/jbnr/draft/indexDraftJbgl.vue | 223 ++++++++++++++++++ src/views/Home/{ => jbnr}/jbgl/JbglCreate.vue | 39 ++- src/views/Home/{ => jbnr}/jbgl/JbglDetail.vue | 0 src/views/Home/{ => jbnr}/jbgl/JbglForm.vue | 0 src/views/Home/{ => jbnr}/jbgl/index.vue | 0 7 files changed, 273 insertions(+), 9 deletions(-) create mode 100644 src/views/Home/jbnr/draft/indexDraftJbgl.vue rename src/views/Home/{ => jbnr}/jbgl/JbglCreate.vue (89%) rename src/views/Home/{ => jbnr}/jbgl/JbglDetail.vue (100%) rename src/views/Home/{ => jbnr}/jbgl/JbglForm.vue (100%) rename src/views/Home/{ => jbnr}/jbgl/index.vue (100%) diff --git a/src/api/home/jbgl/index.ts b/src/api/home/jbgl/index.ts index e63d827..0126a3d 100644 --- a/src/api/home/jbgl/index.ts +++ b/src/api/home/jbgl/index.ts @@ -51,4 +51,12 @@ export const JbglApi = { exportJbgl: async (params) => { return await request.download({ url: `/home/jbgl/export-excel`, params }) }, + // 保存为草稿 + saveDraft: async (data: JbglVO) => { + return await request.post({ url: `/home/jbgl/saveDraft`, data }) + }, +// 查询草稿 + getDraft: async (params: any) => { + return await request.get({ url: `/home/jbgl/draft`, params }) + }, } diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 0281d50..12a64eb 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -713,27 +713,27 @@ const remainingRouter: AppRouteRecordRaw[] = [ } }, { - path: 'jbgl/JbglCreate', - component: () => import('@/views/Home/jbgl/JbglCreate.vue'), + path: 'jbnr/jbgl/JbglCreate', + component: () => import('@/views/Home/jbnr/jbgl/JbglCreate.vue'), name: 'JbglCreate', meta: { noCache: true, hidden: true, canTo: true, title: '发起加班管理流程', - activeMenu: '/Home/jbgl/Jbglflow' + activeMenu: '/Home/jbnr/jbgl/Jbglflow' } }, { - path: 'jbgl/JbglDetail', - component: () => import('@/views/Home/jbgl/JbglDetail.vue'), + path: 'jbnr/jbgl/JbglDetail', + component: () => import('@/views/Home/jbnr/jbgl/JbglDetail.vue'), name: 'JbglDetail', meta: { noCache: true, hidden: true, canTo: true, title: '查看加班管理流程', - activeMenu: '/Home/jbgl/Jbglflow' + activeMenu: '/Home/jbnr/jbgl/Jbglflow' } }, { diff --git a/src/views/Home/jbnr/draft/indexDraftJbgl.vue b/src/views/Home/jbnr/draft/indexDraftJbgl.vue new file mode 100644 index 0000000..1e1b9db --- /dev/null +++ b/src/views/Home/jbnr/draft/indexDraftJbgl.vue @@ -0,0 +1,223 @@ + + + diff --git a/src/views/Home/jbgl/JbglCreate.vue b/src/views/Home/jbnr/jbgl/JbglCreate.vue similarity index 89% rename from src/views/Home/jbgl/JbglCreate.vue rename to src/views/Home/jbnr/jbgl/JbglCreate.vue index 9e6f16d..faf6889 100644 --- a/src/views/Home/jbgl/JbglCreate.vue +++ b/src/views/Home/jbnr/jbgl/JbglCreate.vue @@ -93,6 +93,7 @@ @@ -175,6 +176,25 @@ const getUserInfo = async () => { deptInfo.value = formData.value.deptName ?? ''; userInfo.value = formData.value.userName ?? ''; }; + +const draftButton = ref(false) +const saveDraft = async () => { + // 校验表单 + await formRef.value.validate() + // 提交请求 + formLoading.value = true + try { + const data = formData.value as unknown as JbglVO + await JbglApi.saveDraft(data) + message.success(t('存为草稿成功!')) + // 关闭当前 Tab + delView(unref(currentRoute)) + await push({ name: 'Jbgl' }) + } finally { + formLoading.value = false + } +} + /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { @@ -193,11 +213,14 @@ const submitForm = async () => { data.startUserSelectAssignees = startUserSelectAssignees.value } - const curFullPath = currentRoute.value.fullPath + let curFullPath = currentRoute.value.fullPath if( curFullPath ) { data.curfullpath = curFullPath } + if (curFullPath.includes("?")) { + curFullPath = curFullPath.split("?")[0]; + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) if ( processKey) { data.processDefinitionKey = processKey @@ -215,8 +238,18 @@ const submitForm = async () => { onMounted(async () => { await getUserInfo() - const curFullPath = currentRoute.value.fullPath - + let curFullPath = currentRoute.value.fullPath + if (curFullPath.includes("?")) { + // 使用 URLSearchParams 提取查询参数 + const params = new URLSearchParams(curFullPath.split("?")[1]); + const id = params.get("id") ; + // 获取路径部分 + curFullPath = curFullPath.split("?")[0]; + if ( id != "") { + formData.value = await JbglApi.getJbgl(Number( id) ) + draftButton.value= true + } + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) if ( !processKey ) { diff --git a/src/views/Home/jbgl/JbglDetail.vue b/src/views/Home/jbnr/jbgl/JbglDetail.vue similarity index 100% rename from src/views/Home/jbgl/JbglDetail.vue rename to src/views/Home/jbnr/jbgl/JbglDetail.vue diff --git a/src/views/Home/jbgl/JbglForm.vue b/src/views/Home/jbnr/jbgl/JbglForm.vue similarity index 100% rename from src/views/Home/jbgl/JbglForm.vue rename to src/views/Home/jbnr/jbgl/JbglForm.vue diff --git a/src/views/Home/jbgl/index.vue b/src/views/Home/jbnr/jbgl/index.vue similarity index 100% rename from src/views/Home/jbgl/index.vue rename to src/views/Home/jbnr/jbgl/index.vue From 56336a7b8c95efb968477f48f6de734c49dcf37f Mon Sep 17 00:00:00 2001 From: XaoLi717 <144221124+XaoLi717@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:00:01 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home/hygl/index.ts | 8 + src/views/Home/hynr/draft/indexDraftHygl.vue | 265 +++++++++++++++++++ src/views/Home/hynr/hygl/HyglCreate.vue | 38 ++- 3 files changed, 308 insertions(+), 3 deletions(-) create mode 100644 src/views/Home/hynr/draft/indexDraftHygl.vue diff --git a/src/api/home/hygl/index.ts b/src/api/home/hygl/index.ts index 8ca28b5..48fc588 100644 --- a/src/api/home/hygl/index.ts +++ b/src/api/home/hygl/index.ts @@ -63,4 +63,12 @@ export const HyglApi = { exportHygl: async (params) => { return await request.download({ url: `/home/hygl/export-excel`, params }) }, + // 保存为草稿 + saveDraft: async (data: HyglVO) => { + return await request.post({ url: `/home/hygl/saveDraft`, data }) + }, +// 查询草稿 + getDraft: async (params: any) => { + return await request.get({ url: `/home/hygl/draft`, params }) + }, } diff --git a/src/views/Home/hynr/draft/indexDraftHygl.vue b/src/views/Home/hynr/draft/indexDraftHygl.vue new file mode 100644 index 0000000..b94a8c8 --- /dev/null +++ b/src/views/Home/hynr/draft/indexDraftHygl.vue @@ -0,0 +1,265 @@ + + + diff --git a/src/views/Home/hynr/hygl/HyglCreate.vue b/src/views/Home/hynr/hygl/HyglCreate.vue index ef0ff62..ade15de 100644 --- a/src/views/Home/hynr/hygl/HyglCreate.vue +++ b/src/views/Home/hynr/hygl/HyglCreate.vue @@ -153,6 +153,7 @@ @@ -260,6 +261,24 @@ userInfo.value = formData.value.userName ?? ''; }; + const draftButton = ref(false) + const saveDraft = async () => { + // 校验表单 + await formRef.value.validate() + // 提交请求 + formLoading.value = true + try { + const data = formData.value as unknown as HyglVO + await HyglApi.saveDraft(data) + message.success(t('存为草稿成功!')) + // 关闭当前 Tab + delView(unref(currentRoute)) + await push({ name: 'Hygl' }) + } finally { + formLoading.value = false + } + } + /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { @@ -279,11 +298,14 @@ data.startUserSelectAssignees = startUserSelectAssignees.value } - const curFullPath = currentRoute.value.fullPath + let curFullPath = currentRoute.value.fullPath if( curFullPath ) { data.curfullpath = curFullPath } + if (curFullPath.includes("?")) { + curFullPath = curFullPath.split("?")[0]; + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) if ( processKey) { data.processDefinitionKey = processKey @@ -329,8 +351,18 @@ await getUserInfo() await getList() - const curFullPath = currentRoute.value.fullPath - + let curFullPath = currentRoute.value.fullPath + if (curFullPath.includes("?")) { + // 使用 URLSearchParams 提取查询参数 + const params = new URLSearchParams(curFullPath.split("?")[1]); + const id = params.get("id") ; + // 获取路径部分 + curFullPath = curFullPath.split("?")[0]; + if ( id != "") { + formData.value = await HyglApi.getHygl(Number( id) ) + draftButton.value= true + } + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) if ( !processKey ) { From ddb0cc1e55eb2235e168f708b8f756d8a4f54dce Mon Sep 17 00:00:00 2001 From: XaoLi717 <144221124+XaoLi717@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:38:28 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home/clgl/index.ts | 8 + src/views/Home/clnr/clgl/ClglCreate.vue | 37 ++- src/views/Home/clnr/draft/indexDraftClgl.vue | 247 +++++++++++++++++++ 3 files changed, 290 insertions(+), 2 deletions(-) create mode 100644 src/views/Home/clnr/draft/indexDraftClgl.vue diff --git a/src/api/home/clgl/index.ts b/src/api/home/clgl/index.ts index bbabf9f..e10e905 100644 --- a/src/api/home/clgl/index.ts +++ b/src/api/home/clgl/index.ts @@ -56,4 +56,12 @@ export const ClglApi = { exportClgl: async (params) => { return await request.download({ url: `/home/clgl/export-excel`, params }) }, + // 保存为草稿 + saveDraft: async (data: ClglVO) => { + return await request.post({ url: `/home/clgl/saveDraft`, data }) + }, + // 查询草稿 + getDraft: async (params: any) => { + return await request.get({ url: `/home/clgl/draft`, params }) + }, } diff --git a/src/views/Home/clnr/clgl/ClglCreate.vue b/src/views/Home/clnr/clgl/ClglCreate.vue index 4831f88..4d5cdbe 100644 --- a/src/views/Home/clnr/clgl/ClglCreate.vue +++ b/src/views/Home/clnr/clgl/ClglCreate.vue @@ -145,6 +145,7 @@ @@ -262,6 +263,24 @@ const changeDriverForm = (val:any) => { form.carDriverInfo = val.contactInfo } +const draftButton = ref(false) +const saveDraft = async () => { + // 校验表单 + await formRef.value.validate() + // 提交请求 + formLoading.value = true + try { + const data = formData.value as unknown as ClglVO + await ClglApi.saveDraft(data) + message.success(t('存为草稿成功!')) + // 关闭当前 Tab + delView(unref(currentRoute)) + await push({ name: 'Clgl' }) + } finally { + formLoading.value = false + } +} + /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { @@ -281,11 +300,14 @@ const submitForm = async () => { data.startUserSelectAssignees = startUserSelectAssignees.value } - const curFullPath = currentRoute.value.fullPath + let curFullPath = currentRoute.value.fullPath if( curFullPath ) { data.curfullpath = curFullPath } + if (curFullPath.includes("?")) { + curFullPath = curFullPath.split("?")[0]; + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) if ( processKey) { data.processDefinitionKey = processKey @@ -326,7 +348,18 @@ const getUserInfo = async () => { onMounted(async () => { await getUserInfo() - const curFullPath = currentRoute.value.fullPath + let curFullPath = currentRoute.value.fullPath + if (curFullPath.includes("?")) { + // 使用 URLSearchParams 提取查询参数 + const params = new URLSearchParams(curFullPath.split("?")[1]); + const id = params.get("id") ; + // 获取路径部分 + curFullPath = curFullPath.split("?")[0]; + if ( id != "") { + formData.value = await ClglApi.getClgl(Number( id) ) + draftButton.value= true + } + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) diff --git a/src/views/Home/clnr/draft/indexDraftClgl.vue b/src/views/Home/clnr/draft/indexDraftClgl.vue new file mode 100644 index 0000000..b43bf1d --- /dev/null +++ b/src/views/Home/clnr/draft/indexDraftClgl.vue @@ -0,0 +1,247 @@ + + + From e385bafc3c240220800efe0c4bc63bda355f2c16 Mon Sep 17 00:00:00 2001 From: XaoLi717 <144221124+XaoLi717@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:47:01 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Home/clnr/draft/indexDraftClgl.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Home/clnr/draft/indexDraftClgl.vue b/src/views/Home/clnr/draft/indexDraftClgl.vue index b43bf1d..28c346d 100644 --- a/src/views/Home/clnr/draft/indexDraftClgl.vue +++ b/src/views/Home/clnr/draft/indexDraftClgl.vue @@ -128,7 +128,7 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict' import download from '@/utils/download' import { ClglApi, ClglVO } from '@/api/home/clgl' -import ClglForm from './ClglForm.vue' +import ClglForm from "@/views/Home/clnr/clgl/ClglForm.vue"; import * as LeaveApi from '@/api/bpm/leave' import {dateFormatter2} from "@/utils/formatTime"; From a8b3cef503599414d450dcde1d7429bd08245d68 Mon Sep 17 00:00:00 2001 From: XaoLi717 <144221124+XaoLi717@users.noreply.github.com> Date: Tue, 24 Dec 2024 16:23:20 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E5=8A=9E=E5=85=AC=E7=94=A8=E5=93=81?= =?UTF-8?q?=E8=8D=89=E7=A8=BF=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home/bgyp/index.ts | 8 + src/views/Home/bgnr/bgyp/BgypCreate.vue | 37 +++- src/views/Home/bgnr/draft/indexDraftBgyp.vue | 212 +++++++++++++++++++ 3 files changed, 254 insertions(+), 3 deletions(-) create mode 100644 src/views/Home/bgnr/draft/indexDraftBgyp.vue diff --git a/src/api/home/bgyp/index.ts b/src/api/home/bgyp/index.ts index 78368cb..0fd15ad 100644 --- a/src/api/home/bgyp/index.ts +++ b/src/api/home/bgyp/index.ts @@ -51,4 +51,12 @@ export const BgypApi = { exportBgyp: async (params) => { return await request.download({ url: `/home/bgyp/export-excel`, params }) }, + // 保存为草稿 + saveDraft: async (data: BgypVO) => { + return await request.post({ url: `/home/bgyp/saveDraft`, data }) + }, +// 查询草稿 + getDraft: async (params: any) => { + return await request.get({ url: `/home/bgyp/draft`, params }) + }, } diff --git a/src/views/Home/bgnr/bgyp/BgypCreate.vue b/src/views/Home/bgnr/bgyp/BgypCreate.vue index abc9e0c..25352ce 100644 --- a/src/views/Home/bgnr/bgyp/BgypCreate.vue +++ b/src/views/Home/bgnr/bgyp/BgypCreate.vue @@ -86,6 +86,7 @@ @@ -164,6 +165,23 @@ const userList = ref([]) // 用户列表 const deptInfo = ref('') // 部门信息 const userInfo = ref('') // 用户名字 +const draftButton = ref(false) +const saveDraft = async () => { + // 校验表单 + await formRef.value.validate() + // 提交请求 + formLoading.value = true + try { + const data = formData.value as unknown as BgypVO + await BgypApi.saveDraft(data) + message.success(t('存为草稿成功!')) + // 关闭当前 Tab + delView(unref(currentRoute)) + await push({ name: 'Bgyp' }) + } finally { + formLoading.value = false + } +} /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 @@ -183,11 +201,14 @@ const submitForm = async () => { data.startUserSelectAssignees = startUserSelectAssignees.value } - const curFullPath = currentRoute.value.fullPath + let curFullPath = currentRoute.value.fullPath if( curFullPath ) { data.curfullpath = curFullPath } + if (curFullPath.includes("?")) { + curFullPath = curFullPath.split("?")[0]; + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) if ( processKey) { data.processDefinitionKey = processKey @@ -215,8 +236,18 @@ const formRules = reactive({ onMounted(async () => { await getUserInfo() - const curFullPath = currentRoute.value.fullPath - + let curFullPath = currentRoute.value.fullPath + if (curFullPath.includes("?")) { + // 使用 URLSearchParams 提取查询参数 + const params = new URLSearchParams(curFullPath.split("?")[1]); + const id = params.get("id") ; + // 获取路径部分 + curFullPath = curFullPath.split("?")[0]; + if ( id != "") { + formData.value = await BgypApi.getBgyp(Number( id) ) + draftButton.value= true + } + } const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) if ( !processKey ) { diff --git a/src/views/Home/bgnr/draft/indexDraftBgyp.vue b/src/views/Home/bgnr/draft/indexDraftBgyp.vue new file mode 100644 index 0000000..5587589 --- /dev/null +++ b/src/views/Home/bgnr/draft/indexDraftBgyp.vue @@ -0,0 +1,212 @@ + + +