From c72d34fb9a0bfc4ae161096ec4ecd1de63f11727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 11 Oct 2024 11:11:06 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/constants.js | 2 +- .../pages/salary/components/personalScope.js | 10 ++-- .../salary/components/personalScopeModal.js | 48 ++++++------------- 3 files changed, 19 insertions(+), 41 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index ac81a719..dc2422a0 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -296,7 +296,7 @@ export const personScopeConditions = [ items: [ { conditionType: "SELECT_LINKAGE", - domkey: ["targetParams"], + domkey: ["targetType"], fieldcol: 18, label: "对象类型", lanId: 111, diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js index fa392444..698d181d 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -228,14 +228,10 @@ class PersonalScope extends Component { {...personalAddModal} taxAgentId={taxAgentId} onSuccess={() => this.personalScopeTableRef.getPersonalScopeList()} - onCancel={() => + onCancel={(callback) => this.setState({ - personalAddModal: { - ...personalAddModal, - visible: false, - includeType: "" - } - }) + personalAddModal: { ...personalAddModal, visible: false, includeType: "" } + }, () => callback && callback()) } /> {importParams.visible && ( diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index 9ad50c15..ab9d5dcb 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -8,7 +8,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaSwitch } from "comsMobx"; import { WeaBrowser, WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; -import { Button, message, Modal } from "antd"; +import { Button, message } from "antd"; import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; import { personScopeConditions, scopeSelectLinkageDatas } from "./constants"; @@ -55,8 +55,10 @@ class PersonalScopeModal extends Component { } return { ...o, label: getLabel(o.lanId, o.label), - options: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })), - selectLinkageDatas: scopeSelectLinkageDatas[_.head(targetTypeList).id] + options: _.map(targetTypeList, it => ({ + key: it.id, showname: it.name, selected: it.id === "EMPLOYEE" + })), + selectLinkageDatas: { ...scopeSelectLinkageDatas } }; }) })) @@ -68,39 +70,25 @@ class PersonalScopeModal extends Component { const { taxAgentStore: { personScopeForm } } = this.props; personScopeForm.validateForm().then(f => { if (f.isValid) { - console.log(70, personScopeForm.getFormParams()); - - - const { status, targetTypeIds, targetType } = this.state; - const { includeType, taxAgentId, onSuccess, onCancel } = this.props; - if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) { - Modal.warning({ - title: "信息确认", - content: "必要信息不完整,红色*为必填项!" - }); - return; - } + const { employeeStatus, targetType, target } = personScopeForm.getFormParams(); + const { includeType, taxAgentId } = this.props; const payload = { - employeeStatus: status.split(","), - includeType, - targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), - taxAgentId + includeType, taxAgentId, + employeeStatus: employeeStatus.split(","), + targetParams: _.map(target.split(","), it => ({ targetType, targetId: it })) }; this.setState({ loading: true }); taxAgentRangeSave(payload).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { - message.success("保存成功"); - this.handleReset(); - onSuccess(); - onCancel(); + message.success(getLabel(111, "操作成功!")); + this.props.onCancel(this.props.onSuccess); } else { - message.error(errormsg || "保存失败"); + message.error(errormsg); } }).catch(() => this.setState({ loading: true })); } else { f.showErrors(); - this.forceUpdate(); } }); }; @@ -154,8 +142,7 @@ class PersonalScopeModal extends Component { } - + ), hide: fields.hide }); @@ -169,18 +156,13 @@ class PersonalScopeModal extends Component { val === "1" ? personScopeForm.updateFields({ employeeStatus: { value: _.map(employeeStatus, o => o.id).join(",") } }) : personScopeForm.updateFields({ employeeStatus: { value: "" } }); }; - handleChange = (params) => { - const { taxAgentStore: { personScopeForm } } = this.props, { employeeStatus } = this.state; - const key = _.keys(params)[0], value = params[key].value; - console.log(params, key, value); - }; render() { const { onCancel, title, visible, taxAgentStore: { personScopeForm } } = this.props; const { employeeStatus, targetTypeList, targetType, status, statusAll, loading, conditions } = this.state; const buttons = [ , - + ]; return (