Merge pull request 'test : 测试ci/cd' (#1042) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/1042
This commit is contained in:
2025-06-13 06:23:55 +00:00

View File

@@ -2,12 +2,12 @@
<div v-loading="loading" style="padding: 0 30px">
<el-form :model="formData" ref="form" :rules="rules" style="margin-left: 5px;margin-top: 18px">
<el-row :gutter="30">
<!-- <el-col :span="6" style="margin-left: -15px">-->
<!-- <el-form-item label="分摊名称" prop="shareName" >-->
<!-- <el-input v-model="formData.shareName" placeholder="请输入分摊名称" clearable>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="6" style="margin-left: -15px">-->
<!-- <el-form-item label="分摊名称" prop="shareName" >-->
<!-- <el-input v-model="formData.shareName" placeholder="请输入分摊名称" clearable>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="6" style="margin-left: -10px">
<el-form-item label="分摊月份" prop="apportionmentMonth" label-width="80">
<el-date-picker
@@ -21,7 +21,7 @@
</el-form-item>
</el-col>
<el-col :span="3" >
<el-button color="#DED0B2" @click="handleAdd" style="font-size: 16px">添加一行</el-button>
<el-button color="#DED0B2" @click="handleAdd" style="font-size: 16px">添加一行</el-button>
</el-col>
<el-table v-if="showTable" :data="formData.tableData" style="width: 100%">
<el-table-column prop="projectId" label="项目名称" min-width="230">
@@ -386,7 +386,47 @@ const handleSubmit = (instance) => {
apportionmentMonth: formData.value.apportionmentMonth,
usrAllocations: formData.value.tableData,
}
console.log('params', params, formData.value.tableData)
console.log('params', params.usrAllocations, formData.value.tableData)
const resultMap = params.usrAllocations.reduce((acc, item) => {
if (!acc[item.researchPersonnelId]) {
acc[item.researchPersonnelId] = [];
}
acc[item.researchPersonnelId].push(item);
return acc;
}, {});
const exceedList = [];
Object.entries(resultMap).forEach(([id, items]) => {
const totalDuration = items.reduce((sum, item) => sum + (item.researchDuration || 0), 0);
const preciseTotalDuration = parseFloat(totalDuration.toFixed(2));
if (preciseTotalDuration > 21.75) {
// 收集超出的研发人员ID及总工时
exceedList.push({ id, totalDuration: preciseTotalDuration });
}
});
// 从 resultMap 中获取 researchPersonnel
const exceedResearchPersonnel = exceedList.map(item => {
const id = item.id;
const personnelItems = resultMap[id];
// 获取第一个对象中的 researchPersonnel假设所有对象的 researchPersonnel 相同)
const researchPersonnel = personnelItems[0].researchPersonnel;
return { id, researchPersonnel, totalDuration: item.totalDuration };
});
console.log('超过21.75的研发人员:', exceedResearchPersonnel);
if (exceedResearchPersonnel.length > 0) {
console.log('以下研发人员的总研发工时超过21.75天:', exceedResearchPersonnel);
ElNotification({
title: '提示',
message: `以下研发人员的总研发工时超过21.75天:${exceedResearchPersonnel.map(e => e.researchPersonnel).join('')}`,
type: 'warning'
});
}
// 调用函数
console.log('是大V',resultMap)
const {code, msg} = await addShare(params)
ElNotification({
title: '提示',
@@ -536,9 +576,11 @@ onMounted(() => {
}
}
}
:deep(.el-date-editor--month){
width: 100%!important;
:deep(.el-date-editor--month) {
width: 100% !important;
}
:deep(.el-input-number) {
width: 100%;