模板管理新增时,获取选择模板接口增加type字段;
评价结果审批状态通过字典获取
This commit is contained in:
@ -92,7 +92,7 @@ const SupplierTemplateManageAdd: React.FC<PageProps> = ({ breadcrumb, dispatch }
|
||||
// 获取所有模板列表
|
||||
const fetchTemplateList = async () => {
|
||||
try {
|
||||
const res = await getAllTemplates({ status: '1' });
|
||||
const res = await getAllTemplates({ status: '1', type: 'currentUnit' });
|
||||
if (res.success && res.data) {
|
||||
// 如果是修改,需要过滤掉自己
|
||||
if (location.state?.editData) {
|
||||
@ -234,10 +234,9 @@ const SupplierTemplateManageAdd: React.FC<PageProps> = ({ breadcrumb, dispatch }
|
||||
// 校验每个一级指标下的二级指标之和是否等于该一级指标分值
|
||||
for (const stItem of templateData) {
|
||||
const firstLevelScore = parseFloat(stItem.score || '0');
|
||||
const secondLevelTotal = stItem.indicatorNdList?.reduce(
|
||||
(acc, ndItem) => acc + parseFloat(ndItem.score || '0'),
|
||||
0,
|
||||
) || 0;
|
||||
const secondLevelTotal =
|
||||
stItem.indicatorNdList?.reduce((acc, ndItem) => acc + parseFloat(ndItem.score || '0'), 0) ||
|
||||
0;
|
||||
|
||||
if (secondLevelTotal !== firstLevelScore) {
|
||||
message.error(`二级指标分值之和必须等于其一级指标的分值`);
|
||||
@ -305,8 +304,8 @@ const SupplierTemplateManageAdd: React.FC<PageProps> = ({ breadcrumb, dispatch }
|
||||
message.error(intl.formatMessage({ id: 'supplierTemplateManage.message.addIndicator' }));
|
||||
return;
|
||||
}
|
||||
// 校验分数
|
||||
if (!validateScore()) {
|
||||
// 校验分数
|
||||
if (!validateScore()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user