|
|
|
@ -19,6 +19,7 @@ interface Enterprise { |
|
|
|
|
uploadTime: string; |
|
|
|
|
description: string; |
|
|
|
|
fileUid: string; |
|
|
|
|
fileName: string; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
interface FormData { |
|
|
|
@ -67,10 +68,12 @@ const CustomerRetention: React.FC<CustomerRetentionProps> = ({ customer }) => { |
|
|
|
|
getListApi({}, query.page, query.num) |
|
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
const columns = [ |
|
|
|
|
const columns: any = [ |
|
|
|
|
{ |
|
|
|
|
title: '序号', |
|
|
|
|
align: 'center', |
|
|
|
|
dataIndex: 'key', |
|
|
|
|
width: 50, |
|
|
|
|
render: (text: string, record: any, index: number) => index + 1 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
@ -88,9 +91,11 @@ const CustomerRetention: React.FC<CustomerRetentionProps> = ({ customer }) => { |
|
|
|
|
dataIndex: 'file', |
|
|
|
|
key: 'file', |
|
|
|
|
sorter: true, |
|
|
|
|
render: (text: any, record: { fileUid: string; }) => ( |
|
|
|
|
render: (text: any, record: { |
|
|
|
|
fileName: any; |
|
|
|
|
fileUid: string; }) => ( |
|
|
|
|
<Space size="middle"> |
|
|
|
|
<a onClick={() => showModal2(record.fileUid)}>服务声明扫描图片文件链接</a> |
|
|
|
|
<a onClick={() => showModal2(record.fileUid)}>{record.fileName}</a> |
|
|
|
|
</Space> |
|
|
|
|
), |
|
|
|
|
}, |
|
|
|
@ -103,26 +108,27 @@ const CustomerRetention: React.FC<CustomerRetentionProps> = ({ customer }) => { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleOk = () => { |
|
|
|
|
setLoading(true); |
|
|
|
|
// setLoading(true);
|
|
|
|
|
if (fileList.length == 0) { |
|
|
|
|
openNotification('top', '请上传文件', 'info'); |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
var formData = { |
|
|
|
|
customerId: customer.customerId, |
|
|
|
|
fileId: fileRes?.fileId, |
|
|
|
|
fileName: fileRes?.fileName, |
|
|
|
|
description: form.getFieldValue('description') |
|
|
|
|
} |
|
|
|
|
saveCustomerRet(formData).then(res => { |
|
|
|
|
openNotification('top', '保存成功', 'success'); |
|
|
|
|
const query = {page: 1, num: 20}; |
|
|
|
|
setQuery(query); |
|
|
|
|
getListApi({}, query.page, query.num) |
|
|
|
|
setFileList([]); // 清空文件列表
|
|
|
|
|
form.resetFields(['description']); // 重置description字段
|
|
|
|
|
setIsModalOpen(false); |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} |
|
|
|
|
var formData = { |
|
|
|
|
customerId: customer.customerId, |
|
|
|
|
fileId: fileRes?.fileId, |
|
|
|
|
fileName: fileRes?.fileName, |
|
|
|
|
description: form.getFieldValue('description') |
|
|
|
|
} |
|
|
|
|
saveCustomerRet(formData).then(res => { |
|
|
|
|
openNotification('top', '保存成功', 'success'); |
|
|
|
|
const query = {page: 1, num: 20}; |
|
|
|
|
setQuery(query); |
|
|
|
|
getListApi({}, query.page, query.num) |
|
|
|
|
setFileList([]); // 清空文件列表
|
|
|
|
|
form.resetFields(['description']); // 重置description字段
|
|
|
|
|
setIsModalOpen(false); |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handleCancel = () => { |
|
|
|
@ -246,9 +252,9 @@ const CustomerRetention: React.FC<CustomerRetentionProps> = ({ customer }) => { |
|
|
|
|
<div> |
|
|
|
|
{contextHolder} |
|
|
|
|
<div> |
|
|
|
|
<div> |
|
|
|
|
<span style={{fontWeight: 600, fontSize: 16}}>{customer.customerName}</span> |
|
|
|
|
<Button type="primary" style={{ marginBottom: 20, float: 'right' }} onClick={showModal}>新增留档</Button> |
|
|
|
|
<div style={{ display: 'flex',justifyContent: 'space-between', width: '100%' }}> |
|
|
|
|
<div className="ikd-page-header"><div className="title">{customer.customerName}</div></div> |
|
|
|
|
<Button type="primary" style={{ marginBottom: 10, float: 'right' }} onClick={showModal}>新增留档</Button> |
|
|
|
|
</div> |
|
|
|
|
{loading ? ( |
|
|
|
|
<Spin tip="Loading..." /> |
|
|
|
@ -305,7 +311,7 @@ const CustomerRetention: React.FC<CustomerRetentionProps> = ({ customer }) => { |
|
|
|
|
</Upload.Dragger> |
|
|
|
|
</div> |
|
|
|
|
<Form.Item label="说明描述" name="description" rules={[{ required: false }]}> |
|
|
|
|
<TextArea rows={4} /> |
|
|
|
|
<TextArea rows={4} maxLength={200} showCount/> |
|
|
|
|
</Form.Item> |
|
|
|
|
</Form> |
|
|
|
|
</Modal> |
|
|
|
|