Commit 919e9ffa authored by alwayOnlie's avatar alwayOnlie

修改bug

parent 9ef47d94
......@@ -35,6 +35,7 @@ const situationList: React.FC<Iprops> = ({ contractId }) => {
/* 执行请款的选中 */
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([])
const [value, setvalue] = useState('');
/* 搜素 */
const onSearch = (values) => {
const data = {
......@@ -216,6 +217,7 @@ const situationList: React.FC<Iprops> = ({ contractId }) => {
current: page,
pageSize: size,
}
setvalue('')
getContracInfoList(data)
}
useEffect(() => {
......@@ -241,6 +243,8 @@ const situationList: React.FC<Iprops> = ({ contractId }) => {
placeholder="搜素"
allowClear
onSearch={onSearch}
value={value}
onChange={(e) => setvalue(e.target.value)}
/>
<Button style={{ paddingLeft: 10, paddingRight: 10, marginLeft: 10, marginRight: 10 }} onClick={Reset}> 重置 </Button>
</div>
......
......@@ -313,6 +313,7 @@ const table = (props: any) => {
PlanList.map((item) => {
item.applyNo = item.orderNO;
item.outerStatusName = item.orderStatusName;
item.orderTime = item.orderTime ? moment().format('YYYY-MM-DD') : '';
// item.isHasTax = item.isHasTax == '是' ? 1 : 0;
})
setPlanList(PlanList)
......
......@@ -10,39 +10,22 @@ import { goodcolumns } from '../Table'
import { PublicApi } from '@/services/api';
const { Option } = Select;
const { Text } = Typography;
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
const FormList = (props: any) => {
const { currentRef, Row, sourceType } = props;
const refs = useRef({});
/* 显示模态框 */
const [isModalVisible, setIsModalVisible] = useState(false);// 显示模态框
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]) // 选中的
const [selectRow, setSelectRow] = useState<any[]>([]) // 模态框选择的行数据
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id' });
const [dataList, setData] = useState<Array<any>>([]) // 列表数据
/* 选中 */
const rowSelectionGood: any = {
selectedRowKeys: selectedRowKeys,
onChange: (selectedRowKeys: any, selectedRows: any) => {
setSelectedRowKeys(selectedRowKeys)
setSelectRow(selectedRows)
console.log(setSelectedRowKeys)
}
};
const [columnsTab, setcolumnsTab] = useState<any>([]);
/* 确定 */
const handleOk = () => {
console.log(dataList)
let dataArr = dataList.length != 0 ? dataList.concat(selectRow) : selectRow;
const hash = {}
let templateList = dataArr.reduceRight((item, next) => {
if (!hash[next.id]) hash[next.id] = true && item.push(next)
return item
}, [])
templateList.map((item: any, index: number) => {
let list = RowCtl.selectRow;
list.map((item: any, index: number) => {
item.rowId = index + 1
dataArr.push(item);
})
setData(templateList)
setData(list)
setIsModalVisible(false);
};
/* 获取商品 */
......@@ -59,11 +42,9 @@ const FormList = (props: any) => {
/* 删除 */
const handleDelete = (id) => {
const dataSource = [...dataList];
const RowKeys = [...selectedRowKeys]
let List = dataSource.filter((item) => item.id !== id);
const RowKeysList = RowKeys.filter(item => item !== id);
setData(List)
setSelectedRowKeys(RowKeysList)
// setSelectedRowKeys(RowKeysList)
};
/* 获取物料信息 */
const getList = () => {
......@@ -439,7 +420,7 @@ const FormList = (props: any) => {
}}
columns={goodcolumns}
currentRef={refs}
rowSelection={rowSelectionGood}
rowSelection={rowSelection}
fetchTableData={(params: any) => getGoodsList(params)}
/>
</Modal>
......
......@@ -3,7 +3,7 @@ import { Button, Card, Tabs, message } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import Information from './components/Information'
import FormList from './components/FormList'
import Fromtable from './components/fromtable'
import Fromtable from './components/Fromtable'
import ContractText from './components/ContractText'
import { PublicApi } from '@/services/api';
import { history } from 'umi'
......
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