diff --git a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js index b6fd6ffb..d0718a2f 100644 --- a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js +++ b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js @@ -5,13 +5,24 @@ * Date: 2022/11/30 */ import React, { Component } from "react"; -import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; +import { + WeaBrowser, + WeaDialog, + WeaFormItem, + WeaHelpfulTip, + WeaLocaleProvider, + WeaSearchGroup, + WeaSelect, + WeaTextarea +} from "ecCom"; import { Button, message, Modal } from "antd"; import { getTaxAgentRangeForm } from "../../apis/taxAgent"; import { commonEnumList } from "../../apis/ruleconfig"; import { SelectWithAll } from "../../pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee"; import "./index.less"; +const getLabel = WeaLocaleProvider.getLabel; + class PersonalScopeModal extends Component { constructor(props) { super(props); @@ -91,6 +102,11 @@ class PersonalScopeModal extends Component { key: "POSITION", showname: "岗位", selected: false + }, + { + key: "SQL", + showname: "SQL", + selected: false } ]; this.setState({ @@ -124,7 +140,9 @@ class PersonalScopeModal extends Component { const payload = { employeeStatus: status.split(","), includeType, - targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), + targetParams: targetType !== "SQL" ? + _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it, target: "" })) : + [{ targetType, targetId: "0", target: targetTypeIds }], [saveKeyVal["key"]]: saveKeyVal["value"] }; this.setState({ loading: true }); @@ -156,6 +174,12 @@ class PersonalScopeModal extends Component { case "POSITION": browserType = { ...browserType, type: 278, title: "岗位选择" }; break; + case "SQL": + return
+ this.setState({ targetTypeIds: val, targetTypeIdsNames: val })}/> + }/> +
; default: break; } @@ -259,3 +283,13 @@ class PersonalScopeModal extends Component { } export default PersonalScopeModal; + +export const SQLHelpTip = () => { + return
+

{getLabel(111, "注意事项:")}

+

{getLabel(111, "1、sql需返回人员id")}

+

{getLabel(111, "2、sql结尾不需要 ; go /等符号")}

+

{getLabel(111, "使用例子:定义获取岗位是开发的人员")}

+

{getLabel(111, "select id from hrmresource where JOBTITLE = 17")}

+
; +}; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/addTaxAgentModal.js b/pc4mobx/hrmSalary/pages/taxAgent/addTaxAgentModal.js index 23d14a23..fae1b5c6 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/addTaxAgentModal.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/addTaxAgentModal.js @@ -1,8 +1,19 @@ import React from "react"; import { Button, Col, Row } from "antd"; -import { WeaBrowser, WeaCheckbox, WeaDialog, WeaError, WeaSelect } from "ecCom"; +import { + WeaBrowser, + WeaCheckbox, + WeaDialog, + WeaError, + WeaHelpfulTip, + WeaLocaleProvider, + WeaSelect, + WeaTextarea +} from "ecCom"; +import { SQLHelpTip } from "../../components/PersonalScopeModal"; import "../ledger/index.less"; +const { getLabel } = WeaLocaleProvider; export default class AddTaxAgentModal extends React.Component { constructor(props) { super(props); @@ -24,7 +35,7 @@ export default class AddTaxAgentModal extends React.Component { this.setState({ checkAll: "1" }); - }else{ + } else { this.setState({ checkAll: "0" }); @@ -38,10 +49,10 @@ export default class AddTaxAgentModal extends React.Component { const { checkboxValue, ids, selectedKey } = this.state; const payload = { employeeStatus: checkboxValue.split(","), - targetParams: _.map(ids.split(","), (it) => ({ - targetType: selectedKey, + targetParams: selectedKey !== "SQL" ? _.map(ids.split(","), (it) => ({ + targetType: selectedKey, target: "", targetId: it - })) + })) : [{ targetType: selectedKey, targetId: "0", target: ids }] }; if (_.isEmpty(ids) && _.isEmpty(checkboxValue)) { this.refs.weaError.showError(); @@ -64,7 +75,7 @@ export default class AddTaxAgentModal extends React.Component { this.setState({ selectedKey: "EMPLOYEE", checkboxValue: "", - checkAll: '0', + checkAll: "0", ids: "" }); }; @@ -182,6 +193,18 @@ export default class AddTaxAgentModal extends React.Component { /> )} + {this.state.selectedKey === "SQL" && ( + +
+ this.setState({ ids })}/> + }/> +
+
+ )} @@ -197,13 +220,13 @@ export default class AddTaxAgentModal extends React.Component { if (checkAll === "1") { const checked = _.map(employeeStatus, it => it.id); this.setState({ - checkAll: '1', + checkAll: "1", checkboxValue: checked.join(",") }); } else { this.setState({ - checkAll: '0', - checkboxValue: '' + checkAll: "0", + checkboxValue: "" }); } }}/>