diff --git a/src/api/project-demand/summary/index.js b/src/api/project-demand/summary/index.js index 6a8f03e..5efb23d 100644 --- a/src/api/project-demand/summary/index.js +++ b/src/api/project-demand/summary/index.js @@ -96,3 +96,10 @@ export const approvePlan= (data) => { }); }; + +export const getProjectOption = () => { + return request({ + url: '/workflow/mosr/requirement/master', + method: "get" + }); +}; diff --git a/src/components/steps/index.vue b/src/components/steps/index.vue index f8dc544..2d305ca 100644 --- a/src/components/steps/index.vue +++ b/src/components/steps/index.vue @@ -371,6 +371,13 @@ const schema = computed(() => { colProps: { span: 6 } + }, + { + label: '主项目', + prop: 'masterProjectName', + colProps: { + span: 6 + } } ] }) diff --git a/src/views/project-demand/summary/add.vue b/src/views/project-demand/summary/add.vue index e5b8b38..ea0477d 100644 --- a/src/views/project-demand/summary/add.vue +++ b/src/views/project-demand/summary/add.vue @@ -192,7 +192,7 @@ - + {{ optionalChargeLeadershipList.length !== 0 ? '更改' : '请选择' }} @@ -205,7 +205,18 @@ v-model:value="optionalChargeLeadershipList" @ok="optionalChargeLeaderPickerOkOrCancel"/> - + + + + + + + import OperationRender from '@/views/workflow/common/OperationRender.vue' import {debounce} from 'lodash' -import {getDetail, getProcessInfo, requirementReported, resubmitReported} from "@/api/project-demand/summary"; +import {getDetail, getProcessInfo, requirementReported, resubmitReported,getProjectOption} from "@/api/project-demand/summary"; import {ElNotification} from "element-plus"; import {useAuthStore} from '@/stores/userstore.js' import {useTagsView} from '@/stores/tagsview.js' @@ -355,6 +366,7 @@ const summaryForm = ref() const deploymentId = ref() const optionalChargeLeadershipPickerRef = ref() const optionalChargeLeadershipList = ref([]) +const masterProjectList = ref([]) const specialFundOption = ref([]) const showTable = ref(true) const showSingleTable = ref(false) @@ -448,6 +460,14 @@ const disabledDate = (time) => { return time.getTime() < new Date(formData.value.startTime).getTime(); } +const getProjectList = () => { + getProjectOption().then(res => { + if (res.code === 1000) { + masterProjectList.value=res.data + } + }) +} +getProjectList() const getIsFund = async () => { if (!route.query.id) return; // loading.value = true @@ -471,6 +491,15 @@ const getFundName = (id) => { }) return label } +const getProjectName = (id) => { + let label = '' + masterProjectList.value.forEach(item => { + if (item.value == id) { + label = item.label + } + }) + return label +} const compositeParam = (item, type) => { let tag = '' if (name.value === 'Summary/add' || name.value === 'Summary/edit') { @@ -548,6 +577,9 @@ const handleSubmit = debounce(async (instance) => { if (formData.value.isSpecialFund && !formData.value.specialFund) { formData.value.specialFund = getFundName(formData.value.specialFundId) } + if (formData.value.masterProjectId) { + formData.value.masterProjectName = getProjectName(formData.value.masterProjectId) + } if (!attachment.value.isHaveOneFile) { attachment.value.validate() ElNotification({ @@ -602,6 +634,9 @@ const handleResubmit = debounce((instance) => { if (formData.value.isSpecialFund && !formData.value.specialFund) { formData.value.specialFund = getFundName(formData.value.specialFundId) } + if (formData.value.masterProjectId) { + formData.value.masterProjectName = getProjectName(formData.value.masterProjectId) + } if (!attachment.value.isHaveOneFile) { attachment.value.validate() ElNotification({