feat(项目需求): 开发项目需求的功能。

This commit is contained in:
dk
2026-05-13 21:13:21 +08:00
parent 28c47b14a3
commit 60debcda8a
19 changed files with 3562 additions and 92 deletions

View File

@@ -116,9 +116,15 @@ async function handleSubmit() {
:confirm-loading="submitting"
@confirm="handleSubmit"
>
<ElForm ref="formRef" :model="model" :rules="rules" label-position="top">
<ElFormItem :label="`需求名称:${requirementTitle}`"></ElFormItem>
<ElAlert
v-if="requirementTitle"
:title="`需求名称:${requirementTitle}`"
type="info"
:closable="false"
class="mb-16px"
/>
<ElForm ref="formRef" :model="model" :rules="rules" label-position="top">
<ElFormItem v-if="isClaimAction" label="是否需要评审" prop="reviewChoice">
<ElRadioGroup v-model="model.reviewChoice" class="business-form-radio-group">
<ElRadio v-for="option in reviewChoiceOptions" :key="option.value" :value="option.value">

View File

@@ -404,21 +404,9 @@ watch(
</ElSelect>
</ElFormItem>
</ElCol>
<ElCol :span="12">
<ElCol v-if="isViewMode" :span="12">
<ElFormItem label="实现项目">
<template v-if="isViewMode">
<ReadonlyField :value="projectOptionsMap.get(model.implementProjectId || '') || '--'" />
</template>
<ElSelect
v-else
v-model="model.implementProjectId"
class="w-full"
filterable
clearable
placeholder="请选择实现项目"
>
<ElOption v-for="item in projectOptions" :key="item.id" :label="item.projectName" :value="item.id" />
</ElSelect>
<ReadonlyField :value="projectOptionsMap.get(model.implementProjectId || '') || '--'" />
</ElFormItem>
</ElCol>
<ElCol :span="12">

View File

@@ -1,7 +1,8 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue';
import { computed, onMounted, ref } from 'vue';
import { RDMS_REQ_SOURCE_TYPE_DICT_CODE } from '@/constants/dict';
import { fetchGetRequirementStatusDict } from '@/service/api';
import { useDict } from '@/hooks/business/dict';
import DictSelect from '@/components/custom/dict-select.vue';
import TableSearchPanel from '@/components/custom/table-search-panel.vue';
import MemberSelectOption from './member-select-option.vue';
@@ -33,6 +34,17 @@ const model = defineModel<Api.Product.RequirementSearchParams>('model', { requir
const requirementStatusOptions = ref<Array<{ label: string; value: string }>>([]);
const { enabledDictData: sourceTypeDictData } = useDict(RDMS_REQ_SOURCE_TYPE_DICT_CODE);
const sourceTypeOptions = computed(() => {
return sourceTypeDictData.value
.filter(item => item.value !== 'product_requirement')
.map(item => ({
label: item.label,
value: item.value
}));
});
async function loadStatusOptions() {
const { error, data } = await fetchGetRequirementStatusDict();
@@ -112,12 +124,9 @@ onMounted(async () => {
</ElCol>
<ElCol :lg="6" :md="12" :sm="12">
<ElFormItem label="需求来源">
<DictSelect
v-model="model.sourceType"
:dict-code="RDMS_REQ_SOURCE_TYPE_DICT_CODE"
clearable
placeholder="筛选需求来源"
/>
<ElSelect v-model="model.sourceType" clearable placeholder="筛选需求来源">
<ElOption v-for="item in sourceTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
</ElSelect>
</ElFormItem>
</ElCol>
</TableSearchPanel>

View File

@@ -149,6 +149,11 @@ watch(
model.value.category = props.parentRequirement.category;
}
// 默认选中父需求的负责人
if (props.parentRequirement?.currentHandlerUserId) {
model.value.currentHandlerUserId = props.parentRequirement.currentHandlerUserId;
}
await nextTick();
formRef.value?.clearValidate();
}