diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
index e4d99a5e..7a3ed519 100644
--- a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
@@ -9,15 +9,16 @@ import { WeaCheckbox, WeaSearchGroup } from "ecCom";
class SelectItemsWrapper extends Component {
renderTitle = (item) => {
- const { groupName } = item;
+ const { onSelectGroupAll } = this.props;
+ const { groupName, groupId } = item;
return
-
+ onSelectGroupAll(groupId, val)}/>
已选择0个字段
;
};
render() {
- const { dataSource } = this.props;
+ const { dataSource, onSelectItem } = this.props;
return (
{
@@ -31,13 +32,11 @@ class SelectItemsWrapper extends Component {
{
_.map(items, child => {
- const { name, checked } = child;
+ const { name, checked, id } = child;
return -
{
- console.log(value);
- }}
+ onChange={(val) => onSelectItem(id, val)}
/>
;
})
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
index e70e6acd..0a7b6c4d 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
@@ -229,6 +229,14 @@ class AttendanceDataComp extends Component {
handleSearchItemSet = (val) => {
const { fieldSetPayload, fieldSetList } = this.state;
this.setState({
+ fieldSetList: _.map(_.cloneDeep(fieldSetList), item => {
+ return {
+ ...item,
+ items: _.filter(item.items || [], child => {
+ return child.name.indexOf(val) !== -1;
+ })
+ };
+ }),
fieldSetPayload: {
...fieldSetPayload,
data: _.map(_.cloneDeep(fieldSetList), item => {
@@ -251,7 +259,7 @@ class AttendanceDataComp extends Component {
data: _.map(_.cloneDeep(fieldSetList), item => {
return {
...item,
- items: _.map(item.items || [], child => !!child.checked)
+ items: _.filter(item.items || [], child => !!child.checked)
};
})
}
@@ -265,6 +273,66 @@ class AttendanceDataComp extends Component {
});
}
};
+ handleSelectGroupAll = (groupId, checked) => {
+ const { fieldSetPayload, fieldSetList } = this.state;
+ this.setState({
+ fieldSetList: _.map(_.cloneDeep(fieldSetList), item => {
+ if (groupId === item.groupId) {
+ return {
+ ...item,
+ items: _.map(item.items || [], child => {
+ return { ...child, checked: !!Number(checked) };
+ })
+ };
+ }
+ return { ...item };
+ }),
+ fieldSetPayload: {
+ ...fieldSetPayload,
+ data: _.map(_.cloneDeep(fieldSetList), item => {
+ if (groupId === item.groupId) {
+ return {
+ ...item,
+ items: _.map(item.items || [], child => {
+ return { ...child, checked: !!Number(checked) };
+ })
+ };
+ }
+ return { ...item };
+ })
+ }
+ });
+ };
+ handleSelectItem = (id, checked) => {
+ const { fieldSetPayload, fieldSetList } = this.state;
+ this.setState({
+ fieldSetList: _.map(_.cloneDeep(fieldSetList), item => {
+ return {
+ ...item,
+ items: _.map(item.items || [], child => {
+ if (id === child.id) {
+ return { ...child, checked: !!Number(checked) };
+ }
+ return { ...child };
+ })
+ };
+ }),
+ fieldSetPayload: {
+ ...fieldSetPayload,
+ data: _.map(_.cloneDeep(fieldSetList), item => {
+ return {
+ ...item,
+ items: _.map(item.items || [], child => {
+ if (id === child.id) {
+ return { ...child, checked: !!Number(checked) };
+ }
+ return { ...child };
+ })
+ };
+ })
+ }
+ });
+ };
render() {
const {
@@ -327,7 +395,13 @@ class AttendanceDataComp extends Component {
/>
{/* 表头设置 */}
}
+ comp={
+
+ }
onCancel={this.handleCloseSettings}
onSearchItemSet={this.handleSearchItemSet}
onShowOnlyChecked={this.handleShowOnlyChecked}