年审
This commit is contained in:
@ -26,7 +26,7 @@ import { TaskStatus, TaskStatusText, TaskStatusColor, TaskType, TaskTypeText } f
|
||||
import moment from 'moment';
|
||||
import styles from './supplierEvaluateResult.less';
|
||||
import { history } from 'umi';
|
||||
import { getEvaluateResultList } from '@/servers/api/supplierEvaluate';
|
||||
import { getEvaluateResultList, submitTaskForApproval } from '@/servers/api/supplierEvaluate';
|
||||
|
||||
const { Option } = Select;
|
||||
const { RangePicker } = DatePicker;
|
||||
@ -152,6 +152,31 @@ const SupplierEvaluateResult: React.FC = () => {
|
||||
fetchResultList(1, pagination.pageSize, {});
|
||||
};
|
||||
|
||||
// 处理提交审批
|
||||
const handleApprove = (record: API.EvaluateTaskRecord) => {
|
||||
Modal.confirm({
|
||||
title: '提交审批确认',
|
||||
content: `确定要提交"${record.evaluateTheme}"的评价任务进行审批吗?`,
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: async () => {
|
||||
try {
|
||||
const response = await submitTaskForApproval(record.id);
|
||||
if (response.success) {
|
||||
message.success('提交审批成功');
|
||||
// 刷新数据
|
||||
fetchResultList(pagination.current, pagination.pageSize, searchParams);
|
||||
} else {
|
||||
message.error(response.message || '提交审批失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('提交审批失败:', error);
|
||||
message.error('提交审批失败,请稍后重试');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 查看详情 - 修改为跳转到详情页
|
||||
const handleViewDetail = (record: API.EvaluateTaskRecord) => {
|
||||
history.push({
|
||||
@ -241,9 +266,16 @@ const SupplierEvaluateResult: React.FC = () => {
|
||||
width: 100,
|
||||
align: 'center' as const,
|
||||
render: (_: unknown, record: API.EvaluateTaskRecord) => (
|
||||
<Button type="link" onClick={() => handleViewDetail(record)}>
|
||||
查看
|
||||
</Button>
|
||||
<Space>
|
||||
<Button type="link" onClick={() => handleViewDetail(record)}>
|
||||
查看
|
||||
</Button>
|
||||
{record.approveStatus === null && record.status === '2' && (
|
||||
<Button type="link" onClick={() => handleApprove(record)}>
|
||||
提交审批
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
@ -26,24 +26,6 @@
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
:global {
|
||||
.filter-action-row {
|
||||
margin-bottom: 16px;
|
||||
|
||||
.filter-form {
|
||||
.filter-btns {
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content-area {
|
||||
background-color: #fff;
|
||||
padding: 24px;
|
||||
margin-bottom: 24px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add styles for the tables */
|
||||
:global(.ant-table) {
|
||||
|
@ -246,6 +246,9 @@ const SupplierEvaluateScoreDetail: React.FC = () => {
|
||||
<Spin spinning={loading}>
|
||||
{scoreDetail ? (
|
||||
<div className="content-area">
|
||||
<Title level={5} className={styles.pageTitle} style={{textAlign: 'center'}}>
|
||||
尊敬的评价人,请您谨慎评估,客观打分。您的评价结果将会成为供应商绩效评价的重要依据,并可能影响与供应商的后续合作。
|
||||
</Title>
|
||||
<Card title="基本信息" bordered={false}>
|
||||
<Descriptions column={2} bordered>
|
||||
<Descriptions.Item label="供应商名称">{getSupplierName()}</Descriptions.Item>
|
||||
|
@ -1,34 +1,16 @@
|
||||
.supplierTemplateManageContainer {
|
||||
}
|
||||
|
||||
.page-header {
|
||||
.pageHeader {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 24px;
|
||||
justify-content: space-between;
|
||||
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
}
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.inner-card {
|
||||
.innerCard {
|
||||
margin-bottom: 24px;
|
||||
|
||||
.ant-card-head {
|
||||
padding: 0 0 16px 0;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.ant-card-head-title {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.ant-card-body {
|
||||
padding: 24px 0;
|
||||
:global(.ant-card-head) {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,18 +22,17 @@
|
||||
}
|
||||
|
||||
.ant-card-head {
|
||||
padding: 0 0 16px 0;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.ant-card-head-title {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
.ant-card-head-title {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.formActions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 24px;
|
||||
text-align: center;
|
||||
padding: 16px 0;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ import {
|
||||
updateTemplate,
|
||||
addTemplate
|
||||
} from '@/servers/api/supplierEvaluate';
|
||||
import './supplierTemplateManage.less';
|
||||
import styles from './supplierTemplateManage.less';
|
||||
|
||||
const { Option } = Select;
|
||||
|
||||
@ -239,7 +239,7 @@ const SupplierTemplateManageAdd: React.FC = () => {
|
||||
return (
|
||||
<div className="common-container">
|
||||
<Card bordered={false}>
|
||||
<div className="page-header">
|
||||
<div className={styles.pageHeader}>
|
||||
<Title level={4} style={{ margin: 0 }}>
|
||||
{isEdit ? '编辑评价模板' : '新增评价模板'}
|
||||
</Title>
|
||||
@ -261,7 +261,7 @@ const SupplierTemplateManageAdd: React.FC = () => {
|
||||
wrapperCol={{ span: 17 }}
|
||||
>
|
||||
<Spin spinning={loading}>
|
||||
<Card title="基础信息" bordered={false} className="inner-card">
|
||||
<Card title="基础信息" bordered={false} className={styles.innerCard}>
|
||||
<Row gutter={24}>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
@ -299,7 +299,7 @@ const SupplierTemplateManageAdd: React.FC = () => {
|
||||
name="categoryId"
|
||||
rules={[{ required: true, message: '请选择品类' }]}
|
||||
>
|
||||
<CategorySelector value={categoryLimitation} />
|
||||
<CategorySelector value={categoryLimitation} multiple={false} />
|
||||
</Form.Item>
|
||||
) : null;
|
||||
}}
|
||||
@ -375,7 +375,7 @@ const SupplierTemplateManageAdd: React.FC = () => {
|
||||
|
||||
<Divider />
|
||||
|
||||
<Card title="指标信息" bordered={false} className="inner-card">
|
||||
<Card title="指标信息" bordered={false} className={styles.innerCard}>
|
||||
<EvaluateTemplateTable
|
||||
onChange={handleTemplateDataChange}
|
||||
value={templateData}
|
||||
@ -383,7 +383,7 @@ const SupplierTemplateManageAdd: React.FC = () => {
|
||||
</Card>
|
||||
</Spin>
|
||||
|
||||
<div className="form-actions">
|
||||
<div className={styles.formActions}>
|
||||
<Space>
|
||||
<Button onClick={handleBack}>取消</Button>
|
||||
<Button type="primary" htmlType="submit" loading={loading} icon={<SaveOutlined />}>
|
||||
|
@ -15,12 +15,13 @@ import {
|
||||
} from '@/dicts/supplierTemplateDict';
|
||||
import ScoreEvaluationTable from '@/components/ScoreEvaluationTable';
|
||||
import EvaluateTemplateTable from '@/components/EvaluateTemplateTable';
|
||||
import type { TemplateDimension } from '@/servers/dao/supplierEvaluateTask';
|
||||
|
||||
const { Title } = Typography;
|
||||
|
||||
const SupplierTemplateManageDetail: React.FC = () => {
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [templateDetail, setTemplateDetail] = useState<SupplierEvaluate.TemplateDetail | null>(
|
||||
const [templateDetail, setTemplateDetail] = useState<TemplateDimension | null>(
|
||||
null,
|
||||
);
|
||||
const [templateData, setTemplateData] = useState<any[]>([]);
|
||||
|
Reference in New Issue
Block a user