比对检测计划

This commit is contained in:
sjl
2025-07-21 13:47:56 +08:00
parent c8f3b4eddc
commit e29f25653e
31 changed files with 1174 additions and 673 deletions

View File

@@ -483,7 +483,7 @@ const getTableList = async (params: any) => {
}
//console.log('tablegetBoundPqDevList')
return getBoundPqDevList({
'planId': props.id,
'planIdList': [props.id],
'checkStateList': checkStateList.value,
'checkResult': form.value.checkResult,
'reportState': form.value.checkReportStatus,
@@ -596,7 +596,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
label: '系数校准结果',
minWidth: 100,
sortable: true,
isShow: factorCheckShow && appSceneStore.currentScene === "1" ,
isShow: factorCheckShow.value && appSceneStore.currentScene === "1" ,
render: scope => {
if (scope.row.factorCheckResult === 0) {
return '不合格'

View File

@@ -33,14 +33,14 @@
:style="{color:node.label=='未检'?'#fac858':node.label=='检测中'?'#ee6666':'#91cc75'}" />
<!-- 节点名称 -->
<span>{{ node.label }}</span>
<!-- 子节点右侧图标 + tooltip -->
<!-- 子节点右侧图标 + tooltip -->
<el-tooltip
v-if="data.pid"
v-if="data.name == '34535'"
placement="top"
:manual="true"
:content="'子计划信息'">
content="子计划信息">
<Menu
@click.stop="detail()"
@click.stop="childDetail(node.data)"
style="width: 16px; height: 16px; margin-left: 8px; cursor: pointer; color: var(--el-color-primary)"
/>
</el-tooltip>
@@ -49,6 +49,8 @@
</el-tree>
</div>
</div>
<SourceOpen ref='openSourceView' :width="width" :height="height"></SourceOpen>
</template>
<script lang='ts' setup>
import { type Plan } from '@/api/plan/interface';
@@ -57,7 +59,10 @@ import { nextTick, onMounted, ref, watch } from 'vue';
import { useRouter } from 'vue-router'
import {useCheckStore} from "@/stores/modules/check";
import { ElTooltip } from 'element-plus';
import SourceOpen from '@/views/plan/planList/components/childrenPlan.vue'
const openSourceView = ref()
const router = useRouter()
const checkStore = useCheckStore()
const filterText = ref('')
@@ -96,7 +101,6 @@ const getTreeData = (val: any) => {
//点击表格后左侧树刷新,高亮显示对应节点
const clickTableToTree = (val: any,id:any) => {
defaultChecked.value = []
data.value = val
let node = ref('')
@@ -119,8 +123,10 @@ const clickTableToTree = (val: any,id:any) => {
}
}
const {updateSelectedTreeNode} = defineProps<{
const {updateSelectedTreeNode,width,height} = defineProps<{
updateSelectedTreeNode:Function;
width: number;
height: number;
}>();
watch(
() => searchForm.value.planName,
@@ -155,11 +161,16 @@ const filterNode = (value: string, data: any) => {
return data.name.includes(value)
}
// 点击详情
const detail = () => {
router.push('/plan/planList')
}
const childDetail = (data: Plan.ResPlan) => {
openSourceView.value.open("检测计划详情",data)
}
onMounted(() => {
// console.log()
})

View File

@@ -41,7 +41,7 @@ const open = async () => {
// 清空表单内容
const resetFormContent = () => {
Object.assign(formContent,{temperature:'',humidity:''})
Object.assign(formContent,{temperature:'22',humidity:'50'})
}

View File

@@ -70,14 +70,14 @@ const modeList = [
const handelOpen = async (isActive: any) => {
await authStore.setShowMenu();
return;
if (isActive) {
router.push({ path: "/static" });
} else {
ElMessage({
message: "当前模式未配置",
type: "warning",
});
}
// if (isActive) {
// router.push({ path: "/static" });
// } else {
// ElMessage({
// message: "当前模式未配置",
// type: "warning",
// });
// }
};
const handleSelect = (key: string, keyPath: string[]) => {
//console.log(key, keyPath);

View File

@@ -1,11 +1,11 @@
<!-- 真正的首页 -->
<template>
<div class='static'>
<div class='static' ref='popupBaseView'>
<el-row :gutter='10'>
<el-col :lg='4' :xl='4' :md='4' :sm='4'>
<div class='left_tree'>
<!-- <tree ref='treeRef' :updateSelectedTreeNode='getPieData || (() => {})' /> -->
<tree ref='treeRef' :updateSelectedTreeNode='updateData|| (() => {})' />
<tree ref='treeRef' :updateSelectedTreeNode='updateData|| (() => {})' :width="viewWidth" :height="viewHeight" />
</div>
</el-col>
<el-col :lg='20' :xl='20' :md='20' :sm='20'>
@@ -29,8 +29,8 @@
</div>
<!--检测计划统计 饼图统计-->
<div class='container_pieShow'>
<el-collapse model-value='1' accordion @change='handleCollapseChange'>
<el-collapse-item name='1'>
<el-collapse model-value='1' accordion @change='handleCollapseChange' >
<el-collapse-item name='1' >
<template #title>
<div class='container_pieShow_title'>
<span>检测计划统计</span>
@@ -118,6 +118,8 @@ import { type Plan } from '@/api/plan/interface'
import type { CollapseModelValue } from 'element-plus/es/components/collapse/src/collapse.mjs'
import { type Device } from '@/api/device/interface/device'
import { ResultData } from '@/api/interface'
import { useViewSize } from '@/hooks/useViewSize'
import { map } from 'lodash'
const planName = ref('')
const dictStore = useDictStore()
@@ -148,6 +150,7 @@ const tableHeight = ref('calc(100% - 50px)') // 初始高度
const planList = ref<ResultData<Plan.ReqPlan[]>>()
const select_Plan = ref<Plan.ReqPlan>()
const isLabelLineShow = ref(true)
const { popupBaseView,viewWidth, viewHeight } = useViewSize()
const handleCollapseChange = (val: CollapseModelValue) => {
// 计算新的高度
@@ -302,7 +305,7 @@ const getPieData = async (id: string) => {
select_Plan.value = plan
const pqDevList_Result2 = await getBoundPqDevList({ 'planId': id, 'checkStateList': [0, 1, 2, 3] })
const pqDevList_Result2 = await getBoundPqDevList({ 'planIdList': [id], 'checkStateList': [0, 1, 2, 3] })
boundPqDevList.value = pqDevList_Result2.data as Device.ResPqDev[]
// 遍历 boundPqDevList 并更新计数对象
boundPqDevList.value.forEach(t => {
@@ -409,7 +412,6 @@ const planDetail = () => {
//功能选择css切换
const handleCheckFunction = (val: any) => {
editableTabsValue.value = '0'
form.value.activeChildTabs = 0
tabsList.value.map((item: any, index: any) => {
@@ -454,8 +456,7 @@ const handleCheckFunction = (val: any) => {
const resizeObserver = new ResizeObserver(entries => {
for (let entry of entries) {
chartsWidth.value = entry.contentRect.width
//console.log('Charts Info Width:', chartsWidth.value);
pieRef1.value?.reSize(chartsWidth.value * 0.95, 180, true)
pieRef2.value?.reSize(chartsWidth.value * 0.95, 180, true)
pieRef3.value?.reSize(chartsWidth.value * 0.95, 180, true)
@@ -485,11 +486,21 @@ const initPlan = async () => {
result: 0,
code: 0,
state: 0,
standardDevNameStr: '',
associateReport: 0,
reportTemplateName: '',
reportTemplateVersion: '',
dataRule: '',
testItemNameStr:'',
testItems: [],
standardDevIdList:[],
standardDevMap: new Map<string, number>(),
}
planList.value = (await getPlanListByPattern(reqPlan)) as ResultData<Plan.ReqPlan[]>
}
onBeforeMount(async () => {
await initPlan()
for (let i = 0; i < planList.value.data.length; i++) {
if (Array.isArray(planList.value.data[i].children) && planList.value.data[i].children.length > 0) {
@@ -646,7 +657,7 @@ const handleBatchGenerate = async () => {
justify-content: space-between;
padding: 0 15px;
font-weight: bold;
width: 100%;
width: 99%;
font-size: 14px;
}

View File

@@ -53,6 +53,7 @@ import { useAuthStore } from "@/stores/modules/auth";
import { useModeStore, useAppSceneStore } from "@/stores/modules/mode"; // 引入模式 store
import { ref } from "vue";
import {getCurrentScene} from "@/api/user/login";
const authStore = useAuthStore();
const modeStore = useModeStore(); // 使用模式 store
const AppSceneStore = useAppSceneStore();
@@ -87,6 +88,7 @@ const handelOpen = async (item: any) => {
// AppSceneStore.setCurrentMode(scene+'');//0省级平台1设备出厂2研发自测
AppSceneStore.setCurrentMode(scene+'');//0省级平台1设备出厂2研发自测
await authStore.setShowMenu();
await authStore.getAuthMenuList();
return;
// if (isActive) {
// router.push({ path: "/static" });