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