UPDATE: 完善检修计划项目负责人和项目成员逻辑。
This commit is contained in:
@@ -154,4 +154,9 @@ export const mergeSubPlanCheckData = (params: Plan.ResPlan) => {
|
|||||||
//根据误差体系id获取测试项
|
//根据误差体系id获取测试项
|
||||||
export const getPqErrSysTestItemList = (params: {errorSysId : string}) => {
|
export const getPqErrSysTestItemList = (params: {errorSysId : string}) => {
|
||||||
return http.get(`/pqErrSys/getTestItems?id=${params.errorSysId}`)
|
return http.get(`/pqErrSys/getTestItems?id=${params.errorSysId}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取计划项目成员
|
||||||
|
export const getMemberList = (params: {id : string}) => {
|
||||||
|
return http.get(`/adPlan/getMemberList?planId=${params.id}`)
|
||||||
}
|
}
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
:data="leftTreeData"
|
:data="leftTreeData"
|
||||||
:default-checked-keys="defaultCheckedKeys"
|
:default-checked-keys="defaultCheckedKeys"
|
||||||
:default-expanded-keys="defaultCheckedKeys"
|
:default-expanded-keys="defaultCheckedKeys"
|
||||||
|
:default-expand-all="props.expandAll"
|
||||||
:filter-node-method="filterNode"
|
:filter-node-method="filterNode"
|
||||||
node-key="id"
|
node-key="id"
|
||||||
style="padding-left: 0; padding-right: 20px"
|
style="padding-left: 0; padding-right: 20px"
|
||||||
@@ -293,6 +294,10 @@ const props = defineProps({
|
|||||||
disabled: {
|
disabled: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
expandAll: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const leftTreeRef = ref<TreeInstance>()
|
const leftTreeRef = ref<TreeInstance>()
|
||||||
|
|||||||
@@ -232,6 +232,7 @@
|
|||||||
:data="devData"
|
:data="devData"
|
||||||
:height="selectByMode ? 325 : 220"
|
:height="selectByMode ? 325 : 220"
|
||||||
:disabled="allDisabled"
|
:disabled="allDisabled"
|
||||||
|
:expand-all="planType !== '0'"
|
||||||
>
|
>
|
||||||
<template v-if="planType === 0 && !allDisabled" #footer>
|
<template v-if="planType === 0 && !allDisabled" #footer>
|
||||||
<div style="text-align: right">
|
<div style="text-align: right">
|
||||||
@@ -383,6 +384,7 @@ import {
|
|||||||
addPlan,
|
addPlan,
|
||||||
getBoundPqDevList,
|
getBoundPqDevList,
|
||||||
getBoundStandardDevAllList,
|
getBoundStandardDevAllList,
|
||||||
|
getMemberList,
|
||||||
getPqErrSysList,
|
getPqErrSysList,
|
||||||
getPqErrSysTestItemList,
|
getPqErrSysTestItemList,
|
||||||
getPqScriptList,
|
getPqScriptList,
|
||||||
@@ -828,6 +830,10 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
|||||||
isSelectDisabled.value = data.testState !== 0
|
isSelectDisabled.value = data.testState !== 0
|
||||||
if (data.importFlag === 1) {
|
if (data.importFlag === 1) {
|
||||||
allDisabled.value = true
|
allDisabled.value = true
|
||||||
|
formContent.leader = data.leader
|
||||||
|
if (data.members) {
|
||||||
|
formContent.memberIds = data.members.split(',')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -933,6 +939,9 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
|||||||
boundPqDevList.value = boundData as Device.ResPqDev[]
|
boundPqDevList.value = boundData as Device.ResPqDev[]
|
||||||
} else if (planType.value === 1) {
|
} else if (planType.value === 1) {
|
||||||
unboundPqDevList.value = boundData.filter((i: any) => !i.boundPlanName) as Device.ResPqDev[]
|
unboundPqDevList.value = boundData.filter((i: any) => !i.boundPlanName) as Device.ResPqDev[]
|
||||||
|
memberData.value = user_Result.data
|
||||||
|
.filter((user: any) => formContent.memberIds?.includes(user.id))
|
||||||
|
.map((user: any) => ({ ...user, disabled: false }))
|
||||||
} else if (planType.value === 2) {
|
} else if (planType.value === 2) {
|
||||||
const fatherBoundData_Result = await getBoundPqDevList({ planIdList: [data.fatherPlanId] })
|
const fatherBoundData_Result = await getBoundPqDevList({ planIdList: [data.fatherPlanId] })
|
||||||
const fatherBoundData = Array.isArray(fatherBoundData_Result.data) ? fatherBoundData_Result.data : []
|
const fatherBoundData = Array.isArray(fatherBoundData_Result.data) ? fatherBoundData_Result.data : []
|
||||||
@@ -941,6 +950,11 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
|||||||
fatherItem => !boundData.some((boundItem: any) => boundItem.id === fatherItem.id)
|
fatherItem => !boundData.some((boundItem: any) => boundItem.id === fatherItem.id)
|
||||||
) as Device.ResPqDev[]
|
) as Device.ResPqDev[]
|
||||||
boundPqDevList.value = boundData as Device.ResPqDev[]
|
boundPqDevList.value = boundData as Device.ResPqDev[]
|
||||||
|
if (data.fatherPlanId) {
|
||||||
|
const fatherMemberData_Result = await getMemberList({ id: data.fatherPlanId })
|
||||||
|
const fatherMemberData = Array.isArray(fatherMemberData_Result.data) ? fatherMemberData_Result.data : []
|
||||||
|
memberData.value = fatherMemberData.map((user: any) => ({ ...user, disabled: false }))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -975,6 +989,8 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
|||||||
if (plan == 1) {
|
if (plan == 1) {
|
||||||
//新增子计划名称清空
|
//新增子计划名称清空
|
||||||
formContent.name = ''
|
formContent.name = ''
|
||||||
|
formContent.datasourceIds = []
|
||||||
|
formContent.memberIds = []
|
||||||
}
|
}
|
||||||
generateData()
|
generateData()
|
||||||
// 所有数据加载完成后显示对话框
|
// 所有数据加载完成后显示对话框
|
||||||
|
|||||||
Reference in New Issue
Block a user