评委会组建
This commit is contained in:
@ -57,7 +57,7 @@ export function getAssessRoomStatus(id: any) {
|
||||
* @param id
|
||||
*/
|
||||
export function saveAssessRoomInfo(data: any) {
|
||||
return request('/api/biz-service-ebtp-rsms/v1/bizassessroom', {
|
||||
return request('/api/biz-service-ebtp-process/v1/bizassessroom', {
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
|
@ -698,13 +698,34 @@ const JudgingPanel: React.FC<{}> = () => {
|
||||
valueType: 'select',
|
||||
valueEnum: professionalMap,
|
||||
width: '30%',
|
||||
formItemProps: {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择专业名称',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '人数',
|
||||
dataIndex: 'extractNumber',
|
||||
width: '30%',
|
||||
renderFormItem: (_, { record }) => {
|
||||
return <InputNumber min={0} addonAfter="人" />;
|
||||
return <InputNumber min={1} addonAfter="人" />;
|
||||
},
|
||||
formItemProps: {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入人数',
|
||||
},
|
||||
{
|
||||
type: 'number',
|
||||
min: 1,
|
||||
message: '人数必须大于0',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -755,19 +776,34 @@ const JudgingPanel: React.FC<{}> = () => {
|
||||
return acc;
|
||||
}, {} as Record<string, string>);
|
||||
const idToCodeMap = Object.entries(professionalMap || {}).reduce((acc, [id, option]) => {
|
||||
acc[id] = option.text;
|
||||
acc[id] = option.code;
|
||||
return acc;
|
||||
}, {} as Record<string, string>);
|
||||
// 遍历表格数据并附加专业名称
|
||||
const enhancedData = tableData.map(item => {
|
||||
const name = idToNameMap[item.specialityId] || ''; // 获取对应名称
|
||||
const code = idToCodeMap[item.specialityId] || ''; // 获取对应名称
|
||||
const name = idToNameMap[item.specialityId] || undefined; // 获取对应名称
|
||||
const code = idToCodeMap[item.specialityId] || undefined; // 获取对应名称
|
||||
return {
|
||||
...item,
|
||||
specialityName: name, // 添加专业名称字段
|
||||
specialityNo: code,
|
||||
};
|
||||
});
|
||||
// 添加校验函数
|
||||
const validateProfessionals = (data: DataSourceType[]) => {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const item = data[i];
|
||||
if (!item.specialityId || item.specialityId.trim() === '') {
|
||||
message.error(`第${i + 1}行专业名称不能为空`);
|
||||
return false;
|
||||
}
|
||||
if (!item.extractNumber || item.extractNumber <= 0) {
|
||||
message.error(`第${i + 1}行人数必须大于0`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const renderFooter = () => {//评审小组footer
|
||||
return (
|
||||
<>
|
||||
@ -808,6 +844,13 @@ const JudgingPanel: React.FC<{}> = () => {
|
||||
if (pass) {
|
||||
pass = checkData(finalVals)
|
||||
}
|
||||
// 在校验通过后再添加专业数据校验
|
||||
if (pass) {
|
||||
// 校验专业数据必填项
|
||||
if (!validateProfessionals(tableData)) {
|
||||
pass = false;
|
||||
}
|
||||
}
|
||||
const st = moment(formVals.startTime).format('yyyy-MM-DD HH:mm:ss');
|
||||
const et = moment(formVals.endTime).format('yyyy-MM-DD HH:mm:ss');
|
||||
if (st > et || st == et) {//校验时间
|
||||
@ -821,7 +864,6 @@ const JudgingPanel: React.FC<{}> = () => {
|
||||
formVals.startTime != undefined ? formVals.startTime = formVals.startTime.format('yyyy-MM-DD HH:mm:ss') : null;
|
||||
formVals.endTime != undefined ? formVals.endTime = formVals.endTime.format('yyyy-MM-DD HH:mm:ss') : null;
|
||||
const _cqData = cqData.length > 0 ? [{ ...cqData[0], extractNumber: count }] : [{ category: "2", extractMethod: "2", extractNumber: count, subCategory: "4" }]//抽取数量录入
|
||||
console.log("_cqData", _cqData);
|
||||
let params = { ...formVals, juryRoomList: juryRoomList, projectId: proId, juryCategoryVOList: _cqData, reserveStatus: 0, extractSpecialityList: enhancedData };
|
||||
if (updateData != undefined) {
|
||||
params['id'] = updateData.id;
|
||||
|
Reference in New Issue
Block a user