Commit f3de12d3 authored by alwayOnlie's avatar alwayOnlie

合同请款对接

parent b33a1f06
// @统一处理 业务表格内不嵌套NiceForm组件的高级筛选 间距异常问题
.god-schema-form {
& > .ant-form-item {
margin-bottom: 0 !important;
}
& > .ant-row-end {
margin-top: 24px !important;
}
}
import React from 'react'
import {history} from 'umi'
import { formatTimeString } from '@/utils'
import EyePreview from '@/components/EyePreview'
import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons'
import CustomTag from '@/pages/procurement/components/CustomTag'
import CustomBadge from '@/pages/procurement/components/customBadge'
import { CALLFORBID_TYPE, PURCHASE_TYPE } from '@/constants'
// 招投标内部状态
export const insideStatusText = [
"待提交审核",
"审核通过",
"报名审核通过",
"资格预审审核通过",
"待开标",
"待评标",
"待提交审核定标",
"定标审核通过(二级)",
"完成招标",
"已废标",
]
// 招投标外部状态
export const outStatusText = [
"待提交招标",
"待平台审核招标",
"待招标报名",
"待资格预审",
"待开标",
"待评标",
"待定标",
"待中标公示",
"完成招标",
"已废标",
]
// 评标中的环节状态
export const remarkProcessStatus = [
"未报名",
"已评标",
"未评标",
"未报名",
"未报价",
"报名审核未通过",
"资格审核未通过",
]
// 招标表格基本列
export const baseBidListColumns: any[] = [
{
title: '招标编号/项目',
align: 'left',
dataIndex: 'code',
key: 'code',
render: (text, record) => <>
<EyePreview url={`${history.location.pathname}/detail?id=${record.id}`}>
{text}
</EyePreview>
<div>{record['projectName']}</div>
</>
},
{
title: '采购类型',
align: 'left',
dataIndex: 'purchaseType',
key: 'purchaseType',
render: (t) => PURCHASE_TYPE[t]
},
{
title: '招标方式',
align: 'left',
dataIndex: 'inviteTenderType',
key: 'inviteTenderType',
render: (t) => CALLFORBID_TYPE[t]
},
{
title: '发布时间',
align: 'left',
dataIndex: 'createTime',
key: 'createTime',
render: (text, record) => formatTimeString(record.createTime),
width: 200
},
{
title: '投标开始/截止时间',
align: 'left',
dataIndex: 'createTime',
key: 'createTime',
render: (text, record) => <>
<div><PlayCircleOutlined />&nbsp;{formatTimeString(record.inviteTenderStartTime)}</div>
<div><PoweroffOutlined />&nbsp;{formatTimeString(record.inviteTenderEndTime)}</div>
</>,
width: 200
},
{
title: '外部状态',
align: 'left',
dataIndex: 'tenderOutStatus',
key: 'tenderOutStatus',
render: text => <CustomTag status={text} type='out' />
},
{
title: '内部状态',
align: 'left',
dataIndex: 'inviteTenderInStatus',
key: 'inviteTenderInStatus',
render: (text) => <CustomBadge status={text} type='inside' />
},
]
// 投标表格基本列
export const baseTenderListColumns: any[] = [
{
title: '投标编号/项目',
align: 'left',
dataIndex: 'id',
key: 'id',
render: (text, record) => <>
{record.code ? <EyePreview url={`/memberCenter/procurementAbility/tender/tenderSearch/detail?id=${record.id}`}>
{record.code}
</EyePreview> : null}
<div>{record.inviteTender.projectName}</div>
</>
},
{
title: '招标编号/会员',
align: 'left',
dataIndex: 'memberId',
key: 'memberId',
render: (text, record) => <>
<EyePreview url={`/memberCenter/procurementAbility/tender/callForBidsSearch/detail?id=${record.inviteTender.id}`}>
{record.inviteTender.code}
</EyePreview>
<div>{record.inviteTender.memberName}</div>
</>
},
{
title: '投标开始/截止时间',
align: 'left',
dataIndex: 'inviteTender',
key: 'inviteTender',
render: (text, record) => <>
<div><PlayCircleOutlined />&nbsp;{formatTimeString(record.inviteTender.inviteTenderStartTime)}</div>
<div><PoweroffOutlined />&nbsp;{formatTimeString(record.inviteTender.inviteTenderEndTime)}</div>
</>,
width: 200
},
{
title: '外部状态',
align: 'left',
dataIndex: 'tenderOutStatus',
key: 'tenderOutStatus',
render: text => <CustomTag status={text} type='out' />
},
{
title: '内部状态',
align: 'left',
dataIndex: 'submitTenderInStatus',
key: 'submitTenderInStatus',
render: (text) => <CustomBadge status={text} type='tenderInside' />
},
]
......@@ -10,6 +10,7 @@ import { PublicApi } from '@/services/api';
const Option = Select.Option;
const { Link } = Anchor;
import { history } from 'umi'
const { Text } = Typography;
const activeAnchorClassName = 'ant-anchor-link-active'
......@@ -35,6 +36,9 @@ const Details = (props: any) => {
})
const [payPlanList, setpayPlanList] = useState<any>([])
const [data, setdata] = useState<any>([])
const [contractNo, setcontractNo] = useState();
const [basics, setbasics] = useState({})
const [contractAbstract, setcontractAbstract] = useState();
const [tabPane] = useState([
{ id: 'process', title: '基本流程' },
{ id: 'conditions', title: '付款计划' },
......@@ -61,6 +65,9 @@ const Details = (props: any) => {
PublicApi.getContractExecuteGetDetail({ contractId }).then(res => {
if (res.code === 1000) {
let { basics, payPlanList } = res.data
setcontractNo(basics.contractNo)
setcontractAbstract(basics.contractAbstract)
setbasics(basics)
const basicInfo = {
col1: [
{ label: '合同编号:', extra: basics.contractNo ? basics.contractNo : '' },
......@@ -82,7 +89,7 @@ const Details = (props: any) => {
const data = {
contractId,
orderNo: basics.sourceNo ? basics.sourceNo : '',
orderAbstract: basics.contractAbstract,
orderAbstract: '',
startTime: basics.startTime,
endTime: basics.endTime,
current: 1,
......@@ -207,10 +214,13 @@ const Details = (props: any) => {
})
})
}
const onConfirm = () => {
setVisible(false)
console.log('确定')
/* 非手工单进入请款 */
const like = (sourceType) => {
// basics.
sessionStorage.setItem('basics', JSON.stringify(basics));
history.push('/memberCenter/contract/funds/addbill/Add?applyId=' + contractId + '&sourceType=' + sourceType)
}
return (
<div className={style.anchorWrap}>
<Anchor
......@@ -227,6 +237,7 @@ const Details = (props: any) => {
}}
>
<ArrowLeftOutlined
onClick={() => history.goBack()}
style={{
fontSize: '14px',
color: '#909399',
......@@ -240,7 +251,7 @@ const Details = (props: any) => {
marginLeft: '8px',
}}
>
进口头层黄牛皮荔枝纹 | SPTY12
{contractAbstract} | {contractNo}
</span>
</div>
......@@ -312,7 +323,7 @@ const Details = (props: any) => {
<div className={style.proportion}>{item.payRatio}%</div>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div className={style.Price}>¥{item.payAmount}</div>
<div style={{ cursor: 'pointer', fontSize: 12, backgroundColor: '#00B37A', color: '#fff', padding: '4px 8px' }}>请款</div>
<div onClick={() => like(1)} style={{ cursor: 'pointer', fontSize: 12, backgroundColor: '#00B37A', color: '#fff', padding: '4px 8px' }}>请款</div>
</div>
<div className={style.warp_List}>
<div className={style.warp_ListItem}>
......
import React, { useState, useRef } from 'react'
import React, { useState, useRef, useEffect } from 'react'
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Tabs, Button } from 'antd';
......@@ -10,13 +10,17 @@ import ReutrnEle from '@/components/ReturnEle';
import AddInfo from './components/info'
import InfoTable from './components/table'
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
const { TabPane } = Tabs;
const Add: React.FC<{}> = () => {
const Add: React.FC<{}> = (props) => {
const { location: { query: { sourceType } } } = props;
console.log(sourceType)
const currentBasic = useRef<any>({});
const [basic, setbasic] = useState<any>({});
const detailData = useRef<any>({});
const [flag, setflag] = useState<any>(false);
const [id, setid] = useState('');
......@@ -26,6 +30,7 @@ const Add: React.FC<{}> = () => {
setid(data.selectRow.id)
console.log(data)
}
const TabList = [
{
name: '基本信息', components:
......@@ -34,21 +39,43 @@ const Add: React.FC<{}> = () => {
getcontractId={getflag}
/>
},
{ name: '请款明细', components: <InfoTable flag={flag} id={id} /> },
{
name: '请款明细', components:
<InfoTable
flag={flag}
id={id}
currentRef={detailData}
/>
},
]
const submit = async () => {
const basicsVO = await currentBasic.current.get();
console.log(basicsVO)
// const detailList = await detailData.current.get();
let detailList = [
{
id: 0,
applyAmount: 100,
orderId: 41,
orderNO: 'JJHJ23484',
isHasTax: 1,
taxRate: 10
}
]
console.log(basicsVO, detailList)
basicsVO.data.sourceType = sourceType ? sourceType : 3;
let data = {
basics: basicsVO.data,
detailList: []
detailList: detailList,
}
PublicApi.postContractApplyAmountSave(data).then(res => {
console.log(res);
if (res.code === 1000) {
history.push('/memberCenter/contract/funds/addbill')
}
})
}
return (
<PageHeaderWrapper
title="新建请款单"
......
......@@ -24,6 +24,7 @@ const AddInfo = (props: any) => {
const [visible, setvisible] = useState<boolean>(false);
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio' });
const [account, setaccount] = useState<string>('');
const [isFalg, setisFalg] = useState(false);
/* 初始值 */
const [basics, setBasics] = useState<any>({
......@@ -121,34 +122,46 @@ const AddInfo = (props: any) => {
/* 确认回显数据 */
const Confirm = () => {
let selectRow = RowCtl.selectRow[0];
getAmountOrder(selectRow)
setvisible(!visible);
}
/* 查询银行卡新 */
const getAmountOrder = (selectRow) => {
PublicApi.getContractManageGetContractInfoByApplyAmountOrder({ contractId: selectRow.id }).then(res => {
const expectPayTime = new Date(res.data.payPlanList[0].expectPayTime).getTime();
const basicsData = basics;
const info = Info;
basicsData.payeeName = res.data.corporateAccountConfig.name;
basicsData.bankAccount = res.data.corporateAccountConfig.bankAccount;
basicsData.bankDeposit = res.data.corporateAccountConfig.bankDeposit;
basicsData.payPlanId = res.data.payPlanList[0].id;
basicsData.payRatio = res.data.payPlanList[0].payRatio;
basicsData.expectPayTime = moment(expectPayTime),
basicsData.payWay = res.data.payPlanList[0].payWay
basicsData.contractNo = selectRow.contractNo;
basicsData.contractId = selectRow.id;
info.startTime = selectRow.startTime;
info.status = "同意签订合同";
// basicsData.applyAmount = res.data.payPlanList[0].applyAmount;
setpayPlanList(res.data.payPlanList)
setInfo(info)
getcontractId({ flag: true, selectRow })
const auth = JSON.parse(localStorage.getItem('auth'));
setaccount(auth.account);
setBasics(basicsData)
attrValueForm.setFieldsValue(basicsData);
if (res.code == 1000) {
const expectPayTime = new Date(res.data.payPlanList[0].expectPayTime).getTime();
const basicsData = basics;
const info = Info;
basicsData.payeeName = res.data.corporateAccountConfig.name;
basicsData.bankAccount = res.data.corporateAccountConfig.bankAccount;
basicsData.bankDeposit = res.data.corporateAccountConfig.bankDeposit;
basicsData.payPlanId = res.data.payPlanList[0].id;
basicsData.payRatio = res.data.payPlanList[0].payRatio;
basicsData.expectPayTime = moment(expectPayTime),
basicsData.payWay = res.data.payPlanList[0].payWay
basicsData.contractNo = selectRow.contractNo;
basicsData.contractId = selectRow.id;
info.startTime = selectRow.startTime;
info.status = "同意签订合同";
// basicsData.applyAmount = res.data.payPlanList[0].applyAmount;
setpayPlanList(res.data.payPlanList)
setInfo(info)
getcontractId({ flag: true, selectRow })
const auth = JSON.parse(localStorage.getItem('auth'));
setaccount(auth.account);
setBasics(basicsData)
attrValueForm.setFieldsValue(basicsData);
}
})
setvisible(!visible);
}
useEffect(() => {
let basics = JSON.parse(sessionStorage.getItem('basics'))
if (basics) {
getAmountOrder(basics);
setisFalg(true)
}
}, [])
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
attrValueForm.validateFields().then(res => {
......@@ -199,9 +212,9 @@ const AddInfo = (props: any) => {
<div style={{
flex: 1,
}}>
<Form.Item label="请款单号" labelAlign="left" labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
{/* <Form.Item label="请款单号" labelAlign="left" labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
<span>{basics.applyAbstract}</span>
</Form.Item>
</Form.Item> */}
<Form.Item
label="请款单摘要"
labelAlign="left"
......@@ -224,7 +237,12 @@ const AddInfo = (props: any) => {
name="contractNo"
wrapperCol={{ span: 18 }}
>
<Search placeholder="最长60个字符,30个汉字" readOnly enterButton={<div onClick={() => setvisible(!visible)}><LinkOutlined /> 选择</div>} />
{
isFalg ?
<Input placeholder='最长60个字符,30个汉字' disabled />
:
<Search placeholder="最长60个字符,30个汉字" readOnly enterButton={<div onClick={() => setvisible(!visible)} ><LinkOutlined /> 选择</div>} />
}
</Form.Item>
<Form.Item label="收款方" labelAlign="left" labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
<span>{account}</span>
......@@ -351,12 +369,12 @@ const AddInfo = (props: any) => {
>
<TextArea placeholder='最长160字符,80个汉字' maxLength={160} style={{ height: 72 }} />
</Form.Item>
<Form.Item label="发票编号" labelAlign="left" labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
{/* <Form.Item label="发票编号" labelAlign="left" labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
<span>{Info.number}</span>
</Form.Item>
<Form.Item label="开票日期" labelAlign="left" labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
<span>{Info.time}</span>
</Form.Item>
</Form.Item> */}
<Form.Item label="单据时间" labelAlign="left" labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
<span>{Info.startTime}</span>
</Form.Item>
......
import React, { useState, useRef } from 'react';
import React, { useState, useRef, useEffect } from 'react';
import { Button, Table, Input, Space, Drawer, Typography } from 'antd'
import styles from './index.less'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
......@@ -18,38 +18,65 @@ import { PublicApi } from '@/services/api';
const { Text } = Typography;
const table = (props: any) => {
const { flag, id } = props;
const { flag, id, currentRef } = props;
const refs = useRef({});
const [visible, setvisible] = useState<boolean>(false);
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio' });
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'orderId', type: 'radio' });
const [toorderAmount, settoorderAmount] = useState<number>(0);
const [PlanList, setPlanList] = useState<any>([
]);
const tabcolumns: any = [
{
title: '单据号/摘要', dataIndex: 'payNum', align: 'center',
title: '单据编号/摘要', dataIndex: 'applyNo', align: 'center',
render: (text, record) =>
<div>
<p> {text}</p>
{/* <p>{record.applyAbstract}</p> */}
</div>
},
{
title: '单据类型', dataIndex: 'payStage', align: 'center',
title: '订单类型', dataIndex: 'orderTypeName', align: 'center',
render: (text) =>
<div>
<p>{text}</p>
</div>
},
{
title: '单据状态', dataIndex: 'expectPayTime', align: 'center',
title: '单据状态', dataIndex: 'outerStatus', align: 'center',
render: (text) =>
<div>
<p>{text}</p>
</div>
},
{
title: '单据时间', dataIndex: 'payRatio', align: 'center',
title: '单据时间', dataIndex: 'orderTime', align: 'center',
},
{
dataIndex: 'payAmount', align: 'center',
title: (
<Space direction='vertical'>
<Text>单据金额</Text>
<Text>合计: ¥156.000.00</Text>
<Text>合计: ¥{toorderAmount}</Text>
</Space>
),
dataIndex: 'orderAmount', align: 'center',
render: (text, record) =>
<div>
<p>{text}</p>
</div>
},
{
title: '含税/税率', dataIndex: 'payWay', align: 'left',
title: '含税/税率', dataIndex: 'taxRate', align: 'left',
render: (text, record) =>
<div>
<p>{text ? '是' : '否'}</p>
<p>%{text}</p>
</div>
},
{
......@@ -60,15 +87,23 @@ const table = (props: any) => {
<Text>合计: ¥156.000.00</Text>
</Space>
),
render: (text, record) =>
<div>
<p>{text ? text : 0}</p>
</div>
},
{
dataIndex: 'payAmount', align: 'center',
dataIndex: 'unPayApplyAmount', align: 'center',
title: (
<Space direction='vertical'>
<Text>已请款待付款</Text>
<Text>合计: ¥156.000.00</Text>
</Space>
),
render: (text, record) =>
<div>
<p>{text ? text : 0}</p>
</div>
},
{
dataIndex: 'payAmount', align: 'center',
......@@ -78,28 +113,103 @@ const table = (props: any) => {
<Text>合计: ¥156.000.00</Text>
</Space>
),
render: (_, item, index) =>
<Input
addonBefore="¥"
style={{
width: 130,
}}
placeholder=""
onChange={(e) => onSelectChange(e, 'payAmount', index)}
/>
},
{
title: '操作',
dataIndex: '',
align: 'center',
key: 'x',
render: (_, item, index) => <a onClick={() => Delete(item, index)}>删除</a>,
},
];
const [PlanList, setPlanList] = useState<any>([
{
payNum: '1',
payStage: '',
expectPayTime: '',
payRatio: '',
payAmount: '',
payWay: '1',
payParam: '',
},
]);
const onSelectChange = (e, name, idx) => {
}
/* 计算金额 */
const Amount = () => {
// bidCount
let tobidCount = 0;
let toorderAmount = 0;
PlanList.map(item => {
toorderAmount += item.orderAmount;
})
settoorderAmount(toorderAmount)
}
/* 删除 */
const Delete = (elm, idx) => {
// const dataSource = [...PlanList];
// const arr = [...payNumArr]
// let List = dataSource.filter((item, index) => index !== idx);
// let numberArr = arr.filter((item, index) => elm.payNum !== item);
// console.log(numberArr);
// setpayNumArr(numberArr)
// setPlanList(List)
};
const columnsList: any = [
{
title: '单据编号/摘要',
dataIndex: 'applyNo',
align: 'center',
render: (text, record) =>
<div>
<p> {text}</p>
<p>{record.applyAbstract}</p>
</div>
},
{
title: '单据类型',
dataIndex: 'orderTypeName',
align: 'center',
render: (text, record) =>
<div>
<p>{text}</p>
</div>
},
{
title: '单据时间',
dataIndex: 'orderTime',
align: 'center',
},
{
title: '单据状态',
dataIndex: 'outerStatus',
align: 'center',
render: (text) =>
<div>
<p>{text}</p>
</div>
},
{
title: '单据金额',
dataIndex: 'orderAmount',
align: 'center',
render: (text, record) =>
<div>
<p>{text}</p>
</div>
},
{
title: '待请款',
dataIndex: 'toBePayAmount',
align: 'center',
render: (text, record) =>
<div>
<p>{text}</p>
</div>
},
]
/***
* @function fetchData 请求表格数据
......@@ -109,15 +219,26 @@ const table = (props: any) => {
return new Promise(resolve => {
PublicApi.getContractApplyAmountContractOrderPageList({ ...params }).then(res => {
console.log(res)
// resolve(res.data)
resolve(res.data)
})
})
}
const Confirm = () => {
let PlanList = [];
PlanList.push(RowCtl.selectRow[0])
setPlanList(PlanList)
console.log(PlanList, RowCtl.selectRow[0])
setvisible(false)
Amount()
}
return (
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
})
}
})
return (
<div className="table">
{
flag && <div style={{ padding: 15, }} onClick={() => setvisible(!visible)} >
......@@ -159,7 +280,7 @@ const table = (props: any) => {
>
<StandardTable
tableProps={{
rowKey: 'id',
rowKey: 'orderId',
}}
columns={columnsList}
currentRef={refs}
......
This diff is collapsed.
import React, { useState, useRef, ReactNode } from 'react'
import { history, Link } from 'umi';
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Anchor, Radio, Steps, Row, Col, Input, message, Modal, Card } from 'antd';
import { Radio, Input, message, Modal, Card } from 'antd';
import statuStyle from '../../common/colorTag'
import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god';
......@@ -15,6 +15,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment';
import "../../constants/index.less"
const { TextArea } = Input;
const Bill: React.FC<{}> = () => {
......@@ -36,7 +37,7 @@ const Bill: React.FC<{}> = () => {
return (
<div>
<EyePreview
type="button"
url={`/memberCenter/contract/funds/bill/details?applyId=${record.id}&type=pageDetailList`}
>
{text}
</EyePreview>
......@@ -60,7 +61,8 @@ const Bill: React.FC<{}> = () => {
align: 'center',
dataIndex: 'contractNo',
render: (text: any, record: any) => <EyePreview
type="button"
// type="button"
url={`/memberCenter/contract/manage/QueryList/QueryListdetails?contractId=${record.contractId}`}
>
{text}
</EyePreview>
......@@ -103,9 +105,10 @@ const Bill: React.FC<{}> = () => {
return (
<>
{
record.status != 9 || record.status != 7 || record.status != 8 || record.status != 1 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => invalid(record.id)}>作废</span>
// 0.全部,1.待提交审核,2.待审核(一级),3.审核不通过(一级),4.待审核(二级),5.审核不通过(二级),6.待提交财务付款,7.待付款,8.已付款,9.已作废
record.status != 7 || record.status != 8 || record.status != 1 || record.status != 9 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => invalid(record.id)}>作废</span>
}
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/bill/details?applyId=${record.id}&type=1`)}>查看</span>
{/* <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`}>查看</span> */}
</>
)
}
......
import React, { useState } from 'react';
import { Button, Input, Form, Select, Radio, message, Modal } from 'antd'
const { Search, TextArea } = Input
import { StandardTable } from 'god';
import { PublicApi } from '@/services/api';
const { Option } = Select;
const Examine = (props: any) => {
const { ExamineFlag, getfetchData, applyId, type } = props;
const [Visible, setIsModalVisible] = useState<boolean>(false)
const [isPass, setIsAllMember] = useState()
const [form] = Form.useForm();
/***
* @function fetchData 请求表格数据
**/
/* 提交表单 */
const onFinish = (values: any) => {
values.applyId = applyId;
let fn;
switch (type) {
case 'submitExamine':
fn = PublicApi.postContractApplyAmountSubmitExamine
break;
case 'PageToBeExamineOne':
fn = PublicApi.postContractApplyAmountExamineStepOne
break;
case 'ToBeExamineTwo':
fn = PublicApi.postContractApplyAmountExamineStepTwo
break;
}
const msg = message.loading({
content: '正在操作',
duration: 0,
});
fn(values).then(res => {
console.log(res);
if (res.code === 1000) {
getfetchData({
ExamineFlag: false,
code: 1000
})
}
}).finally(() => {
msg();
});
};
const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value)
}
const onFinishFailed = (errorInfo: any) => {
console.log('Failed:', errorInfo);
};
/* 回调 */
const fetchData = (val) => {
console.log(22222);
if (val == 'onCancel') {
getfetchData({
ExamineFlag: false,
code: 9999
})
} else {
console.log('确认')
}
}
return (
<div>
<Modal footer={null} title="提交审核" visible={ExamineFlag} onCancel={() => fetchData('onCancel')}>
<Form
name="basic"
form={form}
initialValues={{ remember: true }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
>
<Form.Item name="isPass" label="" rules={[{ required: true, message: '请选择作废日期' }]} initialValue={isPass} >
<Radio.Group onChange={handleIsAllMemberChange}>
<Radio value={1}>通过</Radio>
<Radio value={0}>不通过</Radio>
</Radio.Group>
</Form.Item>
<Form.Item label={isPass ? '审核通过原因' : '审不核通过原因'} rules={[{ required: true, message: '请选择作废日期' }]}>
</Form.Item>
<Form.Item label='' name="opinion" rules={[{ required: true, message: '审核通过意见' }]}>
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} />
</Form.Item>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<Button onClick={() => fetchData('onCancel')} style={{ marginRight: 10 }}>取消</Button>
<Button type="primary" htmlType="submit">保存</Button>
</div>
</Form>
</Modal>
</div>
)
}
export default Examine;
import React, { useRef, useState } from 'react';
import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god';
import EyePreview from '@/components/EyePreview'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { PublicApi } from '@/services/api';
import Submit from '@/components/NiceForm/components/Submit'
const Materials = (props: any) => {
const { applyId, type } = props;
const ref = useRef({});
/***
* @function fetchData 请求表格数据
**/
const isTitle = (title, Price) => {
return (
<div className="a">
<div>{title}</div>
<div>合计金额:¥{Price}</div>
</div>
)
}
// 列表数据
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
let fn;
switch (type) {
/* 查询请款明细 */
case 'pageDetailList':
fn = PublicApi.getContractApplyAmountPageDetailList
break;
case 'submitExamine':
fn = PublicApi.getContractApplyAmountPageToBeAdd
break;
case 'PageToBeExamineOne':
fn = PublicApi.getContractApplyAmountPageToBeExamineOne
break;
case 'ToBeExamineTwo':
fn = PublicApi.getContractApplyAmountPageToBeExamineTwo
break;
case 'pageToBeSubmit':
fn = PublicApi.getContractApplyAmountPageToBeSubmit
break;
// case '':
// fn = PublicApi.postContractApplyAmountExamineStepTwo
// break;
}
fn({
applyId,
...params
}).then(res => {
resolve(res.data)
})
})
}
/* 请款明细 */
const columns: ColumnType<any>[] = [{
title: '单据号/摘要',
dataIndex: type == 'pageDetailList' ? 'orderNO' : 'applyNo',
align: 'center',
render: (text, record) =>
<div>
<EyePreview
type="button"
>
{text}
</EyePreview>
<p>{type == 'pageDetailList' ? record.orderAbstract : record.applyAbstract}</p>
</div>
}, {
title: '单据类型',
dataIndex: 'orderTypeName',
align: 'center',
}, {
title: '单据状态',
dataIndex: 'orderTypeName',
align: 'center',
},
{
title: '单据时间',
dataIndex: 'orderTime',
align: 'center',
defaultSortOrder: 'descend',
},
{
title: isTitle('单据金额', '188999'),
dataIndex: 'orderAmount',
align: 'center',
},
{
title: '含税/税率',
dataIndex: 'isHasTaxName',
align: 'center',
},
{
title: isTitle('已付款', '188999'),
dataIndex: 'payAmount',
align: 'center',
},
{
title: isTitle('已请款待付款', '188999'),
dataIndex: 'unPayApplyAmount',
align: 'center',
},
{
title: isTitle('请款金额', '18000'),
dataIndex: 'applyAmount',
align: 'center',
}]
return (
<div className='ant-card-body'>
<StandardTable
tableProps={{
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
formilyProps={{
ctx: {
inline: false,
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'orderNo',
FORM_FILTER_PATH,
);
},
components: {
DateRangePickerUnix,
Submit
}
}
}}
/>
</div>
)
}
export default Materials;
......@@ -5,14 +5,15 @@ import style from './index.less';
import { ArrowLeftOutlined } from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview'
import statuStyle from '../../common/colorTag'
import { history } from 'umi';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import Submit from '@/components/NiceForm/components/Submit'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { PublicApi } from '@/services/api';
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import Examine from '../components/examine'
import Materials from './components/materials'
const { Link } = Anchor;
const { Step } = Steps;
......@@ -36,6 +37,7 @@ const BillDetails = (props: any) => {
const [applyAbstract, setapplyAbstract] = useState('');
const [reason, setDatareason] = useState('');
const [status, setstatus] = useState<any>()
const [ExamineFlag, setExamineFlag] = useState<boolean>(false);
useEffect(() => {
setTargetOffset(window.innerHeight / 6);
}, []);
......@@ -101,6 +103,17 @@ const BillDetails = (props: any) => {
}
})
}
/* 提交审核的回调 */
const getfetchData = (data) => {
console.log(data)
setExamineFlag(data.ExamineFlag)
if (data.code === 1000) {
setTimeout(() => {
history.goBack()
}, 2000)
}
}
/* 作废 */
const oninvalid = () => {
let res_data: any = {
......@@ -141,69 +154,8 @@ const BillDetails = (props: any) => {
// fetchListData(data)
}, []);
const isTitle = (title, Price) => {
return (
<div className="a">
<div>{title}</div>
<div>合计金额:¥{Price}</div>
</div>
)
}
/* 请款明细 */
const columns: ColumnType<any>[] = [{
title: '单据号/摘要',
dataIndex: 'orderNO',
align: 'center',
render: (text, record) =>
<div>
<EyePreview
type="button"
>
{text}
</EyePreview>
<p>{record.orderAbstract}</p>
</div>
}, {
title: '单据类型',
dataIndex: 'orderTypeName',
align: 'center',
}, {
title: '单据状态',
dataIndex: 'orderTypeName',
align: 'center',
},
{
title: '单据时间',
dataIndex: 'orderTime',
align: 'center',
defaultSortOrder: 'descend',
},
{
title: isTitle('单据金额', '188999'),
dataIndex: 'orderAmount',
align: 'center',
},
{
title: '含税/税率',
dataIndex: 'isHasTaxName',
align: 'center',
},
{
title: isTitle('已付款', '188999'),
dataIndex: 'payAmount',
align: 'center',
},
{
title: isTitle('已请款待付款', '188999'),
dataIndex: 'unPayApplyAmount',
align: 'center',
},
{
title: isTitle('请款金额', '18000'),
dataIndex: 'applyAmount',
align: 'center',
}]
/* 操作人 */
const columnsList: ColumnType<any>[] = [{
title: '序号',
......@@ -250,18 +202,7 @@ const BillDetails = (props: any) => {
},
]
// 列表数据
const fetchData = (params?: any) => {
console.log(params)//可以直接打印参数
return new Promise((resolve, reject) => {
PublicApi.getContractApplyAmountPageDetailList({
applyId,
...params
}).then(res => {
resolve(res.data)
})
})
}
// 流转记录
const fetListData = (params: any) => {
return new Promise((resolve, reject) => {
......@@ -320,7 +261,7 @@ const BillDetails = (props: any) => {
</div>
<div>
{
type == 1 || status != 9 || status != 7 || status != 8 || status != 1 && <Button type="primary" style={{ width: 80, marginRight: 16 }} onClick={() => setIsModalVisible(!isModalVisible)}>单据作废 </Button>
status == 1 && <Button type="primary" style={{ width: 80, marginRight: 16 }} onClick={() => setExamineFlag(!ExamineFlag)}>单据审核 </Button>
}
</div>
......@@ -401,34 +342,7 @@ const BillDetails = (props: any) => {
</div>
</div>
</div>
<div className='ant-card-body'>
<StandardTable
tableProps={{
rowKey: 'id',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
formilyProps={{
ctx: {
inline: false,
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'orderNo',
FORM_FILTER_PATH,
);
},
components: {
DateRangePickerUnix,
Submit
}
}
}}
/>
</div>
<Materials applyId={applyId} type={type} />
</div>
{/* 流转记录 */}
<div id='record' className='ant-card ant-card-bordered'>
......@@ -482,6 +396,13 @@ const BillDetails = (props: any) => {
<p style={{ padding: 10, margin: 0 }}>单据作废原因 <span style={{ color: 'red' }}>*</span></p>
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} onChange={(e) => setreason(e)} />
</Modal>
{/* 审核组建 */}
<Examine
ExamineFlag={ExamineFlag}
getfetchData={getfetchData}
applyId={applyId}
type="submitExamine"
/>
</div>
)
}
......
import React, { useState, useRef, ReactNode } from 'react'
import { history, Link } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Anchor, Radio, Steps, Row, Col, Input, message, Modal, Card } from 'antd';
import statuStyle from '../../common/colorTag'
import { Card } from 'antd';
import { SchemaBli } from '../schema';
import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god';
import { SchemaBli } from '../schema';
import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import EyePreview from '@/components/EyePreview';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { PublicApi } from '@/services/api'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment';
import Examine from '../components/examine'
import "../../constants/index.less"
const { TextArea } = Input;
const Levelpayment: React.FC<{}> = () => {
const ref = useRef<any>({});
const [ExamineFlag, setExamineFlag] = useState<boolean>(false);
const [applyId, setapplyId] = useState('');
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [id, setId] = useState('');
const [isModalVisible, setIsModalVisible] = useState(false);
const today = moment(); // 当天日期
const [isAllMember, setIsAllMember] = useState(true)
const [reason, setDatareason] = useState('')
;
//表头
const columns: ColumnType<any>[] = [{
title: '请款单号/摘要',
dataIndex: 'applyNo',
align: 'center',
render: (text: any, record: any) => {
return (
<div>
<EyePreview
type="button"
// url={`/memberCenter/contract/funds/levelpayment/Details?applyId=${record.id}&type=PageToBeExamineOne`}
url={`/memberCenter/contract/funds/addbill/Details?applyId=${record.id}&type=PageToBeExamineOne`}
>
{text}
</EyePreview>
......@@ -46,77 +43,60 @@ const Levelpayment: React.FC<{}> = () => {
},
}, {
title: '单据时间',
align: 'center',
dataIndex: 'orderTime',
}, {
title: '收款方',
align: 'center',
dataIndex: 'payeeMemberName',
},
{
title: '合同编号',
align: 'center',
dataIndex: 'contractNo',
render: (text: any, record: any) => <EyePreview
type="button"
// type="button"
url={`/memberCenter/contract/manage/QueryList/QueryListdetails?contractId=${record.contractId}`}
>
{text}
</EyePreview>
},
{
title: '合同总金额',
align: 'center',
dataIndex: 'contractAmount',
render: (text: any, record: any) =>
<span>{text}</span>
<p>{text}</p>
},
{
title: '请款金额',
dataIndex: 'applyAmount',
align: 'center',
render: (text: any, record: any) =>
<span>{text}</span>
<p>{text}</p>
},
{
title: '内部状态',
dataIndex: 'statusName',
align: 'center',
render: (text: any, record: any) => {
let component: ReactNode = null
component = (
<>
<span style={statuStyle.success}>已完成签约</span>
</>
)
return component
}
render: (text: any, record: any) =>
<div style={{ display: 'flex', alignItems: 'center' }}>
<span style={{ marginRight: 10, background: '#FFC400', display: "inline-block", width: '6px', height: '6px', borderRadius: '50%' }}></span>
<span>{text}</span>
</div>
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
render: (text: any, record: any) => {
// 作废:待付款、已付款、待提交审核状态的不能作废
return (
<>
{
record.status != 9 || record.status != 7 || record.status != 8 || record.status != 1 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => invalid(record.id)}>作废</span>
}
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/bill/details?applyId=${record.id}&type=1`)}>查看</span>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => isModal(record)}>审核</span>
</>
)
}
}]
const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value)
}
const invalid = (id) => {
setId(id)
setIsModalVisible(!isModalVisible)
const isModal = (record) => {
setExamineFlag(!ExamineFlag)
setapplyId(record.id)
}
// 模拟请求
const fetchData = (params?: any) => {
......@@ -125,7 +105,7 @@ const Levelpayment: React.FC<{}> = () => {
params.startTime = params.startTime ? moment().format('YYYY-MM-DD') : '';
params.endTime = params.endTime ? moment().format('YYYY-MM-DD') : '';
return new Promise((resolve, reject) => {
PublicApi.getContractApplyAmountPageList({
PublicApi.getContractApplyAmountPageToBeExamineOne({
...params,
}).then(res => {
resolve(res.data)
......@@ -133,13 +113,13 @@ const Levelpayment: React.FC<{}> = () => {
})
}
const fetchOptions = (service) => {
return async function () {
const res = await service();
if (res.code === 1000) {
return res.data.map((item) => { return { label: item.name, value: item.status } })
}
return [];
/* 提交审核的回调 */
const getfetchData = (data) => {
console.log(data)
setExamineFlag(data.ExamineFlag)
if (data.code === 1000) {
ref.current.reload()
}
}
const rowSelection: any = {
......@@ -149,37 +129,15 @@ const Levelpayment: React.FC<{}> = () => {
setSelectRow(selectedRows)
}
};
/* 作废 */
const oninvalid = () => {
let res_data: any = {
applyId: id,
reason,
}
if (isAllMember) {
const msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractApplyAmountInvalid(res_data).then(res => {
if (res.code === 1000) {
handleCancel()
ref.current.reload();
}
}).finally(() => {
msg();
})
} else {
handleCancel()
const fetchOptions = (service) => {
return async function () {
const res = await service();
if (res.code === 1000) {
return res.data.map((item) => { return { label: item.name, value: item.status } })
}
return [];
}
}
const setreason = (e) => {
setDatareason(e.target.value);
}
const handleCancel = () => {
setIsModalVisible(!isModalVisible);
};
return (
<PageHeaderWrapper>
<Card>
......@@ -216,14 +174,12 @@ const Levelpayment: React.FC<{}> = () => {
}}
/>
</Card>
<Modal title="单据作废" visible={isModalVisible} onCancel={handleCancel} onOk={oninvalid}>
<Radio.Group onChange={handleIsAllMemberChange} defaultValue={isAllMember} value={isAllMember}>
<Radio value={true}>作废</Radio>
<Radio value={false}>不作废</Radio>
</Radio.Group>
<p style={{ padding: 10, margin: 0 }}>单据作废原因 <span style={{ color: 'red' }}>*</span></p>
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} onChange={(e) => setreason(e)} />
</Modal>
<Examine
ExamineFlag={ExamineFlag}
getfetchData={getfetchData}
applyId={applyId}
type="PageToBeExamineOne"
/>
</PageHeaderWrapper>
)
......
......@@ -69,3 +69,65 @@ export const SchemaBli: any = {
},
}
}
export const addSchemaBli: ISchema = {
type: 'object',
properties: {
applyNo: {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入请款编号',
align: 'flex-end',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
colStyle: {
marginLeft: 20
}
},
properties: {
"applyAbstract": {
type: 'string',
"x-component-props": {
placeholder: '请输入请款摘要'
}
},
"payeeMemberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入收款方'
}
},
"[startTime,endTime]": {
type: 'array',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间', '结束时间'],
disabledDate: current => {
// return current && current < moment().startOf('day')
}
},
},
status: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择内部状态'
},
title: '请选择外部状态',
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},
},
}
}
import React, { useState, useRef, ReactNode } from 'react'
import { history, Link } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Anchor, Radio, Steps, Row, Col, Input, message, Modal, Card } from 'antd';
import statuStyle from '../../common/colorTag'
import { Card } from 'antd';
import { SchemaBli } from '../schema';
import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god';
import { SchemaBli } from '../schema';
import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import EyePreview from '@/components/EyePreview';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { PublicApi } from '@/services/api'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment';
import Examine from '../components/examine'
import "../../constants/index.less"
const { TextArea } = Input;
const Secondpayment: React.FC<{}> = () => {
const ref = useRef<any>({});
const [ExamineFlag, setExamineFlag] = useState<boolean>(false);
const [applyId, setapplyId] = useState('');
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [id, setId] = useState('');
const [isModalVisible, setIsModalVisible] = useState(false);
const today = moment(); // 当天日期
const [isAllMember, setIsAllMember] = useState(true)
const [reason, setDatareason] = useState('')
;
//表头
const columns: ColumnType<any>[] = [{
title: '请款单号/摘要',
dataIndex: 'applyNo',
align: 'center',
render: (text: any, record: any) => {
return (
<div>
<EyePreview
type="button"
url={`/memberCenter/contract/funds/addbill/Details?applyId=${record.id}&type=ToBeExamineTwo`}
>
{text}
</EyePreview>
......@@ -46,77 +42,59 @@ const Secondpayment: React.FC<{}> = () => {
},
}, {
title: '单据时间',
align: 'center',
dataIndex: 'orderTime',
}, {
title: '收款方',
align: 'center',
dataIndex: 'payeeMemberName',
},
{
title: '合同编号',
align: 'center',
dataIndex: 'contractNo',
render: (text: any, record: any) => <EyePreview
type="button"
// type="button"
url={`/memberCenter/contract/manage/QueryList/QueryListdetails?contractId=${record.contractId}`}
>
{text}
</EyePreview>
},
{
title: '合同总金额',
align: 'center',
dataIndex: 'contractAmount',
render: (text: any, record: any) =>
<span>{text}</span>
<p>{text}</p>
},
{
title: '请款金额',
dataIndex: 'applyAmount',
align: 'center',
render: (text: any, record: any) =>
<span>{text}</span>
<p>{text}</p>
},
{
title: '内部状态',
dataIndex: 'statusName',
align: 'center',
render: (text: any, record: any) => {
let component: ReactNode = null
component = (
<>
<span style={statuStyle.success}>已完成签约</span>
</>
)
return component
}
render: (text: any, record: any) =>
<div style={{ display: 'flex', alignItems: 'center' }}>
<span style={{ marginRight: 10, background: '#FFC400', display: "inline-block", width: '6px', height: '6px', borderRadius: '50%' }}></span>
<span>{text}</span>
</div>
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
render: (text: any, record: any) => {
// 作废:待付款、已付款、待提交审核状态的不能作废
return (
<>
{
record.status != 9 || record.status != 7 || record.status != 8 || record.status != 1 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => invalid(record.id)}>作废</span>
}
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/bill/details?applyId=${record.id}&type=1`)}>查看</span>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => isModal(record)}>审核</span>
</>
)
}
}]
const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value)
}
const invalid = (id) => {
setId(id)
setIsModalVisible(!isModalVisible)
const isModal = (record) => {
setExamineFlag(!ExamineFlag)
setapplyId(record.id)
}
// 模拟请求
const fetchData = (params?: any) => {
......@@ -125,7 +103,7 @@ const Secondpayment: React.FC<{}> = () => {
params.startTime = params.startTime ? moment().format('YYYY-MM-DD') : '';
params.endTime = params.endTime ? moment().format('YYYY-MM-DD') : '';
return new Promise((resolve, reject) => {
PublicApi.getContractApplyAmountPageList({
PublicApi.getContractApplyAmountPageToBeExamineTwo({
...params,
}).then(res => {
resolve(res.data)
......@@ -142,6 +120,15 @@ const Secondpayment: React.FC<{}> = () => {
return [];
}
}
/* 提交审核的回调 */
const getfetchData = (data) => {
console.log(data)
setExamineFlag(data.ExamineFlag)
if (data.code === 1000) {
ref.current.reload()
}
}
const rowSelection: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
......@@ -149,37 +136,6 @@ const Secondpayment: React.FC<{}> = () => {
setSelectRow(selectedRows)
}
};
/* 作废 */
const oninvalid = () => {
let res_data: any = {
applyId: id,
reason,
}
if (isAllMember) {
const msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractApplyAmountInvalid(res_data).then(res => {
if (res.code === 1000) {
handleCancel()
ref.current.reload();
}
}).finally(() => {
msg();
})
} else {
handleCancel()
}
}
const setreason = (e) => {
setDatareason(e.target.value);
}
const handleCancel = () => {
setIsModalVisible(!isModalVisible);
};
return (
<PageHeaderWrapper>
<Card>
......@@ -216,14 +172,12 @@ const Secondpayment: React.FC<{}> = () => {
}}
/>
</Card>
<Modal title="单据作废" visible={isModalVisible} onCancel={handleCancel} onOk={oninvalid}>
<Radio.Group onChange={handleIsAllMemberChange} defaultValue={isAllMember} value={isAllMember}>
<Radio value={true}>作废</Radio>
<Radio value={false}>不作废</Radio>
</Radio.Group>
<p style={{ padding: 10, margin: 0 }}>单据作废原因 <span style={{ color: 'red' }}>*</span></p>
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} onChange={(e) => setreason(e)} />
</Modal>
<Examine
ExamineFlag={ExamineFlag}
getfetchData={getfetchData}
applyId={applyId}
type="ToBeExamineTwo"
/>
</PageHeaderWrapper>
)
......
import React, { useState, useRef, ReactNode } from 'react'
import { history, Link } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Anchor, Radio, Steps, Row, Col, Input, message, Modal, Card } from 'antd';
import statuStyle from '../../common/colorTag'
import { Card, message } from 'antd';
import { SchemaBli } from '../schema';
import { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god';
import { SchemaBli } from '../schema';
import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import EyePreview from '@/components/EyePreview';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { PublicApi } from '@/services/api'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment';
import Examine from '../components/examine'
import "../../constants/index.less"
const { TextArea } = Input;
const Submitpayment: React.FC<{}> = () => {
const ref = useRef<any>({});
const [ExamineFlag, setExamineFlag] = useState<boolean>(false);
const [applyId, setapplyId] = useState('');
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [id, setId] = useState('');
const [isModalVisible, setIsModalVisible] = useState(false);
const today = moment(); // 当天日期
const [isAllMember, setIsAllMember] = useState(true)
const [reason, setDatareason] = useState('')
;
//表头
const columns: ColumnType<any>[] = [{
title: '请款单号/摘要',
dataIndex: 'applyNo',
align: 'center',
render: (text: any, record: any) => {
return (
<div>
<EyePreview
type="button"
url={`/memberCenter/contract/funds/addbill/Details?applyId=${record.id}&type=pageToBeSubmit`}
>
{text}
</EyePreview>
......@@ -46,77 +41,72 @@ const Submitpayment: React.FC<{}> = () => {
},
}, {
title: '单据时间',
align: 'center',
dataIndex: 'orderTime',
}, {
title: '收款方',
align: 'center',
dataIndex: 'payeeMemberName',
},
{
title: '合同编号',
align: 'center',
dataIndex: 'contractNo',
render: (text: any, record: any) => <EyePreview
type="button"
// type="button"
url={`/memberCenter/contract/manage/QueryList/QueryListdetails?contractId=${record.contractId}`}
>
{text}
</EyePreview>
},
{
title: '合同总金额',
align: 'center',
dataIndex: 'contractAmount',
render: (text: any, record: any) =>
<span>{text}</span>
<p>{text}</p>
},
{
title: '请款金额',
dataIndex: 'applyAmount',
align: 'center',
render: (text: any, record: any) =>
<span>{text}</span>
<p>{text}</p>
},
{
title: '内部状态',
dataIndex: 'statusName',
align: 'center',
render: (text: any, record: any) => {
let component: ReactNode = null
component = (
<>
<span style={statuStyle.success}>已完成签约</span>
</>
)
return component
}
render: (text: any, record: any) =>
<div style={{ display: 'flex', alignItems: 'center' }}>
<span style={{ marginRight: 10, background: '#C0C4CC', display: "inline-block", width: '6px', height: '6px', borderRadius: '50%' }}></span>
<span>{text}</span>
</div>
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
render: (text: any, record: any) => {
// 作废:待付款、已付款、待提交审核状态的不能作废
return (
<>
{
record.status != 9 || record.status != 7 || record.status != 8 || record.status != 1 && <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => invalid(record.id)}>作废</span>
}
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/bill/details?applyId=${record.id}&type=1`)}>查看</span>
<span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => ApplyAmountSubmit(record.id)}>提交请款单</span>
</>
)
}
}]
const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value)
}
const invalid = (id) => {
setId(id)
setIsModalVisible(!isModalVisible)
const ApplyAmountSubmit = (applyId) => {
const msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractApplyAmountSubmit({ applyId }).then(res => {
console.log(res);
if (res.code === 1000) {
getfetchData({
ExamineFlag: false,
code: 1000
})
}
}).finally(() => {
msg();
});
}
// 模拟请求
const fetchData = (params?: any) => {
......@@ -125,7 +115,7 @@ const Submitpayment: React.FC<{}> = () => {
params.startTime = params.startTime ? moment().format('YYYY-MM-DD') : '';
params.endTime = params.endTime ? moment().format('YYYY-MM-DD') : '';
return new Promise((resolve, reject) => {
PublicApi.getContractApplyAmountPageList({
PublicApi.getContractApplyAmountPageToBeSubmit({
...params,
}).then(res => {
resolve(res.data)
......@@ -133,13 +123,13 @@ const Submitpayment: React.FC<{}> = () => {
})
}
const fetchOptions = (service) => {
return async function () {
const res = await service();
if (res.code === 1000) {
return res.data.map((item) => { return { label: item.name, value: item.status } })
}
return [];
/* 提交审核的回调 */
const getfetchData = (data) => {
console.log(data)
setExamineFlag(data.ExamineFlag)
if (data.code === 1000) {
ref.current.reload()
}
}
const rowSelection: any = {
......@@ -149,37 +139,15 @@ const Submitpayment: React.FC<{}> = () => {
setSelectRow(selectedRows)
}
};
/* 作废 */
const oninvalid = () => {
let res_data: any = {
applyId: id,
reason,
}
if (isAllMember) {
const msg = message.loading({
content: '正在操作',
duration: 0,
});
PublicApi.postContractApplyAmountInvalid(res_data).then(res => {
if (res.code === 1000) {
handleCancel()
ref.current.reload();
}
}).finally(() => {
msg();
})
} else {
handleCancel()
const fetchOptions = (service) => {
return async function () {
const res = await service();
if (res.code === 1000) {
return res.data.map((item) => { return { label: item.name, value: item.status } })
}
return [];
}
}
const setreason = (e) => {
setDatareason(e.target.value);
}
const handleCancel = () => {
setIsModalVisible(!isModalVisible);
};
return (
<PageHeaderWrapper>
<Card>
......@@ -216,14 +184,12 @@ const Submitpayment: React.FC<{}> = () => {
}}
/>
</Card>
<Modal title="单据作废" visible={isModalVisible} onCancel={handleCancel} onOk={oninvalid}>
<Radio.Group onChange={handleIsAllMemberChange} defaultValue={isAllMember} value={isAllMember}>
<Radio value={true}>作废</Radio>
<Radio value={false}>不作废</Radio>
</Radio.Group>
<p style={{ padding: 10, margin: 0 }}>单据作废原因 <span style={{ color: 'red' }}>*</span></p>
<TextArea placeholder="在此输入你的原因,最多60个汉字" maxLength={120} onChange={(e) => setreason(e)} />
</Modal>
<Examine
ExamineFlag={ExamineFlag}
getfetchData={getfetchData}
applyId={applyId}
type="PageToBeSubmit"
/>
</PageHeaderWrapper>
)
......
......@@ -17,6 +17,7 @@ import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePicke
import { PublicApi } from '@/services/api';
import { PlusCircleOutlined, PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons'
import moment from 'moment';
import '../../constants/index.less'
const addList = () => {
const ref = useRef<any>({});
......@@ -136,7 +137,7 @@ const addList = () => {
return (
<div>
{
record.innerStatus == '1' || record.outerStatus == '1' || record.outerStatus == '3' || record.outerStatus == '5' ? <span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }}>修改</span> : ''
record.innerStatus == '1' || record.outerStatus == '1' || record.outerStatus == '3' || record.outerStatus == '5' ? <span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => edit(record)}>修改</span> : ''
}
{/* 只有内部状态为待提交乙方签订合同状态且从未提交过的才可以删除,删除前需要提示,确认后才能删除 */}
{
......@@ -147,6 +148,19 @@ const addList = () => {
)
}
}]
/* 修改 */
const edit = (record) => {
// record.sourceId = record.sourceId;
// record.sourceNo = record.sourceNo;
// record.totalAmount = record.totalAmount;
// record.partyBMemberId = record.partyBMemberId;
// record.partyBRoleId = record.partyARoleId;
// record.partyBName = record.partyBName;
// sessionStorage.setItem('record', JSON.stringify(record));
history.push(`/memberCenter/contract/manage/add/addList/contracAdd?sourceType=${record.sourceType}&id=${record.id}`)
}
/* 提交审核 */
const submit = (id) => {
const msg = message.loading({
......@@ -192,6 +206,9 @@ const addList = () => {
currentRef={ref}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
formilyLayouts={{
justify: 'space-between'
}}
formilyProps={{
ctx: {
inline: false,
......@@ -211,7 +228,7 @@ const addList = () => {
},
layouts: {
order: 2,
span: 24
span: 16
}
}}
formilyChilds={{
......
......@@ -54,13 +54,20 @@ const FormList = (props: any) => {
dataIndex: 'purchaseCount',
key: 'purchaseCount',
align: 'center',
render: (_, record, index) => <Input
style={{
width: 120,
}}
placeholder=""
onChange={(e) => setInput(e, 'purchaseCount', index)}
/>
render: (text, record, index) =>
<Form.Item
name={`isHasTax${index}`}
initialValue={text + index}
rules={[{ required: true, message: '请选择' }]}
>
<Input
style={{
width: 120,
}}
placeholder=""
onChange={(e) => setInput(e, 'purchaseCount', index)}
/>
</Form.Item>
},
{
title: '含税', dataIndex: 'isHasTax', align: 'center',
......@@ -68,7 +75,7 @@ const FormList = (props: any) => {
<Form.Item
name={`isHasTax${index}`}
initialValue={text}
initialValue={text + index}
rules={[{ required: true, message: '请选择' }]}
>
<Select
......
......@@ -26,7 +26,7 @@ const PurchaseList = () => {
render: (text, record) =>
<div>
<EyePreview
type="button"
url={`/memberCenter/procurementAbility/offter/view?id=${record.demandId}&number=${record.demandNO}`}
>
{text}
</EyePreview>
......@@ -102,7 +102,7 @@ const PurchaseList = () => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }} onClick={() => like(record)}>创建采购询价合同</span>
<span style={{ color: '#00B37A', cursor: 'pointer' }} onClick={() => history.push(`/memberCenter/contract/manage/purchase/details?contractId=${record.id}`)}>查看</span>
{/* <span style={{ color: '#00B37A', cursor: 'pointer' }} onClick={() => history.push(`/memberCenter/contract/manage/purchase/details?contractId=${record.id}`)}>查看</span> */}
</div>
)
}
......@@ -126,7 +126,7 @@ const PurchaseList = () => {
record.partyBRoleId = record.awardRoleId;
record.partyBName = record.awardName;
sessionStorage.setItem('record', JSON.stringify(record));
history.push(`/memberCenter/contract/manage/add/addList/contracAdd?contractId=${record.id}&sourceType=1`)
history.push(`/memberCenter/contract/manage/add/addList/contracAdd?contractId=${record.id}&type=list`)
};
// 列表数据
const fetchData = (params?: any) => {
......@@ -169,7 +169,8 @@ const PurchaseList = () => {
DateRangePickerUnix,
Submit
}
}
},
}}
/>
</Card>
......
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