产品-多页面列表查询人员状态传参统一修改为数组

This commit is contained in:
黎永顺 2023-07-10 11:00:47 +08:00
parent 61ebfdf9f1
commit d984a105fd
4 changed files with 31 additions and 26 deletions

View File

@ -26,7 +26,7 @@ export default class CalculateDetail extends React.Component {
departmentIds: "",
positionIds: "",
subcompanyIds: "",
status: "",
statuses: "",
consolidatedTaxation: "0"
},
selectedKey: "0",
@ -115,7 +115,7 @@ export default class CalculateDetail extends React.Component {
);
};
Select = (value, key) => {
const { status } = this.state.searchItemsValue;
const { statuses } = this.state.searchItemsValue;
return (
<WeaFormItem
label={value}
@ -123,10 +123,13 @@ export default class CalculateDetail extends React.Component {
wrapperCol={{ span: 18 }}
>
<WeaSelect
value={status}
multiple
value={statuses}
options={[
{ key: "", showname: "" }, { key: "ALL", showname: "全部" },
{ key: "NORMAL", showname: "在职" }, { key: "UNAVAILABLE", showname: "离职" }
{ key: "0", showname: "试用" }, { key: "1", showname: "正式" },
{ key: "2", showname: "临时" }, { key: "3", showname: "试用延期" },
{ key: "4", showname: "解雇" }, { key: "5", showname: "离职" },
{ key: "6", showname: "退休" }
]}
onChange={(val) => this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/>
</WeaFormItem>
@ -338,7 +341,7 @@ export default class CalculateDetail extends React.Component {
workcode: "",
departmentIds: "",
positionIds: "",
status: "",
statuses: "",
consolidatedTaxation: "0"
}
})}>
@ -356,7 +359,7 @@ export default class CalculateDetail extends React.Component {
{ com: this.Browser("分部", "subcompanyIds") },
{ com: this.Browser("部门", "departmentIds") },
{ com: this.Browser("岗位", "positionIds") },
{ com: this.Select("状态", "status") },
{ com: this.Select("状态", "statuses") },
{ com: this.Checkbox("合并计税", "consolidatedTaxation") }
];
return <WeaSearchGroup title={"基本信息"} items={searchItems} showGroup/>;

View File

@ -17,7 +17,7 @@ export default class UserSure extends React.Component {
workcode: "",
departmentIds: "",
positionIds: "",
status: ""
statuses: ""
},
selectedKey: "0",
selectedRowKeys: [], // table 选中项
@ -78,7 +78,7 @@ export default class UserSure extends React.Component {
);
};
Select = (value, key) => {
const { status } = this.state.searchItemsValue;
const { statuses } = this.state.searchItemsValue;
return (
<WeaFormItem
label={value}
@ -86,10 +86,13 @@ export default class UserSure extends React.Component {
wrapperCol={{ span: 18 }}
>
<WeaSelect
value={String(status)}
multiple
value={String(statuses)}
options={[
{ key: "", showname: "" }, { key: "ALL", showname: "全部" },
{ key: "NORMAL", showname: "在职" }, { key: "UNAVAILABLE", showname: "离职" }
{ key: "0", showname: "试用" }, { key: "1", showname: "正式" },
{ key: "2", showname: "临时" }, { key: "3", showname: "试用延期" },
{ key: "4", showname: "解雇" }, { key: "5", showname: "离职" },
{ key: "6", showname: "退休" }
]}
onChange={(val) => this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/>
</WeaFormItem>
@ -342,7 +345,7 @@ export default class UserSure extends React.Component {
employeeName: "",
departmentIds: "",
positionIds: "",
status: ""
statuses: ""
}
})}>
重置
@ -358,7 +361,7 @@ export default class UserSure extends React.Component {
{ com: this.Input("工号", "workcode") },
{ com: this.Browser("部门", "departmentIds") },
{ com: this.Browser("岗位", "positionIds") },
{ com: this.Select("状态", "status") }
{ com: this.Select("状态", "statuses") }
];
return <WeaSearchGroup title={"基本信息"} items={searchItems} showGroup/>;
};

View File

@ -68,7 +68,7 @@ class Index extends Component {
workcode: "",
departmentIds: "",
positionIds: "",
userstatus: "",
statuses: "",
// archiveStatus: "EFFICIENT",
taxAgentId: "",
subcompanyIds: ""
@ -125,7 +125,7 @@ class Index extends Component {
};
Select = (value, key) => {
const { taxAgentStore } = this.props;
const { userstatus, archiveStatus, taxAgentId } = this.state.searchItemsValue;
const { statuses, archiveStatus, taxAgentId } = this.state.searchItemsValue;
const { archiveStatusList, userStatusList } = this.state;
const { taxAgentAdminOption } = taxAgentStore;
return (
@ -135,8 +135,9 @@ class Index extends Component {
wrapperCol={{ span: 18 }}
>
<WeaSelect
value={key === "userstatus" ? userstatus : key === "taxAgentId" ? taxAgentId : archiveStatus}
options={key === "userstatus" ? userStatusList : key === "taxAgentId" ? [{
multiple={key === "statuses"}
value={key === "statuses" ? statuses : key === "taxAgentId" ? taxAgentId : archiveStatus}
options={key === "statuses" ? userStatusList : key === "taxAgentId" ? [{
key: "",
showname: ""
}, ...taxAgentAdminOption] : archiveStatusList}
@ -213,10 +214,7 @@ class Index extends Component {
key: String(it.value),
showname: it.defaultLabel
}))],
userStatusList: [{
key: "",
showname: ""
}, ..._.map(userStatusList, it => ({
userStatusList: [..._.map(userStatusList, it => ({
key: String(it.value),
showname: it.defaultLabel
}))]
@ -666,7 +664,7 @@ class Index extends Component {
{ com: this.Browser("分部", "subcompanyIds") },
{ com: this.Browser("部门", "departmentIds") },
{ com: this.Browser("岗位", "positionIds") },
{ com: this.Select("人员状态", "userstatus") },
{ com: this.Select("人员状态", "statuses") },
// { com: this.Select("档案状态", "archiveStatus") },
{ com: this.Select("个税扣缴义务人", "taxAgentId") },
{ com: this.Input("工号", "workcode") }
@ -691,7 +689,7 @@ class Index extends Component {
workcode: "",
departmentIds: "",
positionIds: "",
userstatus: "",
statuses: "",
archiveStatus: ""
}
})}> 重置 </Button>,

View File

@ -1,7 +1,7 @@
import { action, observable } from "mobx";
import { WeaTableNew } from "comsMobx";
import * as API from "../apis/payrollFiles";
import { statisticsEmployeeDetailList, getDataPerspective } from "../apis/statistics";
import { getDataPerspective, statisticsEmployeeDetailList } from "../apis/statistics";
const { TableStore } = WeaTableNew;
@ -14,11 +14,12 @@ export class PayrollFilesStore {
@action("薪资档案-列表查询")
queryList = (payload = {}, searchItemsValue = {}, url = "") => {
return new Promise((resolve, reject) => {
const { departmentIds, positionIds, subcompanyIds, ...extra } = searchItemsValue;
const { departmentIds, positionIds, subcompanyIds, statuses, ...extra } = searchItemsValue;
API.queryList({
departmentIds: departmentIds ? departmentIds.split(",") : [],
positionIds: positionIds ? positionIds.split(",") : [],
subcompanyIds: subcompanyIds ? subcompanyIds.split(",") : [],
statuses: statuses ? statuses.split(",") : [],
...payload, ...extra, url
}).then(res => {
const { data, status } = res;