|
|
@@ -118,8 +118,8 @@ const ContractRenews: React.FC = () => {
|
|
|
params.contractId = values.contractId;
|
|
|
}
|
|
|
|
|
|
- if (values.status !== undefined && values.status !== null) {
|
|
|
- params.status = values.status;
|
|
|
+ if (values.state !== undefined && values.state !== null) {
|
|
|
+ params.state = values.state;
|
|
|
}
|
|
|
|
|
|
if (values.dateRange && values.dateRange.length > 0) {
|
|
|
@@ -153,12 +153,12 @@ const ContractRenews: React.FC = () => {
|
|
|
// 编辑模式 - 填充表单
|
|
|
form.setFieldsValue({
|
|
|
contractId: record.contractId,
|
|
|
- renewNo: record.renewNo,
|
|
|
- renewStartDate: record.renewStartDate ? dayjs(record.renewStartDate) : null,
|
|
|
- renewEndDate: record.renewEndDate ? dayjs(record.renewEndDate) : null,
|
|
|
- renewAmount: record.renewAmount,
|
|
|
- status: record.status,
|
|
|
- remark: record.remark,
|
|
|
+
|
|
|
+
|
|
|
+ endDate: record.endDate ? dayjs(record.endDate) : null,
|
|
|
+ amount: record.amount,
|
|
|
+ state: record.state,
|
|
|
+ content: record.content,
|
|
|
});
|
|
|
} else {
|
|
|
// 新增模式 - 重置表单
|
|
|
@@ -180,8 +180,8 @@ const ContractRenews: React.FC = () => {
|
|
|
// 格式化日期
|
|
|
const formattedValues: CreateContractRenewRequest | UpdateContractRenewRequest = {
|
|
|
...values,
|
|
|
- renewStartDate: values.renewStartDate ? values.renewStartDate.format('YYYY-MM-DD') : undefined,
|
|
|
- renewEndDate: values.renewEndDate ? values.renewEndDate.format('YYYY-MM-DD') : undefined,
|
|
|
+
|
|
|
+ endDate: values.endDate ? values.endDate.format('YYYY-MM-DD') : undefined,
|
|
|
};
|
|
|
|
|
|
if (currentRecord) {
|
|
|
@@ -244,8 +244,8 @@ const ContractRenews: React.FC = () => {
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '续签编号',
|
|
|
- dataIndex: 'renewNo',
|
|
|
- key: 'renewNo',
|
|
|
+ dataIndex: '',
|
|
|
+ key: '',
|
|
|
width: 150,
|
|
|
sorter: true,
|
|
|
},
|
|
|
@@ -263,35 +263,35 @@ const ContractRenews: React.FC = () => {
|
|
|
},
|
|
|
{
|
|
|
title: '续签开始日期',
|
|
|
- dataIndex: 'renewStartDate',
|
|
|
- key: 'renewStartDate',
|
|
|
+ dataIndex: '',
|
|
|
+ key: '',
|
|
|
width: 120,
|
|
|
render: (date: string) => date ? dayjs(date).format('YYYY-MM-DD') : '-',
|
|
|
},
|
|
|
{
|
|
|
title: '续签结束日期',
|
|
|
- dataIndex: 'renewEndDate',
|
|
|
- key: 'renewEndDate',
|
|
|
+ dataIndex: 'endDate',
|
|
|
+ key: 'endDate',
|
|
|
width: 120,
|
|
|
render: (date: string) => date ? dayjs(date).format('YYYY-MM-DD') : '-',
|
|
|
},
|
|
|
{
|
|
|
title: '续签金额',
|
|
|
- dataIndex: 'renewAmount',
|
|
|
- key: 'renewAmount',
|
|
|
+ dataIndex: 'amount',
|
|
|
+ key: 'amount',
|
|
|
width: 100,
|
|
|
render: (amount: number) => `¥${Number(amount).toFixed(2)}`,
|
|
|
},
|
|
|
{
|
|
|
title: '状态',
|
|
|
- dataIndex: 'status',
|
|
|
- key: 'status',
|
|
|
+ dataIndex: 'state',
|
|
|
+ key: 'state',
|
|
|
width: 100,
|
|
|
- render: (status: number) => {
|
|
|
- const statusInfo = RenewStatusEnum[status];
|
|
|
- return statusInfo ? (
|
|
|
- <Tag color={statusInfo.color} key={status}>
|
|
|
- {statusInfo.label}
|
|
|
+ render: (state: number) => {
|
|
|
+ const stateInfo = RenewStatusEnum[state];
|
|
|
+ return stateInfo ? (
|
|
|
+ <Tag color={stateInfo.color} key={state}>
|
|
|
+ {stateInfo.label}
|
|
|
</Tag>
|
|
|
) : (
|
|
|
<Tag color="default">未知</Tag>
|
|
|
@@ -348,7 +348,7 @@ const ContractRenews: React.FC = () => {
|
|
|
<ContractSelect placeholder="选择合同" style={{ width: 200 }} />
|
|
|
</Form.Item>
|
|
|
|
|
|
- <Form.Item name="status" label="状态">
|
|
|
+ <Form.Item name="state" label="状态">
|
|
|
<Select placeholder="选择状态" style={{ width: 150 }}>
|
|
|
{Object.entries(RenewStatusEnum).map(([value, { label, color }]) => (
|
|
|
<Option key={value} value={Number(value)}>
|
|
|
@@ -423,7 +423,7 @@ const ContractRenews: React.FC = () => {
|
|
|
form={form}
|
|
|
layout="vertical"
|
|
|
onFinish={handleSubmit}
|
|
|
- initialValues={{ status: 0 }}
|
|
|
+ initialValues={{ state: 0 }}
|
|
|
>
|
|
|
<Form.Item
|
|
|
name="contractId"
|
|
|
@@ -434,7 +434,7 @@ const ContractRenews: React.FC = () => {
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item
|
|
|
- name="renewNo"
|
|
|
+ name=""
|
|
|
label="续签编号"
|
|
|
rules={[{ required: true, message: '请输入续签编号' }]}
|
|
|
>
|
|
|
@@ -443,7 +443,7 @@ const ContractRenews: React.FC = () => {
|
|
|
|
|
|
<div className="grid grid-cols-2 gap-4">
|
|
|
<Form.Item
|
|
|
- name="renewStartDate"
|
|
|
+ name=""
|
|
|
label="续签开始日期"
|
|
|
rules={[{ required: true, message: '请选择续签开始日期' }]}
|
|
|
>
|
|
|
@@ -455,7 +455,7 @@ const ContractRenews: React.FC = () => {
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item
|
|
|
- name="renewEndDate"
|
|
|
+ name="endDate"
|
|
|
label="续签结束日期"
|
|
|
rules={[{ required: true, message: '请选择续签结束日期' }]}
|
|
|
>
|
|
|
@@ -468,7 +468,7 @@ const ContractRenews: React.FC = () => {
|
|
|
</div>
|
|
|
|
|
|
<Form.Item
|
|
|
- name="renewAmount"
|
|
|
+ name="amount"
|
|
|
label="续签金额"
|
|
|
rules={[
|
|
|
{ required: true, message: '请输入续签金额' },
|
|
|
@@ -484,13 +484,13 @@ const ContractRenews: React.FC = () => {
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item
|
|
|
- name="status"
|
|
|
+ name="state"
|
|
|
label="状态"
|
|
|
rules={[{ required: true, message: '请选择状态' }]}
|
|
|
>
|
|
|
<Select placeholder="选择状态" style={{ width: '100%' }}>
|
|
|
{Object.entries(RenewStatusEnum).map(([value, { label, color }]) => (
|
|
|
- <Option key={value} value={Number(value)}>
|
|
|
+ <Option key={value} value={value}>
|
|
|
<Tag color={color} style={{ marginRight: 4 }} />
|
|
|
{label}
|
|
|
</Option>
|
|
|
@@ -499,7 +499,7 @@ const ContractRenews: React.FC = () => {
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item
|
|
|
- name="remark"
|
|
|
+ name="content"
|
|
|
label="备注"
|
|
|
>
|
|
|
<Input.TextArea rows={4} placeholder="请输入备注信息" />
|