From cb918ea5627a66ba744bba20459b70089bea53a7 Mon Sep 17 00:00:00 2001 From: bestlee Date: Wed, 2 Sep 2026 16:28:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4=E7=94=B3=E8=AF=B7=E8=A1=A8?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=8E=A5=E5=8F=A3=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/api/change.ts | 2 +- src/views/my/initiateChange/index.vue | 123 ++-- .../modules/ChangeCompareTable.vue | 30 +- .../my/initiateChange/modules/changeApply.vue | 645 ++++++++++-------- .../my/initiateChange/modules/changePre.vue | 108 +-- 5 files changed, 503 insertions(+), 405 deletions(-) diff --git a/src/service/api/change.ts b/src/service/api/change.ts index 372240f..9ae91f0 100644 --- a/src/service/api/change.ts +++ b/src/service/api/change.ts @@ -72,7 +72,7 @@ export function applicationSaveApi(id: number, params: { }) { return request({ url: `/api/changes/${id}/apply-form`, - method: 'post', + method: 'put', data: params }); } diff --git a/src/views/my/initiateChange/index.vue b/src/views/my/initiateChange/index.vue index 8145847..a1b8b49 100644 --- a/src/views/my/initiateChange/index.vue +++ b/src/views/my/initiateChange/index.vue @@ -12,7 +12,7 @@ import { aiRiskOrganize, aiRiskPreAnalysis, } from "@/service/api/ai"; -import { precheckSaveApi } from "@/service/api/change"; +import { precheckSaveApi, applicationSaveApi } from "@/service/api/change"; import Ed from "./modules/Ed.vue"; import Hazop from "./modules/hazop.vue"; import Jsa from "./modules/jsa.vue"; @@ -228,7 +228,6 @@ const confirmTab = (t: string) => { const regenerate = () => window.$message?.success(`演示:已根据变更描述重新生成${TAB_NAME[tab.value]}(本页内容已刷新)`); const download = () => window.$message?.success(`演示:${TAB_NAME[tab.value]}已下载(Word/PDF)`); -const downloadPdf = () => window.$message?.success(`演示:${previewFile.value} 已下载`); const finishApprover = () => { sheet.value = ''; window.$message?.success('审批流程已更新(底部固定行摘要同步刷新)'); @@ -589,6 +588,44 @@ const TAB_NAME: Record = { train: "变更培训内容", pssr: "PSSR检查内容", accept: "验收评价", close: "变更关闭确认表", }; +// 变更申请表表单必填判断 +const changeApplyRules = () => { + if(title.value.trim()===''){ + window.$message?.warning('请填写变更名称'); + return true + } + let form = changeApplyRef.value?.form; + if(form?.manage_dept?.trim() === ''){ + window.$message?.warning('请填写申请部门'); + return true + } + if(form?.main_changes?.length===0){ + window.$message?.warning('请添加主要变更内容'); + return true + } + if(form?.main_changes.some((str:string)=>str.trim()==='')){ + window.$message?.warning('请填写主要变更内容'); + return true + } + if(form?.change_type===null){ + window.$message?.warning('请选择变更类型'); + return true + } + if(form?.change_level===null){ + window.$message?.warning('请选择变更等级'); + return true + } + if(form?.duration_type===null){ + window.$message?.warning('请选择变更时限'); + return true + } + if(form?.duration_type === 1 && form?.restore_deadline===null){ + window.$message?.warning('请选择计划恢复时间'); + return true + } + return false +} + // 保存草稿 const saveDraft = async () => { // 变更预识别 @@ -617,6 +654,18 @@ const saveDraft = async () => { updateLoading('save', false); changePreRef.value?.updateBtnDisabled(false); } + // 变更申请表 + if(tab.value === 'form'){ + if(changeApplyRules()){ + return + } + updateLoading('save', true); + const {error} = await applicationSaveApi(currentId.value, changeApplyRef.value?.form); + if(!error){ + window.$message?.success("已保存为草稿,可在左侧「我的草稿」中继续编辑"); + } + updateLoading('save', false); + } } // 更新按钮禁用状态 @@ -681,19 +730,18 @@ onMounted(async () => {
-
+
- - +
- +
+ +
- +
- +
- + - + - + @@ -1179,42 +1227,7 @@ onMounted(async () => { - - - - - - - +