Commit 9a83313d authored by xiexiuxing's avatar xiexiuxing

feat: 合同执行改

parent a7cef240
......@@ -21,7 +21,6 @@ const DrawerModal: React.FC<Iprops> = ({
setDrawerModal,
contractId,
}) => {
console.log(item)
const ref = useRef({});
const [selectRow, setSelectRow] = useState<any[]>([]) // 抽屉选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
......
import React, { useEffect, useState, useRef } from 'react';
import { Anchor, Table, Input, Space, Typography, message, Button, } from 'antd';
import { Anchor, Table,DatePicker, Input, Space, Typography, message, Button } from 'antd';
import style from './index.less';
import { ArrowLeftOutlined } from '@ant-design/icons';
const { Link } = Anchor;
......@@ -17,6 +17,13 @@ import PopModal from './components/PopModal';
import { getContractExecuteGetDetail, getContractExecutePageExecuteInfoList, getContractManageGetContractInfoByApplyAmountOrder } from '@/services/ContractV2Api'
const intl = getIntl();
const PAGE_SIZE = 8;
const { RangePicker } = DatePicker
type FromProps = {
orderNo:string,
orderAbstract:string,
startTime:string,
endTime:string,
}
const Details = (props: any) => {
const ref = useRef({});
const [currLink, setCurrLink] = useState(activeAnchorClassName)
......@@ -91,12 +98,44 @@ const Details = (props: any) => {
}).finally(() => {
setListLoading(false);
}).catch((err) => {
resolve([])
});
}
/* 执行请款的选中 */
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
// 设置提交数据
const [from,setfrom] = useState<FromProps>({
orderNo :'',
orderAbstract:'',
startTime:'',
endTime:'',
})
// 设置搜索的值
const setvalue = (e,name)=>{
const value = e.target.value;
from[name] = value;
console.log(value,name,from)
setfrom({...from})
}
const onChange = (value, dateString) => {
console.log(moment(value[0]).format('YYYY-MM-DD HH:mm:ss') ,'111')
// moment(value).format('YYYY-MM-DD HH:mm:ss') : ''
from.startTime = moment(value[0]).format('YYYY-MM-DD HH:mm:ss')
from.endTime = moment(value[1]).format('YYYY-MM-DD HH:mm:ss')
console.log(from)
setfrom(from)
}
const query = ()=>{
const data = {
contractId,
...from,
current: page,
pageSize: size,
}
getContracInfoList(data)
}
/* 获取详情的数据 */
const getDetail = () => {
console.log(contractId)
......@@ -151,10 +190,7 @@ const Details = (props: any) => {
setTargetOffset(window.innerHeight / 4);
const data = {
contractId,
orderNo: '',
orderAbstract: '',
startTime: "",
endTime: "",
...from,
current: page,
pageSize: size,
}
......@@ -288,32 +324,6 @@ const Details = (props: any) => {
const [ModalVisible, setIsModalVisible] = useState<boolean>(false)
const [payType, setpayType] = useState<any>([])
/* 显示模态款 */
const onModal = (record, Multiple) => {
if (!Multiple) {
const List = [];
List.push(record)
setSelectRow(List)
}
getContractManageGetContractInfoByApplyAmountOrder({ contractId }).then(res => {
if (res.code == 1000) {
setpayType(res.data.payPlanList)
setIsModalVisible(!ModalVisible)
}
})
}
/* 批量 */
const onselect = () => {
if (selectRow.length != 0) {
onModal({}, true)
} else {
const msg = message.loading({
content: intl.formatMessage({id: 'contract.qinggouxuanqingkuanzhangdan'}),
duration: 0,
});
msg();
}
}
/* 点击显示弹出 */
const getPayment = (item) => {
setitem(item)
......@@ -328,35 +338,7 @@ const Details = (props: any) => {
setSelectRow(selectedRows)
}
};
const [values, setvalues] = useState('');
/* 搜素 */
const onSearch = (values) => {
const data = {
contractId,
orderNo: values,
orderAbstract: '',
startTime: "",
endTime: "",
current: 1,
pageSize: 5,
}
setvalues(values)
getContracInfoList(data)
}
/* 重置 */
const Reset = () => {
setvalues('');
const data = {
contractId,
orderNo: '',
orderAbstract: '',
startTime: "",
endTime: "",
current: 1,
pageSize: 5,
}
getContracInfoList(data)
}
/* 查看付款明细回调 */
const setDrawerModal = () => {
setVisible(!visible)
......@@ -365,26 +347,18 @@ const Details = (props: any) => {
const setDrawerPopModal = () => {
setIsModalVisible(!ModalVisible)
}
// 分页
const handlePaginationChange = (current: number, pageSize: number) => {
const data = {
contractId,
orderNo: '',
orderAbstract: '',
startTime: "",
endTime: "",
...from,
current: current,
pageSize: pageSize,
}
setSize(pageSize)
console.log(current, pageSize, size)
getContracInfoList(data)
};
const like = (sourceType, item) => {
console.log(sourceType, item);
// sessionStorage.setItem('basics', JSON.stringify(basics));
// history.push('/memberCenter/contract/funds/addbill/Add?applyId=' + contractId + '&sourceType=' + sourceType + '&paymentId=' + item.id)
}
return (
<div className={style.anchorWrap}>
<Anchor
......@@ -443,20 +417,32 @@ const Details = (props: any) => {
{intl.formatMessage({id: 'contract.zhixingqingkuang'})}
</div>
<div className={style.wrapper}>
<Input.Search
style={{ width: 240 }}
placeholder={intl.formatMessage({id: 'contract.sousu'})}
<Input
style={{ width: 240 ,marginRight:10}}
placeholder="请输入单据号"
allowClear
value={from.orderNo}
onChange={(e)=>setvalue(e,'orderNo')}
/>
<Input
style={{ width: 240 ,marginRight:10}}
placeholder="请输入单据摘要"
allowClear
onSearch={onSearch}
value={values}
onChange={e => setvalues(e.target.value)}
value={from.orderAbstract}
onChange={(e)=>setvalue(e,'orderAbstract')}
/>
<Button style={{ paddingLeft: 10, paddingRight: 10, marginLeft: 10, marginRight: 10 }} onClick={Reset}> {intl.formatMessage({id: 'contract.zhongzhi'})} </Button>
{/* <Button type="primary" onClick={() => onselect()}>{intl.formatMessage({id: 'contract.piliangqingkuan'})}</Button> */}
<RangePicker
showTime={{ format: 'HH:mm' }}
format="YYYY-MM-DD HH:mm"
onChange={onChange}
/>
<Button type="primary" onClick={query}>查询</Button>
</div>
</div>
</div>
<div className='ant-card-body'>
<Table
rowKey='keyId'
rowSelection={rowSelection}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment