Commit dded1d0c authored by alwayOnlie's avatar alwayOnlie

修改bug

parent a57bc860
......@@ -26,43 +26,40 @@ const DrawerModal: React.FC<Iprops> = ({
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const PaymentList: any = [
{
title: '请款单号/摘要', dataIndex: 'applyNo', align: 'center',
title: '请款单号/摘要', dataIndex: 'applyNo', align: 'left',
render: (text: any, record: any) => {
return (
<div>
<EyePreview
url={`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/preview?id=${record.orderId}`}
>
{text}
</EyePreview>
<p> {text}</p>
<p>{record.applyAbstract}</p>
</div>
);
},
},
{ title: '状态', dataIndex: 'statusName', align: 'center', },
{ title: '状态', dataIndex: 'statusName', align: 'left', },
{
title: '请款时间', dataIndex: 'orderTime', align: 'center',
title: '请款时间', dataIndex: 'orderTime', align: 'left',
render: (text: any, record: any) => (
<div>{moment(Number(text)).format('YYYY-MM-DD')}</div>
)
},
{
title: '请款金额', dataIndex: 'applyAmount', align: 'center',
title: '请款金额', dataIndex: 'applyAmount', align: 'left',
render: (text: any, record: any) => (
<div>{text}</div>
)
},
{
title: '付款时间', dataIndex: 'payTime', align: 'center',
title: '付款时间', dataIndex: 'payTime', align: 'left',
render: (text: any, record: any) => (
<div>{moment(Number(text)).format('YYYY-MM-DD')}</div>
)
},
{
title: '付款金额', dataIndex: 'payAmount', align: 'center',
title: '付款金额', dataIndex: 'payAmount', align: 'left',
render: (text: any, record: any) => (
<div>{text}</div>
<div>{text ? text : 0}</div>
)
},
]
......
......@@ -64,7 +64,6 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
setProduct(params);
GetCommodityAttribute(params.id);
setFlag(false);
}
/** 关闭 */
......
......@@ -64,6 +64,11 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
RowCtl.setSelectRow([]);
RowCtl.setSelectedRowKeys([]);
}
const onconfirm = () => {
confirm(RowCtl.selectRow[0])
RowCtl.setSelectRow([]);
RowCtl.setSelectedRowKeys([]);
}
return (
<Drawer
visible={visible}
......@@ -79,11 +84,12 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
<Button onClick={onClose} style={{ marginRight: 8 }}>
取消
</Button>
<Button onClick={() => confirm(RowCtl.selectRow[0])} type="primary">
<Button onClick={onconfirm} type="primary">
确定
</Button>
</div>
}
destroyOnClose
>
<StandardTable
currentRef={ref}
......
......@@ -66,9 +66,10 @@ const Details = (props: any) => {
let { basics, outerTaskStepList, innerTaskStepList, payPlanList, contractText } = res.data
let contractAbstract = res.data.basics.contractAbstract;
setsignatureLogId(basics.signatureLogId)
const basicInfo: any = {
col1: [
{ label: '合同编号', extra: basics.contractNo ? basics.contractNo : '', url: `/memberCenter/contract/manage/QueryList/QueryListdetails?contractId=${contractId}` },
{ label: '合同编号', extra: basics.contractNo ? basics.contractNo : '', },
{ label: '合同摘要', extra: basics.contractAbstract ? basics.contractAbstract : '' },
{ label: '外部状态', extra: basics.outerStatusName ? basics.outerStatusName : '', type: 'StatusTag' },
{ label: '内部状态', extra: basics.innerStatusName ? basics.innerStatusName : '' },
......@@ -83,6 +84,9 @@ const Details = (props: any) => {
{ label: '合同有效期:', extra: `${basics.startTime}${basics.endTime}` },
],
}
if (type) {
basicInfo.col1[0].url = `/memberCenter/contract/coordination/coordinationList/details?contractId=${contractId}`
}
if (basics.sourceId) {
switch (basics.sourceType) {
case 1: {
......
......@@ -33,6 +33,7 @@ const purchaseList: React.FC<Iprops> = ({
const [record, setRecord] = useState<any>({});
const [visible, setVisible] = useState<boolean>(false);
const [total, setTotal] = useState(0);
const [current, setcurrent] = useState(1); // 当前页
const columnsTab = (Numberamount, Totalamount) => {
......@@ -168,8 +169,8 @@ const purchaseList: React.FC<Iprops> = ({
PublicApi.postContractCoordinationAssociatedOfferGoods(res_data).then(res => {
if (res.code === 1000) {
let data = {
current: 1,
pageSize: 10
current: current,
pageSize: 8
}
fetchListData(data)
}
......@@ -198,6 +199,7 @@ const purchaseList: React.FC<Iprops> = ({
current: current,
pageSize: 8
}
setcurrent(current)
fetchListData(data)
};
return (
......
......@@ -131,7 +131,7 @@ const situationList: React.FC<Iprops> = ({ contractId }) => {
render: (text, record) => (
<Space direction='vertical'>
<Text>{record.isHasTax == 1 ? '是' : '否'}</Text>
<Text>%{text}</Text>
<Text>{text}%</Text>
</Space>
)
},
......
import React, { useState, useRef, useEffect } from 'react'
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Tabs, Button } from 'antd';
import { Card, Tabs, Button, message, } from 'antd';
import { createFormActions } from '@formily/antd';
import {
SaveOutlined,
......@@ -18,6 +18,7 @@ const { TabPane } = Tabs;
const Add: React.FC<{}> = (props: any) => {
const { location: { query: { sourceType, paymentId, type } } } = props;
console.log(type)
const [Loading, setLoading] = useState<any>(false)
const currentBasic = useRef<any>({});
const detailData = useRef<any>({});
const [flag, setflag] = useState<any>(false);
......@@ -50,19 +51,31 @@ const Add: React.FC<{}> = (props: any) => {
]
const submit = async () => {
const basicsVO = await currentBasic.current.get();
const detailList = await Object.keys(detailData.current).length != 0 ? await detailData.current.get() : [];
basicsVO.data.sourceType = sourceType ? sourceType : 3;
let data = {
basics: basicsVO.data,
detailList: detailList,
}
PublicApi.postContractApplyAmountSave(data).then(res => {
console.log(res);
if (res.code === 1000) {
history.push('/memberCenter/contract/funds/addbill')
let msg = message.loading({
content: '正在操作',
duration: 0,
});
setLoading(true);
if (!Loading) {
const basicsVO = await currentBasic.current.get();
const detailList = await Object.keys(detailData.current).length != 0 ? await detailData.current.get() : [];
basicsVO.data.sourceType = sourceType ? sourceType : 3;
let data = {
basics: basicsVO.data,
detailList: detailList,
}
})
PublicApi.postContractApplyAmountSave(data).then(res => {
console.log(res);
setLoading(false);
if (res.code === 1000) {
history.push('/memberCenter/contract/funds/addbill')
}
}).finally(() => {
msg();
});
}
}
......
......@@ -256,7 +256,7 @@ const table = (props: any) => {
PublicApi.getContractApplyAmountContractOrderPageList({ ...params }).then(res => {
if (res.code == 1000) {
if (res.data.data) {
res.data.data.findIndex((item, index) => {
res.data.data.findIndex((item: any, index) => {
item.orderTime = item.orderTime ? moment().format('YYYY-MM-DD') : '';
item.keyId = index + 1;
})
......
......@@ -87,7 +87,7 @@ const AddbillList: React.FC<{}> = () => {
// 状态, 1.待提交审核, 2.待审核(一级), 3.审核不通过(一级), 4.待审核(二级), 5.审核不通过(二级), 6.待提交财务付款, 7.待付款, 8.已付款, 9.已作废
// 删除:只有内部状态为待提交审核状态且从未提交审核的才可以删除,删除前需要提示,确认后才能删除
let node;
let edit = <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/editbill/edit?paymentId=${record.id}&type=edit`)}>修改</span>;
let edit = <span style={{ color: '#00B37A', marginRight: 20, cursor: 'pointer', }} onClick={() => history.push(`/memberCenter/contract/funds/editbill/edit?id=${record.id}`)}>修改</span>;
switch (record.status) {
case 1:
node = edit;
......@@ -101,6 +101,7 @@ const AddbillList: React.FC<{}> = () => {
default:
break;
}
console.log(node, '1231312')
return (
<>
{
......
......@@ -87,7 +87,7 @@ const Bill: React.FC<{}> = () => {
render: (text: any, record: any) => {
let component: ReactNode = null
component = (
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'end' }}>
<span style={{ marginRight: 10, background: '#FFC400', display: "inline-block", width: '6px', height: '6px', borderRadius: '50%' }}></span>
<span>{text}</span>
</div>
......
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';
import { Button, Table, Input, Space, Typography, Drawer } from 'antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { StandardTable } from 'god';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { Schema } from "./schema"
import { PublicApi } from '@/services/api';
import moment from 'moment';
import {
PlusOutlined
} from '@ant-design/icons'
import { PublicApi } from '@/services/api';
const { Text } = Typography;
const table = (props: any) => {
const { flag, id, currentRef, sourceType } = props;
const { currentRef, list, sourceType, contractId } = props;
const refs = useRef({});
/**
* @param visible 显示添加对应单据状态
......@@ -29,7 +24,6 @@ const table = (props: any) => {
* @param tabcolumns 单据表格
*/
const [visible, setvisible] = useState<boolean>(false);
// const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'orderId' });
const [toorderAmount, settoorderAmount] = useState<number>(0);
const [topayAmount, settopayAmount] = useState<number>(0);
const [tounPayApplyAmount, settounPayApplyAmount] = useState<number>(0);
......@@ -41,8 +35,8 @@ const table = (props: any) => {
title: '单据编号/摘要', dataIndex: 'applyNo', align: 'center',
render: (text, record) =>
<div>
<div> {text}</div>
{/* <p>{record.applyAbstract}</p> */}
<div> {record.orderNO}</div>
<p>{record.orderAbstract}</p>
</div>
},
{
......@@ -54,7 +48,7 @@ const table = (props: any) => {
},
{
title: '单据状态', dataIndex: 'outerStatusName', align: 'center',
title: '单据状态', dataIndex: 'statusName', align: 'center',
render: (text) =>
<div>
<div>{text}</div>
......@@ -95,7 +89,7 @@ const table = (props: any) => {
<Text>合计: ¥{topayAmount}</Text>
</Space>
),
render: (text, record) =>
render: (text) =>
<div>
<div>{text ? text : 0}</div>
</div>
......@@ -129,6 +123,7 @@ const table = (props: any) => {
width: 130,
}}
placeholder=""
value={item.applyAmount}
onChange={(e) => onSelectChange(e, 'applyAmount', index)}
onBlur={() => Amount()}
/>
......@@ -140,17 +135,10 @@ const table = (props: any) => {
render: (_, item, index) => <a onClick={() => Delete(item, index)}>删除</a>,
}
];
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const rowSelection: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows)
setSelectedRowKeys(selectedRowKeys)
console.log(selectedRowKeys, selectedRows, 'rowSelection')
}
};
useEffect(() => {
setPlanList(list)
}, [list])
const onSelectChange = (e, name, idx) => {
let item = [...PlanList];
......@@ -184,7 +172,6 @@ const table = (props: any) => {
settounPayApplyAmount(tounPayApplyAmount)
settoorderAmount(toorderAmount)
}
/* 删除 */
const Delete = (elm, idx) => {
const dataSource = [...PlanList];
......@@ -192,6 +179,36 @@ const table = (props: any) => {
setPlanList(List)
};
const Confirm = () => {
setPlanList(selectRow)
setvisible(false)
Amount()
}
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
let data = [];
console.log(PlanList)
PlanList.map((item: any) => {
data.push(
{
id: item.id,
applyAmount: item.applyAmount,
orderId: item.orderId,
orderNO: item.applyNo,
isHasTax: item.isHasTax,
taxRate: item.taxRate,
executeId: item.id ? item.id : '',
}
)
})
resolve(data)
})
}
})
const columnsList: any = [
{
title: '单据编号/摘要',
......@@ -246,17 +263,13 @@ const table = (props: any) => {
</div>
},
]
/***
* @function fetchData 请求表格数据
**/
const fetchData = (params: any) => {
params.contractId = id;
params.contractId = contractId;
return new Promise(resolve => {
PublicApi.getContractApplyAmountContractOrderPageList({ ...params }).then(res => {
if (res.code == 1000) {
if (res.data.data) {
res.data.data.findIndex((item, index) => {
res.data.data.findIndex((item: any, index) => {
item.orderTime = item.orderTime ? moment().format('YYYY-MM-DD') : '';
item.keyId = index + 1;
})
......@@ -266,58 +279,28 @@ const table = (props: any) => {
})
})
}
const Confirm = () => {
setPlanList(selectRow)
setvisible(false)
Amount()
}
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
let data = [];
console.log(PlanList)
PlanList.map((item: any) => {
data.push(
{
id: 0,
applyAmount: item.applyAmount,
orderId: item.orderId,
orderNO: item.applyNo,
isHasTax: item.isHasTax,
taxRate: item.taxRate,
executeId: item.id ? item.id : '',
}
)
})
resolve(data)
})
}
})
useEffect(() => {
let PlanList = JSON.parse(sessionStorage.getItem('list'))
console.log(PlanList, sourceType)
if (sourceType == 2) {
PlanList.map((item) => {
item.applyNo = item.orderNO;
item.outerStatusName = item.orderStatusName;
// item.isHasTax = item.isHasTax == '是' ? 1 : 0;
})
setPlanList(PlanList)
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const rowSelection: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectRow(selectedRows)
setSelectedRowKeys(selectedRowKeys)
console.log(selectedRowKeys, selectedRows, 'rowSelection')
}
}, [])
};
return (
<div className="table">
{
flag && <div style={{ padding: 15, }} onClick={() => setvisible(!visible)} >
sourceType == 3 && <div style={{ padding: 15, }} onClick={() => setvisible(!visible)} >
<Button block type='dashed'><PlusOutlined />选择待请款单据</Button>
</div>
}
<Table
columns={tabcolumns}
dataSource={PlanList}
rowKey="keyId"
dataSource={list}
rowKey="id"
style={{
width: "100%"
}}
......
import React, { useState, useRef, useEffect } from 'react'
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Tabs, Button } from 'antd';
import { createFormActions } from '@formily/antd';
import { Card, Tabs, Button, message } from 'antd';
import {
SaveOutlined,
} from '@ant-design/icons'
......@@ -10,41 +9,35 @@ import AddInfo from './components/info'
import ReutrnEle from '@/components/ReturnEle';
import InfoTable from './components/table'
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
const { TabPane } = Tabs;
const Editbill: React.FC<{}> = (props: any) => {
const { location: { query: { sourceType, paymentId, type } } } = props;
console.log(type)
const { location: { query: { id } } } = props;
const currentBasic = useRef<any>({});
const detailData = useRef<any>({});
const [flag, setflag] = useState<any>(false);
const [id, setid] = useState('');
const [basicsData, setbasicsData] = useState<any>('');
const [list, setList] = useState<any>([]);
const [Loading, setLoading] = useState<any>(false)
/* 判断是不是手工单 */
const getflag = (data) => {
setflag(data.flag)
setid(data.selectRow.id)
}
const TabList = [
{
name: '基本信息', components:
name: '基本信息',
components:
<AddInfo
currentRef={currentBasic}
getcontractId={getflag}
sourceType={sourceType}
paymentId={paymentId}
type={type}
basicsData={basicsData}
/>
},
{
name: '请款明细', components:
<InfoTable
flag={flag}
id={id}
currentRef={detailData}
sourceType={sourceType}
list={list}
sourceType={basicsData.sourceType}
contractId={basicsData.contractId}
/>
},
]
......@@ -52,21 +45,45 @@ const Editbill: React.FC<{}> = (props: any) => {
const submit = async () => {
const basicsVO = await currentBasic.current.get();
const detailList = await Object.keys(detailData.current).length != 0 ? await detailData.current.get() : [];
basicsVO.data.sourceType = sourceType ? sourceType : 3;
let msg = message.loading({
content: '正在操作',
duration: 0,
});
let data = {
basics: basicsVO.data,
detailList: detailList,
}
PublicApi.postContractApplyAmountSave(data).then(res => {
console.log(res);
if (res.code === 1000) {
history.push('/memberCenter/contract/funds/addbill')
}
})
if (!Loading) {
setLoading(true);
PublicApi.postContractApplyAmountSave(data).then(res => {
if (res.code === 1000) {
setLoading(false);
history.push('/memberCenter/contract/funds/addbill')
}
}).finally(() => {
msg();
});
}
}
useEffect(() => {
const applyId = id;
PublicApi.getContractApplyAmountGetDetail({ applyId }).then(res => {
if (res.code == 1000) {
setbasicsData(res.data.basics);
}
})
let data: any = {
pageSize: 99,
current: 1,
}
PublicApi.getContractApplyAmountPageDetailList({
applyId,
...data
}).then(res => {
setList(res.data.data)
})
}, [])
return (
<PageHeaderWrapper
title="修改请款单"
......@@ -80,7 +97,7 @@ const Editbill: React.FC<{}> = (props: any) => {
<Tabs defaultActiveKey="0" type="card" size="small">
{
TabList.map((item, index) => (
<TabPane tab={item.name} key={index}>
<TabPane tab={item.name} key={index} forceRender>
{item.components}
</TabPane>
))
......
......@@ -354,6 +354,8 @@ const FormList = (props: any) => {
console.log(item)
setData(item)
}
const onExpand = expandedKeys => {
};
return (
<div className={styles.box}>
{
......@@ -361,18 +363,20 @@ const FormList = (props: any) => {
<Button block type='dashed'><PlusOutlined />选择采购物料</Button>
</div>
}
<Table
rowKey={'index'}
dataSource={dataList}
columns={columnsTab}
rowKey='id'
expandable={{
expandedRowRender: record => Object.keys(Row).length === 0 ? null : listItem(record),
expandedRowRender: (record, index) => listItem(record),
onExpand: record => onExpand(record)
}}
dataSource={dataList}
style={{
width: "100%"
}}
/>
{/* 模态框 */}
<Modal title="选择采购物料" width={900} visible={isModalVisible} onOk={handleOk} onCancel={handleCancel}>
<StandardTable
......
......@@ -182,7 +182,7 @@ const Details = (props: any) => {
render: (text) => {
return (
<div>
%{text}
{text}%
</div>
)
}
......@@ -221,7 +221,7 @@ const Details = (props: any) => {
title: (
<Space direction='vertical'>
<Text>金额(不含税)</Text>
<Text>合计: {bidAmount}</Text>
<Text>合计:{bidAmount}</Text>
</Space>
),
render: (text) => {
......@@ -448,7 +448,7 @@ const Details = (props: any) => {
</div>
</div>
{/* 付款计划 */}
<PaymentCard IsShow={true} payPlanList={payPlanList} basics={basicInfo} contractId={contractId} />
<PaymentCard IsShow={false} payPlanList={payPlanList} basics={basicInfo} contractId={contractId} />
{/* 交易条件 */}
<div id='docking' className='ant-card ant-card-bordered'>
<div className='ant-card-head'>
......
......@@ -103,7 +103,7 @@ const FormList = (props: any) => {
item.payWay != 3 &&
<div className={styles.setBox}>
{/* payParam */}
<InputNumber defaultValue={item.payWay} placeholder='' onChange={(e) => onSelectChange(e, 'payParam', index)} width={60} max={31} />
<InputNumber defaultValue={item.payParam} placeholder='' onChange={(e) => onSelectChange(e, 'payParam', index)} width={60} max={31} />
<span>{item.payWay == 2 ? '号' : item.payWay == 1 ? '天' : ''}</span>
</div>
}
......
......@@ -70,13 +70,32 @@ const Signacontract = () => {
dataIndex: 'sourceNo',
align: 'left',
render: (text, record) => {
let url = '';
if (record.sourceId) {
switch (record.sourceType) {
case 1: {
if (record.turn && record.sourceId) {
url = `/memberCenter/procurementAbility/confirmOffer/offerInquire/preview?id=${record.sourceId}&turn=${record.turn}`
}
break;
};
case 2: {
url = `/memberCenter/procurementAbility/callForBids/callForBidsSearch/detail?id=${record.sourceId}`
break;
};
case 3: {
url = `/memberCenter/procurementAbility/purchaseBid/search/detail?id=${record.sourceId}&number=${record.sourceNo}`
break;
};
}
}
return (
<div>
{
text && record.sourceId &&
<EyePreview
type={record.sourceType == 1 ? record.sourceId ? 'link' : "button" : 'link'}
url={record.sourceType == 1 ? `/memberCenter/procurementAbility/confirmOffer/offerInquire/demand/preview?id=${record.sourceId}&number${record.sourceNo}` : `/memberCenter/procurementAbility/callForBids/callForBidsSearch/detail?id=${record.sourceId}`}
type={record.sourceId ? 'link' : "button"}
url={url}
>
{text}
</EyePreview>
......
......@@ -158,7 +158,7 @@ const BidRequirement: React.FC<Iprops> = (props: any) => {
<Form.Item
label="报名要求附件"
name="demandUrls"
// rules={[{ required: true, message: '请上传报名要求附件' }]}
// rules={[{ required: true, message: '请上传报名要求附件' }]}
>
<div className={styles.upload_data}>
{files.length > 0 && files.map((v, index) => (
......
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