菜单与 审核按钮,登录新用户修改密码
This commit is contained in:
@ -74,7 +74,9 @@ interface coscoSupplierSurveyAttachments {
|
||||
//变更要求
|
||||
interface changeComparisonDataProps {
|
||||
name?: string;
|
||||
nameEn?: string;
|
||||
range?: string;
|
||||
supplierType?: string;
|
||||
}
|
||||
const BaseInfoFormModal: React.FC<Props> = ({
|
||||
visible,
|
||||
@ -114,7 +116,9 @@ const BaseInfoFormModal: React.FC<Props> = ({
|
||||
});
|
||||
setChangeComparisonData({
|
||||
name: initialValues.name,
|
||||
range: initialValues.range
|
||||
range: initialValues.range,
|
||||
supplierType: initialValues.supplierType,
|
||||
nameEn: initialValues.nameEn,
|
||||
})
|
||||
setViewData({
|
||||
...changeData,
|
||||
@ -261,11 +265,15 @@ const BaseInfoFormModal: React.FC<Props> = ({
|
||||
)}
|
||||
<Form.Item shouldUpdate>
|
||||
{() => {
|
||||
console.log(changeComparisonData,';changeComparisonData');
|
||||
|
||||
// 每次Form数据变化都会重新render
|
||||
const currentName = form.getFieldValue(['coscoSupplierBase', 'name']);
|
||||
const currentNameEn = form.getFieldValue(['coscoSupplierBase', 'nameEn']);
|
||||
const currentRange = form.getFieldValue(['coscoSupplierBase', 'range']);
|
||||
const shouldShowPanel =
|
||||
(changeComparisonData?.name !== undefined && currentName !== changeComparisonData.name) ||
|
||||
(changeComparisonData?.name !== undefined && (currentName !== changeComparisonData.name && changeComparisonData.supplierType === 'dvs' )) ||
|
||||
(changeComparisonData?.name !== undefined && (currentNameEn !== changeComparisonData.nameEn && changeComparisonData.supplierType === 'ovs' )) ||
|
||||
(changeComparisonData?.range !== undefined && currentRange !== changeComparisonData.range);
|
||||
|
||||
if (!shouldShowPanel) return null;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Descriptions, Button } from 'antd';
|
||||
import { coscoSupplierBase } from '../services';
|
||||
import { Descriptions, Button, message } from 'antd';
|
||||
import { coscoSupplierBase, getSupplierIdCount } from '../services';
|
||||
import { useIntl } from 'umi';
|
||||
import BaseInfoFormModal from './BaseInfoFormModal'
|
||||
|
||||
@ -68,7 +68,16 @@ const BaseInfoTab: React.FC<BaseInfoTabProps> = (props) => {
|
||||
//增改查
|
||||
const [formVisible, setFormVisible] = useState(false);
|
||||
const handleAdd = () => {
|
||||
setFormVisible(true);
|
||||
|
||||
getSupplierIdCount(record).then((res) => {
|
||||
if(res === 0) {
|
||||
setFormVisible(true);
|
||||
} else {
|
||||
message.warning('已存在变更信息审核')
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
};
|
||||
const handleFormSubmit = () => {
|
||||
setFormVisible(false);
|
||||
|
@ -283,6 +283,9 @@ export const categoryTree = () => request.get('/cosco/category/categoryTree');
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 验证是否有变更
|
||||
*/
|
||||
export const getSupplierIdCount = (id: string) => request.get(`/coscoSupplierChangeApply/getSupplierIdCount/${id}`);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user