供应商年审审查
This commit is contained in:
@ -633,12 +633,12 @@ const EvaluateTemplateTable: React.FC<EvaluateTemplateTableProps> = ({
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
>
|
||||
<Button
|
||||
type="text"
|
||||
danger
|
||||
icon={<DeleteOutlined />}
|
||||
title="删除一级指标"
|
||||
/>
|
||||
<Button
|
||||
type="text"
|
||||
danger
|
||||
icon={<DeleteOutlined />}
|
||||
title="删除一级指标"
|
||||
/>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
));
|
||||
@ -754,12 +754,12 @@ const EvaluateTemplateTable: React.FC<EvaluateTemplateTableProps> = ({
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
>
|
||||
<Button
|
||||
type="text"
|
||||
danger
|
||||
icon={<MinusCircleOutlined />}
|
||||
title="删除细分指标"
|
||||
/>
|
||||
<Button
|
||||
type="text"
|
||||
danger
|
||||
icon={<MinusCircleOutlined />}
|
||||
title="删除细分指标"
|
||||
/>
|
||||
</Popconfirm>
|
||||
)}
|
||||
</div>
|
||||
|
@ -20,7 +20,6 @@ import {
|
||||
import { ArrowLeftOutlined, SaveOutlined } from '@ant-design/icons';
|
||||
import { getAnnualReviewDetail, submitAnnualReviewScore } from '@/servers/api/supplierAnnual';
|
||||
import {
|
||||
AnnualReviewStatus,
|
||||
AnnualReviewStatusText,
|
||||
AnnualReviewStatusColor,
|
||||
ExamineResult,
|
||||
@ -31,6 +30,7 @@ import styles from './supplierAnnualReview.less';
|
||||
const { Title } = Typography;
|
||||
const { TextArea } = Input;
|
||||
|
||||
// 评分项接口定义
|
||||
interface ScoreFormItem {
|
||||
id: string;
|
||||
name: string;
|
||||
@ -57,42 +57,21 @@ const SupplierAnnualReviewScore: React.FC = () => {
|
||||
if (res.success && res.data) {
|
||||
setReviewDetail(res.data);
|
||||
|
||||
// 这里应该根据实际接口返回的数据设置打分项
|
||||
// 由于没有具体的数据结构,这里模拟一些打分项
|
||||
const mockScoreItems: ScoreFormItem[] = [
|
||||
{
|
||||
id: '1',
|
||||
name: '质量评价',
|
||||
description: '供应商产品质量及质量管理体系评价',
|
||||
examineResult: '',
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '交付评价',
|
||||
description: '供应商交付及时性、准确性评价',
|
||||
examineResult: '',
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: '服务评价',
|
||||
description: '供应商服务响应速度及服务质量评价',
|
||||
examineResult: '',
|
||||
remark: '',
|
||||
},
|
||||
];
|
||||
// 使用接口返回的评分项数据
|
||||
if (res.data.scoreItems && res.data.scoreItems.length > 0) {
|
||||
setScoreItems(res.data.scoreItems);
|
||||
|
||||
setScoreItems(mockScoreItems);
|
||||
// 初始化表单
|
||||
const initialValues: any = {};
|
||||
res.data.scoreItems.forEach((item: ScoreFormItem) => {
|
||||
initialValues[`examineResult_${item.id}`] = item.examineResult || '';
|
||||
initialValues[`remark_${item.id}`] = item.remark || '';
|
||||
});
|
||||
|
||||
// 初始化表单
|
||||
const initialValues: any = {};
|
||||
mockScoreItems.forEach((item) => {
|
||||
initialValues[`examineResult_${item.id}`] = '';
|
||||
initialValues[`remark_${item.id}`] = '';
|
||||
});
|
||||
|
||||
form.setFieldsValue(initialValues);
|
||||
form.setFieldsValue(initialValues);
|
||||
} else {
|
||||
message.warning('未找到评分项数据');
|
||||
}
|
||||
} else {
|
||||
message.error(res.message || '获取审查详情失败');
|
||||
}
|
||||
@ -129,6 +108,8 @@ const SupplierAnnualReviewScore: React.FC = () => {
|
||||
const formValues = form.getFieldsValue();
|
||||
const scoreVoList = scoreItems.map((item) => ({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
description: item.description,
|
||||
examineResult: formValues[`examineResult_${item.id}`],
|
||||
remark: formValues[`remark_${item.id}`] || '',
|
||||
}));
|
||||
@ -222,63 +203,67 @@ const SupplierAnnualReviewScore: React.FC = () => {
|
||||
|
||||
<Card title="审查结果" bordered={false} className={styles['detail-card']}>
|
||||
<Form form={form} layout="vertical" className={styles['score-form']}>
|
||||
<Table
|
||||
rowKey="id"
|
||||
dataSource={scoreItems}
|
||||
pagination={false}
|
||||
bordered
|
||||
className={styles['score-table']}
|
||||
columns={[
|
||||
{
|
||||
title: '评分项',
|
||||
dataIndex: 'name',
|
||||
width: '15%',
|
||||
},
|
||||
{
|
||||
title: '评分项说明',
|
||||
dataIndex: 'description',
|
||||
width: '25%',
|
||||
},
|
||||
{
|
||||
title: '评审结果',
|
||||
dataIndex: 'examineResult',
|
||||
width: '25%',
|
||||
render: (_, record) => (
|
||||
<Form.Item
|
||||
name={`examineResult_${record.id}`}
|
||||
rules={[{ required: true, message: '请选择评审结果' }]}
|
||||
style={{ marginBottom: 0 }}
|
||||
>
|
||||
<Radio.Group>
|
||||
<Radio value={ExamineResult.QUALIFIED}>
|
||||
{ExamineResultText[ExamineResult.QUALIFIED]}
|
||||
</Radio>
|
||||
<Radio value={ExamineResult.UNQUALIFIED}>
|
||||
{ExamineResultText[ExamineResult.UNQUALIFIED]}
|
||||
</Radio>
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '评审说明',
|
||||
dataIndex: 'remark',
|
||||
width: '35%',
|
||||
render: (_, record) => (
|
||||
<Form.Item
|
||||
name={`remark_${record.id}`}
|
||||
style={{ marginBottom: 0 }}
|
||||
>
|
||||
<TextArea
|
||||
rows={2}
|
||||
placeholder="请输入评审说明"
|
||||
maxLength={200}
|
||||
/>
|
||||
</Form.Item>
|
||||
),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
{scoreItems.length > 0 ? (
|
||||
<Table
|
||||
rowKey="id"
|
||||
dataSource={scoreItems}
|
||||
pagination={false}
|
||||
bordered
|
||||
className={styles['score-table']}
|
||||
columns={[
|
||||
{
|
||||
title: '评分项',
|
||||
dataIndex: 'name',
|
||||
width: '15%',
|
||||
},
|
||||
{
|
||||
title: '评分项说明',
|
||||
dataIndex: 'description',
|
||||
width: '25%',
|
||||
},
|
||||
{
|
||||
title: '评审结果',
|
||||
dataIndex: 'examineResult',
|
||||
width: '25%',
|
||||
render: (_, record) => (
|
||||
<Form.Item
|
||||
name={`examineResult_${record.id}`}
|
||||
rules={[{ required: true, message: '请选择评审结果' }]}
|
||||
style={{ marginBottom: 0 }}
|
||||
>
|
||||
<Radio.Group>
|
||||
<Radio value={ExamineResult.QUALIFIED}>
|
||||
{ExamineResultText[ExamineResult.QUALIFIED]}
|
||||
</Radio>
|
||||
<Radio value={ExamineResult.UNQUALIFIED}>
|
||||
{ExamineResultText[ExamineResult.UNQUALIFIED]}
|
||||
</Radio>
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '评审说明',
|
||||
dataIndex: 'remark',
|
||||
width: '35%',
|
||||
render: (_, record) => (
|
||||
<Form.Item
|
||||
name={`remark_${record.id}`}
|
||||
style={{ marginBottom: 0 }}
|
||||
>
|
||||
<TextArea
|
||||
rows={2}
|
||||
placeholder="请输入评审说明"
|
||||
maxLength={200}
|
||||
/>
|
||||
</Form.Item>
|
||||
),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
) : (
|
||||
<Empty description="暂无评分项数据" />
|
||||
)}
|
||||
|
||||
<div className={styles['score-actions']}>
|
||||
<Button
|
||||
|
@ -52,28 +52,8 @@ const SupplierAnnualReviewDetail: React.FC = () => {
|
||||
|
||||
// 这里应该根据实际接口返回的数据设置评分结果
|
||||
// 由于没有具体的数据结构,这里模拟一些评分结果
|
||||
const mockScoreResults: ScoreResult[] = [
|
||||
{
|
||||
id: '1',
|
||||
itemName: '产品质量',
|
||||
examineResult: ExamineResult.QUALIFIED,
|
||||
remark: '产品质量符合要求,无重大质量问题',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
itemName: '交货及时性',
|
||||
examineResult: ExamineResult.QUALIFIED,
|
||||
remark: '交货及时,满足生产需求',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
itemName: '服务态度',
|
||||
examineResult: ExamineResult.UNQUALIFIED,
|
||||
remark: '客户反馈服务态度有待提高,响应不及时',
|
||||
},
|
||||
];
|
||||
|
||||
setScoreResults(mockScoreResults);
|
||||
setScoreResults(res.data.taskIndicatorVo);
|
||||
} else {
|
||||
message.error(res.message || '获取审查详情失败');
|
||||
}
|
||||
@ -136,6 +116,13 @@ const SupplierAnnualReviewDetail: React.FC = () => {
|
||||
width: 120,
|
||||
render: (result: string) => getResultTag(result),
|
||||
},
|
||||
{
|
||||
title: '星号项',
|
||||
dataIndex: 'isStar',
|
||||
key: 'isStar',
|
||||
width: 120,
|
||||
render: (result: string) => result === '1' ? '是' : '否',
|
||||
},
|
||||
{
|
||||
title: '评审说明',
|
||||
dataIndex: 'remark',
|
||||
|
@ -57,3 +57,4 @@
|
||||
.status-tag {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
@ -68,8 +68,10 @@ declare namespace supplierAnnualReview {
|
||||
|
||||
// 打分项
|
||||
interface ScoreItem {
|
||||
examineResult: string;
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
examineResult: string;
|
||||
remark: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
Reference in New Issue
Block a user