修正了我的报销搜索

main
白封羽 2023-01-06 13:48:25 +08:00
parent c01d602bc3
commit e63fa0153d
1 changed files with 18 additions and 7 deletions

View File

@ -84,13 +84,14 @@ class Subpage extends React.Component<any, any> {
searchWord: "", searchWord: "",
onCreated: false, onCreated: false,
detailedReimbursement: undefined, detailedReimbursement: undefined,
staffId:store.getState().token.staffId, staffId: store.getState().token.staffId,
} }
store.subscribe(this.handleStoreChange); store.subscribe(this.handleStoreChange);
this.pullDepartment() this.pullDepartment()
} }
handleStoreChange=()=>{
this.setState({staffId:store.getState().token.staffId}) handleStoreChange = () => {
this.setState({staffId: store.getState().token.staffId})
} }
createRef = React.createRef<ReimbursementCreate>(); createRef = React.createRef<ReimbursementCreate>();
columns: ProColumns<TableListItem>[] = [ columns: ProColumns<TableListItem>[] = [
@ -282,7 +283,7 @@ class Subpage extends React.Component<any, any> {
let params: any = { let params: any = {
pageNum: current - 1, pageNum: current - 1,
pageSize: pageSize, pageSize: pageSize,
reimbursementSubmitStaffId:store.getState().token.staffId, reimbursementSubmitStaffId: store.getState().token.staffId,
} }
if (filter.status !== undefined && filter.status !== null && filter.status.length !== 0) { if (filter.status !== undefined && filter.status !== null && filter.status.length !== 0) {
params['reimbursementStatuses'] = "" params['reimbursementStatuses'] = ""
@ -330,8 +331,13 @@ class Subpage extends React.Component<any, any> {
total: totalRecordLength, total: totalRecordLength,
}); });
}) })
tableListDataSource = await this.converter(response.data, pageSize) if (response.data.reimbursementSubmitStaff.staffId !== store.getState().token.staffId) {
totalRecordLength = tableListDataSource.length tableListDataSource = await this.converter(response.data, pageSize)
totalRecordLength = tableListDataSource.length
} else {
tableListDataSource = []
totalRecordLength = 0
}
} }
return Promise.resolve({ return Promise.resolve({
@ -384,7 +390,12 @@ class Subpage extends React.Component<any, any> {
optionRender: ({searchText}, {form}, dom) => { optionRender: ({searchText}, {form}, dom) => {
// console.log(searchConfig, formProps, dom) // console.log(searchConfig, formProps, dom)
return [ return [
<div style={{flexWrap: "nowrap", display: "flex", justifyContent: "flex-end", marginRight:6}}> <div style={{
flexWrap: "nowrap",
display: "flex",
justifyContent: "flex-end",
marginRight: 6
}}>
<Space> <Space>
<Search className="searchBar" <Search className="searchBar"
addonBefore={"报销单号:"} addonBefore={"报销单号:"}