路由多语言维护, 优化layoutHeader组件样式,供应商评价-打分详情更改bug
This commit is contained in:
@ -19,6 +19,8 @@ import {
|
||||
getSupplierDimension,
|
||||
getTaskPage,
|
||||
} from '@/servers/api/supplierEvaluate';
|
||||
import { getDictList } from '@/servers/api/dicts';
|
||||
import type { DictItem } from '@/servers/api/dicts';
|
||||
|
||||
const { Title } = Typography;
|
||||
const { TabPane } = Tabs;
|
||||
@ -30,9 +32,9 @@ const SupplierEvaluateScore: React.FC = () => {
|
||||
// 新增状态
|
||||
const [activeTab, setActiveTab] = useState<string>('supplier');
|
||||
const [supplierTableData, setSupplierTableData] = useState<
|
||||
supplierEvaluateScore.SupplierDimensionRecord[]
|
||||
SupplierEvaluateScore.SupplierDimensionResponse[]
|
||||
>([]);
|
||||
const [taskTableData, setTaskTableData] = useState<supplierEvaluateScore.TaskPageRecord[]>([]);
|
||||
const [taskTableData, setTaskTableData] = useState<SupplierEvaluateScore.TaskPageResponse[]>([]);
|
||||
const [supplierTableLoading, setSupplierTableLoading] = useState<boolean>(false);
|
||||
const [taskTableLoading, setTaskTableLoading] = useState<boolean>(false);
|
||||
const [pagination, setPagination] = useState({
|
||||
@ -40,6 +42,7 @@ const SupplierEvaluateScore: React.FC = () => {
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
});
|
||||
const [evaluateStatus, setEvaluateStatus] = useState<DictItem[]>([]);
|
||||
/*
|
||||
name :关键字
|
||||
startTime:开始时间
|
||||
@ -51,7 +54,7 @@ status:状态
|
||||
const values = filterForm.getFieldsValue();
|
||||
|
||||
if (activeTab === 'supplier') {
|
||||
const params: supplierEvaluateScore.SupplierDimensionRequest = {
|
||||
const params: SupplierEvaluateScore.SupplierDimensionRequest = {
|
||||
basePageRequest: {
|
||||
pageNo: pagination.current,
|
||||
pageSize: pagination.pageSize,
|
||||
@ -68,7 +71,7 @@ status:状态
|
||||
|
||||
return params;
|
||||
} else {
|
||||
const params: supplierEvaluateScore.TaskPageRequest = {
|
||||
const params: SupplierEvaluateScore.TaskPageRequest = {
|
||||
basePageRequest: {
|
||||
pageNo: pagination.current,
|
||||
pageSize: pagination.pageSize,
|
||||
@ -153,6 +156,11 @@ status:状态
|
||||
// 初始化加载数据
|
||||
useEffect(() => {
|
||||
handleSearch();
|
||||
getDictList('project_status').then((res) => {
|
||||
if (res.success) {
|
||||
setEvaluateStatus(res.data);
|
||||
}
|
||||
});
|
||||
}, [activeTab]);
|
||||
|
||||
// 处理标签页切换
|
||||
@ -381,10 +389,11 @@ status:状态
|
||||
|
||||
<Form.Item name="status" label="评价状态">
|
||||
<Select placeholder="请选择" style={{ width: 150 }} allowClear>
|
||||
<Option value="1">待评分</Option>
|
||||
<Option value="2">已评分</Option>
|
||||
<Option value="3">进行中</Option>
|
||||
<Option value="4">已完成</Option>
|
||||
{evaluateStatus.map((item) => (
|
||||
<Option key={item.code} value={item.code}>
|
||||
{item.dicName}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
|
@ -9,12 +9,11 @@ import {
|
||||
message,
|
||||
Typography,
|
||||
Empty,
|
||||
Space,
|
||||
Form,
|
||||
Modal,
|
||||
} from 'antd';
|
||||
import { ArrowLeftOutlined, SaveOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||
import { getSupplierScoreDetail, saveEvaluateScore } from '@/servers/api/supplierEvaluate';
|
||||
import { getIndicator, saveEvaluateScore } from '@/servers/api/supplierEvaluate';
|
||||
import ScoreEvaluationTable from '@/components/ScoreEvaluationTable';
|
||||
import styles from './supplierEvaluateScore.less';
|
||||
|
||||
@ -22,18 +21,14 @@ const { Title } = Typography;
|
||||
const { confirm } = Modal;
|
||||
|
||||
const SupplierEvaluateScoreDetail: React.FC = () => {
|
||||
const [form] = Form.useForm();
|
||||
const location = useLocation<{
|
||||
record: supplierEvaluateScore.SupplierDimensionRecord | supplierEvaluateScore.TaskPageRecord;
|
||||
record: SupplierEvaluateScore.SupplierDimensionData;
|
||||
mode?: 'view' | 'score'; // 查看模式或打分模式
|
||||
recordType: 'supplier' | 'task'; // 记录类型:供应商或任务
|
||||
}>();
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [submitting, setSubmitting] = useState<boolean>(false);
|
||||
const [saving, setSaving] = useState<boolean>(false);
|
||||
const [scoreDetail, setScoreDetail] = useState<supplierEvaluateScore.ScoreDetailData | null>(
|
||||
null,
|
||||
);
|
||||
const [scoreDetail, setScoreDetail] = useState<SupplierEvaluateResult.EvaluateScoreDetailData>();
|
||||
const [scoreData, setScoreData] = useState<any[]>([]);
|
||||
const [record, setRecord] = useState<any>(null);
|
||||
const [mode, setMode] = useState<'view' | 'score'>('view'); // 默认为查看模式
|
||||
@ -63,7 +58,7 @@ const SupplierEvaluateScoreDetail: React.FC = () => {
|
||||
}, [location]);
|
||||
|
||||
// 将API数据转换为ScoreEvaluationTable组件所需的格式
|
||||
const formatDataForScoreTable = (data: supplierEvaluateScore.ScoreDetailData) => {
|
||||
const formatDataForScoreTable = (data: SupplierEvaluateResult.EvaluateScoreDetailData) => {
|
||||
if (!data?.taskIndicatorVo) return [];
|
||||
|
||||
return data.taskIndicatorVo.map((indicator) => {
|
||||
@ -103,7 +98,7 @@ const SupplierEvaluateScoreDetail: React.FC = () => {
|
||||
|
||||
setLoading(true);
|
||||
try {
|
||||
const response = await getSupplierScoreDetail(record.id);
|
||||
const response = await getIndicator(record.id);
|
||||
|
||||
if (response.success && response.data) {
|
||||
setScoreDetail(response.data);
|
||||
@ -167,7 +162,7 @@ const SupplierEvaluateScoreDetail: React.FC = () => {
|
||||
setSubmitting(true);
|
||||
try {
|
||||
// 构建提交数据
|
||||
const submitData: supplierEvaluateScore.ScoreSaveRequest = {
|
||||
const submitData: SupplierEvaluateScore.ScoreSaveRequest = {
|
||||
id: record.id,
|
||||
scoreVoList: scoreData.flatMap((item) => {
|
||||
return item.indicatorNdList.map((subItem: any) => ({
|
||||
|
Reference in New Issue
Block a user