UPDATE: 完善检修计划项目负责人和项目成员逻辑。
This commit is contained in:
@@ -37,7 +37,7 @@ export namespace Plan {
|
||||
testConfig?: PlanTestConfig;
|
||||
importFlag?: number; // 导入标识,0-否,1-是
|
||||
leader?: string; // 负责人
|
||||
memberIds?: string[]; //成员
|
||||
memberIds?: string | string[]; //成员
|
||||
members?: string; //成员字符串
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
prop: 'boundPlanName',
|
||||
label: '子计划',
|
||||
minWidth: 150,
|
||||
|
||||
isShow: planFormContent.value?.importFlag === 0,
|
||||
render: scope => {
|
||||
console.log('boundPlanName', isTabPlanFather.value)
|
||||
const value = scope.row.boundPlanName
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
</el-scrollbar>
|
||||
|
||||
<!-- 传递 footer 插槽到 el-card -->
|
||||
<template #footer v-if="!props.disabled">
|
||||
<template #footer v-if="$slots.footer">
|
||||
<slot name="footer"></slot>
|
||||
</template>
|
||||
</el-card>
|
||||
@@ -273,7 +273,7 @@ interface Device {
|
||||
}
|
||||
type Data = RenderContentContext['data']
|
||||
const modelValue = defineModel<string[]>({ default: [] })
|
||||
|
||||
const slots = useSlots()
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Array as unknown as PropType<Device[]>,
|
||||
@@ -325,7 +325,7 @@ onMounted(() => {
|
||||
}
|
||||
})
|
||||
const leftHeight = computed(() => {
|
||||
if (!props.disabled) {
|
||||
if (!props.disabled && slots.footer) {
|
||||
return props.height
|
||||
}
|
||||
return props.height + 45.2
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
<el-select
|
||||
v-model="formContent.memberIds"
|
||||
:disabled="allDisabled"
|
||||
multiple
|
||||
:multiple="planType == 0"
|
||||
autocomplete="off"
|
||||
clearable
|
||||
collapse-tags
|
||||
@@ -232,9 +232,9 @@
|
||||
:data="devData"
|
||||
:height="selectByMode ? 325 : 220"
|
||||
:disabled="allDisabled"
|
||||
:expand-all="planType !== '0'"
|
||||
:expand-all="planType != 0"
|
||||
>
|
||||
<template v-if="planType === 0 && !allDisabled" #footer>
|
||||
<template v-if="planType == 0 && !allDisabled" #footer>
|
||||
<div style="text-align: right">
|
||||
<el-button
|
||||
v-if="modeStore.currentMode !== '比对式'"
|
||||
@@ -662,10 +662,12 @@ const save = () => {
|
||||
if (planType.value == 1) {
|
||||
formContent.fatherPlanId = formContent.id
|
||||
formContent.id = ''
|
||||
formContent.memberIds = [formContent.memberIds?.toString()]
|
||||
await addPlan(formContent)
|
||||
emit('update:tab')
|
||||
// 编辑子计划
|
||||
} else if (planType.value == 2) {
|
||||
formContent.memberIds = [formContent.memberIds?.toString()]
|
||||
await updatePlan(formContent)
|
||||
emit('update:tab')
|
||||
console.log('更新子计划', formContent)
|
||||
@@ -824,19 +826,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
||||
} else {
|
||||
//编辑时先给表单赋值(这会没接收被检设备),需要手动再给被检设备复制后整体表单赋值
|
||||
|
||||
if (plan == 1 || plan == 2) {
|
||||
isSelectDisabled.value = true
|
||||
} else {
|
||||
isSelectDisabled.value = data.testState !== 0
|
||||
if (data.importFlag === 1) {
|
||||
allDisabled.value = true
|
||||
formContent.leader = data.leader
|
||||
if (data.members) {
|
||||
formContent.memberIds = data.members.split(',')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(formContent, { ...data })
|
||||
|
||||
let pqSource_Result: any,
|
||||
@@ -849,7 +839,16 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
||||
user_Result: any
|
||||
|
||||
if (mode.value === '比对式') {
|
||||
if (data.importFlag === 1) {
|
||||
allDisabled.value = true
|
||||
formContent.leader = data.leader
|
||||
}
|
||||
if (plan == 0) {
|
||||
formContent.memberIds = data.members ? data.members.split(',') : []
|
||||
} else {
|
||||
isSelectDisabled.value = true
|
||||
formContent.memberIds = data.members
|
||||
}
|
||||
;[
|
||||
PqErrSys_Result,
|
||||
boundPqDevList_Result,
|
||||
|
||||
Reference in New Issue
Block a user