Commit 1dbcdafe authored by alwayOnlie's avatar alwayOnlie

优化代码

parent 6d3e201c
...@@ -301,28 +301,11 @@ const Details = (props: any) => { ...@@ -301,28 +301,11 @@ const Details = (props: any) => {
</div> </div>
</div> </div>
{ {
type === 'submitExamine' && type &&
<div className="btn" style={{ marginRight: "20px" }}>
<Button type="primary" onClick={() => submitExamine()}>审核</Button>
</div>
}
{
type === 'levelexamine' &&
<div className="btn" style={{ marginRight: "20px" }}>
<Button type="primary" onClick={() => submitExamine()}>审核</Button>
</div>
}
{
type === 'pageToBeExamineTwo' &&
<div className="btn" style={{ marginRight: "20px" }}>
<Button type="primary" onClick={() => submitExamine()}>审核</Button>
</div>
}
{
type === 'Sign' &&
<div className="btn" style={{ marginRight: "20px" }}> <div className="btn" style={{ marginRight: "20px" }}>
<Button type="primary" onClick={() => submitExamine()}>签订合同</Button> <Button type="primary" onClick={() => submitExamine()}>{type === 'Sign' ? '签订合同' : '审核'}</Button>
</div> </div>
} }
</Anchor> </Anchor>
...@@ -335,12 +318,9 @@ const Details = (props: any) => { ...@@ -335,12 +318,9 @@ const Details = (props: any) => {
<Basic basicInfo={basicInfo} /> <Basic basicInfo={basicInfo} />
{/* 执行情况 */} {/* 执行情况 */}
{ {
type == 'implement' && type == 'implement' ?
<SituationList contractId={contractId} /> <SituationList contractId={contractId} />
} : <PurchaseList contractId={contractId} type={type} Refresh={Refresh} />
{/* 采购材料 */}
{
type != 'implement' && <PurchaseList contractId={contractId} type={type} Refresh={Refresh} />
} }
{/* 付款计划 */} {/* 付款计划 */}
<PaymentCard IsShow={true} payPlanList={payPlanList} basics={basicInfo} contractId={contractId} /> <PaymentCard IsShow={true} payPlanList={payPlanList} basics={basicInfo} contractId={contractId} />
...@@ -370,12 +350,10 @@ const Details = (props: any) => { ...@@ -370,12 +350,10 @@ const Details = (props: any) => {
} }
{/* 流转记录 */} {/* 流转记录 */}
{ {
type != 'implement' && <CirculationList contractId={contractId} /> type != 'implement' ? <CirculationList contractId={contractId} /> : <DetailedList contractId={contractId} />
} }
{/* 请款统计 */} {/* 请款统计 */}
{
type == 'implement' && <DetailedList contractId={contractId} />
}
</div> </div>
{/* 提交审核 */} {/* 提交审核 */}
<Modal footer={null} title={type == 'Sign' ? '签订合同' : '提交审核'} visible={Visible} onOk={() => setIsModalVisible(!Visible)} onCancel={() => setIsModalVisible(!Visible)}> <Modal footer={null} title={type == 'Sign' ? '签订合同' : '提交审核'} visible={Visible} onOk={() => setIsModalVisible(!Visible)} onCancel={() => setIsModalVisible(!Visible)}>
......
import React, { useState, useRef, ReactNode } from 'react' import React, { useState, useRef, ReactNode } from 'react'
import { history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Radio, 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 { ColumnType } from 'antd/lib/table/interface';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { SchemaBli } from '../schema'; import { SchemaBli } from '../schema';
......
import React, { useEffect, useState, useRef } from 'react'; import React, { useEffect, useState } from 'react';
import { Anchor, Radio, Steps, Row, Col, Input, Button, message, Modal } from 'antd'; import { Anchor, Radio, Steps, Input, Button, message, Modal } from 'antd';
import style from './index.less'; import style from './index.less';
import { ArrowLeftOutlined } from '@ant-design/icons'; import { ArrowLeftOutlined } from '@ant-design/icons';
import { history } from 'umi'; import { history } from 'umi';
...@@ -236,9 +236,7 @@ const BillDetails = (props: any) => { ...@@ -236,9 +236,7 @@ const BillDetails = (props: any) => {
</div> </div>
<Materials applyId={applyId} type={type} /> <Materials applyId={applyId} type={type} />
</div> </div>
<ColumnsList applyId={applyId} /> <ColumnsList applyId={applyId} />
</div> </div>
<Modal title="单据作废" visible={isModalVisible} onCancel={handleCancel} onOk={oninvalid}> <Modal title="单据作废" visible={isModalVisible} onCancel={handleCancel} onOk={oninvalid}>
<Radio.Group onChange={handleIsAllMemberChange} defaultValue={isAllMember} value={isAllMember}> <Radio.Group onChange={handleIsAllMemberChange} defaultValue={isAllMember} value={isAllMember}>
......
...@@ -205,12 +205,10 @@ const QueryList = () => { ...@@ -205,12 +205,10 @@ const QueryList = () => {
} else { } else {
return res.data.innerList.map((item) => { return { label: item.message, value: item.code } }) return res.data.innerList.map((item) => { return { label: item.message, value: item.code } })
} }
} }
return []; return [];
} }
} }
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<Card> <Card>
......
import React, { useEffect, useState, useRef } from 'react'; import React, { useEffect, useState, useRef } from 'react';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { Anchor, Radio, Steps, Row, Table, Space, Typography, Button } from 'antd'; import { Anchor, Radio, Steps, Table, Space, Typography, Button } from 'antd';
import style from './index.less'; import style from './index.less';
import { ArrowLeftOutlined } from '@ant-design/icons'; import { ArrowLeftOutlined } from '@ant-design/icons';
import { history } from 'umi'; import { history } from 'umi';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import ExamineFrom from '../../components/examine' import ExamineFrom from '../../components/examine'
import Basic from '../../components/detailCard/basic' import Basic from '../../components/detailCard/basic'
import PaymentCard from '../../components/detailCard/PaymentCard'
import { import {
FileWordFilled FileWordFilled
} from '@ant-design/icons' } from '@ant-design/icons'
...@@ -62,6 +59,7 @@ const Details = (props: any) => { ...@@ -62,6 +59,7 @@ const Details = (props: any) => {
/* 总金额 */ /* 总金额 */
const [tobidCount, settobidCount] = useState<number>(0); const [tobidCount, settobidCount] = useState<number>(0);
const [bidAmount, setbidAmount] = useState<number>(0); const [bidAmount, setbidAmount] = useState<number>(0);
const [btnText, setBtnText] = useState('审核');
const [tabPane] = useState([ const [tabPane] = useState([
{ id: 'progress', title: '流转进度' }, { id: 'progress', title: '流转进度' },
{ id: 'process', title: '基本流程' }, { id: 'process', title: '基本流程' },
...@@ -178,7 +176,6 @@ const Details = (props: any) => { ...@@ -178,7 +176,6 @@ const Details = (props: any) => {
...params, ...params,
contractId contractId
}).then(res => { }).then(res => {
// bidCount
let tobidCount = 0; let tobidCount = 0;
let bidAmount = 0; let bidAmount = 0;
res.data.data.map(item => { res.data.data.map(item => {
...@@ -195,6 +192,8 @@ const Details = (props: any) => { ...@@ -195,6 +192,8 @@ const Details = (props: any) => {
const onExpand = expandedKeys => { const onExpand = expandedKeys => {
}; };
useEffect(() => { useEffect(() => {
let text = type == 'Signacontract' ? '签订合同' : '审核';
setBtnText(text);
setTargetOffset(window.innerHeight / 6); setTargetOffset(window.innerHeight / 6);
getDetail() getDetail()
let data = { let data = {
...@@ -321,30 +320,11 @@ const Details = (props: any) => { ...@@ -321,30 +320,11 @@ const Details = (props: any) => {
</div> </div>
<div> <div>
{ {
type === 'ManageSubmitExamine' && type &&
<div className="btn" style={{ marginRight: "20px" }}>
<Button type="primary" onClick={() => submitExamine()}>审核</Button>
</div>
}
{
type === 'ManageExamineStepOne' &&
<div className="btn" style={{ marginRight: "20px" }}>
<Button type="primary" onClick={() => submitExamine()}>审核</Button>
</div>
}
{
type === 'PageToBeExamineStepTwo' &&
<div className="btn" style={{ marginRight: "20px" }}> <div className="btn" style={{ marginRight: "20px" }}>
<Button type="primary" onClick={() => submitExamine()}>审核</Button> <Button type="primary" onClick={() => submitExamine()}>{btnText}</Button>
</div> </div>
} }
{
type === 'Signacontract' &&
<div className="btn" style={{ marginRight: "20px" }}>
<Button type="primary" onClick={() => submitExamine()}>签订合同</Button>
</div>
}
</div> </div>
</Anchor> </Anchor>
<div id='content' className={style.card}> <div id='content' className={style.card}>
...@@ -406,46 +386,7 @@ const Details = (props: any) => { ...@@ -406,46 +386,7 @@ const Details = (props: any) => {
</div> </div>
</div> </div>
{/* 付款计划 */} {/* 付款计划 */}
<div id='conditions' className='ant-card ant-card-bordered'> <PaymentCard IsShow={true} payPlanList={payPlanList} basics={basicInfo} contractId={contractId} />
<div className='ant-card-head'>
<div className='ant-card-head-wrapper'>
<div className='ant-card-head-wrapper'>
付款计划
</div>
</div>
</div>
<div className='ant-card-body '>
<Row gutter={[8, 8]}>
<div className={style.warp}>
{
payPlanList.map((item: any, index: number) => {
return (
<div className={style.warp_item} key={index}>
<div className={style.title}>付款比例</div>
<div className={style.proportion}>{item.payRatio}%</div>
<div className={style.Price}>¥{item.payAmount}</div>
<div className={style.warp_List}>
<div className={style.warp_ListItem}>
<div className={style.label}>付款阶段</div>
<div className={style.text}>{item.payStage}</div>
</div>
<div className={style.warp_ListItem}>
<div className={style.label}>预计付款时间:</div>
<div className={style.text}>{item.expectPayTime}</div>
</div>
<div className={style.warp_ListItem}>
<div className={style.label}>付款方式:</div>
<div className={style.text}>{item.payWayName}</div>
</div>
</div>
</div>
)
})
}
</div>
</Row>
</div>
</div>
{/* 交易条件 */} {/* 交易条件 */}
<div id='docking' className='ant-card ant-card-bordered'> <div id='docking' className='ant-card ant-card-bordered'>
<div className='ant-card-head'> <div className='ant-card-head'>
......
...@@ -19,7 +19,6 @@ const Information = (props: any) => { ...@@ -19,7 +19,6 @@ const Information = (props: any) => {
* */ * */
useEffect(() => { useEffect(() => {
basic.sourceType = String(basic.sourceType); basic.sourceType = String(basic.sourceType);
console.log(basic)
if (basic.contractNo) { if (basic.contractNo) {
if (oldContractId) { if (oldContractId) {
let data = { oldContractNo: basic.contractNo } let data = { oldContractNo: basic.contractNo }
......
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