Commit 63c41d6f authored by alwayOnlie's avatar alwayOnlie

修改bug

parent a35473d9
import React, { useState } from 'react'; import React, { ReactNode, useState } from 'react';
import { Button, Input, Form, Radio, message, Modal } from 'antd' import { Button, Input, Form, Radio, message, Modal, Upload, Row, Col, } from 'antd'
const { TextArea } = Input const { TextArea } = Input
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { IAntdSchemaFormProps } from '@formily/antd' import { IAntdSchemaFormProps } from '@formily/antd'
import { UploadOutlined } from '@ant-design/icons';
export interface Iprops extends IAntdSchemaFormProps { export interface Iprops extends IAntdSchemaFormProps {
/* 显示隐藏 */ /* 显示隐藏 */
...@@ -17,6 +18,7 @@ export interface Iprops extends IAntdSchemaFormProps { ...@@ -17,6 +18,7 @@ export interface Iprops extends IAntdSchemaFormProps {
agreeText?: string, agreeText?: string,
/* 不同意 */ /* 不同意 */
disagree?: string, disagree?: string,
} }
/* 合同审核组建 */ /* 合同审核组建 */
const Examine: React.FC<Iprops> = ({ const Examine: React.FC<Iprops> = ({
...@@ -26,8 +28,10 @@ const Examine: React.FC<Iprops> = ({ ...@@ -26,8 +28,10 @@ const Examine: React.FC<Iprops> = ({
type, type,
agreeText, agreeText,
disagree, disagree,
}) => { }) => {
const [isPass, setIsAllMember] = useState(1) const [isPass, setIsAllMember] = useState(1)
const [state, setstate] = useState<any>(false);
/* 设置选中值 */ /* 设置选中值 */
const handleIsAllMemberChange = (v: any) => { const handleIsAllMemberChange = (v: any) => {
setIsAllMember(v.target.value) setIsAllMember(v.target.value)
...@@ -121,6 +125,53 @@ const Examine: React.FC<Iprops> = ({ ...@@ -121,6 +125,53 @@ const Examine: React.FC<Iprops> = ({
console.log('确认') console.log('确认')
} }
} }
const uploadProps = {
name: 'file',
action: '/api/file/file/upload/prefix',
data: {
fileType: 1,
prefix: '',
},
onChange(info) {
if (info.file.response) {
const { code } = info.file.response;
console.log(code);
message.info('上传成功');
console.log(info.file)
setstate(true);
}
;
if (info.file.status !== 'uploading') {
}
if (info.file.status === 'done') {
} else if (info.file.status === 'error') {
message.error(`${info.file.name} 上传失败`);
}
},
beforeUpload(file) {
if (file.size / 1024 / 1024 > 20) {
message.warning('附件大小超过20M');
return Promise.reject();
}
},
}
const uploadNode = () => {
return (
<div>
<p style={{ paddingTop: 10, paddingBottom: 10, }}>纸质合同(乙方已盖章签字)</p>
<Row style={{ marginBottom: 30, }}>
<Col>
<Upload
{...uploadProps}
>
<Button icon={<UploadOutlined />}>上传附件</Button>
</Upload>
</Col>
</Row>
</div>
)
}
return ( return (
<div> <div>
<Modal footer={null} title="提交审核" visible={ExamineFlag} onCancel={() => fetchData('onCancel')}> <Modal footer={null} title="提交审核" visible={ExamineFlag} onCancel={() => fetchData('onCancel')}>
...@@ -131,6 +182,7 @@ const Examine: React.FC<Iprops> = ({ ...@@ -131,6 +182,7 @@ const Examine: React.FC<Iprops> = ({
onFinish={onFinish} onFinish={onFinish}
onFinishFailed={onFinishFailed} onFinishFailed={onFinishFailed}
> >
{type === 'Signacontract' ? uploadNode() : null}
<Form.Item name="isPass" label="" rules={[{ required: true, message: '请选择通过方式' }]} initialValue={isPass} > <Form.Item name="isPass" label="" rules={[{ required: true, message: '请选择通过方式' }]} initialValue={isPass} >
<Radio.Group onChange={handleIsAllMemberChange}> <Radio.Group onChange={handleIsAllMemberChange}>
<Radio value={1}>{agreeText}</Radio> <Radio value={1}>{agreeText}</Radio>
...@@ -154,5 +206,6 @@ const Examine: React.FC<Iprops> = ({ ...@@ -154,5 +206,6 @@ const Examine: React.FC<Iprops> = ({
Examine.defaultProps = { Examine.defaultProps = {
agreeText: "通过", agreeText: "通过",
disagree: "不通过", disagree: "不通过",
uploadNode: null
} }
export default Examine; export default Examine;
...@@ -126,7 +126,7 @@ const FormList = (props: any) => { ...@@ -126,7 +126,7 @@ const FormList = (props: any) => {
id: _filterArr(sourceType, item, ['', 'goodsId', 'categoryId', 'ids']), id: _filterArr(sourceType, item, ['', 'goodsId', 'categoryId', 'ids']),
}, },
brand: { brand: {
name: _filter(sourceType, item, ['', 'brand', 'categoryName', 'brand']) name: _filter(sourceType, item, ['', 'brand', 'brandName', 'brand'])
}, // 品牌 }, // 品牌
unitName: _filter(sourceType, item, ['', 'unit', 'unitName', 'unitPrice']), //单位 unitName: _filter(sourceType, item, ['', 'unit', 'unitName', 'unitPrice']), //单位
purchaseCount: _filter(sourceType, item, ['', 'purchaseCount', 'count', 'purchaseCount']),// 数量 purchaseCount: _filter(sourceType, item, ['', 'purchaseCount', 'count', 'purchaseCount']),// 数量
......
import { Table, } from 'antd';
import React, { useEffect, useState, useRef } from 'react';
import { PublicApi } from '@/services/api';
export interface Iprops extends IAntdSchemaFormProps {
contractId: any,
listIndex: any
}
const TableList: React.FC<Iprops> = ({ contractId, listIndex }) => {
const [index, setIndex] = useState(1)
/* 外部 */
const [ListData, setListData] = useState<any>([]) // 外部数据
const [page, setPage] = useState(1); // 当前页
const [size, setSize] = useState(10); // 页大小
const [total, setTotal] = useState(0); // 外部总条数
/* 内部 */
const [List, setList] = useState<any>([]); // 内部数据
const [innerpage, setinnerPage] = useState(1); // 当前页
const [innersize, setinnerSize] = useState(10); // 页大小
const [innertotal, setinnerTotal] = useState(0); // 内部总条数
const [listLoading, setListLoading] = useState(false);
/* 流转列表 */
const CirculationList: any = [
{ title: '序号', dataIndex: 'name', align: 'center', render: (_, record, index) => index + 1, },
{ title: '操作角色', dataIndex: 'roleName', align: 'center', },
{ title: '状态', dataIndex: 'statusName', align: 'center', },
{ title: '操作', dataIndex: 'operate', align: 'center', },
{ title: '操作时间', dataIndex: 'operateTime', align: 'center', },
{ title: '审核意见', dataIndex: 'opinion', align: 'center', },
]
/* 内部 */
const fetchDataListcolumns: any = [
{ title: '操作人', dataIndex: 'name', align: 'center', render: (_, record, index) => index + 1, },
{ title: '部门', dataIndex: 'department', align: 'center', },
{ title: '职位', dataIndex: 'jobTitle', align: 'center', },
{ title: '状态', dataIndex: 'statusName', align: 'center', },
{ title: '操作', dataIndex: 'operate', align: 'center', },
{ title: '操作时间', dataIndex: 'operateTime', align: 'center', },
{ title: '审核意见', dataIndex: 'opinion', align: 'center', },
]
/*分页 */
const handlePaginationChange = (current: number, pageSize: number) => {
let data = {
current,
pageSize
}
if (index === 1) {
PageOuterRecordList(data)
} else {
InnerRecordList(data);
}
};
/* 外部 */
const PageOuterRecordList = (data) => {
PublicApi.getContractManagePageOuterRecordList({
contractId,
...data
}).then(res => {
console.log(res);
if (res.code === 1000) {
setListData(res.data.data)
setTotal(res.data.totalCount)
}
}).catch(err => {
console.log(err)
})
}
/* 内部 */
const InnerRecordList = (innerData) => {
PublicApi.getContractManagePageInnerRecordList({
contractId,
...innerData
}).then(res => {
console.log(res);
if (res.code === 1000) {
setList(res.data.data)
setTotal(res.data.totalCount)
}
}).catch(err => {
console.log(err)
})
}
useEffect(() => {
setIndex(listIndex)
}, [listIndex])
useEffect(() => {
if (contractId) {
const data = {
pageSize: size,
current: page,
}
PageOuterRecordList(data)
const innerData = {
pageSize: innersize,
current: innerpage,
}
InnerRecordList(innerData);
}
}, [contractId])
return (
<>
{
index == 1 ?
<Table
columns={CirculationList}
rowKey='id'
loading={listLoading}
dataSource={ListData}
pagination={
{
pageSize: size,
total,
onChange: handlePaginationChange
}
}
style={{
width: "100%"
}}
/>
:
<Table
columns={fetchDataListcolumns}
rowKey='id'
loading={listLoading}
dataSource={List}
pagination={
{
pageSize: size,
total: innertotal,
onChange: handlePaginationChange
}
}
style={{
width: "100%"
}}
/>
}
</>
)
}
export default TableList
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, Table, Space, Typography, Button } from 'antd'; import { Anchor, Radio, Steps, Table, Space, Typography, Button, message } 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';
...@@ -8,6 +8,7 @@ import { PublicApi } from '@/services/api'; ...@@ -8,6 +8,7 @@ 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 PaymentCard from '../../components/detailCard/PaymentCard'
import TableList from './components/TableList'
import { import {
FileWordFilled FileWordFilled
} from '@ant-design/icons' } from '@ant-design/icons'
...@@ -43,6 +44,7 @@ const Details = (props: any) => { ...@@ -43,6 +44,7 @@ const Details = (props: any) => {
* @param contractText 合同文档 * @param contractText 合同文档
*/ */
const [StepList, setStepList] = useState<any>([]); const [StepList, setStepList] = useState<any>([]);
const [outerTaskStepList, setouterTaskStepList] = useState<any>([]) const [outerTaskStepList, setouterTaskStepList] = useState<any>([])
const [innerTaskStepList, setinnerTaskStepList] = useState<any>([]); const [innerTaskStepList, setinnerTaskStepList] = useState<any>([]);
const [currentBatch, setCurrentBatch] = useState('1'); const [currentBatch, setCurrentBatch] = useState('1');
...@@ -139,31 +141,10 @@ const Details = (props: any) => { ...@@ -139,31 +141,10 @@ const Details = (props: any) => {
setStepList(StepList) setStepList(StepList)
return; return;
} else { } else {
setTimeout(() => { setlistIndex(e.target.value)
setlistIndex(e.target.value)
}, 100);
setTimeout(() => {
ref.current.reload();
}, 300);
} }
}; };
/* 流转记录内部 */
const fetchData = (params) => {
return new Promise((resolve, reject) => {
let fn;
fn = listIndex == '1' ? PublicApi.getContractManagePageOuterRecordList : PublicApi.getContractManagePageInnerRecordList;
fn({
...params,
contractId: contractId
}).then(res => {
console.log(res.data, listIndex)
resolve(res.data)
}).catch(err => {
console.log(err)
})
})
}
/*查询合同详情-分页查询合同采购物料*/ /*查询合同详情-分页查询合同采购物料*/
const columns: any = [ const columns: any = [
{ {
...@@ -304,25 +285,7 @@ const Details = (props: any) => { ...@@ -304,25 +285,7 @@ const Details = (props: any) => {
</div> </div>
) )
/* 流转列表 */
const CirculationList: any = [
{ title: '序号', dataIndex: 'name', align: 'center', render: (_, record, index) => index + 1, },
{ title: '操作角色', dataIndex: 'roleName', align: 'center', },
{ title: '状态', dataIndex: 'statusName', align: 'center', },
{ title: '操作', dataIndex: 'operate', align: 'center', },
{ title: '操作时间', dataIndex: 'operateTime', align: 'center', },
{ title: '审核意见', dataIndex: 'opinion', align: 'center', },
]
/* 内部 */
const fetchDataListcolumns: any = [
{ title: '操作人', dataIndex: 'name', align: 'center', render: (_, record, index) => index + 1, },
{ title: '部门', dataIndex: 'department', align: 'center', },
{ title: '职位', dataIndex: 'jobTitle', align: 'center', },
{ title: '状态', dataIndex: 'statusName', align: 'center', },
{ title: '操作', dataIndex: 'operate', align: 'center', },
{ title: '操作时间', dataIndex: 'operateTime', align: 'center', },
{ title: '审核意见', dataIndex: 'opinion', align: 'center', },
]
/* 提交审核的回调 */ /* 提交审核的回调 */
const getfetchData = (data) => { const getfetchData = (data) => {
console.log(data) console.log(data)
...@@ -345,8 +308,8 @@ const Details = (props: any) => { ...@@ -345,8 +308,8 @@ const Details = (props: any) => {
} else { } else {
setIsModalVisible(!Visible) setIsModalVisible(!Visible)
} }
} }
return ( return (
<div className={style.anchorWrap}> <div className={style.anchorWrap}>
<Anchor <Anchor
...@@ -497,14 +460,7 @@ const Details = (props: any) => { ...@@ -497,14 +460,7 @@ const Details = (props: any) => {
</div> </div>
</div> </div>
<div className='ant-card-body'> <div className='ant-card-body'>
<StandardTable <TableList contractId={contractId} listIndex={listIndex} />
tableProps={{
rowKey: 'id',
}}
currentRef={ref}
columns={listIndex === '1' ? CirculationList : fetchDataListcolumns}
fetchTableData={(params: any) => fetchData(params)}
/>
</div> </div>
</div> </div>
</div> </div>
......
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