变更申请表保存接口完成
This commit is contained in:
@@ -72,7 +72,7 @@ export function applicationSaveApi(id: number, params: {
|
||||
}) {
|
||||
return request({
|
||||
url: `/api/changes/${id}/apply-form`,
|
||||
method: 'post',
|
||||
method: 'put',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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<string, string> = {
|
||||
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 () => {
|
||||
</div>
|
||||
<!-- 中间 -->
|
||||
<div class="p-4">
|
||||
<div class="space-y-4" :class="tab === 'pre'?'scroll':'scroll2'">
|
||||
<div :class="tab === 'pre'?'scroll':'scroll2'">
|
||||
<!-- ===== 变更预识别 ===== -->
|
||||
<template v-if="tab === 'pre'">
|
||||
<div v-show="tab === 'pre'">
|
||||
<ChangePre ref="changePreRef" @updateBtn="updateBtn" />
|
||||
</template>
|
||||
|
||||
</div>
|
||||
<!-- ===== 变更申请表 ===== -->
|
||||
<template v-if="tab === 'form'">
|
||||
<ChangeApply ref="changeApplyRef" :formInfo="changePreForm" @updateBtn="updateBtn" />
|
||||
</template>
|
||||
<div v-show="tab === 'form'">
|
||||
<ChangeApply ref="changeApplyRef" :isAiOpen="aiEnabled" :formInfo="changePreForm" @updateBtn="updateBtn" />
|
||||
</div>
|
||||
|
||||
<!-- ===== 风险分析记录表 ===== -->
|
||||
<template v-if="tab === 'risk'">
|
||||
<div v-show="tab === 'risk'" class="space-y-4">
|
||||
<div class="border p-3" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="flex items-center gap-1.5 text-sm font-semibold text-slate-700">
|
||||
@@ -805,9 +853,9 @@ onMounted(async () => {
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<!-- 变更培训内容 -->
|
||||
<template v-if="tab === 'train'">
|
||||
<div v-show="tab === 'train'" class="space-y-4">
|
||||
<div class="flex flex-wrap items-center gap-3 mb-3">
|
||||
<span class="flex items-center gap-1.5 text-sm font-semibold text-slate-700">
|
||||
<Icon icon="lucide:graduation-cap" class="size-16px text-violet-500" />
|
||||
@@ -827,9 +875,9 @@ onMounted(async () => {
|
||||
</div>
|
||||
<NInput v-model:value="trainText" type="textarea" :bordered="false" :autosize="{minRows: 4}" class="font-mono text-sm" placeholder="" />
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<!-- PSSR 检查内容 -->
|
||||
<template v-if="tab === 'pssr'">
|
||||
<div v-show="tab === 'pssr'" class="space-y-4">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<span class="flex items-center gap-1.5 text-sm font-semibold text-slate-700">
|
||||
<Icon icon="tabler:clipboard-check" class="size-16px text-violet-500" />
|
||||
@@ -914,9 +962,9 @@ onMounted(async () => {
|
||||
<div class="rounded-lg bg-violet-50/70 px-4 py-2.5 text-xs text-violet-700">
|
||||
清单由 AI 依据变更类型与风险分析自动生成,专业人员审核后随审批发布;确认方式不作硬性要求——可在 PC 端直接点击确认,也可在移动端拍照上传作为佐证(系统自动记录确认人与日期);资料归档组确认后自动同步「变更关闭确认表」显示已归档。
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<!-- 验收评价 -->
|
||||
<template v-if="tab === 'accept'">
|
||||
<div v-show="tab === 'accept'" class="space-y-4">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<span class="flex items-center gap-1.5 text-sm font-semibold text-slate-700">
|
||||
<Icon icon="ix:success" class="size-18px text-emerald-500" />
|
||||
@@ -1050,9 +1098,9 @@ onMounted(async () => {
|
||||
<div class="rounded-lg bg-emerald-50/80 px-4 py-2.5 text-xs leading-5 text-emerald-700">
|
||||
流程说明:投用运行满验收周期后,系统向车间(属地)与涉及专业推送验收任务;各责任单位按上表逐项给出评估结论并上传佐证(数据报表 / 化验报告 / 现场照片),全部完成后汇总至综合验收结论,结论与佐证资料一并纳入变更关闭校验,验收不通过时退回整改或评估恢复原状。
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<!-- 变更关闭确认表 -->
|
||||
<template v-if="tab === 'close'">
|
||||
<div v-show="tab === 'close'" class="space-y-4">
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<span class="flex items-center gap-1.5 text-sm font-semibold text-slate-700">
|
||||
<Icon icon="quill:folder-open" class="size-16px" />
|
||||
@@ -1125,7 +1173,7 @@ onMounted(async () => {
|
||||
<div class="rounded-lg bg-[#EAF0F9] px-4 py-2.5 text-xs leading-5 text-[#17407F]">
|
||||
关闭校验说明:判定为「是」的资料项全部归档后,系统将全部流程完毕信号推送变更主管部门专责,专责确认后点击关闭,系统记录变更关闭时间;「否 / 不涉及」由 AI 辅助判定一次,人工改判须填写理由并留痕。临时变更恢复完成后,恢复操作票与参数核对记录自动追加至本清单。
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -1179,42 +1227,7 @@ onMounted(async () => {
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 附件在线预览弹窗 -->
|
||||
<NModal
|
||||
:show="previewFile !== null"
|
||||
preset="card"
|
||||
:auto-focus="false"
|
||||
:style="{ width: '700px', height: 'auto' }"
|
||||
:segmented="{ content: true, footer: true }"
|
||||
@update:show="(v: boolean) => !v && (previewFile = null)"
|
||||
>
|
||||
<template #header>
|
||||
<div class="flex items-center gap-2 text-base font-semibold text-slate-800">
|
||||
<Icon icon="akar-icons:file" class="size-18px" /> {{ previewFile }}
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<div class="space-y-3">
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1 text-xs text-slate-400">
|
||||
<span>上传人:{{ ROLES[0].person }}</span><span>上传时间:{{ today() }}</span><span>版本:V1(受控)</span>
|
||||
</div>
|
||||
<div class="flex h-72 flex-col items-center justify-center gap-2 rounded-lg border bg-slate-50 text-slate-400">
|
||||
<Icon icon="akar-icons:file" class="size-42px" />
|
||||
<span class="text-sm">文件在线预览区(演示)</span>
|
||||
<span class="text-xs">正式环境由文档预览服务渲染 PDF / Word / 图片内容,支持缩放、翻页与移动端查看</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div class="flex justify-end gap-[10px]">
|
||||
<NButton ghost size="small" @click="downloadPdf">
|
||||
<Icon icon="material-symbols:download" class="size-16px" /> 下载
|
||||
</NButton>
|
||||
<NButton size="small" type="primary" @click="previewFile = null">关闭</NButton>
|
||||
</div>
|
||||
</template>
|
||||
</NModal>
|
||||
<!-- 侧边抽屉:AI 类型判定 / 等级判定表 / 审批流程设置 -->
|
||||
<!-- 侧边抽屉:审批流程设置 -->
|
||||
<NDrawer :show="sheet !== ''" @update:show="(v) => !v && (sheet = '')" placement="right" :width="sheet === 'level' ? '45rem' : '28rem'">
|
||||
<NDrawerContent>
|
||||
<template #header>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, h, ref, watch } from 'vue'
|
||||
import { NButton, NDataTable, NInput } from 'naive-ui'
|
||||
import { NButton, NDataTable, NInput, NPopconfirm } from 'naive-ui'
|
||||
import type { DataTableColumns } from 'naive-ui'
|
||||
import { Icon } from '@iconify/vue'
|
||||
import RichTextInput from './RichTextInput.vue'
|
||||
@@ -106,12 +106,28 @@ const columns = computed<DataTableColumns<ChangeItem>>(() => {
|
||||
width: 50,
|
||||
align: 'center',
|
||||
render: (_row: ChangeItem, rowIndex: number) =>
|
||||
h(NButton, {
|
||||
h(NPopconfirm, {
|
||||
// 组件 Props
|
||||
positiveText: '确定',
|
||||
negativeText: '取消',
|
||||
onPositiveClick: () => {
|
||||
removeRow(rowIndex)
|
||||
},
|
||||
// 可选:自定义确认/取消按钮的样式
|
||||
positiveButtonProps: { size: 'tiny', type: 'primary' },
|
||||
negativeButtonProps: { size: 'tiny' }
|
||||
}, {
|
||||
// 插槽 (Slots)
|
||||
trigger: () => h(NButton,
|
||||
{
|
||||
text: true,
|
||||
size: 'tiny',
|
||||
type: 'error',
|
||||
onClick: () => removeRow(rowIndex),
|
||||
}, () => h(Icon, { icon: 'line-md:close-circle', class: 'size-16px' })),
|
||||
},
|
||||
() => h(Icon, { icon: 'ci:close-circle', class: 'size-16px' })
|
||||
),
|
||||
default: () => '确定要删除吗?' // 弹出框的提示内容
|
||||
}),
|
||||
})
|
||||
}
|
||||
return cols
|
||||
|
||||
@@ -9,6 +9,7 @@ import { localStg } from '@/utils/storage';
|
||||
const themeStore = useThemeStore();
|
||||
|
||||
const props = defineProps({
|
||||
isAiOpen: Boolean,
|
||||
formInfo: Object as () => any
|
||||
})
|
||||
|
||||
@@ -18,8 +19,7 @@ const aiFail = (e: any) => {
|
||||
if (e instanceof AiError) window.$message?.warning(`AI 分析失败:${e.message},可手动填写`);
|
||||
else window.$message?.warning("AI 分析失败,可手动填写");
|
||||
};
|
||||
// 是否开启ai功能
|
||||
const aiEnabled = ref<boolean>(localStg.get('userInfo')?.ai_assist_enabled=='1' ? true : false);
|
||||
const today = () => new Date().toISOString().slice(0, 10);
|
||||
// 按钮禁用
|
||||
const btnDisabled = ref<boolean>(false);
|
||||
// 总分数
|
||||
@@ -66,8 +66,6 @@ const form = ref<{
|
||||
plan_use_date: null,
|
||||
risk_tools: [],
|
||||
});
|
||||
// 上传的资料
|
||||
const files = ref<string[]>(["小试实验报告.pdf", "杂质初步分析.docx"]);
|
||||
// 变更目的选项
|
||||
const PURPOSE_OPTIONS = [
|
||||
"满足市场需求", "提高生产效能", "改善操作条件", "增加安全性能",
|
||||
@@ -226,6 +224,17 @@ const openLevelSheet = async () => {
|
||||
levelAiLoading.value = false;
|
||||
}
|
||||
};
|
||||
// 处理等级判定表评分变化
|
||||
const handleScoreChange = (val:number,index:number) => {
|
||||
LEVEL_DIMS.value[index].score = val;
|
||||
let score = 0;
|
||||
LEVEL_DIMS.value.forEach((d:any) => {
|
||||
score += d.score;
|
||||
});
|
||||
totalScore.value = score;
|
||||
}
|
||||
// 下载PDF
|
||||
const downloadPdf = () => window.$message?.success(`演示:${previewFile.value} 已下载`);
|
||||
|
||||
// 更新表单
|
||||
const updateForm = (res: any, isShow: boolean) => {
|
||||
@@ -241,6 +250,7 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="space-y-4">
|
||||
<!-- 申请部门 / 申请人 -->
|
||||
<div class="grid gap-4 grid-cols-2">
|
||||
<div class="flex gap-3">
|
||||
@@ -255,7 +265,7 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
<!-- 变更目的 -->
|
||||
<div class="flex gap-3">
|
||||
<div class="w-24 shrink-0 pt-2 text-sm font-medium text-slate-600 text-right">变更目的</div>
|
||||
<div class="rounded-lg border border-[#ACC6E5] bg-[#EAF0F9]/40 p-3">
|
||||
<div class="rounded-lg bg-[#EAF0F9]/40 p-3">
|
||||
<NCheckboxGroup v-model:value="form.purposes">
|
||||
<div class="flex flex-wrap gap-y-2 gap-x-4">
|
||||
<NCheckbox v-for="p in PURPOSE_OPTIONS" :key="p" :value="p" :label="p" />
|
||||
@@ -275,9 +285,20 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
<div v-for="(_, i) in form.main_changes" :key="i" class="flex items-center gap-2">
|
||||
<span class="w-5 shrink-0 text-sm text-slate-400">{{ i + 1 }}.</span>
|
||||
<NInput v-model:value="form.main_changes[i]" type="text" placeholder="" />
|
||||
<NButton v-if="form.main_changes.length > 1" text type="error" @click="form.main_changes = form.main_changes.splice(i, 1)">
|
||||
<Icon icon="line-md:close-circle" class="size-16px" />
|
||||
<NPopconfirm
|
||||
v-if="form.main_changes.length > 1"
|
||||
positive-text="确定"
|
||||
:positiveButtonProps="{ size: 'tiny' }"
|
||||
:negativeButtonProps="{ size: 'tiny' }"
|
||||
@positive-click="form.main_changes.splice(i, 1)"
|
||||
>
|
||||
<template #trigger>
|
||||
<NButton text type="error">
|
||||
<Icon icon="ci:close-circle" class="size-16px" />
|
||||
</NButton>
|
||||
</template>
|
||||
确定删除吗?
|
||||
</NPopconfirm>
|
||||
</div>
|
||||
<NButton text type="primary" class="text-xs" @click="form.main_changes = [...form.main_changes, '']">
|
||||
<Icon icon="ic:round-plus" class="size-14px" /> 添加变更点
|
||||
@@ -291,9 +312,20 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
<div v-for="(_, i) in form.related_changes" :key="i" class="flex items-center gap-2">
|
||||
<span class="w-5 shrink-0 text-sm text-slate-400">{{ i + 1 }}.</span>
|
||||
<NInput v-model:value="form.related_changes[i]" placeholder="连带变更点(如:更新操作规程)" />
|
||||
<NButton v-if="form.related_changes.length > 1" text type="error" @click="form.related_changes = form.related_changes.splice(i, 1)">
|
||||
<Icon icon="line-md:close-circle" class="size-16px" />
|
||||
<NPopconfirm
|
||||
v-if="form.related_changes.length > 1"
|
||||
positive-text="确定"
|
||||
:positiveButtonProps="{ size: 'tiny' }"
|
||||
:negativeButtonProps="{ size: 'tiny' }"
|
||||
@positive-click="form.related_changes.splice(i, 1)"
|
||||
>
|
||||
<template #trigger>
|
||||
<NButton text type="error">
|
||||
<Icon icon="ci:close-circle" class="size-16px" />
|
||||
</NButton>
|
||||
</template>
|
||||
确定删除吗?
|
||||
</NPopconfirm>
|
||||
</div>
|
||||
<NButton text type="primary" class="text-xs" @click="form.related_changes = [...form.related_changes, '']">
|
||||
<Icon icon="ic:round-plus" class="size-14px" /> 添加连带变更点
|
||||
@@ -311,7 +343,7 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
<NRadio v-for="t in ['工艺', '设备', '管理']" :key="t" :value="t">{{t}}</NRadio>
|
||||
</div>
|
||||
</NRadioGroup>
|
||||
<NButton text type="primary" class="ml-auto text-xs hover:underline" @click="openTypeSheet">
|
||||
<NButton v-if="isAiOpen" text type="primary" class="ml-auto text-xs hover:underline" @click="openTypeSheet">
|
||||
<Icon icon="lucide:sparkles" class="size-12px" />
|
||||
AI 判定说明
|
||||
</NButton>
|
||||
@@ -321,13 +353,13 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
<div class="flex gap-3">
|
||||
<div class="w-24 shrink-0 pt-2 text-sm font-medium text-slate-600 text-right">变更等级 <span class="text-red-500">*</span></div>
|
||||
<div class="flex flex-1 items-center gap-4 rounded-lg bg-slate-50 px-3 py-2">
|
||||
<NRadioGroup v-model:value="form.change_level" disabled>
|
||||
<NRadioGroup v-model:value="form.change_level" :disabled="isAiOpen">
|
||||
<div class="flex gap-x-2">
|
||||
<NRadio :key="0" :value="0">一般</NRadio>
|
||||
<NRadio :key="1" :value="1">重要</NRadio>
|
||||
</div>
|
||||
</NRadioGroup>
|
||||
<NButton text type="primary" class="ml-auto text-xs hover:underline" @click="openLevelSheet">
|
||||
<NButton v-if="isAiOpen" text type="primary" class="ml-auto text-xs hover:underline" @click="openLevelSheet">
|
||||
<Icon icon="lucide:list-checks" class="size-12px" /> 等级判定表 ({{ totalScore }}分) →
|
||||
</NButton>
|
||||
</div>
|
||||
@@ -392,11 +424,23 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
<div class="flex gap-3">
|
||||
<div class="w-24 shrink-0 pt-2 text-sm font-medium text-slate-600 text-right">资料上传</div>
|
||||
<div class="flex flex-1 flex-wrap items-center gap-2 rounded-lg border border-dashed p-3">
|
||||
<NButton size="small" class="text-xs" v-for="f in files" :key="f" @click="previewFile = f" title="点击在线预览">
|
||||
<Icon icon="akar-icons:file" class="size-14px" />
|
||||
{{ f }}
|
||||
<div
|
||||
class="relative"
|
||||
:style="{'--theme-color':themeStore.themeColor}"
|
||||
v-for="(f,index) in form.update_docs" :key="f"
|
||||
>
|
||||
<div
|
||||
class="text-xs cursor-pointer flex items-center border py-1.5 px-2 rounded-md hover:border-[var(--theme-color)] hover:text-[var(--theme-color)]"
|
||||
title="点击在线预览"
|
||||
@click="previewFile = f"
|
||||
>
|
||||
<Icon icon="akar-icons:file" class="size-14px mr-1" />{{ f }}
|
||||
</div>
|
||||
<NButton text type="error" class="absolute top-[-8px] right-[-8px] bg-[#fff]" @click="form.update_docs.splice(index, 1)">
|
||||
<Icon icon="ci:close-circle" class="size-16px" />
|
||||
</NButton>
|
||||
<NButton @click="files = [...files, `资料_${files.length + 1}.pdf`]">
|
||||
</div>
|
||||
<NButton @click="form.update_docs = [...form.update_docs, `资料_${form.update_docs.length + 1}.pdf`]">
|
||||
<Icon icon="material-symbols:upload" class="size-16px" /> 资料上传
|
||||
</NButton>
|
||||
<span class="text-xs text-slate-400">(点击附件名弹窗预览,支持 PDF / Word / 图片在线查看)</span>
|
||||
@@ -433,6 +477,7 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 侧边抽屉:AI 类型判定 / 等级判定表 / 审批流程设置 -->
|
||||
<NDrawer :show="sheet !== ''" @update:show="(v) => !v && (sheet = '')" placement="right" :width="sheet === 'level' ? '45rem' : '28rem'">
|
||||
<NDrawerContent>
|
||||
@@ -443,20 +488,18 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
<div class="h-full space-y-4 overflow-y-auto">
|
||||
<!-- AI 变更类型判定说明 -->
|
||||
<template v-if="sheet === 'type'">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="inline-flex items-center gap-1 rounded-full border border-violet-200 bg-violet-100 px-2 py-0.5 text-xs font-medium text-violet-700">
|
||||
✨ AI 生成 · 需人工确认
|
||||
</span>
|
||||
<NTag v-if="typeAiLoading" type="info" size="small">
|
||||
<template #icon>
|
||||
<Icon icon="ri:loader-4-fill" class="size-12px animate-spin" />
|
||||
</template>
|
||||
AI 判定中…
|
||||
</NTag>
|
||||
<template v-else>
|
||||
<div v-else class="flex items-center gap-2 max-h-[22px]">
|
||||
<span class="inline-flex items-center gap-1 rounded-full border border-violet-200 bg-violet-100 px-2 py-0.5 text-xs font-medium text-violet-700">
|
||||
✨ AI 生成 · 需人工确认
|
||||
</span>
|
||||
<NTag type="info" size="small">判定:{{ typeAi?.type || '工艺' }}</NTag>
|
||||
<NTag size="small">置信度:{{ typeAi ? `${Math.round(typeAi.confidence * 100)}%` : '高' }}</NTag>
|
||||
</template>
|
||||
</div>
|
||||
<div v-if="typeAi" class="space-y-3 text-sm leading-relaxed text-slate-700">
|
||||
<p><b>判定结论:</b>{{ typeAi.conclusion }}</p>
|
||||
@@ -468,17 +511,6 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
<p v-if="typeAi.knowledge_refs.length"><b>知识库引用:</b>{{ typeAi.knowledge_refs.join('、') }}。</p>
|
||||
<p class="rounded-lg bg-amber-50 p-3 text-xs text-amber-700">AI 判定结果仅供参考,最终类型以人工确认为准;如调整为其他类型,系统将记录修改留痕。</p>
|
||||
</div>
|
||||
<div v-else class="space-y-3 text-sm leading-relaxed text-slate-700">
|
||||
<p><b>判定结论:</b>本次变更涉及反应温度(80℃→90℃)、保温时间(8h→4h)等工艺参数调整及 DCS 报警/联锁值修改,未涉及设备本体更换或材质变更,依据变更类型规则判定为「工艺」类变更。</p>
|
||||
<p><b>判定依据:</b></p>
|
||||
<ul class="list-disc space-y-1 pl-5">
|
||||
<li>命中规则 2.1:操作参数超出原设计控制范围 → 工艺类</li>
|
||||
<li>命中规则 2.4:DCS 报警值/联锁值调整 → 工艺类(仪表联动)</li>
|
||||
<li>排除规则 3.2:无设备规格型号变化 → 不构成设备类</li>
|
||||
</ul>
|
||||
<p><b>知识库引用:</b>工艺卡片 R-101(Rev B)、DCS 联锁台账、《变更管理制度》第 4.2 条。</p>
|
||||
<p class="rounded-lg bg-amber-50 p-3 text-xs text-amber-700">AI 判定结果仅供参考,最终类型以人工确认为准;如调整为其他类型,系统将记录修改留痕。</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 变更等级判定表 -->
|
||||
@@ -535,4 +567,39 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
</div>
|
||||
</NDrawerContent>
|
||||
</NDrawer>
|
||||
<!-- 附件在线预览弹窗 -->
|
||||
<NModal
|
||||
:show="previewFile !== null"
|
||||
preset="card"
|
||||
:auto-focus="false"
|
||||
:style="{ width: '700px', height: 'auto' }"
|
||||
:segmented="{ content: true, footer: true }"
|
||||
@update:show="(v) => !v && (previewFile = null)"
|
||||
>
|
||||
<template #header>
|
||||
<div class="flex items-center gap-2 text-base font-semibold text-slate-800">
|
||||
<Icon icon="akar-icons:file" class="size-18px" /> {{ previewFile }}
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<div class="space-y-3">
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1 text-xs text-slate-400">
|
||||
<span>上传人:{{ userInfo?.real_name }}</span><span>上传时间:{{ today() }}</span><span>版本:V1(受控)</span>
|
||||
</div>
|
||||
<div class="flex h-72 flex-col items-center justify-center gap-2 rounded-lg border bg-slate-50 text-slate-400">
|
||||
<Icon icon="akar-icons:file" class="size-42px" />
|
||||
<span class="text-sm">文件在线预览区(演示)</span>
|
||||
<span class="text-xs">正式环境由文档预览服务渲染 PDF / Word / 图片内容,支持缩放、翻页与移动端查看</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div class="flex justify-end gap-[10px]">
|
||||
<NButton ghost size="small" @click="downloadPdf">
|
||||
<Icon icon="material-symbols:download" class="size-16px" /> 下载
|
||||
</NButton>
|
||||
<NButton size="small" type="primary" @click="previewFile = null">关闭</NButton>
|
||||
</div>
|
||||
</template>
|
||||
</NModal>
|
||||
</template>
|
||||
@@ -78,6 +78,7 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="space-y-4">
|
||||
<!-- 变更内容描述 -->
|
||||
<div class="border" :style="{ borderRadius: themeStore.themeRadius + 'px' }">
|
||||
<div class="flex items-center justify-between px-4 py-2 border-b">
|
||||
@@ -143,4 +144,5 @@ defineExpose({form,updateForm,updateBtnDisabled})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user