分页问题
This commit is contained in:
@ -81,13 +81,13 @@ const SupplierCategoryEntry: React.FC = () => {
|
|||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
setModalInfo({ type: '', visible: false });
|
setModalInfo({ type: '', visible: false });
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
getList(values, 1, 10);
|
getList(values, 1, pagination.pageSize);
|
||||||
};
|
};
|
||||||
// 重置
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
form.resetFields()
|
form.resetFields()
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
getList(values, 1, 10);
|
getList(values, 1, pagination.pageSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleApproval = (accessWorkId: string) => {
|
const handleApproval = (accessWorkId: string) => {
|
||||||
@ -98,7 +98,7 @@ const SupplierCategoryEntry: React.FC = () => {
|
|||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
message.success('发起审批成功');
|
message.success('发起审批成功');
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
getList(values, 1, 10);
|
getList(values, 1, pagination.pageSize);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -70,13 +70,13 @@ const SupplierCategoryEntryReview: React.FC = () => {
|
|||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
setModalInfo({ type: '', visible: false });
|
setModalInfo({ type: '', visible: false });
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
getList(values, 1, 10);
|
getList(values, 1, pagination.pageSize);
|
||||||
};
|
};
|
||||||
// 重置
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
form.resetFields()
|
form.resetFields()
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
getList(values, 1, 10);
|
getList(values, 1, pagination.pageSize);
|
||||||
};
|
};
|
||||||
//列表头部数据
|
//列表头部数据
|
||||||
const columns: ColumnsType<Data> = [
|
const columns: ColumnsType<Data> = [
|
||||||
|
@ -59,7 +59,7 @@ const AccessManagement: React.FC = () => {
|
|||||||
//初始化
|
//初始化
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
getList(values, 1, 10);
|
getList(values, 1, pagination.pageSize);
|
||||||
|
|
||||||
getDictList('approve_type').then((res) => {
|
getDictList('approve_type').then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
@ -80,13 +80,13 @@ const AccessManagement: React.FC = () => {
|
|||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
setModalInfo({ type: '', visible: false });
|
setModalInfo({ type: '', visible: false });
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
getList(values, 1, 10);
|
getList(values, 1, pagination.pageSize);
|
||||||
};
|
};
|
||||||
// 重置
|
// 重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
form.resetFields()
|
form.resetFields()
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
getList(values, 1, 10);
|
getList(values, 1, pagination.pageSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleApproval = (id: string) => {
|
const handleApproval = (id: string) => {
|
||||||
@ -97,7 +97,7 @@ const AccessManagement: React.FC = () => {
|
|||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
message.success('发起审批成功');
|
message.success('发起审批成功');
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
getList(values, 1, 10);
|
getList(values, 1, pagination.pageSize);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -254,7 +254,7 @@ const CategoryLibraryManage: React.FC = () => {
|
|||||||
onCancel={() => setAddVisible(false)}
|
onCancel={() => setAddVisible(false)}
|
||||||
onSuccess={() => {
|
onSuccess={() => {
|
||||||
setAddVisible(false);
|
setAddVisible(false);
|
||||||
getList();
|
getList(1, pagination.pageSize || 10);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* 添加供应商弹窗 */}
|
{/* 添加供应商弹窗 */}
|
||||||
@ -264,7 +264,7 @@ const CategoryLibraryManage: React.FC = () => {
|
|||||||
onCancel={() => setAddSupplierVisible(false)}
|
onCancel={() => setAddSupplierVisible(false)}
|
||||||
onSuccess={() => {
|
onSuccess={() => {
|
||||||
setAddSupplierVisible(false);
|
setAddSupplierVisible(false);
|
||||||
getList();
|
getList(1, pagination.pageSize || 10);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* 库内供应商数量弹窗 */}
|
{/* 库内供应商数量弹窗 */}
|
||||||
|
@ -236,7 +236,7 @@ const SupplierEntryManage: React.FC = () => {
|
|||||||
onCancel={() => setAddVisible(false)}
|
onCancel={() => setAddVisible(false)}
|
||||||
onSuccess={() => {
|
onSuccess={() => {
|
||||||
setAddVisible(false);
|
setAddVisible(false);
|
||||||
getList();
|
getList(1, pagination.pageSize || 10);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* 添加供应商弹窗 */}
|
{/* 添加供应商弹窗 */}
|
||||||
@ -246,7 +246,7 @@ const SupplierEntryManage: React.FC = () => {
|
|||||||
onCancel={() => setAddSupplierVisible(false)}
|
onCancel={() => setAddSupplierVisible(false)}
|
||||||
onSuccess={() => {
|
onSuccess={() => {
|
||||||
setAddSupplierVisible(false);
|
setAddSupplierVisible(false);
|
||||||
getList();
|
getList(1, pagination.pageSize || 10);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* 库内供应商数量弹窗 */}
|
{/* 库内供应商数量弹窗 */}
|
||||||
|
@ -73,7 +73,7 @@ const CategoryLibraryManage: React.FC = () => {
|
|||||||
const res = await approval({ id });
|
const res = await approval({ id });
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
message.success('提交成功');
|
message.success('提交成功');
|
||||||
getList(); // 刷新列表
|
getList(1, pagination.pageSize || 10); // 刷新列表
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -267,7 +267,7 @@ const CategoryLibraryManage: React.FC = () => {
|
|||||||
onCancel={() => setAddVisible(false)}
|
onCancel={() => setAddVisible(false)}
|
||||||
onSuccess={() => {
|
onSuccess={() => {
|
||||||
setAddVisible(false);
|
setAddVisible(false);
|
||||||
getList();
|
getList(1, pagination.pageSize || 10);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* 新增品类库弹窗 */}
|
{/* 新增品类库弹窗 */}
|
||||||
|
@ -199,18 +199,18 @@ const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
|
|||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
render: (_: any, record: any) => (
|
render: (_: any, record: any) => (
|
||||||
<>
|
<>
|
||||||
<Button type="link" onClick={() => handleDetail(record)}>
|
<Button type="link" onClick={() => handleDetail(record)}>
|
||||||
审批记录
|
审批记录
|
||||||
</Button>
|
</Button>
|
||||||
{/* 测试使用,需删除 */}
|
{/* 测试使用,需删除 */}
|
||||||
{ record.approveStatus === '0' && userId == '8' && (
|
{record.approveStatus === '0' && userId == '8' && (
|
||||||
<Button type="link" onClick={() => {
|
<Button type="link" onClick={() => {
|
||||||
supplierChangeApprove({ id:record.id, approveStatus: '1' }).then(() => {
|
supplierChangeApprove({ id: record.id, approveStatus: '1' }).then(() => {
|
||||||
handleReset()
|
handleReset()
|
||||||
})
|
})
|
||||||
}}>
|
}}>
|
||||||
审批
|
审批
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
||||||
@ -264,7 +264,13 @@ const SupplierChangeReviewManage: React.FC<Props> = ({ dispatch }) => {
|
|||||||
dataSource={data}
|
dataSource={data}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
pagination={{ ...tableProps.pagination, total: pagination.total }}
|
pagination={{ ...tableProps.pagination, total: pagination.total }}
|
||||||
onChange={() => setPagination({ ...pagination })}
|
onChange={(pag) => {
|
||||||
|
setPagination({
|
||||||
|
current: pag.current ?? 1,
|
||||||
|
pageSize: pag.pageSize ?? 10,
|
||||||
|
total: pag.total ?? 0,
|
||||||
|
});
|
||||||
|
}}
|
||||||
style={{ flex: 1, minHeight: 0 }}
|
style={{ flex: 1, minHeight: 0 }}
|
||||||
scroll={{ y: 'calc(100vh - 350px)' }}
|
scroll={{ y: 'calc(100vh - 350px)' }}
|
||||||
/>
|
/>
|
||||||
|
@ -42,11 +42,11 @@ const supplierExitAudit: React.FC = () => {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
// 可传查询条件 form.getFieldsValue()
|
// 可传查询条件 form.getFieldsValue()
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
const { exitTheme, time, orgId, approveStatus } = values;
|
const { time } = values;
|
||||||
const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : '';
|
const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : '';
|
||||||
const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : '';
|
const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : '';
|
||||||
|
|
||||||
const { code, data } = await getPage({ pageNo, pageSize, exitTheme, orgId, approveStatus, startTime, endTime });
|
const { code, data } = await getPage({ pageNo, pageSize, ...values, startTime, endTime });
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
setData(data.records);
|
setData(data.records);
|
||||||
setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total }));
|
setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total }));
|
||||||
@ -74,7 +74,7 @@ const supplierExitAudit: React.FC = () => {
|
|||||||
setCreateVisible(true)
|
setCreateVisible(true)
|
||||||
};
|
};
|
||||||
const handleSelectOk = () => {
|
const handleSelectOk = () => {
|
||||||
getList();
|
getList(1, pagination.pageSize);
|
||||||
setCreateVisible(false);
|
setCreateVisible(false);
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -41,11 +41,11 @@ const supplierExitManage: React.FC = () => {
|
|||||||
// 可传查询条件 form.getFieldsValue()
|
// 可传查询条件 form.getFieldsValue()
|
||||||
|
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
const { exitTheme, time, deptId, approveStatus } = values;
|
const { time } = values;
|
||||||
const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : '';
|
const startTime = time ? moment(time[0]).format('YYYY-MM-DD') : '';
|
||||||
const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : '';
|
const endTime = time ? moment(time[1]).format('YYYY-MM-DD') : '';
|
||||||
|
|
||||||
const { code, data } = await getPage({ pageNo, pageSize, exitTheme, deptId, approveStatus, startTime, endTime });
|
const { code, data } = await getPage({ pageNo, pageSize, ...values, startTime, endTime });
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
setData(data.records);
|
setData(data.records);
|
||||||
setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total }));
|
setPagination(prev => ({ ...prev, current: pageNo, pageSize, total: data.total }));
|
||||||
@ -73,7 +73,7 @@ const supplierExitManage: React.FC = () => {
|
|||||||
setCreateVisible(true)
|
setCreateVisible(true)
|
||||||
};
|
};
|
||||||
const handleSelectOk = () => {
|
const handleSelectOk = () => {
|
||||||
getList();
|
getList(1, pagination.pageSize);
|
||||||
setCreateVisible(false);
|
setCreateVisible(false);
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Reference in New Issue
Block a user