|
|
|
|
@ -26,6 +26,21 @@
|
|
|
|
|
<el-input v-model="searchForm.projectName" placeholder="请选择项目后自动填充" disabled />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<el-form-item label="版本号">
|
|
|
|
|
<el-input v-model="searchForm.budgetVersion" disabled>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<el-form-item label="申请说明">
|
|
|
|
|
<el-input v-model="searchForm.remark" type="textarea" placeholder="请输入申请说明" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-col :span="12" class="text-right">-->
|
|
|
|
|
<!-- <el-button type="primary" @click="exportBudget" size="default">-->
|
|
|
|
|
<!-- <el-icon><Download /></el-icon>-->
|
|
|
|
|
@ -307,7 +322,9 @@ const searchForm = reactive({
|
|
|
|
|
projectName: '',
|
|
|
|
|
projectCode: '',
|
|
|
|
|
projectCategory: '',
|
|
|
|
|
flowStatus: ''
|
|
|
|
|
flowStatus: '',
|
|
|
|
|
budgetVersion: 1,
|
|
|
|
|
remark: ''
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 监听项目类别变化,更新默认标签页
|
|
|
|
|
@ -645,6 +662,8 @@ const handleSave = async (status: string, mode: boolean) => {
|
|
|
|
|
ElMessage.warning('不支持的预算类型');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
budgetForm.budgetVersion = searchForm.budgetVersion;
|
|
|
|
|
budgetForm.remark = searchForm.remark;
|
|
|
|
|
console.log('----');
|
|
|
|
|
console.log(budgetForm);
|
|
|
|
|
|
|
|
|
|
@ -776,7 +795,21 @@ const processRdCostData = (budgetForm: budgetInfoForm) => {
|
|
|
|
|
|
|
|
|
|
// 材料成本
|
|
|
|
|
if (assignIfChanged([], rdMaterialCostRef.value?.allMaterialData, oriRdBudgetMaterialCostList.value).length) {
|
|
|
|
|
budgetForm.erpRdBudgetMaterialCostList = rdMaterialCostRef.value?.allMaterialData || [];
|
|
|
|
|
budgetForm.erpRdBudgetMaterialCostList = (rdMaterialCostRef.value?.allMaterialData || []).map(item => {
|
|
|
|
|
const newItem = { ...item };
|
|
|
|
|
|
|
|
|
|
// 如果 是其他材料费,需要将万元转为元
|
|
|
|
|
if (newItem.materialType === 2 || newItem.materialType === '2') {
|
|
|
|
|
if (newItem.price !== null && newItem.price !== undefined) {
|
|
|
|
|
const priceValue = parseFloat(newItem.price);
|
|
|
|
|
if (!isNaN(priceValue)) {
|
|
|
|
|
// 乘以10000
|
|
|
|
|
newItem.price = priceValue * 10000;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return newItem;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 差旅、会议、交流成本
|
|
|
|
|
@ -937,6 +970,8 @@ async function loadBudgetData() {
|
|
|
|
|
routeParams.value = route.query;
|
|
|
|
|
budgetId.value = routeParams.value.id as string | number;
|
|
|
|
|
|
|
|
|
|
await getUsers();
|
|
|
|
|
|
|
|
|
|
if (!budgetId.value || !['update', 'view', 'approval'].includes(routeParams.value.type as string)) {
|
|
|
|
|
handleAddMode();
|
|
|
|
|
return;
|
|
|
|
|
@ -958,8 +993,8 @@ async function handleLoadMode() {
|
|
|
|
|
Object.assign(searchForm, res.data);
|
|
|
|
|
if (routeParams.value.changeFlag === '1') {
|
|
|
|
|
searchForm.flowStatus = 'draft';
|
|
|
|
|
searchForm.budgetVersion = (searchForm.budgetVersion || 0) + 1;
|
|
|
|
|
}
|
|
|
|
|
await getUsers();
|
|
|
|
|
|
|
|
|
|
if (isRdOrPreProductionCategory()) {
|
|
|
|
|
await handleRdOrPreProductionData(res.data);
|
|
|
|
|
@ -989,6 +1024,17 @@ async function handleRdOrPreProductionData(data: any) {
|
|
|
|
|
|
|
|
|
|
// 分组数据
|
|
|
|
|
const groupedMaterialData = groupByField(data.erpRdBudgetMaterialCostList, 'materialType');
|
|
|
|
|
groupedMaterialData[MATERIAL_TYPE.OTHER] = groupedMaterialData[MATERIAL_TYPE.OTHER].map(item => {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
unitPrice: undefined,
|
|
|
|
|
amount: undefined,
|
|
|
|
|
unitId: undefined,
|
|
|
|
|
// 转换为万元显示
|
|
|
|
|
price: item.price ? (item.price / 10000).toFixed(2) : ''
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const groupedTechData = groupByField(data.erpRdBudgetTechCostList, 'techType');
|
|
|
|
|
const groupedLaborData = groupByField(data.erpRdBudgetLaborCostList, 'laborType');
|
|
|
|
|
const groupedLiteratureData = groupByField(data.erpRdBudgetLiteratureCostList, 'literatureType');
|
|
|
|
|
|