|
|
|
|
@ -45,43 +45,47 @@
|
|
|
|
|
|
|
|
|
|
<!-- 中间标签页区域 -->
|
|
|
|
|
<!-- 研发项目预算 -->
|
|
|
|
|
<el-card class="mb-6" v-if="searchForm.projectCategory === PROJECT_CATEGORY.RD">
|
|
|
|
|
<el-card class="mb-6" v-if="searchForm.projectCategory === PROJECT_CATEGORY.RD || searchForm.projectCategory === PROJECT_CATEGORY.PRE_PRODUCTION">
|
|
|
|
|
<el-tabs v-model="activeTab" @tab-click="handleTabClick">
|
|
|
|
|
<el-tab-pane label="预算表" name="budgetTable">
|
|
|
|
|
<RdBudgetTable ref="rdBudgetTableRef" :projectId="searchForm.projectId" :costData="costData" :projectInfo="projectInfo" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="设备费" name="equipmentCost">
|
|
|
|
|
<RdEquipmentCost ref="rdEquipmentCostRef" :projectId="searchForm.projectId" @update="handleEquipmentCostUpdate" />
|
|
|
|
|
<RdEquipmentCost ref="rdEquipmentCostRef" :projectId="searchForm.projectId" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="材料费" name="materialCost">
|
|
|
|
|
<RdMaterialCost ref="rdMaterialCostRef" :projectId="searchForm.projectId" @update="handleMaterialCostUpdate" />
|
|
|
|
|
<RdMaterialCost ref="rdMaterialCostRef" :projectId="searchForm.projectId" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="会议差旅交流" name="travelMeetingExchange">
|
|
|
|
|
<RdTravelMeetingExchange ref="rdTravelMeetingExchangeRef" :projectId="searchForm.projectId" @update="handleTravelMeetingExchangeUpdate" />
|
|
|
|
|
<RdTravelMeetingExchange ref="rdTravelMeetingExchangeRef" :projectId="searchForm.projectId" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="人工劳务咨询" name="laborService">
|
|
|
|
|
<RdLaborService ref="rdLaborServiceRef" :projectId="searchForm.projectId" @update="handleLaborServiceUpdate" />
|
|
|
|
|
<RdLaborService ref="rdLaborServiceRef" :projectId="searchForm.projectId" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="资料文献费" name="literatureCost">
|
|
|
|
|
<RdLiteratureCost ref="rdLiteratureCostRef" :projectId="searchForm.projectId" @update="handleLiteratureCostUpdate" />
|
|
|
|
|
<RdLiteratureCost ref="rdLiteratureCostRef" :projectId="searchForm.projectId" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="测试化验费" name="testingCost">
|
|
|
|
|
<RdTestingCost ref="rdTestingCostRef" :projectId="searchForm.projectId" @update="handleTestingCostUpdate" />
|
|
|
|
|
<RdTestingCost ref="rdTestingCostRef" :projectId="searchForm.projectId" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="其他" name="otherCost">
|
|
|
|
|
<RdOtherCost ref="rdOtherCostRef" :projectId="searchForm.projectId" @update="handleOtherCostUpdate" />
|
|
|
|
|
<RdOtherCost ref="rdOtherCostRef" :projectId="searchForm.projectId" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
<!-- 市场项目预算 -->
|
|
|
|
|
<el-card class="tab-card" shadow="never" v-if="searchForm.projectCategory === PROJECT_CATEGORY.MARKET">
|
|
|
|
|
<el-card
|
|
|
|
|
class="mb-6"
|
|
|
|
|
shadow="never"
|
|
|
|
|
v-if="searchForm.projectCategory === PROJECT_CATEGORY.MARKET || searchForm.projectCategory === PROJECT_CATEGORY.MARKET_PART"
|
|
|
|
|
>
|
|
|
|
|
<el-tabs v-model="activeTab" @tab-click="handleTabClick">
|
|
|
|
|
<el-tab-pane label="预算表" name="budget">
|
|
|
|
|
<BudgetTable ref="budgetTableRef" :projectInfo="projectInfo" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="材料费" name="material">
|
|
|
|
|
<MaterialCost ref="materialCostRef" />
|
|
|
|
|
<MaterialCost ref="materialCostRef" :budgetId="budgetId" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="人工费" name="labor">
|
|
|
|
|
<LaborCost ref="laborCostRef" />
|
|
|
|
|
@ -147,17 +151,20 @@
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 提交审批组件 -->
|
|
|
|
|
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
|
|
|
|
<submitVerify ref="submitVerifyRef" @submit-callback="submitCallback" />
|
|
|
|
|
<!-- 审批记录 -->
|
|
|
|
|
<approvalRecord ref="approvalRecordRef" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, reactive, onMounted } from 'vue';
|
|
|
|
|
<script setup lang="ts" name="BudgetInfoEdit">
|
|
|
|
|
import { ref, reactive } from 'vue';
|
|
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
|
|
import { listProjectInfo, addErpBudgetInfo, updateErpBudgetInfo, getErpBudgetInfo } from '@/api/oa/erp/budgetInfo';
|
|
|
|
|
import { ProjectInfoVO, ProjectInfoQuery } from '@/api/oa/erp/projectInfo/types';
|
|
|
|
|
import { isDeepEqual } from '@/utils/objHandle';
|
|
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
const { business_direction, project_status, project_category } = toRefs<any>(
|
|
|
|
|
@ -215,9 +222,32 @@ const installationCostRef = ref();
|
|
|
|
|
const travelCostRef = ref();
|
|
|
|
|
const otherCostRef = ref();
|
|
|
|
|
|
|
|
|
|
const oriBudgetMaterialCostList = ref<budgetMaterialCostVO[]>([]);
|
|
|
|
|
const oriBudgetLaborCostList = ref<budgetLaborCostVO[]>([]);
|
|
|
|
|
const oriBudgetInstallCostList = ref<budgetInstallCostVO[]>([]);
|
|
|
|
|
const oriBudgetTravelCostList = ref<budgetTravelCostVO[]>([]);
|
|
|
|
|
const oriBudgetOtherCostList = ref<budgetOtherCostVO[]>([]);
|
|
|
|
|
|
|
|
|
|
const oriRdBudgetEquipmentCostList = ref<rdBudgetEquipmentCostVO[]>([]);
|
|
|
|
|
const oriRdBudgetMaterialCostList = ref<rdBudgetMaterialCostVO[]>([]);
|
|
|
|
|
const oriRdBudgetTravelCostList = ref<rdBudgetTravelCostVO[]>([]);
|
|
|
|
|
const oriRdBudgetMeetingCostList = ref<rdBudgetMeetingCostVO[]>([]);
|
|
|
|
|
const oriRdBudgetExchangeCostList = ref<rdBudgetExchangeCostVO[]>([]);
|
|
|
|
|
const oriRdBudgetTechConsultCostList = ref<rdBudgetTechCostVO[]>([]); //技术咨询
|
|
|
|
|
const oriRdBudgetExpertMeetingCostList = ref<rdBudgetTechCostVO[]>([]); //专家咨询会议形式
|
|
|
|
|
const oriRdBudgetExpertCommCostList = ref<rdBudgetTechCostVO[]>([]); //专家咨询通讯形式
|
|
|
|
|
const oriRdBudgetLaborCostList = ref<rdBudgetLaborCostVO[]>([]); //人工费
|
|
|
|
|
const oriRdBudgetServiceCostList = ref<rdBudgetLaborCostVO[]>([]); //劳务费
|
|
|
|
|
const oriRdBudgetLiteratureMaterialCostList = ref<rdBudgetLiteratureCostVO[]>([]); //资料费
|
|
|
|
|
const oriRdBudgetLiteratureSofwareCostList = ref<rdBudgetLiteratureCostVO[]>([]); //专用软件购买费
|
|
|
|
|
const oriRdBudgetTestingCostList = ref<rdBudgetTestingCostVO[]>([]);
|
|
|
|
|
const oriRdBudgetOtherCostList = ref<rdBudgetOtherCostVO[]>([]);
|
|
|
|
|
|
|
|
|
|
const PROJECT_CATEGORY = reactive({
|
|
|
|
|
MARKET: '1', //销售市场项目
|
|
|
|
|
RD: '2' //研发项目
|
|
|
|
|
MARKET: '1', //销售(实施、物流)
|
|
|
|
|
MARKET_PART: '2', //销售(备件)
|
|
|
|
|
RD: '3', //研发
|
|
|
|
|
PRE_PRODUCTION: '4' //预投
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const BUSINESS_STATUS = reactive({
|
|
|
|
|
@ -226,6 +256,28 @@ const BUSINESS_STATUS = reactive({
|
|
|
|
|
AVAILABLE: '3' //可用
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const MATERIAL_TYPE = {
|
|
|
|
|
MAIN: '1', //主要材料费
|
|
|
|
|
OTHER: '2' //其他材料费
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const TECH_TYPE = reactive({
|
|
|
|
|
TECH_CONSULT: '1', //技术咨询开发
|
|
|
|
|
EXPERT_MEETING: '2', //专家咨询-会议形式
|
|
|
|
|
EXPERT_COMM: '3' //专家咨询-通讯形式
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const LABOR_TYPE = reactive({
|
|
|
|
|
LABOR: '1', //人工费
|
|
|
|
|
SERVICE: '2' //劳务费
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const LITERATURE_TYPE = {
|
|
|
|
|
MATERIAL: '1', //资料费
|
|
|
|
|
DOCUMENT: '2', //文件检索费
|
|
|
|
|
SOFTWARE: '3' //专用软件购买费
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 响应式数据
|
|
|
|
|
// 将activeTab从computed改为ref,使其可变
|
|
|
|
|
const activeTab = ref('budget');
|
|
|
|
|
@ -236,7 +288,7 @@ const searchForm = reactive({
|
|
|
|
|
projectId: '',
|
|
|
|
|
projectName: '',
|
|
|
|
|
projectCode: '',
|
|
|
|
|
projectCategory: '1',
|
|
|
|
|
projectCategory: '',
|
|
|
|
|
flowStatus: ''
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@ -244,9 +296,9 @@ const searchForm = reactive({
|
|
|
|
|
watch(
|
|
|
|
|
() => searchForm.projectCategory,
|
|
|
|
|
(newCategory) => {
|
|
|
|
|
if (newCategory === PROJECT_CATEGORY.RD) {
|
|
|
|
|
if (newCategory === PROJECT_CATEGORY.RD || newCategory === PROJECT_CATEGORY.PRE_PRODUCTION) {
|
|
|
|
|
activeTab.value = 'budgetTable';
|
|
|
|
|
} else if (newCategory === PROJECT_CATEGORY.MARKET) {
|
|
|
|
|
} else if (newCategory === PROJECT_CATEGORY.MARKET || newCategory === PROJECT_CATEGORY.MARKET_PART) {
|
|
|
|
|
activeTab.value = 'budget';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -293,7 +345,7 @@ const projectList = ref<ProjectInfoVO[]>([]);
|
|
|
|
|
const projectTotal = ref(0);
|
|
|
|
|
const projectLoading = ref(true);
|
|
|
|
|
const projectSearchForm = reactive({
|
|
|
|
|
keyword: '',
|
|
|
|
|
projectCategory: '',
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10
|
|
|
|
|
});
|
|
|
|
|
@ -302,7 +354,7 @@ const projectSearchForm = reactive({
|
|
|
|
|
const getProjectList = async () => {
|
|
|
|
|
projectLoading.value = true;
|
|
|
|
|
const res = await listProjectInfo(projectSearchForm);
|
|
|
|
|
console.log(res);
|
|
|
|
|
console.log(searchForm);
|
|
|
|
|
projectList.value = res.rows;
|
|
|
|
|
projectTotal.value = res.total;
|
|
|
|
|
projectLoading.value = false;
|
|
|
|
|
@ -311,6 +363,13 @@ const getProjectList = async () => {
|
|
|
|
|
// 标签页切换处理
|
|
|
|
|
const handleTabClick = (tab: any) => {
|
|
|
|
|
activeTab.value = tab.paneName;
|
|
|
|
|
if ((budgetId.value && routeParams.value.type === 'update') || !budgetId.value) {
|
|
|
|
|
if (searchForm.projectCategory === PROJECT_CATEGORY.RD || searchForm.projectCategory === PROJECT_CATEGORY.PRE_PRODUCTION) {
|
|
|
|
|
updateRdBudgetTable();
|
|
|
|
|
} else if (searchForm.projectCategory === PROJECT_CATEGORY.MARKET || searchForm.projectCategory === PROJECT_CATEGORY.MARKET_PART) {
|
|
|
|
|
updateBudgetTable();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 显示项目选择弹窗
|
|
|
|
|
@ -438,12 +497,47 @@ const updateBudgetTable = () => {
|
|
|
|
|
const travelTotal = travelCostRef.value?.getTotalAmount() || { budgetAmount: 0, reducedAmount: 0 };
|
|
|
|
|
const otherTotal = otherCostRef.value?.getTotalAmount() || { budgetAmount: 0, reducedAmount: 0 };
|
|
|
|
|
|
|
|
|
|
// 更新预算表
|
|
|
|
|
budgetTableRef.value.updateBudgetDetailData('材料费', materialTotal.budgetAmount, materialTotal.reducedAmount);
|
|
|
|
|
budgetTableRef.value.updateBudgetDetailData('人工费', laborTotal.budgetAmount, laborTotal.reducedAmount);
|
|
|
|
|
budgetTableRef.value.updateBudgetDetailData('安装费', installationTotal.budgetAmount, installationTotal.reducedAmount);
|
|
|
|
|
budgetTableRef.value.updateBudgetDetailData('差旅费', travelTotal.budgetAmount, travelTotal.reducedAmount);
|
|
|
|
|
budgetTableRef.value.updateBudgetDetailData('其他费用', otherTotal.budgetAmount, otherTotal.reducedAmount);
|
|
|
|
|
// 更新预算表,目前是按单位是万元传值,后续如果根据单位是元,则在此判断更新传的值
|
|
|
|
|
budgetTableRef.value.updateBudgetDetailData('材料费', materialTotal.budgetAmount / 10000, materialTotal.reducedAmount / 10000);
|
|
|
|
|
budgetTableRef.value.updateBudgetDetailData('人工费', laborTotal.budgetAmount / 10000, laborTotal.reducedAmount / 10000);
|
|
|
|
|
budgetTableRef.value.updateBudgetDetailData('安装费', installationTotal.budgetAmount / 10000, installationTotal.reducedAmount / 10000);
|
|
|
|
|
budgetTableRef.value.updateBudgetDetailData('差旅费', travelTotal.budgetAmount / 10000, travelTotal.reducedAmount / 10000);
|
|
|
|
|
budgetTableRef.value.updateBudgetDetailData('其他费用', otherTotal.budgetAmount / 10000, otherTotal.reducedAmount / 10000);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 更新研发项目预算预算表数据
|
|
|
|
|
const updateRdBudgetTable = () => {
|
|
|
|
|
// 获取各tab页的合计数据
|
|
|
|
|
const equipmentAmount = rdEquipmentCostRef.value?.getTotalAmount();
|
|
|
|
|
const equipmentTotal = equipmentAmount.equipmentTotal || 0;
|
|
|
|
|
const materialTotal = rdMaterialCostRef.value?.getTotalAmount() || 0;
|
|
|
|
|
const travelMeetingExchangeAmount = rdTravelMeetingExchangeRef.value?.getTravelMeetingExchangeAmount();
|
|
|
|
|
const travelTotal = travelMeetingExchangeAmount.travelSubtotalTotal || 0;
|
|
|
|
|
const meetingFeeTotal = travelMeetingExchangeAmount.meetingFeeTotal || 0;
|
|
|
|
|
const internationalSubtotalTotal = travelMeetingExchangeAmount.internationalSubtotalTotal || 0;
|
|
|
|
|
const laborAmount = rdLaborServiceRef.value?.getLaborAmount();
|
|
|
|
|
const techConsultTotal = laborAmount.techConsultTotal || 0;
|
|
|
|
|
const laborTotal = laborAmount.laborTotal || 0;
|
|
|
|
|
const serviceTotal = laborAmount.serviceTotal || 0;
|
|
|
|
|
const literatureCost = rdLiteratureCostRef.value?.getLiteratureCost() || 0;
|
|
|
|
|
const literatureTotal = literatureCost.literatureTotal || 0;
|
|
|
|
|
const testingCost = rdTestingCostRef.value?.getTestingAmount() || 0;
|
|
|
|
|
const testingTotal = testingCost.testingTotal || 0;
|
|
|
|
|
const otherCost = rdOtherCostRef.value?.getOtherCost() || 0;
|
|
|
|
|
const otherTotal = otherCost.otherTotal || 0;
|
|
|
|
|
|
|
|
|
|
// 更新预算表,目前是按单位是万元传值,后续如果根据单位是元,则在此判断更新传的值
|
|
|
|
|
rdBudgetTableRef.value.updateRdBudgetDetailData('设备费', equipmentTotal / 10000);
|
|
|
|
|
rdBudgetTableRef.value.updateRdBudgetDetailData('材料费', materialTotal / 10000);
|
|
|
|
|
rdBudgetTableRef.value.updateRdBudgetDetailData('差旅费', travelTotal / 10000);
|
|
|
|
|
rdBudgetTableRef.value.updateRdBudgetDetailData('会议费', meetingFeeTotal / 10000);
|
|
|
|
|
rdBudgetTableRef.value.updateRdBudgetDetailData('国际合作与交流费', internationalSubtotalTotal / 10000);
|
|
|
|
|
rdBudgetTableRef.value.updateRdBudgetDetailData('咨询开发费', techConsultTotal / 10000);
|
|
|
|
|
rdBudgetTableRef.value.updateRdBudgetDetailData('人工费', laborTotal / 10000);
|
|
|
|
|
rdBudgetTableRef.value.updateRdBudgetDetailData('劳务费', serviceTotal / 10000);
|
|
|
|
|
rdBudgetTableRef.value.updateRdBudgetDetailData('资料/文献费', literatureTotal / 10000);
|
|
|
|
|
rdBudgetTableRef.value.updateRdBudgetDetailData('测试化验费', testingTotal / 10000);
|
|
|
|
|
rdBudgetTableRef.value.updateRdBudgetDetailData('其他费用', otherTotal / 10000);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 新增一个方法用于在tab切换时更新预算数据
|
|
|
|
|
@ -470,9 +564,9 @@ const updateBudgetDataOnTabChange = () => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 监听tab切换,更新预算表数据
|
|
|
|
|
watch(activeTab, () => {
|
|
|
|
|
updateBudgetDataOnTabChange();
|
|
|
|
|
});
|
|
|
|
|
// watch(activeTab, () => {
|
|
|
|
|
// updateBudgetDataOnTabChange();
|
|
|
|
|
// });
|
|
|
|
|
// 导出预算
|
|
|
|
|
const exportBudget = () => {
|
|
|
|
|
if (!searchForm.projectId) {
|
|
|
|
|
@ -490,67 +584,156 @@ const handleSave = async (status: string, mode: boolean) => {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (searchForm.projectCategory === PROJECT_CATEGORY.RD) {
|
|
|
|
|
handleEquipmentCostUpdate();
|
|
|
|
|
handleMaterialCostUpdate();
|
|
|
|
|
handleTravelMeetingExchangeUpdate();
|
|
|
|
|
handleLaborServiceUpdate();
|
|
|
|
|
handleLiteratureCostUpdate();
|
|
|
|
|
handleTestingCostUpdate();
|
|
|
|
|
handleOtherCostUpdate();
|
|
|
|
|
} else if (searchForm.projectCategory === PROJECT_CATEGORY.MARKET) {
|
|
|
|
|
updateBudgetTable();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// 收集所有标签页的数据
|
|
|
|
|
if (searchForm.projectCategory === PROJECT_CATEGORY.RD) {
|
|
|
|
|
const allData = {
|
|
|
|
|
projectId: searchForm.projectId,
|
|
|
|
|
costData: { ...costData },
|
|
|
|
|
equipmentCostData: rdEquipmentCostRef.value?.equipmentList || [],
|
|
|
|
|
materialCostData: rdMaterialCostRef.value?.materialList || [],
|
|
|
|
|
travelMeetingExchangeData: {
|
|
|
|
|
travelList: rdTravelMeetingExchangeRef.value?.travelList || [],
|
|
|
|
|
meetingList: rdTravelMeetingExchangeRef.value?.meetingList || [],
|
|
|
|
|
internationalExchangeList: rdTravelMeetingExchangeRef.value?.internationalExchangeList || []
|
|
|
|
|
},
|
|
|
|
|
laborServiceData: {
|
|
|
|
|
techConsultList: rdLaborServiceRef.value?.techConsultList || [],
|
|
|
|
|
expertMeetingList: rdLaborServiceRef.value?.expertMeetingList || [],
|
|
|
|
|
expertCommList: rdLaborServiceRef.value?.expertCommList || [],
|
|
|
|
|
laborList: rdLaborServiceRef.value?.laborList || [],
|
|
|
|
|
serviceList: rdLaborServiceRef.value?.serviceList || []
|
|
|
|
|
},
|
|
|
|
|
literatureCostData: {
|
|
|
|
|
materialsList: rdLiteratureCostRef.value?.materialsList || [],
|
|
|
|
|
literatureRetrieval: rdLiteratureCostRef.value?.literatureRetrieval || {},
|
|
|
|
|
softwareList: rdLiteratureCostRef.value?.softwareList || []
|
|
|
|
|
},
|
|
|
|
|
testingCostData: rdTestingCostRef.value?.testingList || [],
|
|
|
|
|
otherCostData: rdOtherCostRef.value?.otherCostList || []
|
|
|
|
|
};
|
|
|
|
|
} else if (searchForm.projectCategory === PROJECT_CATEGORY.MARKET) {
|
|
|
|
|
const budgetDetailData = budgetTableRef.value?.budgetDetailData;
|
|
|
|
|
let budgetForm = budgetTableRef.value?.budgetForm;
|
|
|
|
|
buttonLoading.value = true;
|
|
|
|
|
const budgetForm = reactive<budgetInfoForm>({});
|
|
|
|
|
if (searchForm.projectCategory === PROJECT_CATEGORY.RD || searchForm.projectCategory === PROJECT_CATEGORY.PRE_PRODUCTION) {
|
|
|
|
|
updateRdBudgetTable();
|
|
|
|
|
|
|
|
|
|
const budgetDetailData = rdBudgetTableRef.value?.budgetDetailData;
|
|
|
|
|
|
|
|
|
|
Object.assign(budgetForm,
|
|
|
|
|
rdBudgetTableRef.value?.rdBudgetInfoForm || {},
|
|
|
|
|
rdBudgetTableRef.value?.footerForm || {}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
budgetForm.budgetStatus = status === 'draft' ? BUSINESS_STATUS.DRAFT : BUSINESS_STATUS.WAITING;
|
|
|
|
|
budgetForm.flowStatus = status === 'draft' ? 'draft' : 'waiting';
|
|
|
|
|
|
|
|
|
|
budgetForm.erpRdBudgetEquipmentCostList = [];
|
|
|
|
|
budgetForm.erpRdBudgetMaterialCostList = [];
|
|
|
|
|
budgetForm.erpRdBudgetTravelCostList = [];
|
|
|
|
|
budgetForm.erpRdBudgetMeetingCostList = [];
|
|
|
|
|
budgetForm.erpRdBudgetExchangeCostList = [];
|
|
|
|
|
budgetForm.erpRdBudgetTechCostList = [];
|
|
|
|
|
budgetForm.erpRdBudgetLaborCostList = [];
|
|
|
|
|
budgetForm.erpRdBudgetLiteratureCostList = [];
|
|
|
|
|
budgetForm.erpRdBudgetTestingCostList = [];
|
|
|
|
|
budgetForm.erpRdBudgetOtherCostList = [];
|
|
|
|
|
|
|
|
|
|
// console.log(budgetForm);
|
|
|
|
|
budgetForm.erpBudgetDetailList = budgetDetailData;
|
|
|
|
|
budgetForm.erpBudgetMaterialCostList = materialCostRef.value?.budgetMaterialCostList;
|
|
|
|
|
|
|
|
|
|
console.log(budgetForm);
|
|
|
|
|
|
|
|
|
|
buttonLoading.value = true;
|
|
|
|
|
if (budgetForm.budgetId) {
|
|
|
|
|
await updateErpBudgetInfo(budgetForm).finally(() => (buttonLoading.value = false));
|
|
|
|
|
} else {
|
|
|
|
|
await addErpBudgetInfo(budgetForm).finally(() => (buttonLoading.value = false));
|
|
|
|
|
if (!isDeepEqual(oriRdBudgetEquipmentCostList.value, rdEquipmentCostRef.value?.equipmentData)) {
|
|
|
|
|
budgetForm.erpRdBudgetEquipmentCostList = rdEquipmentCostRef.value?.equipmentData;
|
|
|
|
|
}
|
|
|
|
|
if (!isDeepEqual(oriRdBudgetMaterialCostList.value, rdMaterialCostRef.value?.allMaterialData)) {
|
|
|
|
|
budgetForm.erpRdBudgetMaterialCostList = rdMaterialCostRef.value?.allMaterialData;
|
|
|
|
|
}
|
|
|
|
|
if (!isDeepEqual(oriRdBudgetTravelCostList.value, rdTravelMeetingExchangeRef.value?.travelList)) {
|
|
|
|
|
budgetForm.erpRdBudgetTravelCostList = rdTravelMeetingExchangeRef.value?.travelList;
|
|
|
|
|
}
|
|
|
|
|
if (!isDeepEqual(oriRdBudgetMeetingCostList.value, rdTravelMeetingExchangeRef.value?.meetingList)) {
|
|
|
|
|
budgetForm.erpRdBudgetMeetingCostList = rdTravelMeetingExchangeRef.value?.meetingList;
|
|
|
|
|
}
|
|
|
|
|
if (!isDeepEqual(oriRdBudgetExchangeCostList.value, rdTravelMeetingExchangeRef.value?.exchangeList)) {
|
|
|
|
|
budgetForm.erpRdBudgetExchangeCostList = rdTravelMeetingExchangeRef.value?.exchangeList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
budgetForm.erpRdBudgetTechCostList = [
|
|
|
|
|
...(!isDeepEqual(oriRdBudgetTechConsultCostList.value, rdLaborServiceRef.value?.techConsultList)
|
|
|
|
|
? rdLaborServiceRef.value?.techConsultList || []
|
|
|
|
|
: []),
|
|
|
|
|
...(!isDeepEqual(oriRdBudgetExpertMeetingCostList.value, rdLaborServiceRef.value?.expertMeetingList)
|
|
|
|
|
? rdLaborServiceRef.value?.expertMeetingList || []
|
|
|
|
|
: []),
|
|
|
|
|
...(!isDeepEqual(oriRdBudgetExpertCommCostList.value, rdLaborServiceRef.value?.expertCommList)
|
|
|
|
|
? rdLaborServiceRef.value?.expertCommList || []
|
|
|
|
|
: [])
|
|
|
|
|
];
|
|
|
|
|
console.log('---');
|
|
|
|
|
console.log(budgetForm.erpRdBudgetTechCostList);
|
|
|
|
|
|
|
|
|
|
budgetForm.erpRdBudgetLaborCostList = [
|
|
|
|
|
...(!isDeepEqual(oriRdBudgetLaborCostList.value, rdLaborServiceRef.value?.laborList) ? rdLaborServiceRef.value?.laborList || [] : []),
|
|
|
|
|
...(!isDeepEqual(oriRdBudgetServiceCostList.value, rdLaborServiceRef.value?.serviceList) ? rdLaborServiceRef.value?.serviceList || [] : [])
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
budgetForm.erpRdBudgetLiteratureCostList = [
|
|
|
|
|
...(!isDeepEqual(oriRdBudgetLiteratureMaterialCostList.value, rdLiteratureCostRef.value?.materialsList)
|
|
|
|
|
? rdLiteratureCostRef.value?.materialsList || []
|
|
|
|
|
: []),
|
|
|
|
|
...(!isDeepEqual(oriRdBudgetLiteratureSofwareCostList.value, rdLiteratureCostRef.value?.softwareList)
|
|
|
|
|
? rdLiteratureCostRef.value?.softwareList || []
|
|
|
|
|
: [])
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
budgetForm.erpRdBudgetLiteratureCostList.push(rdLiteratureCostRef.value?.literatureRetrieval);
|
|
|
|
|
|
|
|
|
|
if (!isDeepEqual(oriRdBudgetTestingCostList.value, rdTestingCostRef.value?.testData)) {
|
|
|
|
|
budgetForm.erpRdBudgetTestingCostList = rdTestingCostRef.value?.testData;
|
|
|
|
|
}
|
|
|
|
|
if (!isDeepEqual(oriRdBudgetOtherCostList.value, rdOtherCostRef.value?.otherCostList)) {
|
|
|
|
|
budgetForm.erpRdBudgetOtherCostList = rdOtherCostRef.value?.otherCostList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (budgetForm.budgetId) {
|
|
|
|
|
budgetForm.toDeletedRdEquipmentCostIdList = rdEquipmentCostRef.value?.toDeletedEquipmentCostIdList;
|
|
|
|
|
budgetForm.toDeletedRdMaterialCostIdList = rdMaterialCostRef.value?.toDeletedMaterialCostIdList;
|
|
|
|
|
budgetForm.toDeletedRdTravelCostIdList = rdTravelMeetingExchangeRef.value?.toDeletedTravelCostIdList;
|
|
|
|
|
budgetForm.toDeletedRdMeetingCostIdList = rdTravelMeetingExchangeRef.value?.toDeletedMeetingCostIdList;
|
|
|
|
|
budgetForm.toDeletedRdExchangeCostIdList = rdTravelMeetingExchangeRef.value?.toDeletedExchangeCostIdList;
|
|
|
|
|
budgetForm.toDeletedRdTechCostIdList = rdLaborServiceRef.value?.toDeletedTechCostIdList;
|
|
|
|
|
budgetForm.toDeletedRdLaborCostIdList = rdLaborServiceRef.value?.toDeletedLaborCostIdList;
|
|
|
|
|
budgetForm.toDeletedRdLiteratureCostIdList = rdLiteratureCostRef.value?.toDeletedLiteratureCostIdList;
|
|
|
|
|
budgetForm.toDeletedRdTestingCostIdList = rdTestingCostRef.value?.toDeletedTestCostIdList;
|
|
|
|
|
budgetForm.toDeletedRdOtherCostIdList = rdOtherCostRef.value?.toDeletedOtherCostIdList;
|
|
|
|
|
}
|
|
|
|
|
} else if (searchForm.projectCategory === PROJECT_CATEGORY.MARKET || searchForm.projectCategory === PROJECT_CATEGORY.MARKET_PART) {
|
|
|
|
|
updateBudgetTable();
|
|
|
|
|
|
|
|
|
|
const budgetDetailData = budgetTableRef.value?.budgetDetailData;
|
|
|
|
|
Object.assign(budgetForm, budgetTableRef.value?.budgetForm);
|
|
|
|
|
budgetForm.budgetStatus = status === 'draft' ? BUSINESS_STATUS.DRAFT : BUSINESS_STATUS.WAITING;
|
|
|
|
|
budgetForm.flowStatus = status === 'draft' ? 'draft' : 'waiting';
|
|
|
|
|
|
|
|
|
|
budgetForm.erpBudgetMaterialCostList = [];
|
|
|
|
|
budgetForm.erpBudgetLaborCostList = [];
|
|
|
|
|
budgetForm.erpBudgetInstallCostList = [];
|
|
|
|
|
budgetForm.erpBudgetTravelCostList = [];
|
|
|
|
|
budgetForm.erpBudgetOtherCostList = [];
|
|
|
|
|
console.log(budgetForm);
|
|
|
|
|
budgetForm.erpBudgetDetailList = budgetDetailData;
|
|
|
|
|
if (!isDeepEqual(oriBudgetMaterialCostList.value, materialCostRef.value?.budgetMaterialCostList)) {
|
|
|
|
|
budgetForm.erpBudgetMaterialCostList = materialCostRef.value?.budgetMaterialCostList;
|
|
|
|
|
}
|
|
|
|
|
if (!isDeepEqual(oriBudgetLaborCostList.value, laborCostRef.value?.budgetLaborCostList)) {
|
|
|
|
|
budgetForm.erpBudgetLaborCostList = laborCostRef.value?.budgetLaborCostList;
|
|
|
|
|
}
|
|
|
|
|
if (!isDeepEqual(oriBudgetInstallCostList.value, installationCostRef.value?.installCostList)) {
|
|
|
|
|
budgetForm.erpBudgetInstallCostList = installationCostRef.value?.installCostList;
|
|
|
|
|
}
|
|
|
|
|
if (!isDeepEqual(oriBudgetTravelCostList.value, travelCostRef.value?.travelCostList)) {
|
|
|
|
|
budgetForm.erpBudgetTravelCostList = travelCostRef.value?.travelCostList;
|
|
|
|
|
}
|
|
|
|
|
if (!isDeepEqual(oriBudgetOtherCostList.value, otherCostRef.value?.otherCostList)) {
|
|
|
|
|
budgetForm.erpBudgetOtherCostList = otherCostRef.value?.otherCostList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (budgetForm.budgetId) {
|
|
|
|
|
budgetForm.toDeletedMaterialCostIdList = materialCostRef.value?.toDeletedMaterialCostIdList;
|
|
|
|
|
budgetForm.toDeletedLaborCostIdList = laborCostRef.value?.toDeletedLaborCostIdList;
|
|
|
|
|
budgetForm.toDeletedInstallCostIdList = installationCostRef.value?.toDeletedInstallCostIdList;
|
|
|
|
|
budgetForm.toDeletedTravelCostIdList = travelCostRef.value?.toDeletedTravelCostIdList;
|
|
|
|
|
budgetForm.toDeletedOtherCostIdList = otherCostRef.value?.toDeletedOtherCostIdList;
|
|
|
|
|
}
|
|
|
|
|
proxy?.$modal.msgSuccess('操作成功');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (budgetForm.budgetId) {
|
|
|
|
|
await updateErpBudgetInfo(budgetForm).finally(() => (buttonLoading.value = false));
|
|
|
|
|
} else {
|
|
|
|
|
await addErpBudgetInfo(budgetForm).finally(() => (buttonLoading.value = false));
|
|
|
|
|
}
|
|
|
|
|
proxy?.$modal.msgSuccess('操作成功');
|
|
|
|
|
// 保存成功后关闭之前记录的tab
|
|
|
|
|
const obj = { path: '/budget/erp/budgetInfo', query: { t: Date.now(), pageNum: routeParams.value.pageNum } };
|
|
|
|
|
proxy?.$tab.closeOpenPage(obj);
|
|
|
|
|
// router.go(-1);
|
|
|
|
|
// handleClose();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
ElMessage.error('保存失败');
|
|
|
|
|
console.error('保存失败:', error);
|
|
|
|
|
} finally {
|
|
|
|
|
buttonLoading.value = false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -562,6 +745,7 @@ const handleClose = () => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
const budgetId = ref();
|
|
|
|
|
// 初始化
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
// 可以在这里加载初始数据
|
|
|
|
|
@ -570,15 +754,135 @@ onMounted(() => {
|
|
|
|
|
nextTick(async () => {
|
|
|
|
|
// 获取路由参数
|
|
|
|
|
routeParams.value = route.query;
|
|
|
|
|
const id = routeParams.value.id as string | number;
|
|
|
|
|
if (id && (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval')) {
|
|
|
|
|
budgetId.value = routeParams.value.id as string | number;
|
|
|
|
|
if (budgetId.value && (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval')) {
|
|
|
|
|
proxy?.$modal.loading('正在加载数据,请稍后...');
|
|
|
|
|
const res = await getErpBudgetInfo(id);
|
|
|
|
|
|
|
|
|
|
const res = await getErpBudgetInfo(budgetId.value);
|
|
|
|
|
Object.assign(searchForm, res.data);
|
|
|
|
|
Object.assign(budgetTableRef.value?.budgetForm,res.data)
|
|
|
|
|
console.log(res.data)
|
|
|
|
|
if (searchForm.projectCategory === PROJECT_CATEGORY.RD || searchForm.projectCategory === PROJECT_CATEGORY.PRE_PRODUCTION) {
|
|
|
|
|
oriRdBudgetEquipmentCostList.value = JSON.parse(JSON.stringify(res.data.erpRdBudgetEquipmentCostList));
|
|
|
|
|
|
|
|
|
|
const erpRdBudgetMaterialCostList = res.data.erpRdBudgetMaterialCostList;
|
|
|
|
|
const groupedRdBudgetMaterialCostListByMaterialType = erpRdBudgetMaterialCostList.reduce((acc, item) => {
|
|
|
|
|
const materialType = item.materialType;
|
|
|
|
|
if (!acc[materialType]) {
|
|
|
|
|
acc[materialType] = [];
|
|
|
|
|
}
|
|
|
|
|
acc[materialType].push(item);
|
|
|
|
|
return acc;
|
|
|
|
|
}, {});
|
|
|
|
|
|
|
|
|
|
const rdBudgetMainMaterialCostList = groupedRdBudgetMaterialCostListByMaterialType[MATERIAL_TYPE.MAIN] || [];
|
|
|
|
|
const rdBudgetOtherMaterialCostList = groupedRdBudgetMaterialCostListByMaterialType[MATERIAL_TYPE.OTHER] || [];
|
|
|
|
|
oriRdBudgetMaterialCostList.value = JSON.parse(JSON.stringify(erpRdBudgetMaterialCostList));
|
|
|
|
|
|
|
|
|
|
oriRdBudgetTravelCostList.value = JSON.parse(JSON.stringify(res.data.erpRdBudgetTravelCostList));
|
|
|
|
|
oriRdBudgetMeetingCostList.value = JSON.parse(JSON.stringify(res.data.erpRdBudgetMeetingCostList));
|
|
|
|
|
oriRdBudgetExchangeCostList.value = JSON.parse(JSON.stringify(res.data.erpRdBudgetExchangeCostList));
|
|
|
|
|
|
|
|
|
|
const erpRdBudgetTechCostList = res.data.erpRdBudgetTechCostList;
|
|
|
|
|
const groupedRdBudgetTechCostListByTechType = erpRdBudgetTechCostList.reduce((acc, item) => {
|
|
|
|
|
const techType = item.techType;
|
|
|
|
|
if (!acc[techType]) {
|
|
|
|
|
acc[techType] = [];
|
|
|
|
|
}
|
|
|
|
|
acc[techType].push(item);
|
|
|
|
|
return acc;
|
|
|
|
|
}, {});
|
|
|
|
|
|
|
|
|
|
const rdBudgetTechConsultCostList = groupedRdBudgetTechCostListByTechType[TECH_TYPE.TECH_CONSULT] || [];
|
|
|
|
|
const rdBudgetExpertMeetingCostList = groupedRdBudgetTechCostListByTechType[TECH_TYPE.EXPERT_MEETING] || [];
|
|
|
|
|
const rdBudgetExpertCommCostList = groupedRdBudgetTechCostListByTechType[TECH_TYPE.EXPERT_COMM] || [];
|
|
|
|
|
oriRdBudgetTechConsultCostList.value = JSON.parse(JSON.stringify(rdBudgetTechConsultCostList)); //技术咨询
|
|
|
|
|
oriRdBudgetExpertMeetingCostList.value = JSON.parse(JSON.stringify(rdBudgetExpertMeetingCostList)); //专家咨询会议形式
|
|
|
|
|
oriRdBudgetExpertCommCostList.value = JSON.parse(JSON.stringify(rdBudgetExpertCommCostList)); //专家咨询通讯形式
|
|
|
|
|
|
|
|
|
|
const erpRdBudgetLaborCostList = res.data.erpRdBudgetLaborCostList;
|
|
|
|
|
const groupedRdBudgetLaborCostListByLaborType = erpRdBudgetLaborCostList.reduce((acc, item) => {
|
|
|
|
|
const laborType = item.laborType;
|
|
|
|
|
if (!acc[laborType]) {
|
|
|
|
|
acc[laborType] = [];
|
|
|
|
|
}
|
|
|
|
|
acc[laborType].push(item);
|
|
|
|
|
return acc;
|
|
|
|
|
}, {});
|
|
|
|
|
|
|
|
|
|
const rdBudgetLaborCostList = groupedRdBudgetLaborCostListByLaborType[LABOR_TYPE.LABOR] || [];
|
|
|
|
|
const rdBudgetServiceCostList = groupedRdBudgetLaborCostListByLaborType[LABOR_TYPE.SERVICE] || [];
|
|
|
|
|
oriRdBudgetLaborCostList.value = JSON.parse(JSON.stringify(rdBudgetLaborCostList)); //人工费
|
|
|
|
|
oriRdBudgetServiceCostList.value = JSON.parse(JSON.stringify(rdBudgetServiceCostList)); //劳务费
|
|
|
|
|
|
|
|
|
|
const erpRdBudgetLiteratureCostList = res.data.erpRdBudgetLiteratureCostList;
|
|
|
|
|
const groupedRdBudgetLiteratureCostListByLiteratureType = erpRdBudgetLiteratureCostList.reduce((acc, item) => {
|
|
|
|
|
const literatureType = item.literatureType;
|
|
|
|
|
if (!acc[literatureType]) {
|
|
|
|
|
acc[literatureType] = [];
|
|
|
|
|
}
|
|
|
|
|
acc[literatureType].push(item);
|
|
|
|
|
return acc;
|
|
|
|
|
}, {});
|
|
|
|
|
|
|
|
|
|
const rdBudgetLiteratureMaterialCostList = groupedRdBudgetLiteratureCostListByLiteratureType[LITERATURE_TYPE.MATERIAL] || [];
|
|
|
|
|
const rdBudgetLiteratureSoftwareCostList = groupedRdBudgetLiteratureCostListByLiteratureType[LITERATURE_TYPE.SOFTWARE] || [];
|
|
|
|
|
oriRdBudgetLiteratureMaterialCostList.value = JSON.parse(JSON.stringify(rdBudgetLiteratureMaterialCostList)); //资料费
|
|
|
|
|
oriRdBudgetLiteratureSofwareCostList.value = JSON.parse(JSON.stringify(rdBudgetLiteratureSoftwareCostList)); //专用软件购买费
|
|
|
|
|
|
|
|
|
|
const rdBudgetLiteratureRetrievalCostList = groupedRdBudgetLiteratureCostListByLiteratureType[LITERATURE_TYPE.DOCUMENT] || []; //文献检索费
|
|
|
|
|
|
|
|
|
|
oriRdBudgetTestingCostList.value = JSON.parse(JSON.stringify(res.data.erpRdBudgetTestingCostList));
|
|
|
|
|
oriRdBudgetOtherCostList.value = JSON.parse(JSON.stringify(res.data.erpRdBudgetOtherCostList));
|
|
|
|
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
console.log(rdBudgetTableRef.value?.budgetForm);
|
|
|
|
|
Object.assign(rdBudgetTableRef.value?.rdBudgetInfoForm, res.data);
|
|
|
|
|
Object.assign(rdBudgetTableRef.value?.footerForm, res.data);
|
|
|
|
|
Object.assign(rdBudgetTableRef.value?.budgetDetailData || [], res.data.erpBudgetDetailList);
|
|
|
|
|
Object.assign(rdEquipmentCostRef.value?.equipmentData || [], res.data.erpRdBudgetEquipmentCostList);
|
|
|
|
|
Object.assign(rdMaterialCostRef.value?.materialData || [], rdBudgetMainMaterialCostList);
|
|
|
|
|
Object.assign(rdMaterialCostRef.value?.otherMaterial || [], rdBudgetOtherMaterialCostList[0]);
|
|
|
|
|
Object.assign(rdTravelMeetingExchangeRef.value?.travelList || [], res.data.erpRdBudgetTravelCostList);
|
|
|
|
|
Object.assign(rdTravelMeetingExchangeRef.value?.meetingList || [], res.data.erpRdBudgetMeetingCostList);
|
|
|
|
|
Object.assign(rdTravelMeetingExchangeRef.value?.exchangeList || [], res.data.erpRdBudgetExchangeCostList);
|
|
|
|
|
Object.assign(rdLaborServiceRef.value?.techConsultList || [], rdBudgetTechConsultCostList);
|
|
|
|
|
Object.assign(rdLaborServiceRef.value?.expertMeetingList || [], rdBudgetExpertMeetingCostList);
|
|
|
|
|
Object.assign(rdLaborServiceRef.value?.expertCommList || [], rdBudgetExpertCommCostList);
|
|
|
|
|
Object.assign(rdLaborServiceRef.value?.laborList || [], rdBudgetLaborCostList);
|
|
|
|
|
Object.assign(rdLaborServiceRef.value?.serviceList || [], rdBudgetServiceCostList);
|
|
|
|
|
|
|
|
|
|
Object.assign(rdLiteratureCostRef.value?.materialsList || [], rdBudgetLiteratureMaterialCostList);
|
|
|
|
|
Object.assign(rdLiteratureCostRef.value?.softwareList || [], rdBudgetLiteratureSoftwareCostList);
|
|
|
|
|
Object.assign(
|
|
|
|
|
rdLiteratureCostRef.value?.literatureRetrieval || [],
|
|
|
|
|
rdBudgetLiteratureRetrievalCostList.length > 0 ? rdBudgetLiteratureRetrievalCostList[0] : {}
|
|
|
|
|
);
|
|
|
|
|
Object.assign(rdTestingCostRef.value?.testData || [], res.data.erpRdBudgetTestingCostList);
|
|
|
|
|
Object.assign(rdOtherCostRef.value?.otherCostList || [], res.data.erpRdBudgetOtherCostList);
|
|
|
|
|
});
|
|
|
|
|
} else if (searchForm.projectCategory === PROJECT_CATEGORY.MARKET || searchForm.projectCategory === PROJECT_CATEGORY.MARKET_PART) {
|
|
|
|
|
// 创建初始状态的深拷贝(确保完全独立)
|
|
|
|
|
oriBudgetMaterialCostList.value = JSON.parse(JSON.stringify(res.data.erpBudgetMaterialCostList));
|
|
|
|
|
oriBudgetLaborCostList.value = JSON.parse(JSON.stringify(res.data.erpBudgetLaborCostList));
|
|
|
|
|
oriBudgetInstallCostList.value = JSON.parse(JSON.stringify(res.data.erpBudgetInstallCostList));
|
|
|
|
|
oriBudgetTravelCostList.value = JSON.parse(JSON.stringify(res.data.erpBudgetTravelCostList));
|
|
|
|
|
oriBudgetOtherCostList.value = JSON.parse(JSON.stringify(res.data.erpBudgetOtherCostList));
|
|
|
|
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
console.log(budgetTableRef.value?.budgetForm);
|
|
|
|
|
Object.assign(budgetTableRef.value?.budgetForm, res.data);
|
|
|
|
|
Object.assign(budgetTableRef.value?.budgetDetailData, res.data.erpBudgetDetailList);
|
|
|
|
|
Object.assign(materialCostRef.value?.budgetMaterialCostList, res.data.erpBudgetMaterialCostList);
|
|
|
|
|
Object.assign(laborCostRef.value?.budgetLaborCostList, res.data.erpBudgetLaborCostList);
|
|
|
|
|
Object.assign(installationCostRef.value?.installCostList, res.data.erpBudgetInstallCostList);
|
|
|
|
|
Object.assign(travelCostRef.value?.travelCostList, res.data.erpBudgetTravelCostList);
|
|
|
|
|
Object.assign(otherCostRef.value?.otherCostList, res.data.erpBudgetOtherCostList);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
proxy?.$modal.closeLoading();
|
|
|
|
|
} else {
|
|
|
|
|
searchForm.projectCategory = routeParams.value.projectCategory;
|
|
|
|
|
// 新增模式:如果已有合同编号,禁用生成按钮
|
|
|
|
|
// if (form.value.contractCode) {
|
|
|
|
|
// isCodeGenerated.value = true;
|
|
|
|
|
@ -587,6 +891,7 @@ onMounted(() => {
|
|
|
|
|
// isCodeGenerated.value = false;
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
projectSearchForm.projectCategory = searchForm.projectCategory;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@ -594,6 +899,22 @@ import SubmitVerify from '@/components/Process/submitVerify.vue';
|
|
|
|
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
|
|
|
|
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
|
|
|
|
import { getContractInfo } from '@/api/oa/erp/contractInfo';
|
|
|
|
|
import { budgetMaterialCostVO } from '@/api/oa/erp/budgetInfo/market/budgetMaterialCost/types';
|
|
|
|
|
import { budgetLaborCostVO } from '@/api/oa/erp/budgetInfo/market/budgetLaborCost/types';
|
|
|
|
|
import { budgetInstallCostVO } from '@/api/oa/erp/budgetInfo/market/budgetInstallCost/types';
|
|
|
|
|
import { budgetTravelCostVO } from '@/api/oa/erp/budgetInfo/market/budgetTravelCost/types';
|
|
|
|
|
import { budgetOtherCostVO } from '@/api/oa/erp/budgetInfo/market/budgetOtherCost/types';
|
|
|
|
|
import { budgetInfoForm } from '@/api/oa/erp/budgetInfo/types';
|
|
|
|
|
import { rdBudgetEquipmentCostVO } from '@/api/oa/erp/budgetInfo/rd/rdBudgetEquipmentCost/types';
|
|
|
|
|
import { rdBudgetMaterialCostVO } from '@/api/oa/erp/budgetInfo/rd/rdBudgetMaterialCost/types';
|
|
|
|
|
import { rdBudgetTravelCostVO } from '@/api/oa/erp/budgetInfo/rd/rdBudgetTravelCost/types';
|
|
|
|
|
import { rdBudgetMeetingCostVO } from '@/api/oa/erp/budgetInfo/rd/rdBudgetMeetingCost/types';
|
|
|
|
|
import { rdBudgetExchangeCostVO } from '@/api/oa/erp/budgetInfo/rd/rdBudgetExchangeCost/types';
|
|
|
|
|
import { rdBudgetTechCostVO } from '@/api/oa/erp/budgetInfo/rd/rdBudgetTechCost/types';
|
|
|
|
|
import { rdBudgetLaborCostVO } from '@/api/oa/erp/budgetInfo/rd/rdBudgetLaborCost/types';
|
|
|
|
|
import { rdBudgetLiteratureCostVO } from '@/api/oa/erp/budgetInfo/rd/rdBudgetLiteratureCost/types';
|
|
|
|
|
import { rdBudgetTestingCostVO } from '@/api/oa/erp/budgetInfo/rd/rdBudgetTestingCost/types';
|
|
|
|
|
import { rdBudgetOtherCostVO } from '@/api/oa/erp/budgetInfo/rd/rdBudgetOtherCost/types';
|
|
|
|
|
// 路由参数
|
|
|
|
|
const routeParams = ref<Record<string, any>>({});
|
|
|
|
|
// 审批相关组件引用
|
|
|
|
|
@ -608,6 +929,12 @@ const approvalVerifyOpen = async () => {
|
|
|
|
|
const handleApprovalRecord = () => {
|
|
|
|
|
approvalRecordRef.value.init(searchForm.budgetId);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 提交回调
|
|
|
|
|
const submitCallback = async () => {
|
|
|
|
|
await proxy.$tab.closePage(proxy.$route);
|
|
|
|
|
router.go(-1);
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|