From 9bd865cb2c006caeb5ab66cf2133764285b5e0b0 Mon Sep 17 00:00:00 2001 From: bestlee Date: Mon, 14 Sep 2026 14:59:27 +0800 Subject: [PATCH] =?UTF-8?q?FEMA=E7=9F=A9=E9=98=B5=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=8CFEMA=E6=8F=92=E4=BB=B6=E9=9D=99?= =?UTF-8?q?=E6=80=81=E9=A1=B5=E9=9D=A2=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/api/system.ts | 14 +- .../my/initiateChange/modules/changeApply.vue | 4 +- src/views/my/initiateChange/modules/fmea.vue | 1492 +++++++++++++++++ src/views/my/initiateChange/modules/hazop.vue | 14 +- .../initiateChange/modules/riskAnalysis.vue | 69 +- .../my/initiateChange/modules/riskCheck.vue | 111 +- src/views/systemManage/setting/index.vue | 389 ++++- 7 files changed, 1974 insertions(+), 119 deletions(-) create mode 100644 src/views/my/initiateChange/modules/fmea.vue diff --git a/src/service/api/system.ts b/src/service/api/system.ts index ccaa3ee..bbe3f1a 100644 --- a/src/service/api/system.ts +++ b/src/service/api/system.ts @@ -95,13 +95,13 @@ export function setApproverApi(id:number,data:any) { } // 获取风险矩阵配置 -export function matrixConfigApi(bizType:string) { +export function matrixConfigApi() { return request({ - url: `/api/risk-matrix/${bizType}`, + url: `/api/matrix`, method: 'get', }); } -// 保存风险矩阵配置 +// 保存风险矩阵配置(HAZOP) export function saveMatrixConfigApi(bizType:string,data:any) { return request({ url: `/api/risk-matrix/${bizType}`, @@ -109,5 +109,13 @@ export function saveMatrixConfigApi(bizType:string,data:any) { data, }); } +// 保存风险矩阵配置(FMEA) +export function saveFmeaMatrixConfigApi(data:any) { + return request({ + url: `/api/fmea-matrix`, + method: 'put', + data, + }); +} diff --git a/src/views/my/initiateChange/modules/changeApply.vue b/src/views/my/initiateChange/modules/changeApply.vue index 59ea8cc..6d80fb8 100644 --- a/src/views/my/initiateChange/modules/changeApply.vue +++ b/src/views/my/initiateChange/modules/changeApply.vue @@ -99,9 +99,9 @@ const PURPOSE_OPTIONS = [ const UPDATE_DOC_OPTIONS = ['PID图纸', '操作规程', '总图', '设备台账', '工艺卡片', '联锁台账', '应急预案']; // 风险分析选项 const RISK_TOOLS_FORM = [ + { key: "RISK", label: "风险预分析" }, { key: "HAZOP", label: "HAZOP" }, - { key: "JSA", label: "JSA" }, - { key: "SCL", label: "设备SCL" }, + { key: "FMEA", label: "FMEA" }, { key: "RISK_CHECK", label: "风险检查表" }, ]; const questions = ref([ diff --git a/src/views/my/initiateChange/modules/fmea.vue b/src/views/my/initiateChange/modules/fmea.vue new file mode 100644 index 0000000..6d629e4 --- /dev/null +++ b/src/views/my/initiateChange/modules/fmea.vue @@ -0,0 +1,1492 @@ + + + + + diff --git a/src/views/my/initiateChange/modules/hazop.vue b/src/views/my/initiateChange/modules/hazop.vue index 5ff548c..2a880e0 100644 --- a/src/views/my/initiateChange/modules/hazop.vue +++ b/src/views/my/initiateChange/modules/hazop.vue @@ -737,8 +737,8 @@ const getMenuOptions = (type: string) => { { label: '删除分析对象', key: 'delObj' }, ] const devOptions = [ - { label: '编辑分离', key: 'editDev' }, - { label: '删除分离', key: 'delDev' }, + { label: '编辑偏离', key: 'editDev' }, + { label: '删除偏离', key: 'delDev' }, ] const map:any = { node: nodeOptions, @@ -1105,7 +1105,7 @@ onBeforeUnmount(() => { - + 当前偏离暂无分析记录,点击右上角「AI 分析当前偏离」自动生成,或「新增行」手动填写 @@ -1389,9 +1389,9 @@ onBeforeUnmount(() => {
@@ -1428,9 +1428,9 @@ onBeforeUnmount(() => {
diff --git a/src/views/my/initiateChange/modules/riskAnalysis.vue b/src/views/my/initiateChange/modules/riskAnalysis.vue index b1f6f2e..d8ad763 100644 --- a/src/views/my/initiateChange/modules/riskAnalysis.vue +++ b/src/views/my/initiateChange/modules/riskAnalysis.vue @@ -6,7 +6,7 @@ import { useThemeStore } from '@/store/modules/theme'; import RiskPre from "./riskPre.vue"; import Hazop from "./hazop.vue"; import Jsa from "./jsa.vue"; -import Scl from "./scl.vue"; +import Fmea from "./fmea.vue"; import RiskCheck from "./riskCheck.vue"; import Footer from './footer.vue' import { matrixConfigApi } from "@/service/api/system"; @@ -19,12 +19,13 @@ const emit = defineEmits(['save','submit','confirmTab']); watch(() => props.currentForm, (newVal:any) => { const omit = (obj:any, fields: string[]) => Object.fromEntries(Object.entries(obj).filter(([k]) => !fields.includes(k))); const result = newVal?.records.map((item:any) => omit(item, [ - 'id', 'created_at', 'updated_at', 'change_id', 'source_row_id' + 'created_at', 'updated_at', 'change_id', 'source_row_id' ])); riskRecords.value = result || []; }) const hazopRiskMatrixConfig = ref(null); +const fmeaRiskMatrixConfig = ref(null); const jsaRiskMatrixConfig = ref(null); const pluginDone = computed(() => riskRecords.value.reduce((acc:any, item:any) => { @@ -33,7 +34,7 @@ const pluginDone = computed(() => return acc; }, {} as Record) ); -const tools = ref(["RISK","HAZOP","JSA", "RISK_CHECK"]); +const tools = ref(["RISK","HAZOP","FMEA", "RISK_CHECK"]); const riskRecords = ref([]); const pluginDrawer = ref(false); const currentPlugin = ref(''); @@ -42,7 +43,7 @@ const currentPlugin = ref(''); const TOOL_CARDS = [ { key: "RISK", name: "风险预分析" }, { key: "HAZOP", name: "HAZOP 分析" }, - { key: "JSA", name: "JSA 分析" }, + { key: "FMEA", name: "FMEA 分析" }, { key: "RISK_CHECK", name: "风险检查表" }, ]; @@ -157,6 +158,10 @@ return result; } // 整理入表 const exportAll = (type: string, items: any[]) => { + // console.log(items) + // console.log(riskRecords.value) + // console.log([...riskRecords.value, ...items]) + // 如果有id且id!=0,就用id去重,否则根据对象内容去重 riskRecords.value = uniqueById([...riskRecords.value, ...items]); if (type === "all") { pluginDrawer.value = false; @@ -173,10 +178,7 @@ const usePlugin = (key: string) => { pluginDrawer.value = true; } // 关闭插件弹框 -const closePlugin = (type: string = "", count: any = undefined) => { - if(type){ - pluginDone.value[type] = count; - } +const closePlugin = () => { pluginDrawer.value = false; } @@ -193,26 +195,20 @@ const confirmTab = (tab:string, val:boolean) => { emit('confirmTab', tab, val); } -// 获取HAZOP风险矩阵配置 -const getHazopRiskMatrixConfig = async () => { - const {data,error} = await matrixConfigApi("HAZOP"); - if(!error){ - hazopRiskMatrixConfig.value = data; - } -} // 获取JSA风险矩阵配置 -const getJsaRiskMatrixConfig = async () => { - const {data,error} = await matrixConfigApi("JSA"); +const getRiskMatrixConfig = async () => { + const {data,error} = await matrixConfigApi(); if(!error){ - jsaRiskMatrixConfig.value = data; + hazopRiskMatrixConfig.value = data?.hazop || null; + jsaRiskMatrixConfig.value = data?.jsa || null; + fmeaRiskMatrixConfig.value = data?.fmea || null; } } defineExpose({riskRecords}) onMounted(() => { - getHazopRiskMatrixConfig(); - getJsaRiskMatrixConfig(); + getRiskMatrixConfig(); }) @@ -229,7 +225,7 @@ onMounted(() => { {{ formInfo?.change_level === 2 ? '重要变更' : '一般变更' }} - {{ formInfo?.change_level === 2 ? '规则:HAZOP 必做,同时开展 JSA' : '规则:JSA,涉及工艺安全边界的应升级 HAZOP' }} + {{ formInfo?.change_level === 2 ? '规则:HAZOP 必做' : '规则:涉及工艺安全边界的应升级 HAZOP' }}
@@ -355,6 +351,16 @@ onMounted(() => { {{jsaRiskLevel(rec.l_value, rec.s_value)?.name}}
+
+ + + {{rec.inherent_level?rec.inherent_level:'-'}} + + +
@@ -421,9 +427,19 @@ onMounted(() => { +
+ + + {{rec.residual_level?rec.residual_level:'-'}} + + +
- {{ rec.source==='RISK'?'风险预分析':rec.source }} + {{ rec.source==='RISK'?'风险预分析':rec.source==='RISK_CHECK'?'风险检查': rec.source }} 已转 PSSR @@ -470,14 +486,11 @@ onMounted(() => { - -