diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index 58da8c6b..b457ae44 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -297,22 +297,33 @@ export const personScopeConditions = [ { conditionType: "SELECT_LINKAGE", domkey: ["targetParams"], - fieldcol: 16, + fieldcol: 18, label: "对象类型", lanId: 111, - labelcol: 8, + labelcol: 6, options: [], rules: "required|string", - selectLinkageDatas: {}, + selectLinkageDatas: { + EMPLOYEE: { + conditionType: "TEXTAREA", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required|string", + viewAttr: 3 + } + }, viewAttr: 3 }, { conditionType: "SELECT", domkey: ["employeeStatus"], - fieldcol: 16, + fieldcol: 18, label: "选择员工状态", lanId: 111, - labelcol: 8, + labelcol: 6, value: "", detailtype: "2", rules: "required|string", diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index a5ad7786..f8aced8d 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -23,7 +23,6 @@ class PersonalScopeModal extends Component { this.state = { loading: false, conditions: [], employeeStatus: [], - targetTypeList: [], targetType: "EMPLOYEE", targetTypeIds: "", targetTypeIdsNames: "", @@ -48,14 +47,15 @@ class PersonalScopeModal extends Component { if (status) { const { employeeStatus, targetTypeList } = data; this.setState({ - targetTypeList: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })), - employeeStatus: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })), - conditions: _.map(personScopeConditions, item => ({ + employeeStatus, conditions: _.map(personScopeConditions, item => ({ ...item, items: _.map(item.items, o => { if (getKey(o) === "employeeStatus") { return { ...o, label: getLabel(o.lanId, o.label), - options: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })) + options: [ + { key: "ALL", showname: getLabel(111, "全选") }, + ..._.map(employeeStatus, it => ({ key: it.id, showname: it.name })) + ] }; } return { @@ -128,6 +128,20 @@ class PersonalScopeModal extends Component { }} />; }; + handleChange = (params) => { + const { taxAgentStore: { personScopeForm } } = this.props, { employeeStatus } = this.state; + const key = _.keys(params)[0], value = params[key].value; + if ( + (key === "employeeStatus" && value.indexOf("ALL") !== -1) + // (key === "employeeStatus" && value.indexOf("ALL") === -1 && _.every(employeeStatus, o => value.indexOf(o.id) !== -1)) + ) { + personScopeForm.updateFields({ [key]: { value: "ALL," + _.map(employeeStatus, o => o.id).join(",") } }); + } else if (key === "employeeStatus" && value.indexOf("ALL") === -1) { + console.log(1) + // personScopeForm.updateFields({ [key]: { value: "" } }); + } + console.log(params); + }; handleReset = () => { this.setState({ targetType: "EMPLOYEE", @@ -150,7 +164,7 @@ class PersonalScopeModal extends Component { this.handleReset(); onCancel(); }}> -
{getSearchs(personScopeForm, conditions, 1, false)}
+
{getSearchs(personScopeForm, conditions, 1, false, this.handleChange)}
{/**/} {/*