提交 dcaaa61f 作者: 龚洪江

功能:加盟合同签署

上级 ece53d34
......@@ -142,6 +142,8 @@ export type listUserApplyTag = InterListFunction<
remark: string;
score: number;
userAccountId: number;
orderNo: string;
signStatus: number;
}
>;
// 审批详情
......@@ -197,6 +199,8 @@ export type editUserApplyTagDetails = InterFunction<
remark: string;
attachmentList?: { userApplyTagId: number; url: string; type: number }[];
brandLogo: string;
contractNo?: string;
signStatus: number;
}
>;
// 后台-编辑服务商信息
......
......@@ -100,6 +100,7 @@ export type userJoinReportDataType = InterFunction<
* 培训机构
*/
trainingInstitution: number;
companyAuthCount: number;
}
>;
// 数据看板-订单数据
......
......@@ -99,3 +99,11 @@ export type approveWithdrawalApplyType = InterFunction<
},
any
>;
// 提现数据统计
export type statisticsType = InterFunction<
any,
{
cashPoolAmount: number;
totalWithdrawAmt: number;
}
>;
import {
approveWithdrawalApplyType,
listPageWithdrawalApplyType,
statisticsType,
} from '~/api/interface/depleteManageType';
import axios from '~/api/request';
......@@ -11,4 +12,7 @@ export class DepleteManageTypeAPI {
//提现审批
static approveWithdrawalApply: approveWithdrawalApplyType = (params) =>
axios.get('/userapp/withdrawal/approveWithdrawalApply', { params });
// 提现数据统计
static getCashAmountAndWithdrawAmount: statisticsType = () =>
axios.get('/userapp/withdrawal/getCashAmountAndWithdrawAmount');
}
......@@ -38,14 +38,7 @@ interface selfProps {
type: number; //0:采购订单,1:商城订单
}
const SureOrder: FC<ModalProps & selfProps> = ({
open,
onOk,
onCancel,
orderItem,
type,
updateContract,
}) => {
const SureOrder: FC<ModalProps & selfProps> = ({ open, onOk, onCancel, orderItem, type }) => {
const navigate = useNavigate();
const [orderInfoForm] = Form.useForm<{
orderTotalAmount: number;
......
......@@ -6,10 +6,12 @@ import {
} from '~/api/interface/customManageType';
import { InterDataType, InterListType, InterReqType } from '~/api/interface';
import { Button, Form, Image, Input, message, Modal, Rate, Select } from 'antd';
import { CustomManageAPI } from '~/api';
import { CustomManageAPI, FddInterfaceAPI } from '~/api';
import SelectMapModal from '~/components/select-map';
import { Uploader } from '~/components/uploader';
import { UploadOutlined } from '@ant-design/icons';
import { decode } from 'js-base64';
import FileSaver from 'file-saver';
// 数据类型
type DataType = InterDataType<editUserApplyTagDetails>;
......@@ -141,6 +143,23 @@ const AddEditModal: FC<propType> = (props) => {
handleCancel();
}
};
// 合同预览
const contractPreview = () => {
if (detail?.contractNo) {
FddInterfaceAPI.viewContract({ contractId: detail?.contractNo }).then(({ result }) => {
window.open(decode(result), '_blank');
});
}
};
// 合同下载
const downloadContract = () => {
if (detail?.contractNo) {
FddInterfaceAPI.downloadContract({ contractId: detail?.contractNo }).then(({ result }) => {
FileSaver.saveAs(decode(result), `${detail?.contractNo}.pdf`);
});
}
};
// componentDidMount
useEffect(() => {
if (!open) return;
......@@ -218,6 +237,18 @@ const AddEditModal: FC<propType> = (props) => {
<Form.Item label='营业执照'>
<Image src={detail?.licenseImg} width={50} height={50} />
</Form.Item>
{detail?.contractNo ? (
<Form.Item label='合同信息'>
<Button type='link' onClick={contractPreview}>
查看
</Button>
<Button type='link' onClick={downloadContract}>
下载
</Button>
</Form.Item>
) : (
''
)}
<Form.Item label='附件' name='attachmentList'>
<Uploader
fileUpload
......
import { Button, Form, Input, message, Modal, ModalProps } from 'antd';
import { FC, useState } from 'react';
import { Uploader } from '~/components/uploader';
import { UploadOutlined } from '@ant-design/icons';
import { listUserApplyTag } from '~/api/interface/customManageType';
import { InterDataType, InterListType } from '~/api/interface';
import { CustomManageAPI, FddInterfaceAPI } from '~/api';
import { useNavigate } from 'react-router-dom';
import { decode } from 'js-base64';
import { uploadContractType } from '~/api/interface/fddInterfaceType';
import { UploadFile } from 'antd/es/upload/interface';
import IframeModal from '~/components/modal/iframeModal';
// 列表类型
type joinType = InterListType<listUserApplyTag>[0];
// 合同返回类型
type contractType = InterDataType<uploadContractType>;
interface selfProps {
onOk: () => void;
onCancel: () => void;
joinItem: joinType | undefined;
}
const ContractModal: FC<ModalProps & selfProps> = ({ open, onOk, onCancel, joinItem }) => {
const navigate = useNavigate();
const [contractForm] = Form.useForm<{ contractUrl: string; contractTitle: string }>();
const [contractFileList, setContractFileList] = useState<UploadFile[]>([]);
const [contractInfo, setContractInfo] = useState<contractType>();
const [contractUrl, setContractUrl] = useState<string>('');
const [iframeModalShow, setIframeModalShow] = useState<boolean>(false);
const handleOk = () => {
contractForm
.validateFields()
.then(() => {
if (contractInfo) {
signContract(contractInfo.contractNo);
}
})
.catch((error: any) => {
message.warning(error?.errorFields[0]?.errors[0]);
});
};
const handleCancel = () => {
onCancel();
contractForm.resetFields();
setContractFileList([]);
};
// 上传合同
// 合同上传
const uploadSuccess = (value: any) => {
contractForm
.validateFields(['contractTitle'])
.then((values) => {
if (joinItem?.orderNo) {
FddInterfaceAPI.uploadContract({
docUrl: value[0].url,
orderNo: joinItem.orderNo,
port: 1,
title: values.contractTitle,
})
.then(({ result }) => {
setContractFileList(value);
contractForm.setFieldValue('contractUrl', value[0].url);
setContractInfo(result);
})
.catch(({ code }) => {
if (code === '1006' || code === '1005') {
navigate('/systemManage/realNameAuth');
}
setContractFileList([]);
});
} else {
setContractFileList([]);
message.warning('orderNo不能为空');
}
})
.catch((error: any) => {
setContractFileList([]);
message.warning(error?.errorFields[0]?.errors[0]);
});
};
// 签署合同
const signContract = (contractId: string) => {
FddInterfaceAPI.signContract({ contractId, port: 1 }).then(({ result }) => {
if (result) {
setContractUrl(decode(result));
setIframeModalShow(true);
}
});
};
const iframeModalCancel = () => {
setIframeModalShow(false);
if (joinItem) {
CustomManageAPI.editUserApplyTagDetails({
id: joinItem.id,
}).then(({ result }) => {
if (result?.signStatus === 2) {
contractForm.resetFields();
setContractFileList([]);
onOk();
}
});
}
};
return (
<>
<Modal open={open} onOk={handleOk} onCancel={handleCancel} title='签署合同' okText='签署合同'>
<Form labelCol={{ span: 4 }} wrapperCol={{ span: 15 }} form={contractForm}>
<Form.Item
label='合同标题'
rules={[{ required: true, message: '请输入合同标题' }]}
name='contractTitle'
>
<Input placeholder='请输入合同标题' />
</Form.Item>
<Form.Item
label='合同文件'
rules={[{ required: true, message: '请上传合同文件' }]}
name='contractUrl'
>
<Uploader
fileUpload
listType='text'
defaultFileList={contractFileList}
onChange={uploadSuccess}
fileType={['application/pdf']}
>
<Button icon={<UploadOutlined />} type='primary'>
上传
</Button>
</Uploader>
</Form.Item>
</Form>
</Modal>
<IframeModal
url={contractUrl}
title='合同签署'
open={iframeModalShow}
onCancel={iframeModalCancel}
/>
</>
);
};
export default ContractModal;
......@@ -7,6 +7,7 @@ import { InterDataType, InterListType, InterReqListType } from '~/api/interface'
import { listAppUserCountType, listUserApplyTag } from '~/api/interface/customManageType';
import ApprovalModal from './comp/approvalModal';
import AddEditModal from '~/pages/customManage/customIdentity/comp/addEditModal';
import ContractModal from '~/pages/customManage/customIdentity/comp/contractModal';
import './index.scss';
// 列表类型
......@@ -46,6 +47,9 @@ const CustomIdentityView = () => {
});
// 数据统计
const [statisticsData, setStatisticsDataType] = useState<statisticsDataType>();
// 合同弹窗
const [contractModalShow, setContractModalShow] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(false);
// 加载列表
const getTableList = async (value = {}) => {
......@@ -79,7 +83,9 @@ const CustomIdentityView = () => {
};
// 获取加盟列表
const getCooperationList = async () => {
setLoading(true);
const res = await CustomManageAPI.cooperationListTag({});
setLoading(false);
if (res && res.code === '200') {
const list = res.result || [];
setCooperationList(list.map((i) => ({ label: i.tagName, value: i.id })));
......@@ -111,6 +117,18 @@ const CustomIdentityView = () => {
}
});
};
// 合同签署
const contractModalShowClick = (record: TableType[0]) => {
setEditData(record);
setContractModalShow(true);
};
const contractModalCancel = () => {
setContractModalShow(false);
};
const contractModalOk = () => {
setContractModalShow(false);
getTableList(query).then();
};
useEffect(() => {
getCooperationList().then();
......@@ -179,7 +197,7 @@ const CustomIdentityView = () => {
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: '150px',
width: '250px',
render: (_text, record) => (
<>
<Button
......@@ -193,6 +211,13 @@ const CustomIdentityView = () => {
审批
</Button>
<Button
type='link'
onClick={() => contractModalShowClick(record)}
disabled={record.approvalStatus !== 1 || record.signStatus === 2}
>
签署合同
</Button>
<Button
type={'link'}
onClick={() => {
setAddModalVisible(true);
......@@ -261,6 +286,7 @@ const CustomIdentityView = () => {
<Table
size='small'
dataSource={tableData}
loading={loading}
columns={columns}
rowKey='id'
scroll={{ x: 1200 }}
......@@ -298,6 +324,13 @@ const CustomIdentityView = () => {
paginationChange(pagination.current, pagination.pageSize);
}}
/>
{/*合同签署*/}
<ContractModal
open={contractModalShow}
onCancel={contractModalCancel}
onOk={contractModalOk}
joinItem={editData}
/>
</div>
);
};
......
......@@ -109,8 +109,10 @@ const JoinInfo = () => {
return (
<div className='join-info'>
<div className='join-info-card-1'>
<div className='join-count'>{joinReportDataType?.joinStoreCount}</div>
<div className='join-meta'>入驻商家总数</div>
<div className='join-count'>{joinReportDataType?.companyAuthCount}</div>
<div className='join-meta'>
已认证企业总数(入驻{joinReportDataType?.joinStoreCount}家)
</div>
</div>
<div className='join-info-card-2'>
<div className='card-header'>
......
.with-draw-manage{
.data-statistics{
display: flex;
align-items: center;
color: red;
justify-content: flex-end;
}
}
......@@ -4,16 +4,19 @@ import { Button, Table } from 'antd';
import { ColumnsType } from 'antd/es/table/InternalTable';
import { DepleteManageTypeAPI } from '~/api';
import { useEffect, useState } from 'react';
import { InterListType, PaginationProps } from '~/api/interface';
import { listPageWithdrawalApplyType } from '~/api/interface/depleteManageType';
import { InterDataType, InterListType, PaginationProps } from '~/api/interface';
import { listPageWithdrawalApplyType, statisticsType } from '~/api/interface/depleteManageType';
import { filterObjAttr } from '~/utils';
import ApplyStatusModal from '~/pages/depleteManage/withDrawList/components/applyStatusModal';
import { withdrawStatusList } from '~/utils/dictionary';
import './index.scss';
// 提现列表返回类型
type withdrawalApplyType = InterListType<listPageWithdrawalApplyType>;
// 提现列表请求类型
type withdrawalApplyParameterType = InterListType<listPageWithdrawalApplyType>;
// 提现数据统计返回类型
type statisticsDataType = InterDataType<statisticsType>;
// 提现方式字典
const settleTypeDic = [
{
......@@ -139,6 +142,8 @@ const WithDrawManage = () => {
const [applyStatusModalShow, setApplyStatusModalShow] = useState<boolean>(false);
// 当前审批对象
const [currentWithDrawItem, setCurrentWithDrawItem] = useState<withdrawalApplyType[0]>();
// 提现数据统计
const [statisticsData, setStatisticsData] = useState<statisticsDataType>();
// 获取提现列表
const getListPageWithdrawalApply = (query?: withdrawalApplyParameterType) => {
......@@ -154,6 +159,14 @@ const WithDrawManage = () => {
setTableData(result.list || []);
});
};
// 提现数据统计
const getCashAmountAndWithdrawAmount = () => {
DepleteManageTypeAPI.getCashAmountAndWithdrawAmount().then(({ result }) => {
if (result) {
setStatisticsData(result);
}
});
};
// 分页
const paginationChange = (pageNo: number, pageSize: number) => {
pagination.pageNo = pageNo;
......@@ -167,6 +180,7 @@ const WithDrawManage = () => {
const filterQuery = filterObjAttr(value, ['time']);
setQuery(filterQuery);
getListPageWithdrawalApply(filterQuery);
getCashAmountAndWithdrawAmount();
};
// 审批弹窗事件
const applyStatusEvent = (record: withdrawalApplyType[0]) => {
......@@ -183,10 +197,34 @@ const WithDrawManage = () => {
useEffect(() => {
getListPageWithdrawalApply();
getCashAmountAndWithdrawAmount();
}, []);
return (
<div className='with-draw-manage'>
<SearchBox search={searchColumns} searchData={searchSuccess} />
<SearchBox
search={searchColumns}
searchData={searchSuccess}
sufFixBtn={
<div className='data-statistics'>
<div>
<span>已提现:</span>
<span>
{statisticsData?.totalWithdrawAmt
? statisticsData?.totalWithdrawAmt.toFixed(2).toLocaleString()
: 0}
</span>
</div>
<div>
<span>账户余额:</span>
<span>
{statisticsData?.cashPoolAmount
? statisticsData?.cashPoolAmount.toFixed(2).toLocaleString()
: 0}
</span>
</div>
</div>
}
/>
<Table
bordered
columns={tableColumns}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论