From 42bc94e720e8d4a87542484bc9d86b1ec3e4b354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 5 Aug 2024 15:06:07 +0800 Subject: [PATCH 001/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxAgent/components/roleSetting/index.js | 33 +++++++++++++++++++ pc4mobx/hrmSalary/pages/taxAgent/index.js | 6 ++++ 2 files changed, 39 insertions(+) create mode 100644 pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js new file mode 100644 index 00000000..4dad8b6b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js @@ -0,0 +1,33 @@ +/* + * 个税扣缴义务人-角色设置 + * + * @Author: 黎永顺 + * @Date: 2024/8/5 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaBrowser, WeaLocaleProvider } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + componentDidMount() { + console.log(this.props); + } + + render() { + + return ( + console.log("自定义btn 点击的回调", values)} + inputStyle={{ width: "100%" }} + onChange={(ids, names, datas) => + console.log("单人力", ids, names, datas) + }/> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.js b/pc4mobx/hrmSalary/pages/taxAgent/index.js index 39ceeec2..82120cc3 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.js @@ -7,6 +7,7 @@ import EditModal from "./editModal"; import TipLabel from "../../components/TipLabel"; import { decentralizationConditions, editConditions } from "./editConditions"; import LogDialog from "../../components/logViewModal"; +import RoleSetting from "./components/roleSetting"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -411,6 +412,11 @@ export default class TaxAgent extends React.Component { ); } }; + }else if(item.dataIndex === "role"){ + return { + ...item, + render: (text, record) => () + } } else { return { ...item }; } From b0ac071035d123afee2f251dd249d22a2c11f41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 5 Aug 2024 15:32:23 +0800 Subject: [PATCH 002/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/taxAgent/components/roleSetting/index.js | 5 +++-- .../taxAgent/components/roleSetting/index.less | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.less diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js index 4dad8b6b..a2ce33b7 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js @@ -9,6 +9,7 @@ */ import React, { Component } from "react"; import { WeaBrowser, WeaLocaleProvider } from "ecCom"; +import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -20,9 +21,9 @@ class Index extends Component { render() { return ( - console.log("自定义btn 点击的回调", values)} - inputStyle={{ width: "100%" }} + replaceDatas={[{ id: 1, name: 操作者 }]} onChange={(ids, names, datas) => console.log("单人力", ids, names, datas) }/> diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.less b/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.less new file mode 100644 index 00000000..30d13b6e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.less @@ -0,0 +1,14 @@ +.tax_role_setting_browser .wea-field-readonly { + width: 100%; + display: inline-block !important; + + .wea-field-readonly.border { + cursor: default !important; + } + + .only-operate { + white-space: normal !important; + display: inline !important; + color: #2db7f5; + } +} From 531e975820632a7f198988ccdb74269464381e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 5 Aug 2024 16:16:21 +0800 Subject: [PATCH 003/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/addRoleDialog/index.js | 58 +++++++++++++++++++ .../pages/taxAgent/components/conditions.js | 29 ++++++++++ .../components/{roleSetting => }/index.less | 2 +- .../taxAgent/components/roleSetting/index.js | 31 +++++++--- pc4mobx/hrmSalary/stores/taxAgent.js | 5 ++ 5 files changed, 116 insertions(+), 9 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/taxAgent/components/addRoleDialog/index.js create mode 100644 pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js rename pc4mobx/hrmSalary/pages/taxAgent/components/{roleSetting => }/index.less (82%) diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/addRoleDialog/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/addRoleDialog/index.js new file mode 100644 index 00000000..3bee7608 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/addRoleDialog/index.js @@ -0,0 +1,58 @@ +/* + * 角色新增 + * + * @Author: 黎永顺 + * @Date: 2024/8/5 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { getSearchs } from "../../../../util"; +import { roleConditions } from "../conditions"; +import { Button } from "antd"; +import "../index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("taxAgentStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.setState({ + conditions: _.map(roleConditions, item => ({ + ...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) })) + })) + }, () => this.props.taxAgentStore.roleForm(this.state.conditions)); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.initRoleForm(); + } + + render() { + const { conditions } = this.state; + const { taxAgentStore: { roleForm } } = this.props; + return ( + {getLabel(111, "保存")}, + + ]} + > +
{getSearchs(roleForm, conditions, 1, false)}
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js b/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js new file mode 100644 index 00000000..cfad3e1d --- /dev/null +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js @@ -0,0 +1,29 @@ +export const roleConditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["name"], + fieldcol: 14, + label: "名称", + lanId: 111, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "TEXTAREA", + domkey: ["description"], + fieldcol: 14, + label: "描述", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + } + ], + defaultshow: true, + title: "" + } +]; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.less b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less similarity index 82% rename from pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.less rename to pc4mobx/hrmSalary/pages/taxAgent/components/index.less index 30d13b6e..7d064e3e 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.less +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less @@ -1,4 +1,4 @@ -.tax_role_setting_browser .wea-field-readonly { +.tax_role_setting_browser { width: 100%; display: inline-block !important; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js index a2ce33b7..df837e76 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js @@ -9,24 +9,39 @@ */ import React, { Component } from "react"; import { WeaBrowser, WeaLocaleProvider } from "ecCom"; -import "./index.less"; +import AddRoleDialog from "../addRoleDialog"; +import "../index.less"; const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { + constructor(props) { + super(props); + this.state = { + addRoleDialog: { visible: false, taxAgentId: "" } + }; + } + componentDidMount() { console.log(this.props); } render() { - + const { addRoleDialog } = this.state; + const { taxAgent } = this.props; return ( - console.log("自定义btn 点击的回调", values)} - replaceDatas={[{ id: 1, name: 操作者 }]} - onChange={(ids, names, datas) => - console.log("单人力", ids, names, datas) - }/> + + this.setState({ addRoleDialog: { taxAgentId: taxAgent.id, visible: true } })} + replaceDatas={[{ id: 1, name: 操作者 }]} + onChange={(ids, names, datas) => + console.log("单人力", ids, names, datas) + }/> + this.setState({ + addRoleDialog: { ...addRoleDialog, visible: false } + }, () => callback && callback())}/> + ); } } diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index ef5cfe2d..5168078c 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -8,6 +8,11 @@ import { decentralizationConditions, editConditions } from "../pages/taxAgent/ed const { TableStore } = WeaTableNew; export class TaxAgentStore { + @observable roleForm = new WeaForm(); //权限-角色form表单 + @action initRoleForm = () => this.roleForm = new WeaForm(); + + + @observable tableStore = new TableStore(); // new table @observable form = new WeaForm(); //表单实体 @observable formDecentralization = new WeaForm(); //关闭分权表单 From 2dc1061fa2bae898cc03b74c0bd8e2a6011d1726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 7 Aug 2024 09:02:12 +0800 Subject: [PATCH 004/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 11 ++ .../components/addRoleDialog/index.js | 38 +++++- .../pages/taxAgent/components/index.less | 74 ++++++++++- .../components/roleDetailSetDialog/index.js | 123 ++++++++++++++++++ .../taxAgent/components/roleSetting/index.js | 56 ++++++-- pc4mobx/hrmSalary/pages/taxAgent/index.js | 6 +- 6 files changed, 283 insertions(+), 25 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index f3c527b1..fff90ce4 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -98,3 +98,14 @@ export const getTaxAgentSelectListAsAdmin = (params) => { export const hasIconInTax = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/sys/conf/code?code=hideIconInTax", "GET", params); }; + +/**权限-角色相关*/ +//保存角色 +export const saveAuthRole = (params) => { + return postFetch("/api/bs/hrmsalary/auth/role/save", params); +}; +//删除角色 +export const deleteAuthRole = (params) => { + return postFetch("/api/bs/hrmsalary/auth/role/delete", params); +}; + diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/addRoleDialog/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/addRoleDialog/index.js index 3bee7608..e196b343 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/addRoleDialog/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/addRoleDialog/index.js @@ -10,9 +10,10 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button, message } from "antd"; import { getSearchs } from "../../../../util"; import { roleConditions } from "../conditions"; -import { Button } from "antd"; +import * as API from "../../../../apis/taxAgent"; import "../index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -33,20 +34,43 @@ class Index extends Component { conditions: _.map(roleConditions, item => ({ ...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) })) })) - }, () => this.props.taxAgentStore.roleForm(this.state.conditions)); + }, () => nextProps.taxAgentStore.roleForm.initFormFields(this.state.conditions)); } - if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.initRoleForm(); + if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.taxAgentStore.initRoleForm(); } + save = (isSetting) => { + const { taxAgentStore: { roleForm }, taxAgentId } = this.props; + roleForm.validateForm().then(f => { + if (f.isValid) { + const payload = roleForm.getFormParams(); + this.setState({ loading: true }); + API.saveAuthRole({ ...payload, taxAgentId }).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.props.onCancel(() => this.props.onSearch()); + isSetting && this.props.showRoleSetDialog({ id: data, name: payload.name }); + } else { + message.error(errormsg); + } + }); + } else { + f.showErrors(); + } + }); + }; + render() { - const { conditions } = this.state; + const { conditions, loading, roleSetDialog } = this.state; const { taxAgentStore: { roleForm } } = this.props; return ( {getLabel(111, "保存")}, - + , + ]} >
{getSearchs(roleForm, conditions, 1, false)}
diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/index.less b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less index 7d064e3e..aa53099d 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/index.less +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less @@ -6,9 +6,77 @@ cursor: default !important; } + .wea-field-readonly.border .child-item { + margin-bottom: 4px; + } + .only-operate { - white-space: normal !important; - display: inline !important; - color: #2db7f5; + position: relative; + + & > a { + white-space: normal !important; + display: inline !important; + color: #2db7f5; + } + + } + + .only-operate:hover { + .ant-select-selection__choice__remove { + visibility: visible; + } + } + + .ant-select-selection__choice__remove:before { + content: "\E62D"; + font-family: anticon !important; + } + + .ant-select-selection__choice__remove { + visibility: hidden; + right: -3px; + font-size: 12px !important; + top: 50%; + margin-top: -6px; + text-decoration: none; + position: static; + padding: 0; + cursor: pointer; + transform: scale(.66666667) rotate(0deg); + } +} + +.tax_role_set_dialog { + .tax_role_set_container { + padding: 10px 25px; + + .tax_role_row_groupname { + padding: 10px 0; + } + + .tax_role_form_item { + min-height: 190px; + border: 1px solid rgb(217, 217, 217); + + & > .wea-select { + margin: 10px 10px 0 20px; + line-height: 25px; + } + + .tax_role_operator_setting { + border-top: 1px solid rgb(217, 217, 217); + padding: 8px; + display: table; + width: 100%; + + & > div { + text-align: right; + } + } + + .tax_role_browser_form_item { + margin: 12px 14px; + } + } } } diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js new file mode 100644 index 00000000..d39d5af8 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js @@ -0,0 +1,123 @@ +/* + * 角色详情设置弹窗 + * + * @Author: 黎永顺 + * @Date: 2024/8/5 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaBrowser, WeaDialog, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSelect, WeaTab, WeaTextarea } from "ecCom"; +import { commonEnumList } from "../../../../apis/archive"; +import { Button, Col, Row } from "antd"; +import "../index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "auth.MemberTargetTypeEnum", name: "", options: [], enumType: "" + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.setState({ name: nextProps.name, selectedKey: "auth.MemberTargetTypeEnum" }, () => this.getEnumList()); + } + } + + getEnumList = () => { + const payload = { enumClass: `com.engine.salary.enums.${this.state.selectedKey}` }; + commonEnumList(payload).then(({ status, data }) => { + if (status) this.setState({ + options: _.map(data, o => ({ key: o.enum, showname: o.defaultLabel })), + enumType: _.head(data).enum || "" + }); + if (!status) this.setState({ options: [], enumType: "" }); + }); + }; + getOperatorSetting = () => { + const { selectedKey, enumType } = this.state; + if (selectedKey !== "auth.AuthTargetTypeEnum") { + let browserType = {}; + switch (enumType) { + case "EMP": + browserType = { ...browserType, type: 17, title: getLabel(82246, "人员选择") }; + break; + case "DEPARTMENT": + browserType = { ...browserType, type: 57, title: getLabel(111, "部门选择") }; + break; + case "JOB": + browserType = { ...browserType, type: 278, title: getLabel(111, "岗位选择") }; + break; + case "SUB_COMPANY": + browserType = { ...browserType, type: 164, title: getLabel(111, "分部选择") }; + break; + case "ROLE": + browserType = { ...browserType, type: 65, title: getLabel(111, "角色选择") }; + break; + case "SQL": + return ( + + ); + default: + break; + } + return ( + + ); + } else { + return (权限); + } + }; + + render() { + const { selectedKey, name, options, enumType } = this.state; + const tabs = [ + { title: getLabel(111, "成员"), viewcondition: "auth.MemberTargetTypeEnum" }, + { title: getLabel(111, "权限"), viewcondition: "auth.AuthTargetTypeEnum" }, + { title: getLabel(111, "数据"), viewcondition: "auth.DataTargetTypeEnum" } + ]; + return ( + +
+ + + + this.setState({ name: val })}/> + + + + +
+ this.setState({ + selectedKey: v, name: !name ? null : name + }, () => this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getEnumList())}/> + this.setState({ enumType: v })}/> + {this.getOperatorSetting()} + + + +
+
+ +
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js index df837e76..31e392d8 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js @@ -9,7 +9,10 @@ */ import React, { Component } from "react"; import { WeaBrowser, WeaLocaleProvider } from "ecCom"; +import { message, Modal } from "antd"; import AddRoleDialog from "../addRoleDialog"; +import RoleDetailSetDialog from "../roleDetailSetDialog"; +import * as API from "../../../../apis/taxAgent"; import "../index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -18,29 +21,58 @@ class Index extends Component { constructor(props) { super(props); this.state = { - addRoleDialog: { visible: false, taxAgentId: "" } + addRoleDialog: { visible: false, taxAgentId: "" }, + roleSetDialog: { visible: false, roleId: "", name: "" } }; } - componentDidMount() { - console.log(this.props); - } + showRoleSetDialog = (role) => this.setState({ roleSetDialog: { visible: true, roleId: role.id, name: role.name } }); + deleteAuthRole = (role) => { + Modal.confirm({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "确认要删除吗?"), + onOk: () => { + API.deleteAuthRole([role.id]).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.props.onSearch(); + } else { + message.error(errormsg); + } + }); + } + }); + + }; render() { - const { addRoleDialog } = this.state; - const { taxAgent } = this.props; + const { addRoleDialog, roleSetDialog } = this.state; + const { taxAgent, onSearch } = this.props; + const { role } = taxAgent; return ( - this.setState({ addRoleDialog: { taxAgentId: taxAgent.id, visible: true } })} - replaceDatas={[{ id: 1, name: 操作者 }]} - onChange={(ids, names, datas) => - console.log("单人力", ids, names, datas) - }/> - ({ + id: o.id, + name: + this.showRoleSetDialog(o)}>{o.name} + this.deleteAuthRole(o)}/> + + }))}/> + {/*添加角色*/} + this.setState({ addRoleDialog: { ...addRoleDialog, visible: false } }, () => callback && callback())}/> + {/*角色详情设置*/} + this.setState({ + roleSetDialog: { ...roleSetDialog, visible: false } + }, () => callback && callback())}/> ); } diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.js b/pc4mobx/hrmSalary/pages/taxAgent/index.js index 82120cc3..3fd39f88 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.js @@ -412,11 +412,11 @@ export default class TaxAgent extends React.Component { ); } }; - }else if(item.dataIndex === "role"){ + } else if (item.dataIndex === "role") { return { ...item, - render: (text, record) => () - } + render: (text, record) => ( getTaxAgentList({})}/>) + }; } else { return { ...item }; } From 6e7137b6b3007701fa034dc0dd12aac515e8beb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 7 Aug 2024 14:02:27 +0800 Subject: [PATCH 005/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 8 ++ .../pages/taxAgent/components/index.less | 6 ++ .../components/roleDetailSetDialog/index.js | 81 +++++++++++++++++-- 3 files changed, 88 insertions(+), 7 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index fff90ce4..fb5d8945 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -108,4 +108,12 @@ export const saveAuthRole = (params) => { export const deleteAuthRole = (params) => { return postFetch("/api/bs/hrmsalary/auth/role/delete", params); }; +//成员列表 +export const authMemberList = (params) => { + return postFetch("/api/bs/hrmsalary/auth/member/list", params); +}; +//数据列表 +export const authDataList = (params) => { + return postFetch("/api/bs/hrmsalary/auth/data/list", params); +}; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/index.less b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less index aa53099d..f1e20c81 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/index.less +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less @@ -78,5 +78,11 @@ margin: 12px 14px; } } + + .tax_role_operator_setting_table { + .setting_table_title { + //line-height: 45px; + } + } } } diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js index d39d5af8..3a7a1247 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js @@ -8,24 +8,43 @@ * @description: */ import React, { Component } from "react"; -import { WeaBrowser, WeaDialog, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSelect, WeaTab, WeaTextarea } from "ecCom"; +import { + WeaBrowser, + WeaDialog, + WeaFormItem, + WeaInput, + WeaLocaleProvider, + WeaSelect, + WeaTab, + WeaTable, + WeaTextarea +} from "ecCom"; import { commonEnumList } from "../../../../apis/archive"; +import * as API from "../../../../apis/taxAgent"; import { Button, Col, Row } from "antd"; import "../index.less"; const getLabel = WeaLocaleProvider.getLabel; +const APIFOX = { + "auth.MemberTargetTypeEnum": API.authMemberList, + "auth.DataTargetTypeEnum": API.authDataList +}; class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "auth.MemberTargetTypeEnum", name: "", options: [], enumType: "" + selectedKey: "auth.MemberTargetTypeEnum", name: "", options: [], enumType: "", + columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 } }; } componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { - this.setState({ name: nextProps.name, selectedKey: "auth.MemberTargetTypeEnum" }, () => this.getEnumList()); + this.setState({ name: nextProps.name, selectedKey: "auth.MemberTargetTypeEnum" }, () => { + this.getEnumList(); + this.getSettingRoler(nextProps.roleId); + }); } } @@ -39,6 +58,26 @@ class Index extends Component { if (!status) this.setState({ options: [], enumType: "" }); }); }; + getSettingRoler = (roleId) => { + const { selectedKey, pageInfo } = this.state; + APIFOX[selectedKey]({ roleId, ...pageInfo }).then(({ status, data }) => { + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: _.map(columns, o => { + if (o.dataIndex === "targetType") { + return { + ...o, + render: (txt, record) => ({txt}) + }; + } + return { ...o }; + }) + }); + } + }); + }; getOperatorSetting = () => { const { selectedKey, enumType } = this.state; if (selectedKey !== "auth.AuthTargetTypeEnum") { @@ -61,7 +100,7 @@ class Index extends Component { break; case "SQL": return ( - + ); default: break; @@ -75,12 +114,30 @@ class Index extends Component { }; render() { - const { selectedKey, name, options, enumType } = this.state; + const { roleId } = this.props; + const { selectedKey, name, options, enumType, pageInfo, columns, dataSource } = this.state; const tabs = [ { title: getLabel(111, "成员"), viewcondition: "auth.MemberTargetTypeEnum" }, { title: getLabel(111, "权限"), viewcondition: "auth.AuthTargetTypeEnum" }, { title: getLabel(111, "数据"), viewcondition: "auth.DataTargetTypeEnum" } ]; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.getSettingRoler(roleId)); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getSettingRoler(roleId)); + } + }; return ( this.setState({ selectedKey: v, name: !name ? null : name - }, () => this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getEnumList())}/> + }, () => { + this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getEnumList(); + this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getSettingRoler(roleId); + })}/> this.setState({ enumType: v })}/> {this.getOperatorSetting()} @@ -113,7 +173,14 @@ class Index extends Component { - + {/*表格*/} + + +
{getLabel(111, "已设操作者")}
+ + +
); From 71b4e766af5e699d645874ae35093bc2a2007923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 8 Aug 2024 11:10:24 +0800 Subject: [PATCH 006/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 12 +++ .../pages/taxAgent/components/index.less | 4 +- .../components/roleDetailSetDialog/index.js | 86 +++++++++++++++---- 3 files changed, 82 insertions(+), 20 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index fb5d8945..499d25c2 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -112,8 +112,20 @@ export const deleteAuthRole = (params) => { export const authMemberList = (params) => { return postFetch("/api/bs/hrmsalary/auth/member/list", params); }; +//保存成员 +export const saveAuthMember = (params) => { + return postFetch("/api/bs/hrmsalary/auth/member/save", params); +}; //数据列表 export const authDataList = (params) => { return postFetch("/api/bs/hrmsalary/auth/data/list", params); }; +//保存数据 +export const saveAuthData = (params) => { + return postFetch("/api/bs/hrmsalary/auth/data/save", params); +}; +//同步数据 +export const syncAuthData = (params) => { + return postFetch("/api/bs/hrmsalary/auth/data/sync", params); +}; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/index.less b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less index f1e20c81..85b34deb 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/index.less +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less @@ -81,7 +81,9 @@ .tax_role_operator_setting_table { .setting_table_title { - //line-height: 45px; + & > .operator { + line-height: 45px; + } } } } diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js index 3a7a1247..a4d5dde9 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js @@ -14,6 +14,7 @@ import { WeaFormItem, WeaInput, WeaLocaleProvider, + WeaScope, WeaSelect, WeaTab, WeaTable, @@ -21,13 +22,15 @@ import { } from "ecCom"; import { commonEnumList } from "../../../../apis/archive"; import * as API from "../../../../apis/taxAgent"; -import { Button, Col, Row } from "antd"; +import { Button, Col, message, Modal, Row } from "antd"; import "../index.less"; const getLabel = WeaLocaleProvider.getLabel; const APIFOX = { "auth.MemberTargetTypeEnum": API.authMemberList, - "auth.DataTargetTypeEnum": API.authDataList + "save.auth.MemberTargetTypeEnum": API.saveAuthMember, + "auth.DataTargetTypeEnum": API.authDataList, + "save.auth.DataTargetTypeEnum": API.saveAuthData }; class Index extends Component { @@ -35,6 +38,7 @@ class Index extends Component { super(props); this.state = { selectedKey: "auth.MemberTargetTypeEnum", name: "", options: [], enumType: "", + replaceDatas: [], loading: { set: false, query: false, async: false }, columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 } }; } @@ -45,6 +49,8 @@ class Index extends Component { this.getEnumList(); this.getSettingRoler(nextProps.roleId); }); + } else { + this.setState({ replaceDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 } }); } } @@ -60,26 +66,56 @@ class Index extends Component { }; getSettingRoler = (roleId) => { const { selectedKey, pageInfo } = this.state; + this.setState({ loading: { ...this.state.loading, query: true } }); APIFOX[selectedKey]({ roleId, ...pageInfo }).then(({ status, data }) => { + this.setState({ loading: { ...this.state.loading, query: false } }); if (status) { const { columns, list: dataSource, pageNum: current, pageSize, total } = data; this.setState({ dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, columns: _.map(columns, o => { - if (o.dataIndex === "targetType") { - return { - ...o, - render: (txt, record) => ({txt}) - }; - } return { ...o }; }) }); } }); }; + addOperatorSettings = () => { + const { roleId } = this.props; + const { selectedKey, enumType: targetType, replaceDatas } = this.state; + if (_.isEmpty(replaceDatas)) { + Modal.warning({ + title: getLabel(111, "系统提示"), + content: getLabel(111, "请先选择操作对象的值!") + }); + return; + } + const payload = _.map(replaceDatas, o => ({ roleId, targetType, target: o.id || "", targetName: o.name || "" })); + this.setState({ loading: { ...this.state.loading, set: true } }); + APIFOX[`save.${selectedKey}`](payload).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, set: false } }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.getSettingRoler(roleId); + } else { + message.error(errormsg); + } + }); + }; + syncAuthData = () => { + const { roleId } = this.props; + this.setState({ async: true }); + API.syncAuthData({ roleId }).then(({ status, errormsg }) => { + this.setState({ async: false }); + if (status) { + message.success(getLabel(111, "操作成功!")); + } else { + message.error(errormsg); + } + }); + }; getOperatorSetting = () => { - const { selectedKey, enumType } = this.state; + const { selectedKey, enumType, replaceDatas } = this.state; if (selectedKey !== "auth.AuthTargetTypeEnum") { let browserType = {}; switch (enumType) { @@ -100,13 +136,21 @@ class Index extends Component { break; case "SQL": return ( - + this.setState({ replaceDatas: [{ id: v, name: v }] })}/> ); + case "LEVEL": + return ( + + ); default: - break; + return (); } return ( - + this.setState({ replaceDatas })}/> ); } else { return (权限); @@ -115,7 +159,7 @@ class Index extends Component { render() { const { roleId } = this.props; - const { selectedKey, name, options, enumType, pageInfo, columns, dataSource } = this.state; + const { selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading } = this.state; const tabs = [ { title: getLabel(111, "成员"), viewcondition: "auth.MemberTargetTypeEnum" }, { title: getLabel(111, "权限"), viewcondition: "auth.AuthTargetTypeEnum" }, @@ -141,6 +185,9 @@ class Index extends Component { return ( {getLabel(111, "同步")} + ]} style={{ width: 960, height: 606.6, minHeight: 200, minWidth: 380, maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" @@ -160,25 +207,26 @@ class Index extends Component {
this.setState({ - selectedKey: v, name: !name ? null : name + selectedKey: v, name: !name ? null : name, replaceDatas: [] }, () => { this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getEnumList(); this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getSettingRoler(roleId); })}/> this.setState({ enumType: v })}/> + onChange={v => this.setState({ enumType: v, replaceDatas: [] })}/> {this.getOperatorSetting()} - +
{/*表格*/} -
{getLabel(111, "已设操作者")}
- +
{getLabel(111, "已设操作者")}
+
From 87aa53955f1ba5218f9ec59c46bfbc60214f79fc 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, 16 Aug 2024 15:05:51 +0800 Subject: [PATCH 007/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/columns.js | 52 ------------------- pc4mobx/hrmSalary/pages/salaryItem/options.js | 2 - 2 files changed, 54 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js index b2cae4bd..7e868d31 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js @@ -2,58 +2,6 @@ import { WeaLocaleProvider } from "ecCom"; import { dataTypeOptions, patternOptions, roundingModeOptions } from "./options"; const getLabel = WeaLocaleProvider.getLabel; -export const columns = [ - { - title: "名称", - dataIndex: "title", - key: "title" - }, - { - title: "属性", - dataIndex: "title", - key: "title" - }, - { - title: "类型", - dataIndex: "title", - key: "title" - }, - { - title: "薪资档案引用", - dataIndex: "refere", - key: "refere" - }, - { - title: "默认使用", - dataIndex: "refere", - key: "refere" - }, - { - title: "进位规则", - dataIndex: "title", - key: "title" - }, - { - title: "保留小数位", - dataIndex: "title", - key: "title" - }, - { - title: "取值方式", - dataIndex: "title", - key: "title" - }, - { - title: "备注", - dataIndex: "title", - key: "title" - }, - { - title: "操作", - dataIndex: "cz", - key: "cz" - } -]; export const salaryItemFields = [ { key: "name", diff --git a/pc4mobx/hrmSalary/pages/salaryItem/options.js b/pc4mobx/hrmSalary/pages/salaryItem/options.js index 58e64e3e..e7ac5f78 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/options.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/options.js @@ -25,7 +25,6 @@ export const roundingModeOptions = [ showname: "见分进角" } ]; - export const patternOptions = [ { key: "0", @@ -83,7 +82,6 @@ export const patternOptions = [ selected: false } ]; - export const dataTypeOptions = [ { key: "number", From fd3d8b5ec4155ab4833dc7a97f2a8a3c8f5b3c94 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, 16 Aug 2024 16:18:08 +0800 Subject: [PATCH 008/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/index.js | 190 ++++++------------ pc4mobx/hrmSalary/pages/salaryItem/index.less | 15 ++ .../pages/salaryItem/salaryItemsTable.js | 67 ++++++ 3 files changed, 147 insertions(+), 125 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 09875add..64863656 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -1,17 +1,16 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { Button, Dropdown, Menu, message, Modal, Switch } from "antd"; -import { WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTop } from "ecCom"; -import { renderLoading, toDecimal_n } from "../../util"; -import CustomTab from "../../components/customTab"; +import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTop } from "ecCom"; +import SalaryItemsTable from "./salaryItemsTable"; +import { toDecimal_n } from "../../util"; import SystemSalaryItemModal from "./systemSalaryItemModal"; -import { columns } from "./columns"; import SlideModalTitle from "../../components/slideModalTitle"; import CustomSalaryItemSlide from "./customSalaryItemSlide"; -import CustomPaginationTable from "../../components/customPaginationTable"; import SyncToSalaryAccountSetDialog from "./syncToSalaryAccountSetDialog"; import "../socialSecurityBenefits/programme/index.less"; import LogDialog from "../../components/logViewModal"; +import "./index.less"; const { getLabel } = WeaLocaleProvider; @inject("salaryItemStore", "taxAgentStore", "salaryFileStore") @@ -20,6 +19,9 @@ export default class SalaryItem extends React.Component { constructor(props) { super(props); this.state = { + name: "", isQuery: false, + + value: "", selectedKey: "0", editable: false, @@ -31,43 +33,25 @@ export default class SalaryItem extends React.Component { syncSalarySetDialog: { visible: false, title: "", id: "" }, logDialogVisible: false, filterConditions: "[]" }; - columns.map(item => { - if (item.dataIndex == "refere") { - item.render = () => { - return ( - - ); - }; - } else if (item.dataIndex == "cz") { - item.render = () => { - return (
- 编辑 - 删除 - {/* 操作日志 */} -
); - }; - - } - }); this.record = {}; } componentWillMount() { // 初始化渲染页面 - const { salaryItemStore: { getTableDatas }, salaryFileStore, taxAgentStore } = this.props; - const { commonEnumList } = salaryFileStore; - const { fetchTaxAgentOption } = taxAgentStore; - fetchTaxAgentOption(); - commonEnumList("user", { enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" }); - getTableDatas({}).then(res => { - this.setState({ - searchParams: { - ...this.state.searchParams, - current: res.pageNum, - total: res.total - } - }); - }); + // const { salaryItemStore: { getTableDatas }, salaryFileStore, taxAgentStore } = this.props; + // const { commonEnumList } = salaryFileStore; + // const { fetchTaxAgentOption } = taxAgentStore; + // fetchTaxAgentOption(); + // commonEnumList("user", { enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" }); + // getTableDatas({}).then(res => { + // this.setState({ + // searchParams: { + // ...this.state.searchParams, + // current: res.pageNum, + // total: res.total + // } + // }); + // }); } onEditItem = (record, isedit) => { @@ -225,7 +209,7 @@ export default class SalaryItem extends React.Component { taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentOption } } = this.props; const { userStatusList } = salaryFileStore; - const { selectedRowKeys, logDialogVisible, filterConditions } = this.state; + const { selectedRowKeys, logDialogVisible, filterConditions, name, isQuery } = this.state; const { loading, deleteItemRequest, getTableDatas } = salaryItemStore; const { tableDataSource, @@ -236,9 +220,6 @@ export default class SalaryItem extends React.Component { setEditSlideVisible, request } = salaryItemStore; - if (this.getColumns().length === 2) { // 无权限处理 - return renderLoading(); - } const handleMenuClick = (e) => { const { salaryItemStore: { setEditSlideVisible, initRequest } } = this.props; @@ -257,51 +238,16 @@ export default class SalaryItem extends React.Component { ); - const renderRightOperation = () => { - return (
- { - (showOperateBtn || showSalaryItemBtn) && - handleMenuClick({ key: "1" })} - style={{ marginRight: "10px" }}>{getLabel(111, "新增自定义薪资项")} - } - { - (showOperateBtn || showSalaryItemBtn) && - - } - { - this.setState({ searchValue: value }); - }} onSearch={(value) => { - this.handleSearch(value); - }}/> -
); - - }; - + let buttons = [ + handleMenuClick({ key: "1" })}>{getLabel(111, "新增自定义薪资项")}, + , + this.setState({ name: val })} + placeholder={getLabel(111, "请输入名称")} onSearch={() => this.setState({ isQuery: !isQuery })}/> + ]; + const dropMenuDatas = [ + { key: "log", icon: , content: getLabel(545781, "操作日志") } + ]; // 新建和修改保存的回调 const handleSlideSave = (continueFlag) => { const { salaryItemStore: { saveItem, request, getTableDatas } } = this.props; @@ -372,45 +318,39 @@ export default class SalaryItem extends React.Component { disabled: !record.canDelete // Column configuration not to be checked }) }; + !(showOperateBtn || showSalaryItemBtn) && (buttons = buttons.slice(-1)); return ( -
- } iconBgcolor="#F14A2D" - showDropIcon onDropMenuClick={this.onDropMenuClick} - dropMenuDatas={[ - { - key: "log", icon: , - content: getLabel(545781, "操作日志") - } - ]} - > - -
- - record.id} - loading={loading} - rowSelection={rowSelection} - dataSource={tableDataSource} - columns={this.getColumns(tableColumns)} - total={this.state.searchParams.total} - current={this.state.searchParams.current} - pageSize={this.state.searchParams.pageSize} - onPageChange={(value) => { - this.handlePageChange(value); - }} - onShowSizeChange={(current, pageSize) => { - this.setState({ - searchParams: { - ...this.state.searchParams, - current, - pageSize - } - }, () => { - this.handleShowSizeChange({ name: this.state.searchValue, ...this.state.searchParams }); - }); - }} - /> - + + } iconBgcolor="#F14A2D" + buttons={buttons} showDropIcon onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas} + className="salaryProjectManagement"> +
+ {/**/} + {/* record.id}*/} + {/* loading={loading}*/} + {/* rowSelection={rowSelection}*/} + {/* dataSource={tableDataSource}*/} + {/* columns={this.getColumns(tableColumns)}*/} + {/* total={this.state.searchParams.total}*/} + {/* current={this.state.searchParams.current}*/} + {/* pageSize={this.state.searchParams.pageSize}*/} + {/* onPageChange={(value) => {*/} + {/* this.handlePageChange(value);*/} + {/* }}*/} + {/* onShowSizeChange={(current, pageSize) => {*/} + {/* this.setState({*/} + {/* searchParams: {*/} + {/* ...this.state.searchParams,*/} + {/* current,*/} + {/* pageSize*/} + {/* }*/} + {/* }, () => {*/} + {/* this.handleShowSizeChange({ name: this.state.searchValue, ...this.state.searchParams });*/} + {/* });*/} + {/* }}*/} + {/* />*/} + {/**/}
setEditSlideVisible(false)} /> } -
+ ); } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index 1d28f1ca..ed8aff62 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -1,3 +1,18 @@ +//薪资项目重构项 +.salaryProjectManagement { + .wea-input-focus { + height: 31.36px; + line-height: 0; + } + + .salaryItems_content { + height: 100%; + padding: 16px 16px 0 16px; + //background: #e5e5e5; + } +} + + .customSalaryItemSlide { padding: 16px; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js new file mode 100644 index 00000000..ac384499 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js @@ -0,0 +1,67 @@ +/* + * 薪资项目管理 + * 表格 + * @Author: 黎永顺 + * @Date: 2024/8/16 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import * as API from "../../apis/item"; + +const getLabel = WeaLocaleProvider.getLabel; + +class SalaryItemsTable extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, columns: [], dataSource: [], + pageInfo: { current: 1, pageSize: 10, total: 10 } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.isQuery !== this.props.isQuery) this.getItemList(nextProps); + } + + getItemList = (props) => { + const { name } = props; + const { pageInfo } = this.state; + const payload = { name, ...pageInfo }; + this.setState({ loading: true }); + API.getItemList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns + }); + } + }); + }; + + render() { + const { dataSource, columns, pageInfo } = this.state; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.getItemList(this.props)); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getItemList(this.props)); + } + }; + return (); + } +} + +export default SalaryItemsTable; From d1fc6e4ea0e8aad90991ae8c808391b9ac3be39e 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, 16 Aug 2024 16:19:00 +0800 Subject: [PATCH 009/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js index ac384499..00f53a98 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js @@ -22,6 +22,10 @@ class SalaryItemsTable extends Component { }; } + componentDidMount() { + this.getItemList(this.props); + } + componentWillReceiveProps(nextProps, nextContext) { if (nextProps.isQuery !== this.props.isQuery) this.getItemList(nextProps); } From b9e7b3743993d99a95de93808289de190a8fd2b1 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, 16 Aug 2024 16:19:21 +0800 Subject: [PATCH 010/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js index 00f53a98..e37acfe9 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js @@ -18,7 +18,7 @@ class SalaryItemsTable extends Component { super(props); this.state = { loading: false, columns: [], dataSource: [], - pageInfo: { current: 1, pageSize: 10, total: 10 } + pageInfo: { current: 1, pageSize: 10, total: 0 } }; } From 6ec8cb76ce73b3f593b84868e67e98e177174e9d 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, 16 Aug 2024 17:06:42 +0800 Subject: [PATCH 011/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/index.js | 4 ++- pc4mobx/hrmSalary/pages/salaryItem/index.less | 2 -- .../pages/salaryItem/salaryItemsTable.js | 27 +++++++++++++++---- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 64863656..0bf9a81b 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -324,7 +324,9 @@ export default class SalaryItem extends React.Component { } iconBgcolor="#F14A2D" buttons={buttons} showDropIcon onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas} className="salaryProjectManagement"> -
+
this.setState({ selectedRowKeys: val })}/> {/**/} {/* record.id}*/} diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index ed8aff62..0ddab0d2 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -7,8 +7,6 @@ .salaryItems_content { height: 100%; - padding: 16px 16px 0 16px; - //background: #e5e5e5; } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js index e37acfe9..93a18aea 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js @@ -8,7 +8,7 @@ * @description: */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { WeaCheckbox, WeaLocaleProvider, WeaTable } from "ecCom"; import * as API from "../../apis/item"; const getLabel = WeaLocaleProvider.getLabel; @@ -17,7 +17,7 @@ class SalaryItemsTable extends Component { constructor(props) { super(props); this.state = { - loading: false, columns: [], dataSource: [], + loading: false, columns: [], dataSource: [], selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 } }; } @@ -41,14 +41,20 @@ class SalaryItemsTable extends Component { const { columns, list: dataSource, pageNum: current, pageSize, total } = data; this.setState({ dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, - columns + columns: _.map(columns, o => { + if (o.dataIndex === "useDefault" || o.dataIndex === "hideDefault" || o.dataIndex === "useInEmployeeSalary") { + return { ...o, width: 80, render: text => }; + } + return { ...o }; + }) }); } }); }; render() { - const { dataSource, columns, pageInfo } = this.state; + const { dataSource, columns, pageInfo, selectedRowKeys } = this.state; + // const { selectedRowKeys, onChange } = this.props; const pagination = { ...pageInfo, showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`, @@ -64,7 +70,18 @@ class SalaryItemsTable extends Component { this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getItemList(this.props)); } }; - return (); + const rowSelection = { + selectedRowKeys, + onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }), + getCheckboxProps: record => { + console.log(record) + return ({ + disabled: !record.canDelete + }) + } + }; + return (); } } From a101de8355d089862d3e9f7e92f5b8a17a87efd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 19 Aug 2024 09:10:47 +0800 Subject: [PATCH 012/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/index.js | 35 ++++----- .../pages/salaryItem/salaryItemsTable.js | 72 +++++++++++++++---- 2 files changed, 77 insertions(+), 30 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 0bf9a81b..8f61de7b 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -2,6 +2,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { Button, Dropdown, Menu, message, Modal, Switch } from "antd"; import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTop } from "ecCom"; +import * as API from "../../apis/item"; import SalaryItemsTable from "./salaryItemsTable"; import { toDecimal_n } from "../../util"; import SystemSalaryItemModal from "./systemSalaryItemModal"; @@ -68,28 +69,29 @@ export default class SalaryItem extends React.Component { }); }; - // 删除列表项 - handleDeleteItem(record) { - const { salaryItemStore: { deleteItemRequest, getTableDatas } } = this.props; + handleDeleteItem = () => { + const { selectedRowKeys, isQuery } = this.state; + if (_.isEmpty(selectedRowKeys)) { + message.warning(getLabel(111, "请勾选数据!")); + return; + } Modal.confirm({ - title: "信息确认", - content: "确认删除该条数据吗?", + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确认删除吗?"), onOk: () => { - deleteItemRequest([record.id]).then(() => { - getTableDatas({ ...this.state.searchParams }).then(res => { - this.setState({ - searchParams: { - ...this.state.searchParams, - total: res.total - } - }); - }); + API.deleteItem(selectedRowKeys).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ isQuery: !isQuery }); + } else { + message.error(errormsg); + } }); }, onCancel: () => { } }); - } + }; getColumns = () => { const { salaryItemStore, taxAgentStore: { showSalaryItemBtn, showOperateBtn } } = this.props; @@ -241,7 +243,7 @@ export default class SalaryItem extends React.Component { let buttons = [ handleMenuClick({ key: "1" })}>{getLabel(111, "新增自定义薪资项")}, - , + , this.setState({ name: val })} placeholder={getLabel(111, "请输入名称")} onSearch={() => this.setState({ isQuery: !isQuery })}/> ]; @@ -326,6 +328,7 @@ export default class SalaryItem extends React.Component { className="salaryProjectManagement">
this.setState({ selectedRowKeys: val })}/> {/**/} {/* this.getItemList(nextProps)); } getItemList = (props) => { @@ -51,10 +54,30 @@ class SalaryItemsTable extends Component { } }); }; + handleDeleteItem = (record) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确认删除吗?"), + onOk: () => { + API.deleteItem(selectedRowKeys).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.getItemList(this.props); + } else { + message.error(errormsg); + } + }); + }, + onCancel: () => { + } + }); + }; render() { - const { dataSource, columns, pageInfo, selectedRowKeys } = this.state; - // const { selectedRowKeys, onChange } = this.props; + const { dataSource, columns, pageInfo, loading } = this.state; + const { + selectedRowKeys, onChange, onDropMenuClick, taxAgentStore: { showOperateBtn, showSalaryItemBtn } + } = this.props; const pagination = { ...pageInfo, showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`, @@ -71,17 +94,38 @@ class SalaryItemsTable extends Component { } }; const rowSelection = { - selectedRowKeys, - onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }), - getCheckboxProps: record => { - console.log(record) - return ({ - disabled: !record.canDelete - }) - } + selectedRowKeys, onChange, + getCheckboxProps: record => ({ + disabled: !record.canDelete + }) }; - return (); + return ( + ( + {(showOperateBtn || showSalaryItemBtn) ? getLabel(111, "编辑") : getLabel(111, "查看")} + { + (showOperateBtn || showSalaryItemBtn) && record.canDelete && + this.handleDeleteItem(record)}>{getLabel(111, "删除")} + } + + + onDropMenuClick("log", record.id)}>{getLabel(545781, "操作日志")} + + + }> + + + ) + } + ]}/>); } } From 3cff712ae950378e8c69a86e432c564245cfee75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 10:35:32 +0800 Subject: [PATCH 013/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/index.js | 42 ++------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 8f61de7b..c6729999 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -239,7 +239,6 @@ export default class SalaryItem extends React.Component { {getLabel(111, "新增系统薪资项")} ); - let buttons = [ handleMenuClick({ key: "1" })}>{getLabel(111, "新增自定义薪资项")}, @@ -313,49 +312,16 @@ export default class SalaryItem extends React.Component { const { salaryItemStore: { setRequest } } = this.props; setRequest(value); }; - const rowSelection = { - selectedRowKeys, - onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }), - getCheckboxProps: record => ({ - disabled: !record.canDelete // Column configuration not to be checked - }) - }; !(showOperateBtn || showSalaryItemBtn) && (buttons = buttons.slice(-1)); return ( } iconBgcolor="#F14A2D" buttons={buttons} showDropIcon onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas} className="salaryProjectManagement"> -
this.setState({ selectedRowKeys: val })}/> - {/**/} - {/* record.id}*/} - {/* loading={loading}*/} - {/* rowSelection={rowSelection}*/} - {/* dataSource={tableDataSource}*/} - {/* columns={this.getColumns(tableColumns)}*/} - {/* total={this.state.searchParams.total}*/} - {/* current={this.state.searchParams.current}*/} - {/* pageSize={this.state.searchParams.pageSize}*/} - {/* onPageChange={(value) => {*/} - {/* this.handlePageChange(value);*/} - {/* }}*/} - {/* onShowSizeChange={(current, pageSize) => {*/} - {/* this.setState({*/} - {/* searchParams: {*/} - {/* ...this.state.searchParams,*/} - {/* current,*/} - {/* pageSize*/} - {/* }*/} - {/* }, () => {*/} - {/* this.handleShowSizeChange({ name: this.state.searchValue, ...this.state.searchParams });*/} - {/* });*/} - {/* }}*/} - {/* />*/} - {/**/} +
+ this.setState({ selectedRowKeys: val })}/>
Date: Tue, 20 Aug 2024 11:09:29 +0800 Subject: [PATCH 014/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salaryItem/customSalaryItemSlide.js | 54 +++++----- pc4mobx/hrmSalary/pages/salaryItem/index.js | 100 +++++++++++------- .../pages/salaryItem/salaryItemsTable.js | 2 +- 3 files changed, 92 insertions(+), 64 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 9e407f56..0abbad77 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -1,8 +1,8 @@ import React from "react"; -import FormalFormModal from "./formalFormModal"; -import SalaryItemForm from "./salaryItemForm"; -import "./index.less"; - +import { WeaLocaleProvider, WeaSlideModal } from "ecCom"; +// import FormalFormModal from "./formalFormModal"; +// import SalaryItemForm from "./salaryItemForm"; +const getLabel = WeaLocaleProvider.getLabel; export default class CustomSalaryItemSlide extends React.Component { constructor(props) { super(props); @@ -37,26 +37,32 @@ export default class CustomSalaryItemSlide extends React.Component { const { request } = this.props; const { valueType, dataType, formulaId } = request; const { formalModalVisible, salaryItemName } = this.state; - return ( -
- - {formalModalVisible && - { - this.handleSaveFormal(data); - }} - onCancel={() => - this.setState({ - formalModalVisible: false, - salaryItemName: "" - })} - />} -
+ return ( +
}/> + + //
+ // + // {formalModalVisible && + // { + // this.handleSaveFormal(data); + // }} + // onCancel={() => + // this.setState({ + // formalModalVisible: false, + // salaryItemName: "" + // })} + // />} + //
); } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index c6729999..519e555a 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -1,12 +1,11 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { Button, Dropdown, Menu, message, Modal, Switch } from "antd"; -import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTop } from "ecCom"; +import { WeaInputSearch, WeaLocaleProvider, WeaTop } from "ecCom"; import * as API from "../../apis/item"; import SalaryItemsTable from "./salaryItemsTable"; import { toDecimal_n } from "../../util"; import SystemSalaryItemModal from "./systemSalaryItemModal"; -import SlideModalTitle from "../../components/slideModalTitle"; import CustomSalaryItemSlide from "./customSalaryItemSlide"; import SyncToSalaryAccountSetDialog from "./syncToSalaryAccountSetDialog"; import "../socialSecurityBenefits/programme/index.less"; @@ -21,6 +20,7 @@ export default class SalaryItem extends React.Component { super(props); this.state = { name: "", isQuery: false, + customItemDialog: { visible: false, title: "", buttons: [] },// 自定义薪资项弹窗 value: "", @@ -199,6 +199,23 @@ export default class SalaryItem extends React.Component { filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]" }); break; + case "customAdd": + case "edit": + const { taxAgentStore: { showOperateBtn, showSalaryItemBtn } } = this.props; + const title = key === "edit" ? getLabel(111, "修改自定义薪资项目") : getLabel(111, "新建自定义薪资项目"); + const buttons = key === "edit" ? [ + , + + ] : [ + , + + ]; + this.setState({ + customItemDialog: { visible: true, title, buttons: (showSalaryItemBtn || showOperateBtn) ? buttons : [] } + }); + break; + case "sysAdd": + break; default: break; } @@ -211,7 +228,7 @@ export default class SalaryItem extends React.Component { taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentOption } } = this.props; const { userStatusList } = salaryFileStore; - const { selectedRowKeys, logDialogVisible, filterConditions, name, isQuery } = this.state; + const { selectedRowKeys, logDialogVisible, filterConditions, name, isQuery, customItemDialog } = this.state; const { loading, deleteItemRequest, getTableDatas } = salaryItemStore; const { tableDataSource, @@ -235,13 +252,13 @@ export default class SalaryItem extends React.Component { }; const menu = ( - - {getLabel(111, "新增系统薪资项")} + + {getLabel(111, "新增系统薪资项")} ); let buttons = [ handleMenuClick({ key: "1" })}>{getLabel(111, "新增自定义薪资项")}, + onClick={() => this.onDropMenuClick("customAdd")}>{getLabel(111, "新增自定义薪资项")}, , this.setState({ name: val })} placeholder={getLabel(111, "请输入名称")} onSearch={() => this.setState({ isQuery: !isQuery })}/> @@ -355,39 +372,44 @@ export default class SalaryItem extends React.Component { }} /> } - { - editSlideVisible && - - } - content={ - { - handleSaveSlideChange(value); - }}/> - } - onClose={() => setEditSlideVisible(false)} - /> - } + {/*新增编辑自定义薪资项目*/} + this.setState({ isQuery: !isQuery })} + onClose={callback => this.setState({ + customItemDialog: { ...customItemDialog, visible: false } + }, () => callback && callback())}/> + {/*{*/} + {/* editSlideVisible &&*/} + {/* */} + {/* }*/} + {/* content={*/} + {/* {*/} + {/* handleSaveSlideChange(value);*/} + {/* }}/>*/} + {/* }*/} + {/* onClose={() => setEditSlideVisible(false)}*/} + {/* />*/} + {/*}*/} ); } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js index e0639540..eee77555 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js @@ -106,7 +106,7 @@ class SalaryItemsTable extends Component { ...columns, { dataIndex: "opt", title: getLabel(111, "操作"), width: 140, render: (__, record) => ( - onDropMenuClick("edit", record)} href="javascript:void(0);">{(showOperateBtn || showSalaryItemBtn) ? getLabel(111, "编辑") : getLabel(111, "查看")} { (showOperateBtn || showSalaryItemBtn) && record.canDelete && From aaf2914e2002d003364cc35cb619d00d2401c5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 11:25:09 +0800 Subject: [PATCH 015/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salaryItem/customSalaryItemSlide.js | 25 ++++++++++++++++--- pc4mobx/hrmSalary/pages/salaryItem/index.less | 3 +++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 0abbad77..9baa49f9 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -2,11 +2,15 @@ import React from "react"; import { WeaLocaleProvider, WeaSlideModal } from "ecCom"; // import FormalFormModal from "./formalFormModal"; // import SalaryItemForm from "./salaryItemForm"; + const getLabel = WeaLocaleProvider.getLabel; + export default class CustomSalaryItemSlide extends React.Component { constructor(props) { super(props); this.state = { + loading: false, + showForm: false, formalModalVisible: false, salaryItemName: "" @@ -33,15 +37,30 @@ export default class CustomSalaryItemSlide extends React.Component { }); }; + renderTitle = () => { + const { loading } = this.state, { title, buttons } = this.props; + return
+
+
+
{title}
+
+
+ { + _.isEmpty(detail) && + + } +
+
; + }; + render() { const { request } = this.props; const { valueType, dataType, formulaId } = request; const { formalModalVisible, salaryItemName } = this.state; return ( + content={
}/> //
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index 0ddab0d2..74da4b67 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -11,6 +11,9 @@ } + + + .customSalaryItemSlide { padding: 16px; From f03c187796e1e67d5ffe059b80c7b041273f1360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 13:37:09 +0800 Subject: [PATCH 016/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/columns.js | 72 +++++++++++++++++++ .../pages/salaryItem/customSalaryItemSlide.js | 11 +-- pc4mobx/hrmSalary/pages/salaryItem/index.less | 50 ++++++++++++- 3 files changed, 121 insertions(+), 12 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js index 7e868d31..f93b0b71 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js @@ -2,6 +2,78 @@ import { WeaLocaleProvider } from "ecCom"; import { dataTypeOptions, patternOptions, roundingModeOptions } from "./options"; const getLabel = WeaLocaleProvider.getLabel; + +export const salaryItemConditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["name"], + fieldcol: 14, + label: "名称", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SWITCH", + domkey: ["useDefault"], + fieldcol: 14, + label: "默认使用", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + tipLanId: 111, + tip: "提示:开启后,每个薪资方案都有该薪资项目,可在具体薪资方案中删除", + viewAttr: 3 + }, + { + conditionType: "SWITCH", + domkey: ["hideDefault"], + fieldcol: 14, + label: "核算时隐藏", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + tipLanId: 111, + tip: "提示:开启后,在薪资账套中添加该项目时,默认勾选隐藏且在核算时隐藏该薪资项目,可在具体薪资账套中设置是否隐藏", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["sharedType"], + fieldcol: 14, + label: "可见性", + lanId: 111, + labelcol: 8, + value: "", + options: [], + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["taxAgentIds"], + fieldcol: 14, + label: "可见性范围", + lanId: 111, + labelcol: 8, + value: "", + options: [], + multiple: true, + rules: "required|string", + viewAttr: 3, + hide: true + }, + ], + title: "", + defaultshow: true + } +]; export const salaryItemFields = [ { key: "name", diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 9baa49f9..4ff97292 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -9,8 +9,6 @@ export default class CustomSalaryItemSlide extends React.Component { constructor(props) { super(props); this.state = { - loading: false, - showForm: false, formalModalVisible: false, salaryItemName: "" @@ -38,18 +36,13 @@ export default class CustomSalaryItemSlide extends React.Component { }; renderTitle = () => { - const { loading } = this.state, { title, buttons } = this.props; + const { title, buttons } = this.props; return
{title}
-
- { - _.isEmpty(detail) && - - } -
+
{buttons}
; }; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index 74da4b67..e12fed2b 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -8,12 +8,56 @@ .salaryItems_content { height: 100%; } + + .wea-slide-modal-title { + border-bottom: 1px solid #e5e5e5 !important; + } + + .titleDialog { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 46px 0 16px; + + .titleCol { + flex: 1; + display: flex; + align-items: center; + } + + .titleLeftBox { + .titleIcon { + color: #fff; + margin: 0; + width: 40px; + height: 40px; + line-height: 40px; + font-size: 22px; + display: flex; + align-items: center; + justify-content: center; + background: #F14A2D; + border-radius: 50%; + } + + .title { + font-size: 14px; + color: #333; + padding-left: 6px; + } + } + + .titleRightBox { + justify-content: flex-end; + + button { + margin-left: 10px; + } + } + } } - - - .customSalaryItemSlide { padding: 16px; From 50b4426a75d60a415b73174250b4c3c953feeedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 14:02:33 +0800 Subject: [PATCH 017/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salaryItem/customSalaryItemSlide.js | 46 +++++++++++++++++-- pc4mobx/hrmSalary/stores/salaryItem.js | 3 ++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 4ff97292..e3486a31 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -1,20 +1,37 @@ import React from "react"; -import { WeaLocaleProvider, WeaSlideModal } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal } from "ecCom"; +import { WeaSwitch } from "comsMobx"; // import FormalFormModal from "./formalFormModal"; // import SalaryItemForm from "./salaryItemForm"; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; +@inject("salaryItemStore") +@observer export default class CustomSalaryItemSlide extends React.Component { constructor(props) { super(props); this.state = { + conditions: [], + showForm: false, formalModalVisible: false, salaryItemName: "" }; } + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + document.querySelector(".custom_salaryItemSlide").classList.add("zIndex0-weaslide-title"); + this.initForm(nextProps); + } else if (nextProps.visible !== this.props.visible && !nextProps.visible) { + document.querySelector(".custom_salaryItemSlide").classList.remove("zIndex0-weaslide-title"); + this.props.salaryItemStore.initItemsForm(); + } + } + handleChange = (params) => { this.props.onChange({ ...this.props.request, ...params }); }; @@ -34,7 +51,29 @@ export default class CustomSalaryItemSlide extends React.Component { originSqlContent: data.referenceType === "sql" ? data.formula : "" }); }; - + renderForm = (form) => { + const { conditions } = this.state, { isFormInit } = form, formParams = form.getFormParams(); + let group = []; + isFormInit && conditions.map(c => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + + { + fields.tip && + } + ), + hide: fields.hide + }); + }); + group.push(); + }); + return group; + }; renderTitle = () => { const { title, buttons } = this.props; return
@@ -51,7 +90,8 @@ export default class CustomSalaryItemSlide extends React.Component { const { valueType, dataType, formulaId } = request; const { formalModalVisible, salaryItemName } = this.state; return (
}/> diff --git a/pc4mobx/hrmSalary/stores/salaryItem.js b/pc4mobx/hrmSalary/stores/salaryItem.js index cc3a0214..45f30171 100644 --- a/pc4mobx/hrmSalary/stores/salaryItem.js +++ b/pc4mobx/hrmSalary/stores/salaryItem.js @@ -9,6 +9,9 @@ const { TableStore } = WeaTableNew; export class SalaryItemStore { @observable salarySetform = new WeaForm(); //同步薪资账套form + @observable itemsForm = new WeaForm(); //自定义薪资项目form + @action initItemsForm = () => this.itemsForm = new WeaForm(); + @observable tableStore = new TableStore(); // new table @observable sysListTableStore = new TableStore(); From fdf82d883d6247d34bfdd3ee6a02916607526cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 14:10:27 +0800 Subject: [PATCH 018/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salaryItem/customSalaryItemSlide.js | 16 ++++++++++++++++ pc4mobx/hrmSalary/style/index.less | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index e3486a31..f615f0e6 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -2,6 +2,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal } from "ecCom"; import { WeaSwitch } from "comsMobx"; +import { salaryItemConditions } from "./columns"; // import FormalFormModal from "./formalFormModal"; // import SalaryItemForm from "./salaryItemForm"; @@ -51,6 +52,21 @@ export default class CustomSalaryItemSlide extends React.Component { originSqlContent: data.referenceType === "sql" ? data.formula : "" }); }; + initForm = (props) => { + this.setState({ + conditions: _.map(salaryItemConditions, c => { + return { + ...c, items: _.map(c.items, fields => { + return { + ...fields, label: getLabel(fields.lanId, fields.label) + }; + }) + }; + }) + }, () => { + props.salaryItemStore.itemsForm.initFormFields(this.state.conditions); + }); + }; renderForm = (form) => { const { conditions } = this.state, { isFormInit } = form, formParams = form.getFormParams(); let group = []; diff --git a/pc4mobx/hrmSalary/style/index.less b/pc4mobx/hrmSalary/style/index.less index 8e65be90..5f2c76d6 100644 --- a/pc4mobx/hrmSalary/style/index.less +++ b/pc4mobx/hrmSalary/style/index.less @@ -117,3 +117,10 @@ } +//公共slide框标题样式 +.zIndex0-weaslide-title { + .wea-new-top-req { + z-index: 0 !important; + } +} + From 673c2ba908323ece7a9b35799b37f84415fb6870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 15:27:03 +0800 Subject: [PATCH 019/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/columns.js | 130 +++++++++++++++++- .../pages/salaryItem/customSalaryItemSlide.js | 35 +++-- pc4mobx/hrmSalary/pages/salaryItem/index.less | 8 ++ 3 files changed, 159 insertions(+), 14 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js index f93b0b71..a478b454 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js @@ -3,6 +3,7 @@ import { dataTypeOptions, patternOptions, roundingModeOptions } from "./options" const getLabel = WeaLocaleProvider.getLabel; + export const salaryItemConditions = [ { items: [ @@ -24,7 +25,7 @@ export const salaryItemConditions = [ label: "默认使用", lanId: 111, labelcol: 8, - value: "", + value: "0", rules: "required|string", tipLanId: 111, tip: "提示:开启后,每个薪资方案都有该薪资项目,可在具体薪资方案中删除", @@ -37,7 +38,7 @@ export const salaryItemConditions = [ label: "核算时隐藏", lanId: 111, labelcol: 8, - value: "", + value: "0", rules: "required|string", tipLanId: 111, tip: "提示:开启后,在薪资账套中添加该项目时,默认勾选隐藏且在核算时隐藏该薪资项目,可在具体薪资账套中设置是否隐藏", @@ -69,6 +70,131 @@ export const salaryItemConditions = [ viewAttr: 3, hide: true }, + { + conditionType: "SELECT", + domkey: ["dataType"], + fieldcol: 14, + label: "字段类型", + lanId: 111, + labelcol: 8, + value: "", + options: [ + { key: "number", showname: "数值", lanId: 111, selected: true }, + { key: "string", showname: "字符", lanId: 111, selected: false } + ], + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["roundingMode"], + fieldcol: 14, + label: "舍入规则", + lanId: 111, + labelcol: 8, + value: "", + options: [ + { key: "1", selected: true, showname: "原始数据", lanId: 111 }, + { key: "2", selected: false, showname: "四舍五入", lanId: 111 }, + { key: "3", selected: false, showname: "向上舍入", lanId: 111 }, + { key: "4", selected: false, showname: "向下舍入", lanId: 111 }, + { key: "5", selected: false, showname: "见分进角", lanId: 111 } + ], + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["pattern"], + fieldcol: 14, + label: "保留小数位", + lanId: 111, + labelcol: 8, + value: "", + options: [ + { key: "0", selected: false, showname: "0" }, + { key: "1", selected: false, showname: "1" }, + { key: "2", selected: true, showname: "2" }, + { key: "3", selected: false, showname: "3" }, + { key: "4", selected: false, showname: "4" }, + { key: "5", selected: false, showname: "5" }, + { key: "6", selected: true, showname: "6" }, + { key: "7", selected: false, showname: "7" }, + { key: "8", selected: false, showname: "8" }, + { key: "9", selected: false, showname: "9" }, + { key: "10", selected: false, showname: "10" } + ], + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["valueType"], + fieldcol: 14, + label: "取值方式", + lanId: 111, + labelcol: 8, + value: "", + detailType: 3, + options: [ + { key: "1", showname: "输入", selected: true, lanId: 111 }, + { key: "2", showname: "公式", selected: false, lanId: 111 }, + { key: "3", showname: "SQL", selected: false, lanId: 111 } + ], + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["defaultValue"], + fieldcol: 14, + label: "默认值", + lanId: 111, + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["formulaContent"], + fieldcol: 14, + label: "公式", + lanId: 111, + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["sortedIndex"], + fieldcol: 14, + label: "显示顺序", + lanId: 111, + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["width"], + fieldcol: 14, + label: "显示宽度", + lanId: 111, + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + conditionType: "TEXTAREA", + domkey: ["description"], + fieldcol: 14, + label: "备注", + lanId: 111, + labelcol: 8, + value: "", + viewAttr: 2, + otherParams: { minRows: 3 } + } ], title: "", defaultshow: true diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index f615f0e6..dc2a1e81 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -1,6 +1,6 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal } from "ecCom"; +import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTools } from "ecCom"; import { WeaSwitch } from "comsMobx"; import { salaryItemConditions } from "./columns"; // import FormalFormModal from "./formalFormModal"; @@ -57,9 +57,19 @@ export default class CustomSalaryItemSlide extends React.Component { conditions: _.map(salaryItemConditions, c => { return { ...c, items: _.map(c.items, fields => { - return { - ...fields, label: getLabel(fields.lanId, fields.label) - }; + fields = { ...fields, label: getLabel(fields.lanId, fields.label) }; + switch (getKey(fields)) { + case "dataType": + case "valueType": + case "roundingMode": + fields = { + ...fields, options: _.map(fields.options, o => ({ ...o, showname: getLabel(o.lanId, o.showname) })) + }; + break; + default: + break; + } + return fields; }) }; }) @@ -67,7 +77,8 @@ export default class CustomSalaryItemSlide extends React.Component { props.salaryItemStore.itemsForm.initFormFields(this.state.conditions); }); }; - renderForm = (form) => { + renderForm = () => { + const { salaryItemStore: { itemsForm: form } } = this.props; const { conditions } = this.state, { isFormInit } = form, formParams = form.getFormParams(); let group = []; isFormInit && conditions.map(c => { @@ -80,7 +91,8 @@ export default class CustomSalaryItemSlide extends React.Component { { fields.tip && + style={{ marginLeft: 16 }} width={350} title={getLabel(fields.tipLanId, fields.tip)} + placement="topLeft"/> } ), hide: fields.hide @@ -102,15 +114,14 @@ export default class CustomSalaryItemSlide extends React.Component { }; render() { - const { request } = this.props; - const { valueType, dataType, formulaId } = request; - const { formalModalVisible, salaryItemName } = this.state; + const { request, onClose } = this.props; + // const { valueType, dataType, formulaId } = request; + // const { formalModalVisible, salaryItemName } = this.state; return ( -
}/> + direction="right" title={this.renderTitle()} onClose={() => onClose()} + content={
{this.renderForm()}
}/> //
// diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index e12fed2b..b80727e6 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -9,10 +9,18 @@ height: 100%; } +} + +.custom_salaryItemSlide { .wea-slide-modal-title { border-bottom: 1px solid #e5e5e5 !important; } + .wea-slide-modal-content { + height: 100%; + background: #f6f6f6; + } + .titleDialog { display: flex; justify-content: space-between; From 848282cfc895dd389c0e4d929220234324f7c218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 15:35:33 +0800 Subject: [PATCH 020/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/columns.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js index a478b454..5db2fdf3 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js @@ -110,7 +110,7 @@ export const salaryItemConditions = [ label: "保留小数位", lanId: 111, labelcol: 8, - value: "", + value: "2", options: [ { key: "0", selected: false, showname: "0" }, { key: "1", selected: false, showname: "1" }, @@ -135,7 +135,7 @@ export const salaryItemConditions = [ lanId: 111, labelcol: 8, value: "", - detailType: 3, + otherParams: { detailtype: 3 }, options: [ { key: "1", showname: "输入", selected: true, lanId: 111 }, { key: "2", showname: "公式", selected: false, lanId: 111 }, @@ -162,7 +162,7 @@ export const salaryItemConditions = [ lanId: 111, labelcol: 8, value: "", - viewAttr: 2 + viewAttr: 1 }, { conditionType: "INPUTNUMBER", From b7c5ae22f351cbdcd9563f95399a164fc6196e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 16:48:02 +0800 Subject: [PATCH 021/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 12 ++++ .../pages/taxAgent/components/index.less | 3 + .../components/roleDetailSetDialog/index.js | 63 +++++++++++++++---- 3 files changed, 66 insertions(+), 12 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 499d25c2..8fcce44a 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -120,6 +120,14 @@ export const saveAuthMember = (params) => { export const authDataList = (params) => { return postFetch("/api/bs/hrmsalary/auth/data/list", params); }; +//删除成员 +export const deleteAuthMember = (params) => { + return postFetch("/api/bs/hrmsalary/auth/member/delete", params); +}; +//删除数据 +export const deleteAuthData = (params) => { + return postFetch("/api/bs/hrmsalary/auth/data/delete", params); +}; //保存数据 export const saveAuthData = (params) => { return postFetch("/api/bs/hrmsalary/auth/data/save", params); @@ -128,4 +136,8 @@ export const saveAuthData = (params) => { export const syncAuthData = (params) => { return postFetch("/api/bs/hrmsalary/auth/data/sync", params); }; +//同步成员 +export const syncAuthMember = (params) => { + return postFetch("/api/bs/hrmsalary/auth/member/sync", params); +}; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/index.less b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less index 85b34deb..4cbd11ce 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/index.less +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less @@ -83,6 +83,9 @@ .setting_table_title { & > .operator { line-height: 45px; + display: flex; + justify-content: space-between; + align-items: center; } } } diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js index a4d5dde9..acec1c09 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js @@ -29,16 +29,20 @@ const getLabel = WeaLocaleProvider.getLabel; const APIFOX = { "auth.MemberTargetTypeEnum": API.authMemberList, "save.auth.MemberTargetTypeEnum": API.saveAuthMember, + "delete.auth.MemberTargetTypeEnum": API.deleteAuthMember, + "sync.auth.MemberTargetTypeEnum": API.syncAuthMember, "auth.DataTargetTypeEnum": API.authDataList, - "save.auth.DataTargetTypeEnum": API.saveAuthData + "save.auth.DataTargetTypeEnum": API.saveAuthData, + "delete.auth.DataTargetTypeEnum": API.deleteAuthData, + "sync.auth.DataTargetTypeEnum": API.syncAuthData }; class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "auth.MemberTargetTypeEnum", name: "", options: [], enumType: "", - replaceDatas: [], loading: { set: false, query: false, async: false }, + selectedKey: "auth.MemberTargetTypeEnum", name: "", options: [], enumType: "", selectedRowKeys: [], + replaceDatas: [], loading: { set: false, query: false, async: false, delete: false }, columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 } }; } @@ -50,7 +54,7 @@ class Index extends Component { this.getSettingRoler(nextProps.roleId); }); } else { - this.setState({ replaceDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 } }); + this.setState({ selectedRowKeys: [], replaceDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 } }); } } @@ -90,7 +94,11 @@ class Index extends Component { }); return; } - const payload = _.map(replaceDatas, o => ({ roleId, targetType, target: o.id || "", targetName: o.name || "" })); + const payload = _.map(replaceDatas, o => ({ + roleId, targetType, target: o.id || "", targetName: o.name || "", + link: selectedKey === "auth.DataTargetTypeEnum" ? "OR" : "", + sortedIndex: selectedKey === "auth.DataTargetTypeEnum" ? 0 : "" + })); this.setState({ loading: { ...this.state.loading, set: true } }); APIFOX[`save.${selectedKey}`](payload).then(({ status, errormsg }) => { this.setState({ loading: { ...this.state.loading, set: false } }); @@ -102,10 +110,31 @@ class Index extends Component { } }); }; - syncAuthData = () => { + deleteOperatorSettings = () => { const { roleId } = this.props; + const { selectedKey, selectedRowKeys } = this.state; + if (_.isEmpty(selectedRowKeys)) { + Modal.warning({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "确定要删除所选批次吗?") + }); + return; + } + this.setState({ loading: { ...this.state.loading, delete: true } }); + APIFOX[`delete.${selectedKey}`](selectedRowKeys).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, delete: false } }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ selectedRowKeys: [] }, () => this.getSettingRoler(roleId)); + } else { + message.error(errormsg); + } + }); + }; + syncAuthData = () => { + const { roleId } = this.props, { selectedKey } = this.state; this.setState({ async: true }); - API.syncAuthData({ roleId }).then(({ status, errormsg }) => { + APIFOX[`sync.${selectedKey}`]({ roleId }).then(({ status, errormsg }) => { this.setState({ async: false }); if (status) { message.success(getLabel(111, "操作成功!")); @@ -159,7 +188,9 @@ class Index extends Component { render() { const { roleId } = this.props; - const { selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading } = this.state; + const { + selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys + } = this.state; const tabs = [ { title: getLabel(111, "成员"), viewcondition: "auth.MemberTargetTypeEnum" }, { title: getLabel(111, "权限"), viewcondition: "auth.AuthTargetTypeEnum" }, @@ -182,6 +213,9 @@ class Index extends Component { }, () => this.getSettingRoler(roleId)); } }; + const rowSelection = { + selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) + }; return ( this.setState({ - selectedKey: v, name: !name ? null : name, replaceDatas: [] + selectedKey: v, name: !name ? null : name, replaceDatas: [], selectedRowKeys: [] }, () => { this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getEnumList(); this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getSettingRoler(roleId); @@ -224,9 +258,14 @@ class Index extends Component { {/*表格*/} -
{getLabel(111, "已设操作者")}
- +
+ {getLabel(111, "已设操作者")} + +
+
From cc81d8c9bd146ab1c684ed0d750636b4d1e24f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 18:07:03 +0800 Subject: [PATCH 022/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/taxAgent/components/conditions.js | 51 +++++++++++++++++ .../roleDetailSetDialog/editRoleDialog.js | 56 +++++++++++++++++++ .../components/roleDetailSetDialog/index.js | 35 +++++++++--- pc4mobx/hrmSalary/stores/taxAgent.js | 3 +- 4 files changed, 136 insertions(+), 9 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/editRoleDialog.js diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js b/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js index cfad3e1d..abf5dd55 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js @@ -27,3 +27,54 @@ export const roleConditions = [ title: "" } ]; +export const roleOperatorConditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["targetType"], + fieldcol: 14, + label: "对象类型", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + conditionType: "BROWSER", + domkey: ["targetName"], + fieldcol: 14, + label: "对象", + lanId: 111, + labelcol: 6, + value: "", + rules: "required", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["link"], + fieldcol: 14, + label: "连接符", + lanId: 111, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["sortedIndex"], + fieldcol: 14, + label: "顺序", + lanId: 111, + labelcol: 6, + value: "", + rules: "required", + viewAttr: 3 + } + ], + defaultshow: true, + title: "" + } +]; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/editRoleDialog.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/editRoleDialog.js new file mode 100644 index 00000000..3e5d8492 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/editRoleDialog.js @@ -0,0 +1,56 @@ +/* + * 编辑橘色操作者 + * + * @Author: 黎永顺 + * @Date: 2024/8/20 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; +import { roleOperatorConditions } from "../conditions"; +import { getSearchs } from "../../../../util"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("taxAgentStore") +@observer +class EditRoleDialog extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.setState({ + conditions: _.map(roleOperatorConditions, item => ({ + ...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) })) + })) + }, () => nextProps.taxAgentStore.roleOperatorForm.initFormFields(this.state.conditions)); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.taxAgentStore.initRoleOperatorForm(); + } + + render() { + const { conditions, loading } = this.state; + const { taxAgentStore: { roleOperatorForm } } = this.props; + return ( + this.save()}>{getLabel(111, "保存")} + ]} + > +
{getSearchs(roleOperatorForm, conditions, 1, false)}
+
+ ); + } +} + +export default EditRoleDialog; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js index acec1c09..cdf3d1c3 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js @@ -21,6 +21,7 @@ import { WeaTextarea } from "ecCom"; import { commonEnumList } from "../../../../apis/archive"; +import EditRoleDialog from "./editRoleDialog"; import * as API from "../../../../apis/taxAgent"; import { Button, Col, message, Modal, Row } from "antd"; import "../index.less"; @@ -43,7 +44,8 @@ class Index extends Component { this.state = { selectedKey: "auth.MemberTargetTypeEnum", name: "", options: [], enumType: "", selectedRowKeys: [], replaceDatas: [], loading: { set: false, query: false, async: false, delete: false }, - columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 } + columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + editOperatorDialog: { visible: false, linkOptions: [], record: {} } }; } @@ -77,13 +79,26 @@ class Index extends Component { const { columns, list: dataSource, pageNum: current, pageSize, total } = data; this.setState({ dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, - columns: _.map(columns, o => { - return { ...o }; - }) + columns: [ + ...columns, { + dataIndex: "opt", title: getLabel(111, "操作"), width: 120, + render: (__, record) => ( this.handleEditOperator(record)}>{getLabel(111, "编辑")}) + } + ] }); } }); }; + handleEditOperator = async (record) => { + let { selectedKey } = this.state, linkOptions = []; + if (selectedKey === "auth.DataTargetTypeEnum") { + const payload = { enumClass: `com.engine.salary.enums.auth.DataLinkEnum` }; + const { data } = await commonEnumList(payload); + linkOptions = _.map(data, o => ({ key: o.enum, showname: o.defaultLabel })); + } + this.setState({ editOperatorDialog: { visible: true, record, linkOptions } }); + }; addOperatorSettings = () => { const { roleId } = this.props; const { selectedKey, enumType: targetType, replaceDatas } = this.state; @@ -97,7 +112,7 @@ class Index extends Component { const payload = _.map(replaceDatas, o => ({ roleId, targetType, target: o.id || "", targetName: o.name || "", link: selectedKey === "auth.DataTargetTypeEnum" ? "OR" : "", - sortedIndex: selectedKey === "auth.DataTargetTypeEnum" ? 0 : "" + sortedIndex: o.sortedIndex || 0 })); this.setState({ loading: { ...this.state.loading, set: true } }); APIFOX[`save.${selectedKey}`](payload).then(({ status, errormsg }) => { @@ -189,7 +204,7 @@ class Index extends Component { render() { const { roleId } = this.props; const { - selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys + selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys, editOperatorDialog } = this.state; const tabs = [ { title: getLabel(111, "成员"), viewcondition: "auth.MemberTargetTypeEnum" }, @@ -264,8 +279,12 @@ class Index extends Component { onClick={this.deleteOperatorSettings}>{getLabel(111, "批量删除")}
+ pagination={pagination} rowSelection={rowSelection}/> + {/* 编辑操作者*/} + this.getSettingRoler(roleId)} + onCancel={callback => this.setState({ + editOperatorDialog: { ...editOperatorDialog, visible: false } + }, () => callback && callback())}/>
diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index 5168078c..dafd7b40 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -10,7 +10,8 @@ const { TableStore } = WeaTableNew; export class TaxAgentStore { @observable roleForm = new WeaForm(); //权限-角色form表单 @action initRoleForm = () => this.roleForm = new WeaForm(); - + @observable roleOperatorForm = new WeaForm(); //权限-角色操作者form表单 + @action initRoleOperatorForm = () => this.roleOperatorForm = new WeaForm(); @observable tableStore = new TableStore(); // new table From b0d790f988fc114f940913831e447c0513f19a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 21 Aug 2024 16:00:28 +0800 Subject: [PATCH 023/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 5 +- .../pages/taxAgent/components/conditions.js | 10 +-- .../pages/taxAgent/components/index.less | 4 + .../roleDetailSetDialog/authTree.js | 39 +++++++++ .../roleDetailSetDialog/editRoleDialog.js | 87 +++++++++++++++++-- .../components/roleDetailSetDialog/index.js | 70 +++++++++------ 6 files changed, 175 insertions(+), 40 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/authTree.js diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 8fcce44a..c8317a45 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -140,4 +140,7 @@ export const syncAuthData = (params) => { export const syncAuthMember = (params) => { return postFetch("/api/bs/hrmsalary/auth/member/sync", params); }; - +//权限项 +export const getAuthOptTree = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/auth/opt/tree", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js b/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js index abf5dd55..ebb21338 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js @@ -32,8 +32,8 @@ export const roleOperatorConditions = [ items: [ { conditionType: "INPUT", - domkey: ["targetType"], - fieldcol: 14, + domkey: ["targetTypeName"], + fieldcol: 18, label: "对象类型", lanId: 111, labelcol: 6, @@ -43,7 +43,7 @@ export const roleOperatorConditions = [ { conditionType: "BROWSER", domkey: ["targetName"], - fieldcol: 14, + fieldcol: 18, label: "对象", lanId: 111, labelcol: 6, @@ -54,7 +54,7 @@ export const roleOperatorConditions = [ { conditionType: "SELECT", domkey: ["link"], - fieldcol: 14, + fieldcol: 18, label: "连接符", lanId: 111, labelcol: 6, @@ -65,7 +65,7 @@ export const roleOperatorConditions = [ { conditionType: "INPUTNUMBER", domkey: ["sortedIndex"], - fieldcol: 14, + fieldcol: 18, label: "顺序", lanId: 111, labelcol: 6, diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/index.less b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less index 4cbd11ce..41ab0eb7 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/index.less +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/index.less @@ -77,6 +77,10 @@ .tax_role_browser_form_item { margin: 12px 14px; } + + .tax_role_auth_tree { + padding: 10px 20px; + } } .tax_role_operator_setting_table { diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/authTree.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/authTree.js new file mode 100644 index 00000000..ccd825a4 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/authTree.js @@ -0,0 +1,39 @@ +/* + * 角色权限设置 + * + * @Author: 黎永顺 + * @Date: 2024/8/21 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import * as API from "../../../../apis/taxAgent"; +import { Row } from "antd"; +import { WeaLocaleProvider } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +class AuthTree extends Component { + constructor(props) { + super(props); + this.state = {}; + } + + componentDidMount() { + const { roleId } = this.props; + API.getAuthOptTree({ roleId }).then(({ status, data }) => { + if (status) { + console.log(data); + } + }); + } + + render() { + return ( + 权限 + ); + } +} + +export default AuthTree; diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/editRoleDialog.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/editRoleDialog.js index 3e5d8492..359605e0 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/editRoleDialog.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/editRoleDialog.js @@ -9,12 +9,13 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { Button } from "antd"; import { roleOperatorConditions } from "../conditions"; import { getSearchs } from "../../../../util"; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; @inject("taxAgentStore") @observer @@ -30,21 +31,95 @@ class EditRoleDialog extends Component { if (nextProps.visible !== this.props.visible && nextProps.visible) { this.setState({ conditions: _.map(roleOperatorConditions, item => ({ - ...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) })) + ...item, items: _.map(item.items, o => { + o = { ...o, label: getLabel(o.lanId, o.label), value: String(nextProps.record[getKey(o)]) }; + switch (getKey(o)) { + case "link": + o = { ...o, options: nextProps.linkOptions, hide: _.isEmpty(nextProps.linkOptions) }; + break; + case "sortedIndex": + o = { ...o, hide: _.isEmpty(nextProps.linkOptions) }; + break; + case "targetName": + o = ["EMP", "DEPARTMENT", "JOB", "SUB_COMPANY", "ROLE"].includes(nextProps.record.targetType) ? + { + ...o, value: "", browserConditionParam: { + ...this.renderBrowserType(nextProps.record.targetType), + replaceDatas: [{ id: nextProps.record["target"], name: nextProps.record[getKey(o)] }] + } + } : + nextProps.record.targetType === "SQL" ? { + ...o, conditionType: "TEXTAREA", otherParams: { minRows: 3 } + } : nextProps.record.targetType === "LEVEL" ? + { + ...o, startValue: nextProps.record[getKey(o)].split("-")[0], + endValue: nextProps.record[getKey(o)].split("-")[1], + conditionType: "SCOPE", precision: 0 + } : { ...o }; + break; + default: + break; + } + return o; + }) })) }, () => nextProps.taxAgentStore.roleOperatorForm.initFormFields(this.state.conditions)); } if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.taxAgentStore.initRoleOperatorForm(); + if (nextProps.loading !== this.props.loading && !nextProps.loading) this.props.onCancel(); } + renderBrowserType = (enumType) => { + let browserType = {}; + switch (enumType) { + case "EMP": + browserType = { ...browserType, type: 17, isSingle: true, title: getLabel(82246, "人员选择") }; + break; + case "DEPARTMENT": + browserType = { ...browserType, type: 57, isSingle: true, title: getLabel(111, "部门选择") }; + break; + case "JOB": + browserType = { ...browserType, type: 278, isSingle: true, title: getLabel(111, "岗位选择") }; + break; + case "SUB_COMPANY": + browserType = { ...browserType, type: 164, isSingle: true, title: getLabel(111, "分部选择") }; + break; + case "ROLE": + browserType = { ...browserType, type: 65, isSingle: true, title: getLabel(111, "角色选择") }; + break; + default: + break; + } + return browserType; + }; + save = () => { + const { taxAgentStore: { roleOperatorForm }, record, onChange } = this.props; + roleOperatorForm.validateForm().then(f => { + if (f.isValid) { + const { targetName: __, link, sortedIndex } = roleOperatorForm.getFormParams(); + const targetName = roleOperatorForm.getFormDatas().targetName; + onChange([_.assign(record, { + editId: record.id, sortedIndex, + id: record.targetType === "LEVEL" ? targetName.value.join("-") : targetName.value, + name: record.targetType === "SQL" ? __ : + record.targetType === "LEVEL" ? __.join("-") : targetName.valueSpan, + link: link === "undefined" ? "OR" : link + })]); + } else { + f.showErrors(); + } + }); + }; + render() { - const { conditions, loading } = this.state; - const { taxAgentStore: { roleOperatorForm } } = this.props; + const { conditions } = this.state; + const { taxAgentStore: { roleOperatorForm }, linkOptions, loading } = this.props; return ( this.save()}>{getLabel(111, "保存")} + ]} >
{getSearchs(roleOperatorForm, conditions, 1, false)}
diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js index cdf3d1c3..de3b1223 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js @@ -22,6 +22,7 @@ import { } from "ecCom"; import { commonEnumList } from "../../../../apis/archive"; import EditRoleDialog from "./editRoleDialog"; +import AuthTree from "./authTree"; import * as API from "../../../../apis/taxAgent"; import { Button, Col, message, Modal, Row } from "antd"; import "../index.less"; @@ -110,16 +111,15 @@ class Index extends Component { return; } const payload = _.map(replaceDatas, o => ({ - roleId, targetType, target: o.id || "", targetName: o.name || "", - link: selectedKey === "auth.DataTargetTypeEnum" ? "OR" : "", - sortedIndex: o.sortedIndex || 0 + roleId, targetType: o.targetType || targetType, target: o.id || "", targetName: o.name || "", + link: o.link || "OR", sortedIndex: o.sortedIndex || 0, id: o.editId || "" })); this.setState({ loading: { ...this.state.loading, set: true } }); APIFOX[`save.${selectedKey}`](payload).then(({ status, errormsg }) => { this.setState({ loading: { ...this.state.loading, set: false } }); if (status) { message.success(getLabel(111, "操作成功!")); - this.getSettingRoler(roleId); + this.setState({ replaceDatas: [] }, () => this.getSettingRoler(roleId)); } else { message.error(errormsg); } @@ -159,6 +159,7 @@ class Index extends Component { }); }; getOperatorSetting = () => { + const { roleId } = this.props; const { selectedKey, enumType, replaceDatas } = this.state; if (selectedKey !== "auth.AuthTargetTypeEnum") { let browserType = {}; @@ -187,7 +188,8 @@ class Index extends Component { case "LEVEL": return ( - + cur.id.split("-"), [])} + onChange={v => this.setState({ replaceDatas: [{ id: v.join("-"), name: v.join("-") }] })}/> ); default: return (); @@ -197,7 +199,7 @@ class Index extends Component { onChange={(__, ___, replaceDatas) => this.setState({ replaceDatas })}/> ); } else { - return (权限); + return (); } }; @@ -261,32 +263,44 @@ class Index extends Component { this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getEnumList(); this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getSettingRoler(roleId); })}/> - this.setState({ enumType: v, replaceDatas: [] })}/> + { + this.state.selectedKey !== "auth.AuthTargetTypeEnum" && + this.setState({ enumType: v, replaceDatas: [] })}/> + } {this.getOperatorSetting()} - - - + { + this.state.selectedKey !== "auth.AuthTargetTypeEnum" && + + + + + + }
{/*表格*/} - - -
- {getLabel(111, "已设操作者")} - -
- - {/* 编辑操作者*/} - this.getSettingRoler(roleId)} - onCancel={callback => this.setState({ - editOperatorDialog: { ...editOperatorDialog, visible: false } - }, () => callback && callback())}/> - -
+ { + this.state.selectedKey !== "auth.AuthTargetTypeEnum" && + + +
+ {getLabel(111, "已设操作者")} + +
+ + {/* 编辑操作者*/} + this.setState({ replaceDatas }, () => this.addOperatorSettings())} + onCancel={callback => this.setState({ + editOperatorDialog: { ...editOperatorDialog, visible: false, record: {} } + }, () => callback && callback())}/> + +
+ }
); From b91f35418e30e749028e8621e6494723d7dcfa6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 22 Aug 2024 15:42:35 +0800 Subject: [PATCH 024/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 4 ++ .../roleDetailSetDialog/authTree.js | 59 +++++++++++++++++-- .../components/roleDetailSetDialog/index.js | 41 ++++++++++--- 3 files changed, 92 insertions(+), 12 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index c8317a45..1f297904 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -140,6 +140,10 @@ export const syncAuthData = (params) => { export const syncAuthMember = (params) => { return postFetch("/api/bs/hrmsalary/auth/member/sync", params); }; +//保存权限 +export const saveAuthOpt = (params) => { + return postFetch("/api/bs/hrmsalary/auth/opt/save", params); +}; //权限项 export const getAuthOptTree = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/auth/opt/tree", "GET", params); diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/authTree.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/authTree.js index ccd825a4..d9d972ac 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/authTree.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/authTree.js @@ -10,28 +10,79 @@ import React, { Component } from "react"; import * as API from "../../../../apis/taxAgent"; import { Row } from "antd"; -import { WeaLocaleProvider } from "ecCom"; +import { WeaLocaleProvider, WeaTree } from "ecCom"; const getLabel = WeaLocaleProvider.getLabel; class AuthTree extends Component { constructor(props) { super(props); - this.state = {}; + this.state = { + checkedKeys: [], expandedKeys: [], datas: {} + }; } componentDidMount() { const { roleId } = this.props; API.getAuthOptTree({ roleId }).then(({ status, data }) => { if (status) { - console.log(data); + this.setState({ + datas: { + canClick: true, id: data.key, nodeid: data.key, isParent: true, name: data.name, + subs: _.map(data.modules, item => ({ + ...item, canClick: true, id: item.key, nodeid: item.key, pid: data.key, isParent: !_.isEmpty(item.pages), + subs: _.map(item.pages, o => ({ + ...o, canClick: true, id: `${item.key}-${o.key}`, nodeid: `${item.key}-${o.key}`, + pid: item.key, isParent: !_.isEmpty(o.opts), + subs: _.map(o.opts, k => ({ + canClick: true, id: `${o.key}-${k.key}`, name: k.name, nodeid: `${o.key}-${k.key}`, + pid: `${item.key}-${o.key}`, isParent: false, able: k.able + })) + })) + })) + } + }, () => this.setState({ expandedKeys: this.initExpandKeys(), checkedKeys: this.initCheckedKeys() })); } }); } + initExpandKeys = () => { + const { datas } = this.state; + const parentIds = []; + const findParent = (node) => { + if (node.subs && node.subs.length > 0) { + parentIds.push(node.id); + node.subs.forEach(child => findParent(child)); + } + }; + findParent(datas); + return parentIds; + }; + initCheckedKeys = () => { + const { datas } = this.state; + const checkedIds = []; + const findCheckedId = (node) => { + if (node.subs && node.subs.length > 0) { + node.subs.forEach(child => { + if (!!child.able) checkedIds.push(child.id); + findCheckedId(child); + }); + } + }; + findCheckedId(datas); + return checkedIds; + }; + render() { + const { checkedKeys, expandedKeys, datas } = this.state; return ( - 权限 + + this.setState({ checkedKeys })} checkedKeys={checkedKeys} + expandedKeys={expandedKeys} onExpand={expandedKeys => this.setState({ expandedKeys })} + datas={datas} + /> + ); } } diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js index de3b1223..0ec684c4 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js @@ -146,6 +146,28 @@ class Index extends Component { } }); }; + saveAuthOpt = () => { + const { roleId } = this.props; + const { state: { checkedKeys } } = this.authTreeRef; + const payload = { + roleId, opts: _.reduce(checkedKeys, (pre, cur) => { + if (cur.indexOf("query") !== -1 || cur.indexOf("admin") !== -1) { + const [page, opt] = cur.split("-"); + return [...pre, { page, opt }]; + } + return pre; + }, []) + }; + this.setState({ loading: { ...this.state.loading, set: true } }); + API.saveAuthOpt(payload).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, set: false } }); + if (status) { + message.success(getLabel(111, "操作成功!")); + } else { + message.error(errormsg); + } + }); + }; syncAuthData = () => { const { roleId } = this.props, { selectedKey } = this.state; this.setState({ async: true }); @@ -199,7 +221,7 @@ class Index extends Component { onChange={(__, ___, replaceDatas) => this.setState({ replaceDatas })}/> ); } else { - return (); + return ( this.authTreeRef = dom}/>); } }; @@ -233,16 +255,19 @@ class Index extends Component { const rowSelection = { selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) }; + const buttons = [ + , + + ]; + selectedKey === "auth.AuthTargetTypeEnum" && buttons.shift(); + selectedKey !== "auth.AuthTargetTypeEnum" && buttons.pop(); return ( {getLabel(111, "同步")} - ]} - style={{ - width: 960, height: 606.6, minHeight: 200, minWidth: 380, - maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" - }} + buttons={buttons} style={{ + width: 960, height: 606.6, minHeight: 200, minWidth: 380, + maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} >
From 724c4bb53b35d831adb3663fe818f25d96d1333d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 3 Sep 2024 16:34:22 +0800 Subject: [PATCH 025/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ledgerBaseSetting.js | 7 +++--- .../ledgerPage/components/ledgerSlide.js | 23 ++++++++++--------- pc4mobx/hrmSalary/pages/ledgerPage/config.js | 1 + 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js index cc89cd8a..823018ec 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js @@ -167,8 +167,9 @@ class LedgerBaseSetting extends Component { { _.map(baseForm, item => { - const { key, label, type, options = [], children = [] } = item; - taxAgentIdDisabled = key === "taxAgentId" && editId && taxAgentId; + const { key, label, type, options = [], children = [], multiple = false } = item; + taxAgentIdDisabled = false; + // taxAgentIdDisabled = key === "taxAgentId" && editId && taxAgentId; taxableItemsDisabled = key === "taxableItems" && editId; return this.handleChangeField(key, v)}/> : type === "CUSTOM" ? diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js index d7229b5d..179d16df 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js @@ -57,17 +57,18 @@ class LedgerSlide extends Component { return false; } this.setState({ loading: true }); - saveLedgerBasic({ ...extra, description, id: editId }).then(({ status, data, errormsg }) => { - this.setState({ loading: false }); - if (status) { - const { onRefreshList } = this.props; - message.success("保存成功"); - onRefreshList(); - !editId && this.setState({ current: current + 1, saveSalarySobId: data }); - } else { - message.error(errormsg || "保存失败"); - } - }).catch(() => this.setState({ loading: false })); + saveLedgerBasic({ ...extra, description, id: editId, taxAgentIds: extra.taxAgentId.split(",") }) + .then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + const { onRefreshList } = this.props; + message.success("保存成功"); + onRefreshList(); + !editId && this.setState({ current: current + 1, saveSalarySobId: data }); + } else { + message.error(errormsg || "保存失败"); + } + }).catch(() => this.setState({ loading: false })); }; /* * Author: 黎永顺 diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/config.js b/pc4mobx/hrmSalary/pages/ledgerPage/config.js index 9af48b4d..b3bc609a 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/config.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/config.js @@ -86,6 +86,7 @@ export const baseSettingFormItem = [ key: "taxAgentId", label: "个税扣缴义务人", type: "SELECT", + multiple: true, options: [] }, { From 6e3d716afdeeb9448eb492b4091e63b31021ce35 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, 6 Sep 2024 13:30:09 +0800 Subject: [PATCH 026/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 2 ++ .../hrmSalary/pages/roleManagement/index.js | 33 +++++++++++++++++++ .../hrmSalary/pages/roleManagement/index.less | 8 +++++ 3 files changed, 43 insertions(+) create mode 100644 pc4mobx/hrmSalary/pages/roleManagement/index.js create mode 100644 pc4mobx/hrmSalary/pages/roleManagement/index.less diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index fff7a3d1..66be0fca 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -42,6 +42,7 @@ import MobilePayroll from "./pages/mobilePayroll"; import SysConfig from "./pages/sysConfig"; import RuleConfig from "./pages/ruleConfig/ruleConfig"; import Appconfig from "./pages/appConfig"; +import RoleManagement from "./pages/roleManagement"; import FieldManagement from "./pages/fieldManagement"; import AnalysisOfSalaryStatistics from "./pages/analysisOfSalaryStatistics"; import EmployeeList from "./pages/employeeView"; @@ -159,6 +160,7 @@ const Routes = ( + diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js new file mode 100644 index 00000000..8b9f1355 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -0,0 +1,33 @@ +/* + * 角色管理 + * + * @Author: 黎永顺 + * @Date: 2024/9/6 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTop } from "ecCom"; +import { Button } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + render() { + const buttons = [ + + ]; + return ( + } + iconBgcolor="#F14A2D" buttons={buttons} className="rolemanagement-index" + > +
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.less b/pc4mobx/hrmSalary/pages/roleManagement/index.less new file mode 100644 index 00000000..de10225a --- /dev/null +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.less @@ -0,0 +1,8 @@ +.rolemanagement-index { + .rolemanagement-content { + height: 100%; + overflow-y: hidden; + padding: 16px 16px 0; + background: rgb(246, 246, 246); + } +} From a729826c8df0f0939fbd5ab82a695b8164a57306 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, 6 Sep 2024 14:15:39 +0800 Subject: [PATCH 027/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 4 ++ .../hrmSalary/pages/roleManagement/index.js | 48 +++++++++++++++++-- .../hrmSalary/pages/roleManagement/index.less | 4 ++ 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 1f297904..aa74fd63 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -100,6 +100,10 @@ export const hasIconInTax = (params) => { }; /**权限-角色相关*/ +//角色列表 +export const getRoleList = (params) => { + return postFetch("/api/bs/hrmsalary/auth/role/list", params); +}; //保存角色 export const saveAuthRole = (params) => { return postFetch("/api/bs/hrmsalary/auth/role/save", params); diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index 8b9f1355..66b92a2a 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -8,23 +8,65 @@ * @description: */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaTop } from "ecCom"; +import { WeaInputSearch, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom"; +import * as API from "../../apis/taxAgent"; import { Button } from "antd"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { + constructor(props) { + super(props); + this.state = { + query: { name: "" }, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 } + }; + } + + componentDidMount() { + this.getRoleList(); + } + + getRoleList = () => { + const { query, pageInfo } = this.state; + const paylaod = { ...pageInfo, ...query }; + API.getRoleList(paylaod).then(({ status, data }) => { + if (status) { + console.log(data); + } + }); + }; + render() { + const { query, dataSource, columns, pageInfo } = this.state; const buttons = [ - + , + this.setState({ query: { name } })} + onSearch={() => this.setState({ pageInfo: { ...pageInfo, current: 1 } }, + () => this.getRoleList())}/> ]; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getRoleList()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getRoleList()); + } + }; return ( } iconBgcolor="#F14A2D" buttons={buttons} className="rolemanagement-index" > -
+
+ +
); } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.less b/pc4mobx/hrmSalary/pages/roleManagement/index.less index de10225a..190f45bc 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.less +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.less @@ -4,5 +4,9 @@ overflow-y: hidden; padding: 16px 16px 0; background: rgb(246, 246, 246); + + .wea-new-table { + background: #FFF; + } } } From a56ee784db69f3c955bca970beb5476baf580b19 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, 6 Sep 2024 15:45:57 +0800 Subject: [PATCH 028/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/AssociativeSearchSingle.js | 26 +++ .../components/associativeSearchMult.js | 160 ++++++++++++++++ .../components/customBrowserDialog.js | 181 ++++++++++++++++++ .../components/customBrowserMutiLeft.js | 41 ++++ .../components/customBrowserMutiRight.js | 43 +++++ .../components/customBrowserOperation.js | 64 +++++++ .../components/CustomBrowser/index.js | 114 +++++++++++ .../components/CustomBrowser/index.less | 22 +++ .../components/addRoleDialog/index.js | 0 .../components/conditions.js | 20 ++ .../components/index.less | 0 .../roleDetailSetDialog/authTree.js | 0 .../roleDetailSetDialog/editRoleDialog.js | 0 .../components/roleDetailSetDialog/index.js | 0 .../components/roleSetting/index.js | 0 .../hrmSalary/pages/roleManagement/index.js | 63 +++++- .../hrmSalary/pages/roleManagement/index.less | 4 + pc4mobx/hrmSalary/pages/taxAgent/index.js | 6 - pc4mobx/hrmSalary/util/index.js | 16 +- 19 files changed, 739 insertions(+), 21 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/index.js create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/index.less rename pc4mobx/hrmSalary/pages/{taxAgent => roleManagement}/components/addRoleDialog/index.js (100%) rename pc4mobx/hrmSalary/pages/{taxAgent => roleManagement}/components/conditions.js (76%) rename pc4mobx/hrmSalary/pages/{taxAgent => roleManagement}/components/index.less (100%) rename pc4mobx/hrmSalary/pages/{taxAgent => roleManagement}/components/roleDetailSetDialog/authTree.js (100%) rename pc4mobx/hrmSalary/pages/{taxAgent => roleManagement}/components/roleDetailSetDialog/editRoleDialog.js (100%) rename pc4mobx/hrmSalary/pages/{taxAgent => roleManagement}/components/roleDetailSetDialog/index.js (100%) rename pc4mobx/hrmSalary/pages/{taxAgent => roleManagement}/components/roleSetting/index.js (100%) diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js new file mode 100644 index 00000000..6e6f9555 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/AssociativeSearchSingle.js @@ -0,0 +1,26 @@ +/* + * 自定义浏览框组件 + * 单选 + * @Author: 黎永顺 + * @Date: 2024/9/3 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import AssociativeSearchMult from "./associativeSearchMult"; + +const getLabel = WeaLocaleProvider.getLabel; + +class AssociativeSearchSingle extends Component { + + + render() { + return ( + + ); + } +} + +export default AssociativeSearchSingle; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js new file mode 100644 index 00000000..db895085 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js @@ -0,0 +1,160 @@ +/* + * 自定义浏览框组件 + * 多选 + * @Author: 黎永顺 + * @Date: 2024/8/29 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button, Icon, Select } from "antd"; +import classNames from "classnames"; +import { postFetch } from "../../../util/request"; + +const getLabel = WeaLocaleProvider.getLabel; +const Option = Select.Option; + +class AssociativeSearchMult extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, data: [], activeKey: "", dropdownWidth: 200 + }; + this.selectedData = {}; + } + + componentDidMount() { + const { dropdownWidth } = this.state; + const w = $(this.refs.searchWrapperMui).outerWidth(); + if (dropdownWidth < w) { + this.setState({ dropdownWidth: w }); + } + } + + handleSearch = (value) => { + this.setState({ loading: true }); + this.getData(value); + }; + getData = (name = "") => { + const { browserConditionParam } = this.props; + const { completeURL, searchParamsKey, convertDatasource, dataParams = {} } = browserConditionParam; + if (_.trim(name)) { + postFetch(completeURL, { ...dataParams, [searchParamsKey]: name, current: 1, pageSize: 9999 }) + .then(({ status, data }) => { + this.setState({ loading: false }); + if (status && data.list) { + this.setState({ + data: convertDatasource ? convertDatasource(data.list) : data.list, + activeKey: this.getActiveKey(convertDatasource ? convertDatasource(data.list) : data.list) + }); + } else { + this.setState({ + data: _.map(data, o => ({ ...o, id: String(o.id), name: o.name })), + activeKey: this.getActiveKey(data) + }); + } + }); + } else { + this.setState({ data: [], loading: false, activeKey: "" }); + } + }; + getActiveKey = (data) => { + const { selectedValues = [] } = this.props; + let v = ""; + if (data && data.length > 0) { + let target = data.filter((d) => selectedValues.indexOf(d.id) === -1); + if (!_.isEmpty(target)) v = String(target[0].id); + } + return v; + }; + getItemById = (id) => { + const { data } = this.state, { datas } = this.props; + if (datas[id]) return datas[id]; + if (!_.isEmpty(data)) { + for (let i = 0; i < data.length; i++) { + if (id === data[i].id) return data[i]; + } + } + }; + handleChange = (values) => { + this.selectedData = {}; + values.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(values, this.selectedData); + this.setState({ activeKey: "" }); + }; + handleBlur = () => this.setState({ data: [], activeKey: "" }); + handleClick = (e) => { + e && e.preventDefault(); + const { datas, selectedValues } = this.props; + if (this.props.clickCallback) this.props.clickCallback(selectedValues, datas); + }; + isReadOnly = () => { + const { viewAttr } = this.props; + return viewAttr === 1 || viewAttr === "1"; + }; + + render() { + const { data, dropdownWidth } = this.state; + const { viewAttr, selectedValues, datas, isSingle, browserConditionParam = {} } = this.props; + const clsname = classNames({ + "required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues), + "mr12": viewAttr === "3" && _.isEmpty(selectedValues), + "wea-associative-single": (isSingle || browserConditionParam.isSingle), + "wea-associative-search-mult": !(isSingle || browserConditionParam.isSingle) + }); + if (this.isReadOnly()) { + let arr = []; + selectedValues && selectedValues.map(v => { + let item = datas[v].name; + if (_.isString(item)) { + arr.push({item}); + } else { + arr.push( ); + } + }); + return ( + {arr} + ); + } + let options = data.map(d => ); + selectedValues && selectedValues.map((v) => { + v && options.unshift(); + }); + const select = ; + return ( +
+ {select} + +
+
+
+ ); + } +} + +export default AssociativeSearchMult; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js new file mode 100644 index 00000000..4e3ac10c --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js @@ -0,0 +1,181 @@ +/* + * 自定义浏览框组件 + * 弹框选择 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom"; +import { Button, Col, Row, Spin } from "antd"; +import CustomBrowserMutiLeft from "./customBrowserMutiLeft"; +import CustomBrowserMutiRight from "./customBrowserMutiRight"; +import CustomBrowserOperation from "./customBrowserOperation"; +import { postFetch } from "../../../util/request"; + +const getLabel = WeaLocaleProvider.getLabel; + +class CustomBrowserDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], + query: { [props.searchParamsKey]: "" } + }; + this.selectedData = {}; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getData(); + if (nextProps.visible !== this.props.visible && nextProps.visible) this.setState({ selectedRowKeys: nextProps.selectedValues }); + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + this.setState({ pageInfo: { current: 1, pageSize: 10, total: 0 } }); + this.selectedData = {}; + } + } + + getData = () => { + const { pageInfo, query } = this.state; + const { dialogType, completeURL, convertDatasource, dataParams = {} } = this.props; + let payload = { ...dataParams }; + dialogType === "table" && (payload = { ...pageInfo, ...payload, ...query }); + this.setState({ loading: true }); + postFetch(completeURL, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status && data.list) { + const { pageNum: current, pageSize, total } = data; + this.setState({ + listDatas: convertDatasource ? convertDatasource(data.list) : data.list, + pageInfo: { ...pageInfo, current, pageSize, total } + }); + } else { + this.setState({ listDatas: data }); + } + }); + }; + handleRowClick = record => { + if (!this.props.isSingle) return; + const values = [record.id]; + const selectedData = { [record["id"]]: record }; + this.props.onCancel(); + this.props.onChange && this.props.onChange(values, selectedData); + }; + handleClear = () => { + this.props.onCancel(); + this.props.onChange && this.props.onChange([], {}); + }; + handleOk = () => { + const { selectedRowKeys } = this.state; + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(selectedRowKeys, this.selectedData); + this.props.onCancel && this.props.onCancel(); + }; + getItemById = (id) => { + const { listDatas } = this.state; + if (this.selectedData[id]) return this.selectedData[id]; + if (!_.isEmpty(listDatas)) { + for (let i = 0; i < listDatas.length; i++) { + if (id === listDatas[i].id) return listDatas[i]; + } + } + }; + + render() { + const { loading, listDatas, pageInfo, selectedRowKeys, query } = this.state; + const { dialogType, tableProps: { rowKey, columns }, isSingle, searchParamsKey } = this.props; + const sheight = this.dialog ? this.dialog.state.height - 55 : 260; + const buttons = [ + , + , + ]; + let dom = +
+
+ + + +
+ + + +
+
+
+ +
+
+ +
+
+
; + if (dialogType === "table") { + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => { + this.getData(); + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + }); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => { + this.getData(); + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + }); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + dom = + this.setState({ query: { ...query, [searchParamsKey]: value } })} + onSearch={() => { + this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => { + this.getData(); + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + }); + }}/> + + ; + } + dialogType === "table" && isSingle && buttons.splice(0, 1); + return ( + this.dialog = dom} title={getLabel(111, "数据选择")} + className="custom_browser_dialog" style={{ + width: 784, height: 460, minHeight: 200, minWidth: 380, + maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} buttons={buttons}> + {dom} + + ); + } +} + +export default CustomBrowserDialog; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js new file mode 100644 index 00000000..a6b962af --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js @@ -0,0 +1,41 @@ +/* + * 自定义浏览框组件 + * 选择框左边 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +class CustomBrowserMutiLeft extends Component { + render() { + const { datas } = this.props; + const list = datas.map(item => { + return
  • +
    {item.name}
    +
    + +
  • ; + }); + return ( +
    +
      + {list} +
    + { + list.length === 0 && +
    + {getLabel(111, "没有可显示的数据")} +
    + } +
    + ); + } +} + +export default CustomBrowserMutiLeft; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js new file mode 100644 index 00000000..5b4376d9 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js @@ -0,0 +1,43 @@ +/* + * 自定义浏览框组件 + * 选择框右边 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom"; +import { Tree } from "antd"; + +const getLabel = WeaLocaleProvider.getLabel; +const TreeNode = Tree.TreeNode; + +class CustomBrowserMutiRight extends Component { + generateTreeNodes = () => { + + }; + + render() { + const { height } = this.props; + return ( +
    + +
    + + {/**/} + {/* {this.generateTreeNodes()}*/} + {/**/} + +
    +
    + ); + } +} + +export default CustomBrowserMutiRight; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js new file mode 100644 index 00000000..c6688f32 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js @@ -0,0 +1,64 @@ +/* + * 自定义浏览框组件 + * 弹框操作栏 + * @Author: 黎永顺 + * @Date: 2024/8/30 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; + +const getLabel = WeaLocaleProvider.getLabel; + +class CustomBrowserOperation extends Component { + render() { + const { + moveToLeft, + moveToRight, + leftArrowText, + rightArrowText, + leftActive, + rightActive, + className, + leftAllActive, + moveAllToLeft, + rightAllActive, + moveAllToRight + } = this.props; + + const moveToLeftButton = ( + + ); + const moveToRightButton = ( + + ); + + const moveAllToLeftButton = ( + + ); + const moveAllToRightButton = ( + + ); + return ( +
    + {moveToLeftButton} + {moveToRightButton} + {moveAllToLeftButton} + {moveAllToRightButton} +
    + ); + } +} + +export default CustomBrowserOperation; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.js b/pc4mobx/hrmSalary/components/CustomBrowser/index.js new file mode 100644 index 00000000..3b9fb3ed --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.js @@ -0,0 +1,114 @@ +/* + * 自定义浏览框组件 + * + * @Author: 黎永顺 + * @Date: 2024/8/29 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import AssociativeSearchMult from "./components/associativeSearchMult"; +import AssociativeSearchSingle from "./components/AssociativeSearchSingle"; +import CustomBrowserDialog from "./components/customBrowserDialog"; +import classNames from "classnames"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + browserDialog: { visible: false }, + selectedData: {}, searchKeys: [], // 搜索按钮选择的数据和keys + rightDatas: [] // 右侧展示的数据 + }; + } + + componentDidMount() { + const { value, fieldConfig } = this.props; + const { browserConditionParam: { replaceDatas = [] } } = fieldConfig; + if (value && replaceDatas.length > 0) { + this.setState({ + searchKeys: value.split(","), + selectedData: _.reduce(replaceDatas, (pre, cur) => ({ ...pre, [cur["id"]]: cur }), {}) + }); + } + } + + renderSingle = () => { + const { fieldConfig } = this.props; + const { selectedData, searchKeys } = this.state; + return (
    + +
    ); + }; + renderMult = () => { + const { fieldConfig } = this.props; + const { selectedData, searchKeys } = this.state; + return (
    + +
    ); + }; + onBrowerChangeHandler = (values, datas) => { + const { form, fieldConfig, isSingle } = this.props; + const { browserConditionParam = {} } = fieldConfig || {}; + this.setState({ + searchKeys: (isSingle || browserConditionParam.isSingle) ? values.slice(-1) : values, + selectedData: ((isSingle || browserConditionParam.isSingle) && !_.isEmpty(values)) ? { [_.last(values)]: datas[_.last(values)] } : datas + }, () => { + this.props.onChange && this.props.onChange(values.join(",")); + if (form) { + form.updateFields({ + [getKey(fieldConfig)]: { value: this.state.searchKeys.join(",") } + }); + } + }); + }; + onBrowerClick = (keys, selectedObj) => { + if (_.isEmpty(keys)) { + this.setState({ searchKeys: [], selectedData: {}, rightDatas: [] }); + } + this.setState({ browserDialog: { visible: true } }); + }; + + render() { + const { browserDialog, selectedData, searchKeys } = this.state; + const { isSingle, viewAttr, fieldConfig = {} } = this.props; + const { browserConditionParam = {} } = fieldConfig || {}; + const className = classNames({ + "wea-browser": true, + "wea-field-readonly": viewAttr === "1" || fieldConfig.viewAttr === "1" + }); + const browser = (isSingle || browserConditionParam.isSingle) ? this.renderSingle() : this.renderMult(); + const style = {}; + if (this.props.resize) style.visibility = "hidden"; + return ( +
    {browser}
    + this.setState({ browserDialog: { visible: false } })} + datas={selectedData} selectedValues={searchKeys}/> +
    + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.less b/pc4mobx/hrmSalary/components/CustomBrowser/index.less new file mode 100644 index 00000000..e2d30e6e --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.less @@ -0,0 +1,22 @@ +.custom_browser_dialog { + .tableSearch { + float: right; + margin: 16px; + position: relative; + z-index: 99; + min-width: 200px; + } + + .ant-spin-nested-loading, .ant-spin-container { + height: 100%; + } + + .wea-input-focus { + height: 35px !important; + //width: 100% !important; + + input { + height: 100% !important; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/addRoleDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js similarity index 100% rename from pc4mobx/hrmSalary/pages/taxAgent/components/addRoleDialog/index.js rename to pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js b/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js similarity index 76% rename from pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js rename to pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js index ebb21338..2e232630 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js @@ -12,6 +12,26 @@ export const roleConditions = [ rules: "required|string", viewAttr: 3 }, + { + browserConditionParam: {}, + conditionType: "CUSTOMBROWSER", + domkey: ["taxAgentIds"], + fieldcol: 14, + label: "个税扣缴义务人", + lanId: 111, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: {}, + conditionType: "CUSTOMBROWSER", + domkey: ["sobIds"], + fieldcol: 14, + label: "薪资账套", + lanId: 111, + labelcol: 6, + viewAttr: 2 + }, { conditionType: "TEXTAREA", domkey: ["description"], diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/index.less b/pc4mobx/hrmSalary/pages/roleManagement/components/index.less similarity index 100% rename from pc4mobx/hrmSalary/pages/taxAgent/components/index.less rename to pc4mobx/hrmSalary/pages/roleManagement/components/index.less diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/authTree.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/authTree.js similarity index 100% rename from pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/authTree.js rename to pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/authTree.js diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/editRoleDialog.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/editRoleDialog.js similarity index 100% rename from pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/editRoleDialog.js rename to pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/editRoleDialog.js diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js similarity index 100% rename from pc4mobx/hrmSalary/pages/taxAgent/components/roleDetailSetDialog/index.js rename to pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js diff --git a/pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleSetting/index.js similarity index 100% rename from pc4mobx/hrmSalary/pages/taxAgent/components/roleSetting/index.js rename to pc4mobx/hrmSalary/pages/roleManagement/components/roleSetting/index.js diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index 66b92a2a..66c7c9e3 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -9,9 +9,11 @@ */ import React, { Component } from "react"; import { WeaInputSearch, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom"; +import { Button, message, Modal } from "antd"; import * as API from "../../apis/taxAgent"; -import { Button } from "antd"; import "./index.less"; +import AddRoleDialog from "./components/addRoleDialog"; +import RoleDetailSetDialog from "./components/roleDetailSetDialog"; const getLabel = WeaLocaleProvider.getLabel; @@ -19,7 +21,8 @@ class Index extends Component { constructor(props) { super(props); this.state = { - query: { name: "" }, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 } + query: { name: "" }, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false } }; } @@ -30,17 +33,49 @@ class Index extends Component { getRoleList = () => { const { query, pageInfo } = this.state; const paylaod = { ...pageInfo, ...query }; + this.setState({ loading: true }); API.getRoleList(paylaod).then(({ status, data }) => { + this.setState({ loading: false }); if (status) { - console.log(data); + const { list: dataSource, columns, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: [...columns, { + title: getLabel(111, "操作"), width: 120, dataIndex: "action", + render: (__, record) => ( + this.deleteAuthRole([record.id])}>{getLabel(111, "删除")}) + }] + }); + } + }); + }; + deleteAuthRole = (payload) => { + Modal.confirm({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "确认要删除吗?"), + onOk: () => { + API.deleteAuthRole(payload).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ selectedRowKeys: [] }, () => this.getRoleList()); + } else { + message.error(errormsg); + } + }); } }); }; render() { - const { query, dataSource, columns, pageInfo } = this.state; + const { + query, dataSource, columns, pageInfo, loading, selectedRowKeys, addRoleDialog, roleSetDialog + } = this.state; const buttons = [ - , + , + , this.setState({ query: { name } })} onSearch={() => this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => this.getRoleList())}/> @@ -58,14 +93,28 @@ class Index extends Component { this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getRoleList()); } }; + const rowSelection = { + selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) + }; return ( } iconBgcolor="#F14A2D" buttons={buttons} className="rolemanagement-index" >
    - + + {/*添加角色*/} + this.setState({ + addRoleDialog: { ...addRoleDialog, visible: false } + }, () => callback && callback())}/> + {/*角色详情设置*/} + this.setState({ + roleSetDialog: { ...roleSetDialog, visible: false } + }, () => callback && callback())}/>
    ); diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.less b/pc4mobx/hrmSalary/pages/roleManagement/index.less index 190f45bc..17beeb3e 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.less +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.less @@ -9,4 +9,8 @@ background: #FFF; } } + + .wea-input-focus .ant-input { + vertical-align: baseline; + } } diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.js b/pc4mobx/hrmSalary/pages/taxAgent/index.js index 3fd39f88..39ceeec2 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.js @@ -7,7 +7,6 @@ import EditModal from "./editModal"; import TipLabel from "../../components/TipLabel"; import { decentralizationConditions, editConditions } from "./editConditions"; import LogDialog from "../../components/logViewModal"; -import RoleSetting from "./components/roleSetting"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -412,11 +411,6 @@ export default class TaxAgent extends React.Component { ); } }; - } else if (item.dataIndex === "role") { - return { - ...item, - render: (text, record) => ( getTaxAgentList({})}/>) - }; } else { return { ...item }; } diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index c95ea59c..f9e0150a 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -1,6 +1,7 @@ import { Spin } from "antd"; import { WeaSwitch } from "comsMobx"; import { WeaAlertPage, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import CustomBrowser from "../components/CustomBrowser"; const getLabel = WeaLocaleProvider.getLabel; @@ -26,7 +27,7 @@ export const getConditionFields = (condition) => { }; // 渲染form表单: 一般对form的渲染都统一使用该方法 -export const getSearchs = (form, condition, col, isCenter, onChange = () => void (0), title) => { +export const getSearchs = (form, condition, col, isCenter, onChange = () => void (0), title, classnames = "") => { const { isFormInit } = form; const formParams = form.getFormParams(); let group = []; @@ -41,14 +42,13 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void wrapperCol={{ span: `${fields.fieldcol}` }} // 右侧控件占一行比例 error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验 tipPosition="bottom" // 错误提示的显示位置: top/bottom - className={(fields.domkey[0] === "subcompanyName" || fields.domkey[0] === "departmentName") ? "hideFormItem" : ""} + className={(fields.domkey[0] === "subcompanyName" || fields.domkey[0] === "departmentName") ? "hideFormItem" : classnames} > - + { + fields.conditionType === "CUSTOMBROWSER" ? + : + + } { fields.helpfulTitle && From 34bf2c8c526ee93203fc3c00a5e89ec89d13466a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 9 Sep 2024 09:35:02 +0800 Subject: [PATCH 029/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/associativeSearchMult.js | 37 ++++---- .../components/customBrowserDialog.js | 85 +++++++++++++++++-- .../components/customBrowserMutiLeft.js | 44 +++++++++- .../components/customBrowserMutiRight.js | 49 +++++++++-- .../components/CustomBrowser/index.js | 1 + .../components/CustomBrowser/index.less | 12 +-- .../components/addRoleDialog/index.js | 10 ++- .../roleManagement/components/conditions.js | 26 ++++-- pc4mobx/hrmSalary/style/index.less | 5 ++ pc4mobx/hrmSalary/util/index.js | 2 +- 10 files changed, 220 insertions(+), 51 deletions(-) diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js index db895085..cfa0b04a 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js @@ -39,23 +39,28 @@ class AssociativeSearchMult extends Component { }; getData = (name = "") => { const { browserConditionParam } = this.props; - const { completeURL, searchParamsKey, convertDatasource, dataParams = {} } = browserConditionParam; + const { + completeURL, filterByName, searchParamsKey, convertDatasource, dataParams = {} + } = browserConditionParam; if (_.trim(name)) { - postFetch(completeURL, { ...dataParams, [searchParamsKey]: name, current: 1, pageSize: 9999 }) - .then(({ status, data }) => { - this.setState({ loading: false }); - if (status && data.list) { - this.setState({ - data: convertDatasource ? convertDatasource(data.list) : data.list, - activeKey: this.getActiveKey(convertDatasource ? convertDatasource(data.list) : data.list) - }); - } else { - this.setState({ - data: _.map(data, o => ({ ...o, id: String(o.id), name: o.name })), - activeKey: this.getActiveKey(data) - }); - } - }); + let payload = { ...dataParams }; + searchParamsKey && (payload = { ...payload, [searchParamsKey]: name, current: 1, pageSize: 9999 }); + postFetch(completeURL, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status && data.list) { + this.setState({ + data: convertDatasource ? convertDatasource(data.list) : data.list, + activeKey: this.getActiveKey(convertDatasource ? convertDatasource(data.list) : data.list) + }); + } else { + this.setState({ + data: filterByName ? _.filter(_.map(data, o => ({ + ...o, id: String(o.id), name: o.name + })), k => k.name.indexOf(name) !== -1) : _.map(data, o => ({ ...o, id: String(o.id), name: o.name })), + activeKey: this.getActiveKey(data) + }); + } + }); } else { this.setState({ data: [], loading: false, activeKey: "" }); } diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js index 4e3ac10c..936113f7 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js @@ -22,15 +22,20 @@ class CustomBrowserDialog extends Component { super(props); this.state = { loading: false, listDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], - query: { [props.searchParamsKey]: "" } + query: { [props.searchParamsKey]: "" }, + leftListSelectedKeys: [], // 左侧table选择的keys + leftListSelectedData: [], // 左侧table选择的数据 + rightCheckedKeys: [], //右侧选择的keys + rightDatas: [] // 右侧展示的数据 }; this.selectedData = {}; } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.visible !== this.props.visible && nextProps.visible) this.getData(); - if (nextProps.visible !== this.props.visible && nextProps.visible) this.setState({ selectedRowKeys: nextProps.selectedValues }); - if (nextProps.visible !== this.props.visible && !nextProps.visible) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.getData(); + this.setState({ selectedRowKeys: nextProps.selectedValues }); + } else { this.setState({ pageInfo: { current: 1, pageSize: 10, total: 0 } }); this.selectedData = {}; } @@ -85,16 +90,70 @@ class CustomBrowserDialog extends Component { } }; + onLeftListCheck = (keys, datas) => { + const { leftListSelectedData } = this.state; + let targets = leftListSelectedData.concat(datas); + targets = _.uniqBy(targets, "id"); + targets = targets.filter((t) => keys.indexOf(t["id"]) > -1); + this.setState({ leftListSelectedKeys: keys, leftListSelectedData: targets }); + }; + onleftDoubleClick = (data) => { + const { rightDatas } = this.state; + this.setState({ + rightDatas: rightDatas.concat(data), + rightCheckedKeys: [], + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + }; + moveTo = (direction) => { + const { rightDatas, rightCheckedKeys, listDatas, leftListSelectedData } = this.state; + if (direction === "right") { + this.setState({ + rightDatas: rightDatas.concat(leftListSelectedData), + leftListSelectedData: [], + leftListSelectedKeys: [] + }); + } + if (direction === "left") { + rds = rightDatas.filter(item => !rightCheckedKeys.some(checkedKey => item[inputId] === checkedKey)); + this.setState({ rightDatas: rds, rightCheckedKeys: [] }); + this.onCountChange(rds); + } + + if (direction === "allToLeft") { + this.setState({ rightDatas: [], rightCheckedKeys: [] }); + this.onCountChange(rds); + } + + if (direction === "allToRight") { + if (this.leftListAllActive()) { + rds = rightDatas.concat(listDatas); + this.setState({ + rightDatas: rds, + rightCheckedKeys: [], + leftListSelectedData: [], + leftTreeCheckedData: [], + leftTreeCheckedKeys: [], + leftListSelectedKeys: [] + }); + } + this.onCountChange(rds); + } + }; + render() { - const { loading, listDatas, pageInfo, selectedRowKeys, query } = this.state; + const { loading, listDatas, pageInfo, selectedRowKeys, query, leftListSelectedKeys, rightDatas } = this.state; const { dialogType, tableProps: { rowKey, columns }, isSingle, searchParamsKey } = this.props; const sheight = this.dialog ? this.dialog.state.height - 55 : 260; const buttons = [ , , ]; + let rightActive = false; + if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true; let dom = -
    +
    @@ -102,16 +161,26 @@ class CustomBrowserDialog extends Component {
    - + this.moveTo("right")} + />
    - +
    ; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js index a6b962af..94343950 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiLeft.js @@ -12,11 +12,51 @@ import { WeaLocaleProvider } from "ecCom"; const getLabel = WeaLocaleProvider.getLabel; +let timeout = null; + class CustomBrowserMutiLeft extends Component { + constructor(props) { + super(props); + this.dataObj = {}; + } + + onClick = (data) => { + clearTimeout(timeout); + timeout = setTimeout(() => { + let { selectedKeys } = this.props; + let keys = selectedKeys ? [...selectedKeys] : []; + let datas = []; + if (keys.indexOf(data.id) > -1) { + keys = keys.filter((k) => k !== data.id); + } else { + keys.push(data.id); + } + keys.forEach((k) => this.dataObj[k] && datas.push(this.dataObj[k])); + this.props.onClick && this.props.onClick(keys, datas); + }, 200); + }; + onDoubleClick = (data) => { + clearTimeout(timeout); + this.props.onDoubleClick && this.props.onDoubleClick([data]); + }; + cls = (item) => { + const { selectedKeys, filterData } = this.props; + let cls = []; + if (selectedKeys && selectedKeys.indexOf(item.id) > -1) { + cls.push("selected"); + } + if (filterData && filterData.filter((d) => d.id === item.id).length > 0) { + cls.push("hide"); + } + return cls.join(" "); + }; + render() { - const { datas } = this.props; + const { datas, selectedKeys } = this.props; const list = datas.map(item => { - return
  • + this.dataObj[item.id] = item; + return
  • this.onClick(item)} + onDoubleClick={() => this.onDoubleClick(item)}>
    {item.name}
    diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js index 5b4376d9..c51d1c42 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js @@ -15,24 +15,55 @@ const getLabel = WeaLocaleProvider.getLabel; const TreeNode = Tree.TreeNode; class CustomBrowserMutiRight extends Component { - generateTreeNodes = () => { + constructor(props) { + super(props); + this.state = { + key: "" + }; + this.nodeIds = []; + this.nodeObj = {}; + } + generateTreeNodes = () => { + const { data } = this.props, { key } = this.state; + const treeNodes = []; + let showData = [...data]; + if (_.trim(key)) { + showData = showData.filter((item) => { + return item.name.indexOf(_.trim(key)) > -1; + }); + } + showData = _.uniqBy(showData, "id"); + this.nodeIds = []; + this.nodeObj = {}; + showData.map((item) => { + let title = ( +
    +
    +
    + {item.name} +
    +
    +
    +
    + ); + treeNodes.push(); + this.nodeIds.push(item["id"]); + this.nodeObj[item["id"]] = item; + }); + return treeNodes; }; render() { const { height } = this.props; return (
    - +
    - {/**/} - {/* {this.generateTreeNodes()}*/} - {/**/} + + {this.generateTreeNodes()} +
    diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.js b/pc4mobx/hrmSalary/components/CustomBrowser/index.js index 3b9fb3ed..92d2944f 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/index.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.js @@ -75,6 +75,7 @@ class Index extends Component { selectedData: ((isSingle || browserConditionParam.isSingle) && !_.isEmpty(values)) ? { [_.last(values)]: datas[_.last(values)] } : datas }, () => { this.props.onChange && this.props.onChange(values.join(",")); + this.props.onCustomChange && this.props.onCustomChange(this.state.selectedData); if (form) { form.updateFields({ [getKey(fieldConfig)]: { value: this.state.searchKeys.join(",") } diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.less b/pc4mobx/hrmSalary/components/CustomBrowser/index.less index e2d30e6e..ff1844c7 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/index.less +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.less @@ -11,12 +11,14 @@ height: 100%; } - .wea-input-focus { - height: 35px !important; - //width: 100% !important; + .wea-hr-muti-dialog { + .wea-input-focus { + height: 35px !important; + width: 100% !important; - input { - height: 100% !important; + input { + height: 100% !important; + } } } } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js index e196b343..51e4f4a3 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js @@ -44,6 +44,9 @@ class Index extends Component { roleForm.validateForm().then(f => { if (f.isValid) { const payload = roleForm.getFormParams(); + + console.log(payload,roleForm.getFormDatas()) + return this.setState({ loading: true }); API.saveAuthRole({ ...payload, taxAgentId }).then(({ status, data, errormsg }) => { this.setState({ loading: false }); @@ -60,20 +63,23 @@ class Index extends Component { } }); }; + handleFormChange=(val)=>{ + console.log(val) + } render() { const { conditions, loading, roleSetDialog } = this.state; const { taxAgentStore: { roleForm } } = this.props; return ( this.save()}>{getLabel(111, "保存")}, ]} > -
    {getSearchs(roleForm, conditions, 1, false)}
    +
    {getSearchs(roleForm, conditions, 1, false, this.handleFormChange)}
    ); } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js b/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js index 2e232630..bc9b50a1 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js @@ -4,7 +4,7 @@ export const roleConditions = [ { conditionType: "INPUT", domkey: ["name"], - fieldcol: 14, + fieldcol: 16, label: "名称", lanId: 111, labelcol: 6, @@ -13,29 +13,39 @@ export const roleConditions = [ viewAttr: 3 }, { - browserConditionParam: {}, + browserConditionParam: { + completeURL: "/api/bs/hrmsalary/salarysob/listAll", + filterByName: true, + tableProps: {}, + isSingle: false + }, conditionType: "CUSTOMBROWSER", domkey: ["taxAgentIds"], - fieldcol: 14, + fieldcol: 16, label: "个税扣缴义务人", lanId: 111, labelcol: 6, - viewAttr: 2 + rules: "required|string", + viewAttr: 3 }, { - browserConditionParam: {}, + browserConditionParam: { + tableProps: {}, + isSingle: false + }, conditionType: "CUSTOMBROWSER", domkey: ["sobIds"], - fieldcol: 14, + fieldcol: 16, label: "薪资账套", lanId: 111, labelcol: 6, - viewAttr: 2 + rules: "required|string", + viewAttr: 3 }, { conditionType: "TEXTAREA", domkey: ["description"], - fieldcol: 14, + fieldcol: 16, label: "描述", lanId: 111, labelcol: 6, diff --git a/pc4mobx/hrmSalary/style/index.less b/pc4mobx/hrmSalary/style/index.less index 4ce6ef7a..a7e56969 100644 --- a/pc4mobx/hrmSalary/style/index.less +++ b/pc4mobx/hrmSalary/style/index.less @@ -43,6 +43,11 @@ padding: 16px; } + .wea-content:not(.wea-associative-search) { + + + } + .wea-select, .ant-select-selection, .ant-select { width: 100%; } diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index f9e0150a..2f79dbe7 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -46,7 +46,7 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void > { fields.conditionType === "CUSTOMBROWSER" ? - : + : } { From 9759a529f5eb42d31abb2be6f1aaa1767dd6c311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 10 Sep 2024 12:23:18 +0800 Subject: [PATCH 030/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/customBrowserDialog.js | 90 ++++++++++++------- .../components/customBrowserMutiRight.js | 23 ++++- .../components/customBrowserOperation.js | 4 +- .../components/CustomBrowser/index.js | 12 ++- .../components/addRoleDialog/index.js | 21 ++--- .../roleManagement/components/conditions.js | 12 ++- .../roleManagement/components/index.less | 10 ++- .../roleDetailSetDialog/editRoleDialog.js | 30 +++++-- .../components/roleDetailSetDialog/index.js | 82 +++++++++++++---- .../hrmSalary/pages/roleManagement/index.js | 18 ++-- pc4mobx/hrmSalary/style/index.less | 5 -- pc4mobx/hrmSalary/util/index.js | 8 +- 12 files changed, 230 insertions(+), 85 deletions(-) diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js index 936113f7..eed764dd 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js @@ -34,9 +34,15 @@ class CustomBrowserDialog extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { this.getData(); - this.setState({ selectedRowKeys: nextProps.selectedValues }); + this.setState({ + selectedRowKeys: nextProps.selectedValues, + leftListSelectedData: _.values(nextProps.datas), rightDatas: _.values(nextProps.datas) + }); } else { - this.setState({ pageInfo: { current: 1, pageSize: 10, total: 0 } }); + this.setState({ + pageInfo: { current: 1, pageSize: 10, total: 0 }, query: { [this.props.searchParamsKey]: "" }, + rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: [] + }); this.selectedData = {}; } } @@ -44,7 +50,7 @@ class CustomBrowserDialog extends Component { getData = () => { const { pageInfo, query } = this.state; const { dialogType, completeURL, convertDatasource, dataParams = {} } = this.props; - let payload = { ...dataParams }; + let payload = { ...dataParams, ...query }; dialogType === "table" && (payload = { ...pageInfo, ...payload, ...query }); this.setState({ loading: true }); postFetch(completeURL, payload).then(({ status, data }) => { @@ -56,7 +62,7 @@ class CustomBrowserDialog extends Component { pageInfo: { ...pageInfo, current, pageSize, total } }); } else { - this.setState({ listDatas: data }); + this.setState({ listDatas: _.map(data, o => ({ ...o, id: String(o.id) })) }); } }); }; @@ -72,12 +78,13 @@ class CustomBrowserDialog extends Component { this.props.onChange && this.props.onChange([], {}); }; handleOk = () => { - const { selectedRowKeys } = this.state; - selectedRowKeys.forEach((v) => { + const { selectedRowKeys, rightDatas } = this.state, { dialogType } = this.props; + const convertSelectedRowKeys = dialogType !== "table" ? rightDatas.map((v) => v.id) : selectedRowKeys; + convertSelectedRowKeys.forEach((v) => { let item = this.getItemById(v); if (item) this.selectedData[v] = item; }); - this.props.onChange && this.props.onChange(selectedRowKeys, this.selectedData); + this.props.onChange && this.props.onChange(convertSelectedRowKeys, this.selectedData); this.props.onCancel && this.props.onCancel(); }; getItemById = (id) => { @@ -85,7 +92,7 @@ class CustomBrowserDialog extends Component { if (this.selectedData[id]) return this.selectedData[id]; if (!_.isEmpty(listDatas)) { for (let i = 0; i < listDatas.length; i++) { - if (id === listDatas[i].id) return listDatas[i]; + if (String(id) === String(listDatas[i].id)) return listDatas[i]; } } }; @@ -106,6 +113,11 @@ class CustomBrowserDialog extends Component { leftListSelectedKeys: [] }); }; + onRightDoubleClick = (key) => { + const { rightDatas } = this.state; + const newRightDatas = rightDatas.filter(item => String(item.id) !== key); + this.setState({ rightDatas: newRightDatas, rightCheckedKeys: [] }); + }; moveTo = (direction) => { const { rightDatas, rightCheckedKeys, listDatas, leftListSelectedData } = this.state; if (direction === "right") { @@ -114,49 +126,58 @@ class CustomBrowserDialog extends Component { leftListSelectedData: [], leftListSelectedKeys: [] }); - } - if (direction === "left") { - rds = rightDatas.filter(item => !rightCheckedKeys.some(checkedKey => item[inputId] === checkedKey)); - this.setState({ rightDatas: rds, rightCheckedKeys: [] }); - this.onCountChange(rds); - } - - if (direction === "allToLeft") { + } else if (direction === "left") { + this.setState({ + rightDatas: rightDatas.filter(item => !rightCheckedKeys.some(checkedKey => String(item.id) === checkedKey)), + rightCheckedKeys: [] + }); + } else if (direction === "allToLeft") { this.setState({ rightDatas: [], rightCheckedKeys: [] }); - this.onCountChange(rds); - } - - if (direction === "allToRight") { + } else if (direction === "allToRight") { if (this.leftListAllActive()) { - rds = rightDatas.concat(listDatas); this.setState({ - rightDatas: rds, + rightDatas: rightDatas.concat(listDatas), rightCheckedKeys: [], leftListSelectedData: [], - leftTreeCheckedData: [], - leftTreeCheckedKeys: [], leftListSelectedKeys: [] }); } - this.onCountChange(rds); } }; + leftListAllActive = () => { + const { rightDatas, listDatas } = this.state; + let bool = true; + if (_.isEmpty(listDatas)) bool = false; + if (!_.isEmpty(listDatas) && !_.isEmpty(rightDatas)) { + bool = listDatas.filter((l) => !rightDatas.some(r => l.id === r.id)).length !== 0; + } + return bool; + }; render() { - const { loading, listDatas, pageInfo, selectedRowKeys, query, leftListSelectedKeys, rightDatas } = this.state; + const { + loading, listDatas, pageInfo, selectedRowKeys, query, leftListSelectedKeys, rightDatas, rightCheckedKeys + } = this.state; const { dialogType, tableProps: { rowKey, columns }, isSingle, searchParamsKey } = this.props; const sheight = this.dialog ? this.dialog.state.height - 55 : 260; const buttons = [ - , + , , ]; - let rightActive = false; + let rightActive = false, leftActive = false, rightAllActive = false; if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true; + if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true; + if (rightDatas && rightDatas.length > 0) rightAllActive = true; let dom =
    - + + this.setState({ query: { ...query, [searchParamsKey]: value } })} + /> +
    @@ -173,13 +194,20 @@ class CustomBrowserDialog extends Component {
    this.moveTo("right")} + moveToLeft={() => this.moveTo("left")} + moveAllToRight={() => this.moveTo("allToRight")} + moveAllToLeft={() => this.moveTo("allToLeft")} />
    this.setState({ rightCheckedKeys })} + onDoubleClick={this.onRightDoubleClick} />
    diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js index c51d1c42..ed56dd09 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js @@ -14,6 +14,8 @@ import { Tree } from "antd"; const getLabel = WeaLocaleProvider.getLabel; const TreeNode = Tree.TreeNode; +let timeout = null; + class CustomBrowserMutiRight extends Component { constructor(props) { super(props); @@ -53,15 +55,30 @@ class CustomBrowserMutiRight extends Component { }); return treeNodes; }; + handleSearchChange = (v) => this.setState({ key: v }); + checkHandler = (v) => { + clearTimeout(timeout); + timeout = setTimeout(() => { + this.props.checkedCb && this.props.checkedCb(v); + }, 200); + }; + onDoubleClick = (key) => { + clearTimeout(timeout); + this.props.onDoubleClick && this.props.onDoubleClick(key); + }; render() { - const { height } = this.props; + const { height, checkedKeys } = this.props; return (
    - +
    - + {this.generateTreeNodes()} diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js index c6688f32..ab56ef02 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserOperation.js @@ -42,12 +42,12 @@ class CustomBrowserOperation extends Component { const moveAllToLeftButton = ( ); const moveAllToRightButton = ( ); return ( diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.js b/pc4mobx/hrmSalary/components/CustomBrowser/index.js index 92d2944f..b0a9ead4 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/index.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.js @@ -30,15 +30,21 @@ class Index extends Component { componentDidMount() { const { value, fieldConfig } = this.props; - const { browserConditionParam: { replaceDatas = [] } } = fieldConfig; - if (value && replaceDatas.length > 0) { + const { value: defaultValue, browserConditionParam: { replaceDatas = [] } } = fieldConfig; + if ((value || defaultValue) && replaceDatas.length > 0) { this.setState({ - searchKeys: value.split(","), + searchKeys: (value || defaultValue).split(","), selectedData: _.reduce(replaceDatas, (pre, cur) => ({ ...pre, [cur["id"]]: cur }), {}) }); } } + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.value !== this.props.value && _.isEmpty(nextProps.value)) { + this.setState({ searchKeys: [], selectedData: [] }); + } + } + renderSingle = () => { const { fieldConfig } = this.props; const { selectedData, searchKeys } = this.state; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js index 51e4f4a3..543cf535 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js @@ -24,7 +24,7 @@ class Index extends Component { constructor(props) { super(props); this.state = { - conditions: [], loading: false + conditions: [], loading: false, formData: { taxAgentIds: [], sobIds: [] } }; } @@ -40,15 +40,13 @@ class Index extends Component { } save = (isSetting) => { - const { taxAgentStore: { roleForm }, taxAgentId } = this.props; + const { taxAgentStore: { roleForm } } = this.props; + const { formData } = this.state; roleForm.validateForm().then(f => { if (f.isValid) { const payload = roleForm.getFormParams(); - - console.log(payload,roleForm.getFormDatas()) - return this.setState({ loading: true }); - API.saveAuthRole({ ...payload, taxAgentId }).then(({ status, data, errormsg }) => { + API.saveAuthRole({ ...payload, ...formData }).then(({ status, data, errormsg }) => { this.setState({ loading: false }); if (status) { message.success(getLabel(111, "操作成功!")); @@ -63,16 +61,19 @@ class Index extends Component { } }); }; - handleFormChange=(val)=>{ - console.log(val) - } + handleFormChange = (val) => { + const key = _.keys(val)[0]; + if (key === "taxAgentIds" || key === "sobIds") { + this.setState({ formData: { ...this.state.formData, ...val } }); + } + }; render() { const { conditions, loading, roleSetDialog } = this.state; const { taxAgentStore: { roleForm } } = this.props; return ( this.save()}>{getLabel(111, "保存")}, ]} > -
    {getSearchs(roleOperatorForm, conditions, 1, false)}
    +
    + {getSearchs(roleOperatorForm, conditions, 1, false, this.handleFormChange)} +
    ); } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js index 0ec684c4..957b88df 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js @@ -13,6 +13,7 @@ import { WeaDialog, WeaFormItem, WeaInput, + WeaInputNumber, WeaLocaleProvider, WeaScope, WeaSelect, @@ -26,6 +27,7 @@ import AuthTree from "./authTree"; import * as API from "../../../../apis/taxAgent"; import { Button, Col, message, Modal, Row } from "antd"; import "../index.less"; +import CustomBrowser from "../../../../components/CustomBrowser"; const getLabel = WeaLocaleProvider.getLabel; const APIFOX = { @@ -46,7 +48,8 @@ class Index extends Component { selectedKey: "auth.MemberTargetTypeEnum", name: "", options: [], enumType: "", selectedRowKeys: [], replaceDatas: [], loading: { set: false, query: false, async: false, delete: false }, columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, - editOperatorDialog: { visible: false, linkOptions: [], record: {} } + editOperatorDialog: { visible: false, linkOptions: [], record: {} }, + dataTargetSettings: { link: "OR", sortedIndex: null } }; } @@ -57,7 +60,10 @@ class Index extends Component { this.getSettingRoler(nextProps.roleId); }); } else { - this.setState({ selectedRowKeys: [], replaceDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 } }); + this.setState({ + selectedRowKeys: [], replaceDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + dataTargetSettings: { link: "OR", sortedIndex: "" } + }); } } @@ -91,18 +97,18 @@ class Index extends Component { } }); }; - handleEditOperator = async (record) => { - let { selectedKey } = this.state, linkOptions = []; - if (selectedKey === "auth.DataTargetTypeEnum") { - const payload = { enumClass: `com.engine.salary.enums.auth.DataLinkEnum` }; - const { data } = await commonEnumList(payload); - linkOptions = _.map(data, o => ({ key: o.enum, showname: o.defaultLabel })); - } - this.setState({ editOperatorDialog: { visible: true, record, linkOptions } }); + handleEditOperator = (record) => { + this.setState({ editOperatorDialog: { ...this.state.editOperatorDialog, visible: true, record } }); + }; + getConnectSymbol = async () => { + const payload = { enumClass: `com.engine.salary.enums.auth.DataLinkEnum` }; + const { data } = await commonEnumList(payload); + const linkOptions = _.map(data, o => ({ key: o.enum, showname: o.defaultLabel })); + this.setState({ editOperatorDialog: { ...this.state.editOperatorDialog, linkOptions } }); }; addOperatorSettings = () => { const { roleId } = this.props; - const { selectedKey, enumType: targetType, replaceDatas } = this.state; + const { selectedKey, enumType: targetType, replaceDatas, dataTargetSettings } = this.state; if (_.isEmpty(replaceDatas)) { Modal.warning({ title: getLabel(111, "系统提示"), @@ -111,8 +117,11 @@ class Index extends Component { return; } const payload = _.map(replaceDatas, o => ({ - roleId, targetType: o.targetType || targetType, target: o.id || "", targetName: o.name || "", - link: o.link || "OR", sortedIndex: o.sortedIndex || 0, id: o.editId || "" + roleId, target: o.id || "", id: o.editId || "", + targetType: o.targetType || targetType, + targetName: o.name || "", + link: o.link || dataTargetSettings.link, + sortedIndex: o.sortedIndex || dataTargetSettings.sortedIndex })); this.setState({ loading: { ...this.state.loading, set: true } }); APIFOX[`save.${selectedKey}`](payload).then(({ status, errormsg }) => { @@ -213,6 +222,23 @@ class Index extends Component { cur.id.split("-"), [])} onChange={v => this.setState({ replaceDatas: [{ id: v.join("-"), name: v.join("-") }] })}/> ); + case "SOB": + return ( + (o.id))} + onCustomChange={replaceDatas => this.setState({ + replaceDatas: _.map(_.values(replaceDatas), o => ({ id: o.id, name: o.name })) + })} + /> + ); default: return (); } @@ -228,8 +254,10 @@ class Index extends Component { render() { const { roleId } = this.props; const { - selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys, editOperatorDialog + selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys, editOperatorDialog, + dataTargetSettings } = this.state; + const { linkOptions } = editOperatorDialog; const tabs = [ { title: getLabel(111, "成员"), viewcondition: "auth.MemberTargetTypeEnum" }, { title: getLabel(111, "权限"), viewcondition: "auth.AuthTargetTypeEnum" }, @@ -287,6 +315,7 @@ class Index extends Component { }, () => { this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getEnumList(); this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getSettingRoler(roleId); + this.state.selectedKey === "auth.DataTargetTypeEnum" && this.getConnectSymbol(); })}/> { this.state.selectedKey !== "auth.AuthTargetTypeEnum" && @@ -297,7 +326,30 @@ class Index extends Component { { this.state.selectedKey !== "auth.AuthTargetTypeEnum" && - + { + this.state.selectedKey === "auth.DataTargetTypeEnum" && + + + + + this.setState({ + dataTargetSettings: { ...dataTargetSettings, link } + })}/> + + + + + this.setState({ + dataTargetSettings: { ...dataTargetSettings, sortedIndex } + })}/> + + + + + } + diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index 66c7c9e3..425e1a9f 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -22,7 +22,8 @@ class Index extends Component { super(props); this.state = { query: { name: "" }, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, - loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false } + loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false }, + roleSetDialog: { visible: false, roleId: "", name: "" } }; } @@ -41,14 +42,21 @@ class Index extends Component { this.setState({ dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, columns: [...columns, { - title: getLabel(111, "操作"), width: 120, dataIndex: "action", + title: getLabel(111, "操作"), width: 150, dataIndex: "action", render: (__, record) => ( - this.deleteAuthRole([record.id])}>{getLabel(111, "删除")}) + + this.showRoleSetDialog(record)}>{getLabel(111, "编辑")} + this.deleteAuthRole([record.id])}>{getLabel(111, "删除")} + + ) }] }); } }); }; + showRoleSetDialog = (role) => this.setState({ roleSetDialog: { visible: true, roleId: role.id, name: role.name } }); deleteAuthRole = (payload) => { Modal.confirm({ title: getLabel(111, "信息确认"), @@ -98,12 +106,12 @@ class Index extends Component { }; return ( } + title={getLabel(111, "业务线管理")} icon={} iconBgcolor="#F14A2D" buttons={buttons} className="rolemanagement-index" >
    + rowSelection={rowSelection} scroll={{ y: `calc(100vh - 173px)` }} rowKey="id"/> {/*添加角色*/} { @@ -46,7 +47,10 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void > { fields.conditionType === "CUSTOMBROWSER" ? - : + onChange({ + [getKey(fields)]: _.map(_.values(val), o => ({ id: o.id, name: o.name })) + })}/> : } { From c07a43b8f8c8b7720ce211bde8f07b33479b472a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 10 Sep 2024 16:33:21 +0800 Subject: [PATCH 031/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/customBrowserDialog.js | 88 ++++++++++--------- .../components/CustomBrowser/index.less | 27 ++++++ .../components/ledgerBaseSetting.js | 6 +- .../components/addRoleDialog/index.js | 2 +- .../roleManagement/components/conditions.js | 2 +- .../components/roleDetailSetDialog/index.js | 6 +- 6 files changed, 85 insertions(+), 46 deletions(-) diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js index eed764dd..4fb296c1 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js @@ -8,13 +8,14 @@ * @description: */ import React, { Component } from "react"; -import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom"; +import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable, WeaTransfer } from "ecCom"; import { Button, Col, Row, Spin } from "antd"; import CustomBrowserMutiLeft from "./customBrowserMutiLeft"; import CustomBrowserMutiRight from "./customBrowserMutiRight"; import CustomBrowserOperation from "./customBrowserOperation"; import { postFetch } from "../../../util/request"; +const WeaTransferList = WeaTransfer.list; const getLabel = WeaLocaleProvider.getLabel; class CustomBrowserDialog extends Component { @@ -171,45 +172,52 @@ class CustomBrowserDialog extends Component { if (rightDatas && rightDatas.length > 0) rightAllActive = true; let dom =
    -
    - - - this.setState({ query: { ...query, [searchParamsKey]: value } })} - /> - - -
    - - - -
    -
    -
    - this.moveTo("right")} - moveToLeft={() => this.moveTo("left")} - moveAllToRight={() => this.moveTo("allToRight")} - moveAllToLeft={() => this.moveTo("allToLeft")} - /> -
    -
    - this.setState({ rightCheckedKeys })} - onDoubleClick={this.onRightDoubleClick} - /> -
    + { + !isSingle ? +
    + + + this.setState({ query: { ...query, [searchParamsKey]: value } })} + /> + + +
    + + + +
    +
    +
    + this.moveTo("right")} + moveToLeft={() => this.moveTo("left")} + moveAllToRight={() => this.moveTo("allToRight")} + moveAllToLeft={() => this.moveTo("allToLeft")} + /> +
    +
    + this.setState({ rightCheckedKeys })} + onDoubleClick={this.onRightDoubleClick} + /> +
    +
    : + this.handleRowClick(_.find(listDatas, item => item.id === id))} + checkedKeys={[]}/> + }
    ; if (dialogType === "table") { diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.less b/pc4mobx/hrmSalary/components/CustomBrowser/index.less index ff1844c7..8cf2ce40 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/index.less +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.less @@ -20,5 +20,32 @@ height: 100% !important; } } + + .wea-transfer-list-wrapper { + border: none !important; + + .transfer-tree { + padding: 0 !important; + + & > li { + margin: 0; + cursor: pointer; + width: 100%; + position: relative; + padding: 6px 0 6px 20px !important; + border-bottom: 1px solid #e9e9e9; + color: #333; + overflow: hidden; + + .ant-tree-switcher { + display: none !important; + } + + .tree-title { + line-height: 30px; + } + } + } + } } } diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js index 823018ec..0edc9aee 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js @@ -90,7 +90,11 @@ class LedgerBaseSetting extends Component { const { settingBaseInfo } = this.state; let tmpV = {}; _.map(Object.keys(settingBaseInfo), key => { - tmpV[key] = !_.isNil(basicForm[key]) ? basicForm[key].toString() : ""; + if (key === "taxAgentId") { + tmpV[key] = _.map(basicForm["taxAgentIds"], it => it.toString()).join(","); + } else { + tmpV[key] = !_.isNil(basicForm[key]) ? basicForm[key].toString() : ""; + } }); this.setState({ settingBaseInfo: { diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js index 543cf535..4ab9f000 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js @@ -73,7 +73,7 @@ class Index extends Component { const { taxAgentStore: { roleForm } } = this.props; return ( this.save()}>{getLabel(111, "保存")}, , - + ]; selectedKey === "auth.AuthTargetTypeEnum" && buttons.shift(); selectedKey !== "auth.AuthTargetTypeEnum" && buttons.pop(); return ( - + this.setState({ dataTargetSettings: { ...dataTargetSettings, sortedIndex } From b99a2069d44f97a8ce9d2c527b2c54f66f971a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 11 Sep 2024 18:37:01 +0800 Subject: [PATCH 032/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 2 +- pc4mobx/hrmSalary/config.js | 6 ++ pc4mobx/hrmSalary/layout.js | 11 ++- .../hrmSalary/pages/calculate/calculate.js | 8 +- .../components/calculateTablelist/index.js | 7 +- .../pages/calculate/doCalc/layout.js | 30 ++++--- .../pages/calculateDetail/compareDetail.js | 22 +++-- .../hrmSalary/pages/calculateDetail/index.js | 20 +++-- .../LedgerBackCalculatedSalaryItemTable.js | 6 +- .../ledgerPage/components/copyLedgerModal.js | 46 +++++------ .../components/ledgerAssociatedPersonnel.js | 10 +-- .../components/ledgerBaseSetting.js | 38 +++++---- .../components/ledgerSalaryAdjustmentRules.js | 6 +- .../components/ledgerSalaryItemNormal.js | 4 +- .../ledgerPage/components/ledgerSearchComp.js | 47 ++++++----- .../ledgerPage/components/ledgerSlide.js | 6 +- .../ledgerPage/components/ledgerTable.js | 16 ++-- pc4mobx/hrmSalary/pages/ledgerPage/config.js | 1 + pc4mobx/hrmSalary/pages/ledgerPage/index.js | 26 ++---- pc4mobx/hrmSalary/pages/ledgerPage/index.less | 1 - .../components/salaryFileList/index.js | 12 +-- .../pages/payrollFiles/config/index.js | 6 +- .../pages/payrollFiles/salaryFiles.js | 11 +-- .../standingBook/index.js | 80 +++++++++---------- pc4mobx/hrmSalary/pages/taxAgent/index.js | 10 +-- pc4mobx/hrmSalary/stores/taxAgent.js | 8 ++ 26 files changed, 214 insertions(+), 226 deletions(-) create mode 100644 pc4mobx/hrmSalary/config.js diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index aa74fd63..390bcf7a 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -12,7 +12,7 @@ export const taxAgentRangeSync = (params) => { // 系统管理员权限 export const getPermission = (params) => { - return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/permission", "GET", params); + return WeaTools.callApi("/api/bs/hrmsalary/auth/permission", "GET", params); }; //获取个税扣缴义务人表单 diff --git a/pc4mobx/hrmSalary/config.js b/pc4mobx/hrmSalary/config.js new file mode 100644 index 00000000..6c9eaaa5 --- /dev/null +++ b/pc4mobx/hrmSalary/config.js @@ -0,0 +1,6 @@ +export const PAGE = { + "salaryArchive": ["/hrmSalary/salaryFile"], //薪资档案 + "salarySob": ["/hrmSalary/ledger"], //薪资账套 + "salaryAcct": ["/hrmSalary/calculate", "/hrmSalary/calcView"], //薪资核算 + "salaryBill": ["/hrmSalary/payroll", "/hrmSalary/payrollGrant", "/hrmSalary/payrollDetail"] //工资单 +}; diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index f1ad9a67..816934d6 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -8,12 +8,16 @@ * @description: */ import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; +import Authority from "./pages/mySalary/authority"; import stores from "./stores"; const { ls } = WeaTools; const { getLabel } = WeaLocaleProvider; +@inject("taxAgentStore") +@observer class Layout extends Component { constructor(props) { super(props); @@ -44,9 +48,10 @@ class Layout extends Component { } render() { - return ( - {this.props.children} - ); + const { taxAgentStore: { PageAndOptAuth, loading } } = this.props; + return ( + {this.props.children} + ); } } diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index e6207394..5d7b516d 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -40,8 +40,9 @@ class Calculate extends Component { } renderCalculateOpts = () => { - const { taxAgentStore: { showOperateBtn } } = this.props; + const { taxAgentStore: { PageAndOptAuth } } = this.props; const { queryParams, isRefresh } = this.state; + const admin = PageAndOptAuth.opts.includes("admin"); let calculateOpts = [ - ]; + ] : []; break; default: break; diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index b391c647..b198a29a 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -72,11 +72,9 @@ export class TaxAgentStore { // 渲染table数据 @action getTaxAgentList = params => { - this.loading = true; params = params || {}; API.getTaxAgentList(params).then( action(({ data, status }) => { - this.loading = false; if (status) { // 接口请求成功/失败处理 const { columns, list, total, pageNum: current, pageSize } = data; From 3c33fc7a3a276de9bb1be902fd1b5e45b9f0be1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 12 Sep 2024 13:53:47 +0800 Subject: [PATCH 034/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 59ae2f76..a36349c4 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -28,9 +28,9 @@ import TableRecord from "../components/tableRecord"; import { dataCollectCondition } from "./columns"; import { removePropertyCondition } from "../../../util/response"; import { convertToUrlString } from "../../../util/url"; +import { postFetch } from "../../../util/request"; import Layout from "../layout"; import moment from "moment"; -import { postFetch } from "../../../util/request"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -106,7 +106,7 @@ class Index extends Component { */ getAdvanceCondition = async () => { const { cumDeductStore: { form } } = this.props; - const { data: authTaxAgent } = postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }); + const { data: authTaxAgent } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }); getCumDeductSaCondition().then(({ status, data }) => { if (status) { this.setState({ @@ -267,7 +267,6 @@ class Index extends Component { handleAddData = (title = "新建", editId = {}) => { const { cumDeductStore: { addForm } } = this.props; const { slidePayload, taxAgentOption } = this.state; - console.log(270,taxAgentOption); const conditions = _.map(dataCollectCondition, (it, idx) => { if (idx === 0) { return { From 4a386102eff16a9792d49db359b137655d945610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 12 Sep 2024 16:34:39 +0800 Subject: [PATCH 035/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 4 + .../pages/dataAcquisition/cumDeduct/index.js | 12 +- .../roleManagement/components/index.less | 4 - .../components/roleDetailSetDialog/index.js | 111 ++++++++++++------ 4 files changed, 88 insertions(+), 43 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 390bcf7a..4b3647ab 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -152,3 +152,7 @@ export const saveAuthOpt = (params) => { export const getAuthOptTree = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/auth/opt/tree", "GET", params); }; +//业务线详情 +export const getRole = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/auth/role/getRole", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index a36349c4..dcc6f052 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -264,9 +264,11 @@ class Index extends Component { * Params: screenParams规则:日期必须放在数组最后一位,人员信息必须第一位 * Date: 2023/2/20 */ - handleAddData = (title = "新建", editId = {}) => { + handleAddData = async (title = "新建", editId = {}) => { + const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); + const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name })); const { cumDeductStore: { addForm } } = this.props; - const { slidePayload, taxAgentOption } = this.state; + const { slidePayload } = this.state; const conditions = _.map(dataCollectCondition, (it, idx) => { if (idx === 0) { return { @@ -465,8 +467,10 @@ class Index extends Component { * Params: * Date: 2023/2/20 */ - handleOpenImport = () => { - const { importPayload, taxAgentOption } = this.state; + handleOpenImport = async () => { + const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); + const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name })); + const { importPayload } = this.state; const { importOpts } = importPayload; this.setState({ importPayload: { diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/index.less b/pc4mobx/hrmSalary/pages/roleManagement/components/index.less index 136dc584..aaac5a7e 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/index.less +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/index.less @@ -50,10 +50,6 @@ .tax_role_set_container { padding: 10px 25px; - .tax_role_row_groupname { - padding: 10px 0; - } - .tax_role_form_item { min-height: 190px; border: 1px solid rgb(217, 217, 217); diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js index 9a79555c..411b267a 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js @@ -8,11 +8,11 @@ * @description: */ import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; import { WeaBrowser, WeaDialog, WeaFormItem, - WeaInput, WeaInputNumber, WeaLocaleProvider, WeaScope, @@ -28,6 +28,8 @@ import * as API from "../../../../apis/taxAgent"; import { Button, Col, message, Modal, Row } from "antd"; import "../index.less"; import CustomBrowser from "../../../../components/CustomBrowser"; +import { roleConditions } from "../conditions"; +import { getSearchs } from "../../../../util"; const getLabel = WeaLocaleProvider.getLabel; const APIFOX = { @@ -41,24 +43,24 @@ const APIFOX = { "sync.auth.DataTargetTypeEnum": API.syncAuthData }; +@inject("taxAgentStore") +@observer class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "auth.MemberTargetTypeEnum", name: "", options: [], enumType: "", selectedRowKeys: [], + selectedKey: "baseinfo", name: "", options: [], enumType: "", selectedRowKeys: [], replaceDatas: [], loading: { set: false, query: false, async: false, delete: false }, columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, editOperatorDialog: { visible: false, linkOptions: [], record: {} }, - dataTargetSettings: { link: "OR", sortedIndex: null } + dataTargetSettings: { link: "OR", sortedIndex: null }, conditions: [], + formData: { taxAgentIds: [], sobIds: [] } }; } componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { - this.setState({ name: nextProps.name, selectedKey: "auth.MemberTargetTypeEnum" }, () => { - this.getEnumList(); - this.getSettingRoler(nextProps.roleId); - }); + this.setState({ name: nextProps.name, selectedKey: "baseinfo" }, () => this.getRole(nextProps.roleId)); } else { this.setState({ selectedRowKeys: [], replaceDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, @@ -67,6 +69,18 @@ class Index extends Component { } } + getRole = (id) => { + API.getRole({ id }).then(({ status, data }) => { + if (status) { + console.log(data); + this.setState({ + conditions: _.map(roleConditions, item => ({ + ...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) })) + })) + }, () => this.props.taxAgentStore.roleForm.initFormFields(this.state.conditions)); + } + }); + }; getEnumList = () => { const payload = { enumClass: `com.engine.salary.enums.${this.state.selectedKey}` }; commonEnumList(payload).then(({ status, data }) => { @@ -156,7 +170,11 @@ class Index extends Component { }); }; saveAuthOpt = () => { - const { roleId } = this.props; + const { roleId } = this.props, { selectedKey } = this.state; + if (selectedKey === "baseinfo") { + this.saveBaseInfo(); + return; + } const { state: { checkedKeys } } = this.authTreeRef; const payload = { roleId, opts: _.reduce(checkedKeys, (pre, cur) => { @@ -177,6 +195,26 @@ class Index extends Component { } }); }; + saveBaseInfo = () => { + const { taxAgentStore: { roleForm }, roleId } = this.props; + const { formData } = this.state; + roleForm.validateForm().then(f => { + if (f.isValid) { + const payload = roleForm.getFormParams(); + this.setState({ loading: { ...this.state.loading, set: true } }); + API.saveAuthRole({ id: roleId, ...payload, ...formData }).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, set: false } }); + if (status) { + message.success(getLabel(111, "操作成功!")); + } else { + message.error(errormsg); + } + }); + } else { + f.showErrors(); + } + }); + }; syncAuthData = () => { const { roleId } = this.props, { selectedKey } = this.state; this.setState({ async: true }); @@ -190,9 +228,9 @@ class Index extends Component { }); }; getOperatorSetting = () => { - const { roleId } = this.props; - const { selectedKey, enumType, replaceDatas } = this.state; - if (selectedKey !== "auth.AuthTargetTypeEnum") { + const { roleId, taxAgentStore: { roleForm } } = this.props; + const { selectedKey, enumType, replaceDatas, conditions } = this.state; + if (!["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey)) { let browserType = {}; switch (enumType) { case "EMP": @@ -246,22 +284,30 @@ class Index extends Component { this.setState({ replaceDatas })}/> ); - } else { + } else if (selectedKey === "auth.AuthTargetTypeEnum") { return ( this.authTreeRef = dom}/>); } + return getSearchs(roleForm, conditions, 1, false, this.handleFormChange); + }; + handleFormChange = (val) => { + const key = _.keys(val)[0]; + if (key === "taxAgentIds" || key === "sobIds") { + this.setState({ formData: { ...this.state.formData, ...val } }); + } }; render() { - const { roleId } = this.props; + const { roleId, taxAgentStore } = this.props; const { selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys, editOperatorDialog, dataTargetSettings } = this.state; const { linkOptions } = editOperatorDialog; const tabs = [ - { title: getLabel(111, "成员"), viewcondition: "auth.MemberTargetTypeEnum" }, - { title: getLabel(111, "权限"), viewcondition: "auth.AuthTargetTypeEnum" }, - { title: getLabel(111, "数据"), viewcondition: "auth.DataTargetTypeEnum" } + { title: getLabel(111, "基础信息"), viewcondition: "baseinfo" }, + { title: getLabel(111, "成员设置"), viewcondition: "auth.MemberTargetTypeEnum" }, + { title: getLabel(111, "功能权限"), viewcondition: "auth.AuthTargetTypeEnum" }, + { title: getLabel(111, "数据范围"), viewcondition: "auth.DataTargetTypeEnum" } ]; const pagination = { ...pageInfo, @@ -287,44 +333,39 @@ class Index extends Component { , ]; - selectedKey === "auth.AuthTargetTypeEnum" && buttons.shift(); - selectedKey !== "auth.AuthTargetTypeEnum" && buttons.pop(); + ["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && buttons.shift(); + !["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && buttons.pop(); return (
    - - - - this.setState({ name: val })}/> - - -
    this.setState({ - selectedKey: v, name: !name ? null : name, replaceDatas: [], selectedRowKeys: [] + selectedKey: v, replaceDatas: [], selectedRowKeys: [] }, () => { - this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getEnumList(); - this.state.selectedKey !== "auth.AuthTargetTypeEnum" && this.getSettingRoler(roleId); - this.state.selectedKey === "auth.DataTargetTypeEnum" && this.getConnectSymbol(); + taxAgentStore.roleForm.resetForm(); + const { selectedKey } = this.state; + !["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && this.getEnumList(); + !["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && this.getSettingRoler(roleId); + selectedKey === "auth.DataTargetTypeEnum" && this.getConnectSymbol(); + selectedKey === "baseinfo" && this.getRole(roleId); })}/> { - this.state.selectedKey !== "auth.AuthTargetTypeEnum" && + !["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && this.setState({ enumType: v, replaceDatas: [] })}/> } {this.getOperatorSetting()} { - this.state.selectedKey !== "auth.AuthTargetTypeEnum" && + !["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && { this.state.selectedKey === "auth.DataTargetTypeEnum" && @@ -359,7 +400,7 @@ class Index extends Component { {/*表格*/} { - this.state.selectedKey !== "auth.AuthTargetTypeEnum" && + !["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) &&
    From 85cdbbe8b2940ae2142ce4ce30d950ebdf4e5669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 12 Sep 2024 17:50:19 +0800 Subject: [PATCH 036/110] =?UTF-8?q?custom/=E5=A4=A7=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/roleDetailSetDialog/index.js | 34 ++++++++++++++++--- .../hrmSalary/pages/roleManagement/index.js | 8 ++++- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js index 411b267a..511d2ce8 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js @@ -19,7 +19,8 @@ import { WeaSelect, WeaTab, WeaTable, - WeaTextarea + WeaTextarea, + WeaTools } from "ecCom"; import { commonEnumList } from "../../../../apis/archive"; import EditRoleDialog from "./editRoleDialog"; @@ -32,6 +33,7 @@ import { roleConditions } from "../conditions"; import { getSearchs } from "../../../../util"; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; const APIFOX = { "auth.MemberTargetTypeEnum": API.authMemberList, "save.auth.MemberTargetTypeEnum": API.saveAuthMember, @@ -72,12 +74,33 @@ class Index extends Component { getRole = (id) => { API.getRole({ id }).then(({ status, data }) => { if (status) { - console.log(data); this.setState({ conditions: _.map(roleConditions, item => ({ - ...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) })) - })) - }, () => this.props.taxAgentStore.roleForm.initFormFields(this.state.conditions)); + ...item, items: _.map(item.items, o => { + if (getKey(o) === "taxAgentIds" || getKey(o) === "sobIds") { + return { + ...o, label: getLabel(o.lanId, o.label), + value: _.map(data[getKey(o)], i => String(i.id)).join(","), + browserConditionParam: { + ...o.browserConditionParam, + replaceDatas: _.map(data[getKey(o)], i => ({ id: String(i.id), name: i.name })) + } + }; + } + return { ...o, label: getLabel(o.lanId, o.label) }; + }) + })), + formData: { + taxAgentIds: _.map(data["taxAgentIds"], i => ({ id: String(i.id), name: i.name })), + sobIds: _.map(data["sobIds"], i => ({ id: String(i.id), name: i.name })) + } + }, () => { + this.props.taxAgentStore.roleForm.initFormFields(this.state.conditions); + this.props.taxAgentStore.roleForm.updateFields({ + name: { value: data.name }, + description: { value: data.description } + }); + }); } }); }; @@ -206,6 +229,7 @@ class Index extends Component { this.setState({ loading: { ...this.state.loading, set: false } }); if (status) { message.success(getLabel(111, "操作成功!")); + this.props.onSearch && this.props.onSearch(); } else { message.error(errormsg); } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index 425e1a9f..b827825e 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -8,6 +8,7 @@ * @description: */ import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; import { WeaInputSearch, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom"; import { Button, message, Modal } from "antd"; import * as API from "../../apis/taxAgent"; @@ -17,6 +18,8 @@ import RoleDetailSetDialog from "./components/roleDetailSetDialog"; const getLabel = WeaLocaleProvider.getLabel; +@inject("taxAgentStore") +@observer class Index extends Component { constructor(props) { super(props); @@ -122,7 +125,10 @@ class Index extends Component { this.setState({ roleSetDialog: { ...roleSetDialog, visible: false } - }, () => callback && callback())}/> + }, () => { + this.props.taxAgentStore.initRoleForm(); + callback && callback(); + })}/>
    ); From 3f0502aabf75c59535a437b373d9f65f58b915ef 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, 13 Sep 2024 11:12:53 +0800 Subject: [PATCH 037/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/config.js | 7 +- .../components/attendanceDataComp.js | 78 +++++++++++-------- .../components/attendanceRefrenceDataModal.js | 41 +++++----- .../pages/dataAcquisition/attendance/index.js | 4 +- .../pages/dataAcquisition/cumDeduct/index.js | 3 +- .../dataAcquisition/cumSituation/index.js | 25 +++--- .../dataAcquisition/otherDeduct/index.js | 25 +++--- .../specialAddDeduction/index.js | 33 ++++---- 8 files changed, 127 insertions(+), 89 deletions(-) diff --git a/pc4mobx/hrmSalary/config.js b/pc4mobx/hrmSalary/config.js index 47c437d6..3b93db1b 100644 --- a/pc4mobx/hrmSalary/config.js +++ b/pc4mobx/hrmSalary/config.js @@ -4,5 +4,10 @@ export const PAGE = { "salaryAcct": ["/hrmSalary/calculate", "/hrmSalary/calcView"], //薪资核算 "salaryBill": ["/hrmSalary/payroll", "/hrmSalary/payrollGrant", "/hrmSalary/payrollDetail"], //工资单 "taxDeclaration": ["/hrmSalary/declare", "/hrmSalary/generateDeclarationDetail"], //个税 - "addUpDeduction": ["/dataAcquisition/cumDeduct"] //累计专项附加扣除 + "addUpDeduction": ["/dataAcquisition/cumDeduct"], //累计专项附加扣除 + "specialAddDeduction": ["/dataAcquisition/specialAddDeduction"], //专项附加扣除 + "otherDeduction": ["/dataAcquisition/otherDeduct"], //其他免税扣除 + "addUpSituation": ["/dataAcquisition/cumSituation"], //往期累计情况 + "attendQuote": ["/dataAcquisition/attendance"], //考勤引用 + "myBill": ["/hrmSalary/mySalary", "/hrmSalary/mySalaryMobile"] //薪资福利 }; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js index dd103159..9869b50e 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js @@ -11,7 +11,6 @@ import { deleteAttendance, getAttendanceFieldSettingList, getAttendanceList, - getLedgerList, getSalaryCycleAndAttendCycle, importAttendQuoteData, returnToAttendanceFieldSettingDefault, @@ -26,6 +25,7 @@ import moment from "moment"; import SelectItemsWrapper from "../../../../components/selectItemsModal/selectItemsWrapper"; import AttendanceRefrenceDataModal from "./attendanceRefrenceDataModal"; import AttendanceDataViewSlide from "./attendanceDataViewSlide"; +import { postFetch } from "../../../../util/request"; const getLabel = WeaLocaleProvider.getLabel; @@ -51,7 +51,7 @@ class AttendanceDataComp extends Component { }, fieldSetPayload: { visible: false, title: "", children: null }, attendanceReferencePayload: { visible: false, title: "" }, - attendanceViewPayload: { visible: false, attendQuoteId: "", salaryYearMonth: "" } + attendanceViewPayload: { visible: false, attendQuoteId: "", salaryYearMonth: "", showOperateBtn: false } }; } @@ -85,25 +85,26 @@ class AttendanceDataComp extends Component { }; getLedgerList = (importData) => { const { importFormPayload } = this.state; - getLedgerList().then(({ status, data }) => { - if (status) { - this.setState({ - importFormPayload: { - ...importFormPayload, salarySobId: _.head(data).id, - salarySobList: _.map(data, it => ({ key: it.id, showname: it.content })) - } - }, async () => { - const { importFormPayload } = this.state; - const { salaryYearMonth, salarySobId } = importFormPayload; - const payload = { salaryYearMonthStr: salaryYearMonth, salarySobId }; - const { data } = await getSalaryCycleAndAttendCycle(payload); + postFetch("/api/bs/hrmsalary/salarysob/listAuth", { filterType: "ADMIN_DATA" }) + .then(({ status, data }) => { + if (status) { this.setState({ - importData: { ...importData, params: { salaryYearMonth, salarySobId } }, - importFormPayload: { ...importFormPayload, ...data } + importFormPayload: { + ...importFormPayload, salarySobId: String(_.head(data).id), + salarySobList: _.map(data, it => ({ key: String(it.id), showname: it.name })) + } + }, async () => { + const { importFormPayload } = this.state; + const { salaryYearMonth, salarySobId } = importFormPayload; + const payload = { salaryYearMonthStr: salaryYearMonth, salarySobId }; + const { data } = await getSalaryCycleAndAttendCycle(payload); + this.setState({ + importData: { ...importData, params: { salaryYearMonth, salarySobId } }, + importFormPayload: { ...importFormPayload, ...data } + }); }); - }); - } - }); + } + }); }; handleChangeImportPayload = (key, value) => { const { importFormPayload, importData } = this.state; @@ -149,11 +150,11 @@ class AttendanceDataComp extends Component { } }); }; - handleViewAttendanceData = ({ id, attendCycle }) => { + handleViewAttendanceData = ({ id, attendCycle, opts = [] }) => { const { attendanceViewPayload } = this.state; this.setState({ attendanceViewPayload: { - ...attendanceViewPayload, + ...attendanceViewPayload, showOperateBtn: opts.includes("admin"), visible: true, attendQuoteId: id, salaryYearMonth: attendCycle } @@ -287,7 +288,7 @@ class AttendanceDataComp extends Component { dataSource, columns, pageInfo, loading, importData, importFormPayload, fieldSetPayload, attendanceReferencePayload, attendanceViewPayload } = this.state; - const { showOperateBtn, salaryYearMonth } = this.props; + const { salaryYearMonth } = this.props; const pagination = { ...pageInfo, showTotal: total => `共 ${total} 条`, @@ -315,10 +316,11 @@ class AttendanceDataComp extends Component { width: 120, dataIndex: "operate", render: (_, record) => { + const { opts = [] } = record; return (
    this.handleViewAttendanceData(record)}>查看 - {showOperateBtn && + {opts.includes("admin") && this.handleDeleteAttendanceData(record)}>删除 @@ -336,9 +338,18 @@ class AttendanceDataComp extends Component { } { - !showOperateBtn && - this.props.onFilterLog("log", record.id)}>{getLabel(545781, "操作日志")} + !opts.includes("admin") && + + + this.props.onFilterLog("log", record.id)}>{getLabel(545781, "操作日志")} + + + }> + + }
    ); @@ -361,14 +372,13 @@ class AttendanceDataComp extends Component { {/* 考勤数据引用 */} {/* 考勤数据查看 */} - this.setState({ - attendanceViewPayload: { - ...attendanceViewPayload, - visible: false, - attendQuoteId: "" - } - })}/> + this.setState({ + attendanceViewPayload: { + ...attendanceViewPayload, + visible: false, + attendQuoteId: "" + } + })}/> ); } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js index c8fdb4b9..87f06a11 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js @@ -13,7 +13,6 @@ import { getSearchs } from "../../../../util"; import { checkOperation, getAttendanceFieldSettingList, - getLedgerList, returnToAttendanceFieldSettingDefault, saveAttendanceFieldSetting, saveAttendanceFieldSettingAsDefault, @@ -21,6 +20,7 @@ import { } from "../../../../apis/attendance"; import SelectItemModal from "../../../../components/selectItemsModal"; import SelectItemsWrapper from "../../../../components/selectItemsModal/selectItemsWrapper"; +import { postFetch } from "../../../../util/request"; import "./index.less"; @inject("attendanceStore") @@ -46,25 +46,26 @@ class AttendanceRefrenceDataModal extends Component { getLedgerList = () => { const { attendanceStore: { refenceform } } = this.props; - getLedgerList().then(({ status, data }) => { - if (status) { - this.setState({ - condition: _.map(reFrenceConditions, (item) => { - const { items } = item; - return { - ...item, - items: _.map(items, child => { - const { domkey } = child; - if (domkey[0] === "salarySobIds") { - return { ...child, options: _.map(data, it => ({ key: it.id, showname: it.content })) }; - } - return { ...child }; - }) - }; - }) - }, () => refenceform.initFormFields(this.state.condition)); - } - }); + postFetch("/api/bs/hrmsalary/salarysob/listAuth", { filterType: "ADMIN_DATA" }) + .then(({ status, data }) => { + if (status) { + this.setState({ + condition: _.map(reFrenceConditions, (item) => { + const { items } = item; + return { + ...item, + items: _.map(items, child => { + const { domkey } = child; + if (domkey[0] === "salarySobIds") { + return { ...child, options: _.map(data, it => ({ key: String(it.id), showname: it.name })) }; + } + return { ...child }; + }) + }; + }) + }, () => refenceform.initFormFields(this.state.condition)); + } + }); }; /* * Author: 黎永顺 diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index e27fc31e..1a2de172 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js @@ -78,7 +78,8 @@ class Index extends Component { render() { const { selectedKey, salaryMonth, fieldName, logDialogVisible, filterConditions } = this.state; - const { taxAgentStore: { showOperateBtn } } = this.props; + const { taxAgentStore: { PageAndOptAuth } } = this.props; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const topTab = [ { title: "考勤数据", key: "DATA" }, { title: "字段管理", key: "FIELD" } @@ -115,7 +116,6 @@ class Index extends Component { selectedKey === "DATA" ? this.attendanceTableRef = dom} - showOperateBtn={showOperateBtn} salaryYearMonth={salaryMonth} onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)} /> : diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index dcc6f052..37be1131 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -241,7 +241,8 @@ class Index extends Component { } }; handleSaveData = () => { - const { cumDeductStore: { addForm } } = this.props, { taxAgentOption } = this.state; + const { cumDeductStore: { addForm } } = this.props, { slidePayload } = this.state; + const taxAgentOption = slidePayload.children.props.taxAgentOption; addForm.validateForm().then(f => { if (f.isValid) { const payload = { diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index dd32ab7c..3fd8637b 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -27,6 +27,7 @@ import { dataCollectCondition, taxOptions } from "./columns"; import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; import { convertToUrlString } from "../../../util/url"; +import { postFetch } from "../../../util/request"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -62,7 +63,8 @@ class Index extends Component { exportPayloadUrl: "", exportPayloadType: false, advanceCondition: null, - targetid: "" + targetid: "", + taxAgentOption: [] }; this.tableRef = null; this.addItemRef = null; @@ -79,11 +81,15 @@ class Index extends Component { * Params: * Date: 2023/2/20 */ - getAdvanceCondition = () => { + getAdvanceCondition = async () => { + const { data: authTaxAgent } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }); const { cumSituationStore: { form } } = this.props; getCumSituationSaCondition().then(({ status, data }) => { if (status) { - this.setState({ advanceCondition: removePropertyCondition(data.condition) }); + this.setState({ + advanceCondition: removePropertyCondition(data.condition), + taxAgentOption: _.map(authTaxAgent, g => ({ key: String(g.id), showname: g.name })) + }); form.initFormFields(removePropertyCondition(data.condition)); } }); @@ -141,10 +147,11 @@ class Index extends Component { * Params: screenParams规则:日期必须放在数组最后一位,人员信息必须第一位 * Date: 2023/2/20 */ - handleAddData = (title = "新建", editId = {}) => { - const { taxAgentStore, cumSituationStore: { addForm } } = this.props; + handleAddData = async (title = "新建", editId = {}) => { + const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); + const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name })); + const { cumSituationStore: { addForm } } = this.props; const { slidePayload } = this.state; - const { taxAgentOption } = taxAgentStore; const conditions = _.map(dataCollectCondition, (it, idx) => { if (idx === 0) { return { @@ -323,8 +330,7 @@ class Index extends Component { * Date: 2023/2/17 */ getScreen = () => { - const { taxAgentStore: { taxAgentOption } } = this.props; - const { declareMonth, year, taxAgentId, innerWidth } = this.state; + const { declareMonth, year, taxAgentId, innerWidth, taxAgentOption } = this.state; const items = [ { com: DataCollectionDatePicker({ @@ -388,7 +394,8 @@ class Index extends Component { this.props.cumSituationStore.initAddForm(); }; handleSaveData = () => { - const { cumSituationStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props; + const { cumSituationStore: { addForm } } = this.props, { slidePayload } = this.state; + const taxAgentOption = slidePayload.children.props.taxAgentOption; addForm.validateForm().then(f => { if (f.isValid) { const payload = { diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index e9e61438..b5f3b024 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -29,6 +29,7 @@ import { dataCollectCondition } from "./columns"; import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; import { convertToUrlString } from "../../../util/url"; +import { postFetch } from "../../../util/request"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -63,7 +64,8 @@ class Index extends Component { exportPayloadUrl: "", exportPayloadType: false, advanceCondition: null, - targetid: "" + targetid: "", + taxAgentOption: [] }; this.tableRef = null; this.addItemRef = null; @@ -80,11 +82,15 @@ class Index extends Component { * Params: * Date: 2023/2/20 */ - getAdvanceCondition = () => { + getAdvanceCondition = async () => { + const { data: authTaxAgent } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }); const { otherDeductStore: { form } } = this.props; getOtherDeductSaCondition().then(({ status, data }) => { if (status) { - this.setState({ advanceCondition: removePropertyCondition(data.condition) }); + this.setState({ + advanceCondition: removePropertyCondition(data.condition), + taxAgentOption: _.map(authTaxAgent, g => ({ key: String(g.id), showname: g.name })) + }); form.initFormFields(removePropertyCondition(data.condition)); } }); @@ -269,10 +275,11 @@ class Index extends Component { * Params: screenParams规则:日期必须放在数组最后一位,人员信息必须第一位 * Date: 2023/2/20 */ - handleAddData = (title = "新建", editId = {}) => { - const { taxAgentStore, otherDeductStore: { addForm } } = this.props; + handleAddData = async (title = "新建", editId = {}) => { + const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); + const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name })); + const { otherDeductStore: { addForm } } = this.props; const { slidePayload } = this.state; - const { taxAgentOption } = taxAgentStore; const conditions = _.map(dataCollectCondition, (it, idx) => { if (idx === 0) { return { @@ -358,8 +365,7 @@ class Index extends Component { * Date: 2023/2/17 */ getScreen = () => { - const { taxAgentStore: { taxAgentOption } } = this.props; - const { declareMonth, taxAgentId, innerWidth } = this.state; + const { declareMonth, taxAgentId, innerWidth, taxAgentOption } = this.state; const items = [ { com: DataCollectionDatePicker({ @@ -403,7 +409,8 @@ class Index extends Component { this.props.otherDeductStore.initAddForm(); }; handleSaveData = () => { - const { otherDeductStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props; + const { otherDeductStore: { addForm } } = this.props, { slidePayload } = this.state; + const taxAgentOption = slidePayload.children.props.taxAgentOption; addForm.validateForm().then(f => { if (f.isValid) { const payload = { diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index fe79d45f..be738854 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -20,6 +20,7 @@ import { condition } from "./components/condition"; import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; import { convertToUrlString } from "../../../util/url"; +import { postFetch } from "../../../util/request"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -52,7 +53,8 @@ class Index extends Component { exportPayloadUrl: "", exportPayloadType: false, advanceCondition: null, - targetid: "" + targetid: "", + taxAgentOption: [] }; this.tableRef = null; this.addItemRef = null; @@ -104,11 +106,15 @@ class Index extends Component { * Params: * Date: 2023/2/20 */ - getAdvanceCondition = () => { + getAdvanceCondition = async () => { + const { data: authTaxAgent } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }); const { specialAddStore: { advanceForm } } = this.props; getSearchCondition().then(({ status, data }) => { if (status) { - this.setState({ advanceCondition: removePropertyCondition(data.condition) }); + this.setState({ + advanceCondition: removePropertyCondition(data.condition), + taxAgentOption: _.map(authTaxAgent, g => ({ key: String(g.id), showname: g.name })) + }); advanceForm.initFormFields(removePropertyCondition(data.condition)); } }); @@ -207,8 +213,7 @@ class Index extends Component { * Date: 2023/2/17 */ getScreen = () => { - const { taxAgentStore: { taxAgentOption } } = this.props; - const { taxAgentId } = this.state; + const { taxAgentId, taxAgentOption } = this.state; const items = [ { com: DataCollectionSelect({ @@ -257,10 +262,11 @@ class Index extends Component { * Params: screenParams规则:日期必须放在数组最后一位,人员信息必须第一位 * Date: 2023/2/20 */ - handleAddData = (title = "新建", editId = {}) => { - const { taxAgentStore, specialAddStore: { addForm } } = this.props; + handleAddData = async (title = "新建", editId = {}) => { + const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); + const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name })); + const { specialAddStore: { addForm } } = this.props; const { slidePayload } = this.state; - const { taxAgentOption } = taxAgentStore; const conditions = _.map(condition, (it, idx) => { if (idx === 0) { return { @@ -341,7 +347,8 @@ class Index extends Component { this.props.specialAddStore.initAddForm(); }; handleSaveData = () => { - const { specialAddStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props; + const { specialAddStore: { addForm } } = this.props, { slidePayload } = this.state; + const taxAgentOption = slidePayload.children.props.taxAgentOption; addForm.validateForm().then(f => { if (f.isValid) { const payload = { @@ -369,10 +376,11 @@ class Index extends Component { * Params: * Date: 2023/2/20 */ - handleOpenImport = () => { + handleOpenImport = async () => { + const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); + const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name })); const { importPayload } = this.state; const { importOpts } = importPayload; - const { taxAgentStore: { taxAgentOption } } = this.props; this.setState({ importPayload: { ...importPayload, @@ -403,7 +411,7 @@ class Index extends Component { }; render() { - const { taxAgentStore: { showOperateBtn }, specialAddStore: { advanceForm } } = this.props; + const { specialAddStore: { advanceForm } } = this.props; const { taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, importPayload, exportPayloadType, targetid @@ -425,7 +433,6 @@ class Index extends Component { url="/api/bs/hrmsalary/specialAddDeduction/list" payload={tablePayload} isSpecial - showOperateBtn={showOperateBtn} onTableOperate={this.handleTableOperate} onViewDetails={(record) => this.handleAddData("专项附加扣除记录", record)} form={advanceForm} From d7b1c173c22cdc45c887a1d670a1ca32a2320a10 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, 13 Sep 2024 14:11:26 +0800 Subject: [PATCH 038/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roleManagement/components/addRoleDialog/index.js | 4 +++- .../components/roleDetailSetDialog/index.js | 8 +++++++- pc4mobx/hrmSalary/pages/roleManagement/index.js | 4 +++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js index 4ab9f000..83c24cd1 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/addRoleDialog/index.js @@ -51,7 +51,9 @@ class Index extends Component { if (status) { message.success(getLabel(111, "操作成功!")); this.props.onCancel(() => this.props.onSearch()); - isSetting && this.props.showRoleSetDialog({ id: data, name: payload.name }); + isSetting && this.props.showRoleSetDialog({ + id: data, name: payload.name, selectedKey: "auth.MemberTargetTypeEnum" + }); } else { message.error(errormsg); } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js index 511d2ce8..d57c0dfd 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js @@ -62,7 +62,13 @@ class Index extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { - this.setState({ name: nextProps.name, selectedKey: "baseinfo" }, () => this.getRole(nextProps.roleId)); + this.setState({ + name: nextProps.name, selectedKey: nextProps.selectedKey || "baseinfo" + }, () => { + this.state.selectedKey === "auth.MemberTargetTypeEnum" && this.getEnumList(); + this.state.selectedKey === "auth.MemberTargetTypeEnum" && this.getSettingRoler(nextProps.roleId); + this.state.selectedKey === "baseinfo" && this.getRole(nextProps.roleId); + }); } else { this.setState({ selectedRowKeys: [], replaceDatas: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index b827825e..9d667ad7 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -59,7 +59,9 @@ class Index extends Component { } }); }; - showRoleSetDialog = (role) => this.setState({ roleSetDialog: { visible: true, roleId: role.id, name: role.name } }); + showRoleSetDialog = (role) => this.setState({ + roleSetDialog: { visible: true, roleId: role.id, name: role.name, selectedKey: role.selectedKey } + }); deleteAuthRole = (payload) => { Modal.confirm({ title: getLabel(111, "信息确认"), From 6928f89df628a06a12b1a947eb7ee879df432763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Sat, 14 Sep 2024 11:41:31 +0800 Subject: [PATCH 039/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/config.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/config.js b/pc4mobx/hrmSalary/config.js index 3b93db1b..6483395a 100644 --- a/pc4mobx/hrmSalary/config.js +++ b/pc4mobx/hrmSalary/config.js @@ -9,5 +9,13 @@ export const PAGE = { "otherDeduction": ["/dataAcquisition/otherDeduct"], //其他免税扣除 "addUpSituation": ["/dataAcquisition/cumSituation"], //往期累计情况 "attendQuote": ["/dataAcquisition/attendance"], //考勤引用 - "myBill": ["/hrmSalary/mySalary", "/hrmSalary/mySalaryMobile"] //薪资福利 + "myBill": ["/hrmSalary/mySalary", "/hrmSalary/mySalaryMobile"], //薪资福利 + "taxAgent": ["/hrmSalary/taxAgent"], //个税扣缴义务人 + "auth": ["/hrmSalary/roleManagement"], //业务管理线 + "variableArchive": ["/hrmSalary/variableSalary"], //浮动薪酬 + "siAccount": ["/socialSecurityBenefits/standingBook", "/socialSecurityBenefits/standingBookDetail", "/socialSecurityBenefits/sbofflineComparison"], //社保福利台账 + "siArchive": ["/socialSecurityBenefits/archives"], //社保档案 + "salaryField": ["/hrmSalary/fieldManagement"], //字段管理 + "salaryItem": ["/hrmSalary/salaryItem"], //薪资项目管理 + "siScheme": ["/socialSecurityBenefits/programme"], //社保福利方案 }; From b597bdd2bb2330d7a129f101a1d234a8ac021c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Sat, 14 Sep 2024 14:28:58 +0800 Subject: [PATCH 040/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roleDetailSetDialog/editRoleDialog.js | 12 ++++++++---- .../components/roleDetailSetDialog/index.js | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/editRoleDialog.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/editRoleDialog.js index 933b333e..d8fe3e0e 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/editRoleDialog.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/editRoleDialog.js @@ -55,10 +55,12 @@ class EditRoleDialog extends Component { ...o, startValue: nextProps.record[getKey(o)].split("-")[0], endValue: nextProps.record[getKey(o)].split("-")[1], conditionType: "SCOPE", precision: 0 - } : nextProps.record.targetType === "SOB" ? { + } : (nextProps.record.targetType === "SOB" || + nextProps.record.targetType === "TAX") ? { ...o, value: nextProps.record["target"], conditionType: "CUSTOMBROWSER", browserConditionParam: { - completeURL: "/api/bs/hrmsalary/salarysob/listAuth", + completeURL: nextProps.record.targetType === "SOB" ? + "/api/bs/hrmsalary/salarysob/listAuth" : "/api/bs/hrmsalary/taxAgent/listAuth", dataParams: { filterType: "QUERY_DATA" }, filterByName: true, isSingle: true, tableProps: {}, searchParamsKey: "name", @@ -71,7 +73,8 @@ class EditRoleDialog extends Component { } return o; }) - })) + })), + targetSob: { id: nextProps.record["target"], name: nextProps.record["targetName"] } }, () => nextProps.taxAgentStore.roleOperatorForm.initFormFields(this.state.conditions)); } if (nextProps.visible !== this.props.visible && !nextProps.visible) { @@ -126,7 +129,8 @@ class EditRoleDialog extends Component { handleFormChange = (val) => { const { record } = this.props; const key = _.keys(val)[0]; - if (key === "targetName" && record.targetType === "SOB") this.setState({ targetSob: _.head(val[key]) }); + if (key === "targetName" && (record.targetType === "SOB" || record.targetType === "TAX")) + this.setState({ targetSob: _.head(val[key]) }); }; render() { diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js index d57c0dfd..bfee4532 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js @@ -307,6 +307,23 @@ class Index extends Component { })} /> ); + case "TAX": + return ( + (o.id))} + onCustomChange={replaceDatas => this.setState({ + replaceDatas: _.map(_.values(replaceDatas), o => ({ id: o.id, name: o.name })) + })} + /> + ); default: return (); } From 15cc213c8c59a029583623589b7d28d8965276ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Sat, 14 Sep 2024 15:52:12 +0800 Subject: [PATCH 041/110] =?UTF-8?q?custom/=E5=A4=A7=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/config.js | 1 + .../pages/analysisOfSalaryStatistics/index.js | 3 +- pc4mobx/hrmSalary/pages/employeeView/index.js | 23 +++--- .../statisticalMicroSettingsSlide.js | 73 ++++++++++--------- pc4mobx/hrmSalary/pages/reportView/index.js | 6 +- pc4mobx/hrmSalary/pages/reportView/index.less | 1 + pc4mobx/hrmSalary/pages/taxAgent/index.js | 4 +- 7 files changed, 56 insertions(+), 55 deletions(-) diff --git a/pc4mobx/hrmSalary/config.js b/pc4mobx/hrmSalary/config.js index 6483395a..d89e5c65 100644 --- a/pc4mobx/hrmSalary/config.js +++ b/pc4mobx/hrmSalary/config.js @@ -18,4 +18,5 @@ export const PAGE = { "salaryField": ["/hrmSalary/fieldManagement"], //字段管理 "salaryItem": ["/hrmSalary/salaryItem"], //薪资项目管理 "siScheme": ["/socialSecurityBenefits/programme"], //社保福利方案 + "report": ["/hrmSalary/analysisOfSalaryStatistics", "/hrmSalary/reportView"], //报表 }; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js index 121e334a..ee1d3f5b 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js @@ -275,7 +275,7 @@ class Index extends Component { render() { const { - taxAgentStore: { statisticsReportBtn }, + taxAgentStore: { PageAndOptAuth }, attendanceStore: { statisticsForm, reportForm, tableStore } } = this.props; const { @@ -283,6 +283,7 @@ class Index extends Component { reportName, keyword, year, logDialogVisible, filterConditions, dateRange, showSearchAd, isQuery } = this.state; + const statisticsReportBtn = PageAndOptAuth.opts.includes("admin"); const buttons = selectedKey === "statistics" ? [ ,
    {/*统计数据范围及规则设置弹框*/} this.setState({ statisticalPayload: { visible: false, id: "", dimension: "" } }, () => isRefresh && this.leftTabRef.reportStatisticsReportList())} diff --git a/pc4mobx/hrmSalary/pages/reportView/index.less b/pc4mobx/hrmSalary/pages/reportView/index.less index e1e94313..4fc5e700 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.less +++ b/pc4mobx/hrmSalary/pages/reportView/index.less @@ -214,6 +214,7 @@ .wea-form-item .wea-form-item-wrapper .wea-field-readonly { white-space: pre-wrap !important; + line-height: 28px; } .wea-slide-modal-title { diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.js b/pc4mobx/hrmSalary/pages/taxAgent/index.js index 84f44c94..02bd0a71 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.js @@ -319,9 +319,9 @@ export default class TaxAgent extends React.Component { doInit, hasRight, getTaxAgentList, - showOperateBtn + PageAndOptAuth } = taxAgentStore; - + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); if (!hasRight && !loading) { // 无权限处理 return renderNoright(); From f1f4258090e0aa478d55189e430a7a807f6c2960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Sat, 14 Sep 2024 18:01:11 +0800 Subject: [PATCH 042/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LedgerBackCalculatedSalaryItemTable.js | 4 +- .../components/ledgerAssociatedPersonnel.js | 2 +- .../ledgerBackCalculatedSalaryItem.js | 10 +--- .../components/ledgerBaseSetting.js | 20 +++----- .../components/ledgerSalaryAdjustmentRules.js | 2 +- .../components/ledgerSalaryItemBaseInfo.js | 4 +- .../components/ledgerSalaryItemNormal.js | 2 +- .../components/payrollCopyDialog/index.js | 50 ++++++++++--------- .../hrmSalary/pages/payrollRelease/index.js | 10 ++-- .../hrmSalary/pages/roleManagement/index.js | 5 ++ .../hrmSalary/pages/variableSalary/index.js | 25 ++++++---- 11 files changed, 68 insertions(+), 66 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js index 6f4c0db2..b2cb8a73 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js @@ -54,7 +54,7 @@ class LedgerBackCalculatedSalaryItemTable extends Component { render() { const { backCalcEditSlide } = this.state; const { record, dataSource, editId, saveSalarySobId, key } = this.props; - const showOperateBtn = record.opts.includes("admin"); + const showOperateBtn = editId ? record.opts.includes("admin") : true; const columns = [ { dataIndex: "name", @@ -76,7 +76,7 @@ class LedgerBackCalculatedSalaryItemTable extends Component { width: 80, render: (text, record, index) => { const { canEdit } = record; - return (showOperateBtn && canEdit) ? + return showOperateBtn ? this.handleEditBackCalc(record)}>编辑 : ; } diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js index dd5ad444..7962c26c 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js @@ -219,7 +219,7 @@ class LedgerAssociatedPersonnel extends Component { loading, extEmpsWitch } = this.state; const { record, editId, saveSalarySobId } = this.props; - const admin = record.opts.includes("admin"); + const admin = editId ? record.opts.includes("admin") : true; const topTab = [ { title: "关联人员范围", diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js index 80764a70..b0b4ee9b 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js @@ -67,14 +67,8 @@ class LedgerBackCalculatedSalaryItem extends Component { _.map(backCalcItems, item => { const { key, label, helpContent, dataSource } = item; return ( - - } - showGroup - > + }> @@ -180,10 +178,10 @@ class LedgerBaseSetting extends Component { > { type === "INPUT" ? - this.handleChangeField(key, v)}/> : type === "TEXTAREA" ? - this.handleChangeField(key, v)}/> : type === "CHECKBOX" ? @@ -194,10 +192,10 @@ class LedgerBaseSetting extends Component { type === "SELECT" ? this.handleChangeField(key, v)}/> : type === "CUSTOM" ? - this.handleChangeField(key, v)}/> : null } ; @@ -214,8 +212,7 @@ class LedgerBaseSetting extends Component { export default LedgerBaseSetting; const CustomSelect = (props) => { - const { list, baseInfo, onChange, inputStr } = props; - const { canEdit } = baseInfo; + const { list, baseInfo, onChange, inputStr, admin } = props; const selectInfo = buildEditBasicInfo(baseInfo); return { @@ -223,8 +220,7 @@ const CustomSelect = (props) => { const { key, options = [] } = item; return onChange(key, v)}/> + disabled={!admin} onChange={(v) => onChange(key, v)}/> ; }) } diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js index 5bbacc7d..90196173 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js @@ -92,7 +92,7 @@ class LedgerSalaryAdjustmentRules extends Component { const { record, editId, onSaveParams } = this.props; const { adjustRuleAddModal } = this.state; const { dataSource } = this.state; - const showOperateBtn = record.opts.includes("admin"); + const showOperateBtn = editId ? record.opts.includes("admin") : true; const btns = showOperateBtn ? [ ] : []; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js index e2b191ae..cef3b2e6 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js @@ -50,12 +50,13 @@ class LedgerSalaryItemBaseInfo extends Component { }; render() { - const { dataSource, onChangeSortableList, onPreview } = this.props; + const { dataSource, onChangeSortableList, onPreview, editId, record } = this.props; const { empFieldListOptions } = this.state; const options = _.map(empFieldListOptions, o => ({ ...o, disabled: _.map(dataSource, g => g.fieldId).includes(o.key) })); if (_.isEmpty(dataSource) || _.isEmpty(options)) return null; + const admin = editId ? record.opts.includes("admin") : true; return ( }>
    @@ -80,6 +81,7 @@ class LedgerSalaryItemBaseInfo extends Component { className="wea-sortable-grid-item" /> { return { diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollCopyDialog/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollCopyDialog/index.js index 904c84d2..611513d5 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollCopyDialog/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollCopyDialog/index.js @@ -8,9 +8,10 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { Button, message } from "antd"; +import { postFetch } from "../../../../util/request"; import { getSearchs } from "../../../../util"; import { copyConditions } from "../conditions"; -import { duplicatePayroll, getPayrollTemplateLedgerList } from "../../../../apis/payroll"; +import { duplicatePayroll } from "../../../../apis/payroll"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @@ -31,29 +32,30 @@ class Index extends Component { } getPayrollTemplateLedgerList = (props) => { - getPayrollTemplateLedgerList().then(({ status, data }) => { - if (status) { - this.setState({ - conditions: _.map(copyConditions, item => { - return { - ...item, items: _.map(item.items, o => { - if (getKey(o) === "salarySobId") { - return { - ...o, label: getLabel(o.lanId, o.label), - options: _.map(data, d => ({ key: d.id, showname: d.content })) - }; - } else { - return { ...o, label: getLabel(o.lanId, o.label) }; - } - }) - }; - }) - }, () => { - props.payrollStore.payrollCopyForm.initFormFields(this.state.conditions); - props.payrollStore.payrollCopyForm.updateFields({ salarySobId: { value: props.salarySobId } }); - }); - } - }); + postFetch("/api/bs/hrmsalary/salarysob/listAuth", { filterType: "ADMIN_DATA" }) + .then(({ status, data }) => { + if (status) { + this.setState({ + conditions: _.map(copyConditions, item => { + return { + ...item, items: _.map(item.items, o => { + if (getKey(o) === "salarySobId") { + return { + ...o, label: getLabel(o.lanId, o.label), + options: _.map(data, d => ({ key: String(d.id), showname: d.name })) + }; + } else { + return { ...o, label: getLabel(o.lanId, o.label) }; + } + }) + }; + }) + }, () => { + props.payrollStore.payrollCopyForm.initFormFields(this.state.conditions); + props.payrollStore.payrollCopyForm.updateFields({ salarySobId: { value: props.salarySobId } }); + }); + } + }); }; save = () => { diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/index.js index 019e3ad7..b601298a 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/index.js @@ -54,14 +54,14 @@ class Index extends Component { ]; break; case "template": - const loading = this.templateRef ? this.templateRef.wrappedInstance.state.delLoading : false; - const delDisabled = !this.templateRef || _.isEmpty(this.templateRef.wrappedInstance.state.selectedRowKeys); + const loading = this.templateRef ? this.templateRef.state.delLoading : false; + const delDisabled = !this.templateRef || _.isEmpty(this.templateRef.state.selectedRowKeys); const btns = [ , ]; const queryBtns = [ @@ -92,7 +92,7 @@ class Index extends Component { case "grant": dom = this.setState({ selectedKey: "template" }, () => { - this.templateRef.wrappedInstance.handleOpts({ key: "edit" }, { id }); + this.templateRef.handleOpts({ key: "edit" }, { id }); })} onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)} />; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index 9d667ad7..0e4f7fb2 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -83,6 +83,9 @@ class Index extends Component { const { query, dataSource, columns, pageInfo, loading, selectedRowKeys, addRoleDialog, roleSetDialog } = this.state; + const { taxAgentStore: { PageAndOptAuth } } = this.props; + const admin = PageAndOptAuth.opts.includes("admin"); + const buttons = [
    : - this.handleRowClick(_.find(listDatas, item => item.id === id))} - checkedKeys={[]}/> + + this.setState({ singleFilterVal })}/> + this.handleRowClick(_.find(listDatas, item => item.id === id))} + data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/> + }
    ; diff --git a/pc4mobx/hrmSalary/components/UnifiedTable/index.js b/pc4mobx/hrmSalary/components/UnifiedTable/index.js index f8cbff97..cff25bf6 100644 --- a/pc4mobx/hrmSalary/components/UnifiedTable/index.js +++ b/pc4mobx/hrmSalary/components/UnifiedTable/index.js @@ -12,7 +12,7 @@ class Index extends Component { } else if (index === 1) { return { ...item, fixed: "left", width: 176 }; } - if (item.dataIndex === "operate") { + if (item.dataIndex === "operate" || item.dataIndex === "opts") { return { ...item, fixed: "right", width: item.width || "120px" }; } return { ...item, width: "33%" }; diff --git a/pc4mobx/hrmSalary/config.js b/pc4mobx/hrmSalary/config.js index da90a688..ba422c79 100644 --- a/pc4mobx/hrmSalary/config.js +++ b/pc4mobx/hrmSalary/config.js @@ -9,7 +9,7 @@ export const PAGE = { "otherDeduction": ["/dataAcquisition/otherDeduct"], //其他免税扣除 "addUpSituation": ["/dataAcquisition/cumSituation"], //往期累计情况 "attendQuote": ["/dataAcquisition/attendance"], //考勤引用 - "myBill": ["/hrmSalary/mySalary", "/hrmSalary/mySalaryMobile", "/hrmSalary/mobilepayroll"], //薪资福利 + "myBill": ["/hrmSalary/mySalary", "/hrmSalary/mySalaryMobile"], //薪资福利 "taxAgent": ["/hrmSalary/taxAgent"], //个税扣缴义务人 "auth": ["/hrmSalary/roleManagement"], //业务管理线 "variableArchive": ["/hrmSalary/variableSalary"], //浮动薪酬 @@ -18,5 +18,5 @@ export const PAGE = { "salaryField": ["/hrmSalary/fieldManagement"], //字段管理 "salaryItem": ["/hrmSalary/salaryItem"], //薪资项目管理 "siScheme": ["/socialSecurityBenefits/programme"], //社保福利方案 - "report": ["/hrmSalary/analysisOfSalaryStatistics", "/hrmSalary/reportView"], //报表 + "report": ["/hrmSalary/analysisOfSalaryStatistics", "/hrmSalary/reportView"] //报表 }; diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js index 816934d6..73fc3cca 100644 --- a/pc4mobx/hrmSalary/layout.js +++ b/pc4mobx/hrmSalary/layout.js @@ -44,6 +44,7 @@ class Layout extends Component { header.appendChild(link); top.$(".ant-message").remove(); window.location.hash.indexOf("mobilepayroll") === -1 && stores.taxAgentStore.getPermission(); + window.location.hash.indexOf("mobilepayroll") !== -1 && stores.taxAgentStore.initPageAndOptAuth(); } } diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js index ee1d3f5b..77f2921a 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js @@ -294,7 +294,7 @@ class Index extends Component { onSearch={() => this.handleReqBtnsClick("search")}/> ] : selectedKey === "detail" ? [ - {getLabel(111, "年薪资核算人员明细:")} + {getLabel(111, "年度:")} this.setState({ year })}/> , ; } }; - } else if (dataIndex === "operate") { + } else if (dataIndex === "operate" || dataIndex === "opts") { return { ...item, width: 150, @@ -169,15 +169,10 @@ class DataTables extends Component { }; } }); - return ; + return ( + ); } } diff --git a/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js index a94d2a07..f9955249 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/customStatisticsItemsModal.js @@ -7,7 +7,6 @@ import React, { Component } from "react"; import { Button, message, Modal } from "antd"; import { - WeaBrowser, WeaCheckbox, WeaDialog, WeaError, @@ -19,6 +18,7 @@ import { WeaTable } from "ecCom"; import { reportStatisticsItemSave, statisticsItemChangetab, statisticsItemGetform } from "../../../apis/statistics"; +import CustomBrowser from "../../../components/CustomBrowser"; import "../index.less"; const { getLabel } = WeaLocaleProvider; @@ -263,23 +263,22 @@ class CustomStatisticsItemsModal extends Component { }) }); }; - handleChangeStatisticalItems = (itemValue, _names, datas) => { + handleChangeStatisticalItems = (data) => { + const itemValue = _.keys(data)[0], datas = _.values(data); const { formData } = this.state; this.setState({ formData: { ...formData, itemValue, itemValueSpan: _.map(datas, it => it.name).join(","), - itemName: datas.length === 1 ? _.map(datas, it => it.names).join(",") : "" + itemName: datas.length === 1 ? _.map(datas, it => it.name).join(",") : "" } }, () => { statisticsItemChangetab({ itemId: itemValue }).then(({ status, data }) => { if (status) { const { ruleData } = data; const { columns, data: dataSource } = ruleData; - this.setState({ - columns, dataSource - }); + this.setState({ columns, dataSource }); } }); }); @@ -368,52 +367,37 @@ class CustomStatisticsItemsModal extends Component { className="statisticItemsWrapper" >
    - - - ({ - id: it, - name: itemValueSpan.split(",")[idx] - })) : []} - completeParams={{ - type: 162, - fielddbtype: "browser.salaryItemBrowser", - f_weaver_belongto_usertype: "0" - }} - conditionDataParams={{ - type: "browser.salaryItemBrowser", - fielddbtype: "browser.salaryItemBrowser", - f_weaver_belongto_usertype: "0" - }} - dataParams={{ - type: "browser.salaryItemBrowser", - f_weaver_belongto_usertype: "0" - }} - destDataParams={{ - type: "browser.salaryItemBrowser", - f_weaver_belongto_usertype: "0" - }} - // isMultCheckbox - inputStyle={{ width: "100%" }} - onChange={this.handleChangeStatisticalItems} - /> - - - - - this.setState({ formData: { ...formData, itemName } })}/> - - -
    - -
    + { + !_.isEmpty(columns) && + + + ({ + id: it, name: itemValueSpan.split(",")[idx] + })) : [], dataParams: { filterType: "QUERY_DATA" }, searchParamsKey: "", filterByName: true + } + }} value={itemValue} onCustomChange={this.handleChangeStatisticalItems}/> + + + + + this.setState({ formData: { ...formData, itemName } })}/> + + +
    + +
    +
    + }
    ); diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index 6dd17207..16df4811 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -144,7 +144,7 @@ class Index extends Component { ]; return ( } selectedKey={selectedKey} + title={getLabel(111, "浮动数据")} icon={} selectedKey={selectedKey} iconBgcolor="#F14A2D" tabDatas={tabs} className="variable_salary_wrapper" buttons={_.find(tabs, o => selectedKey === o.key).buttons} buttonSpace={10} onChange={selectedKey => this.setState({ selectedKey, SFDialog: { ...SFDialog, visible: false } })} diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.less b/pc4mobx/hrmSalary/pages/variableSalary/index.less index 55dbb34b..b76440d6 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.less +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.less @@ -4,6 +4,7 @@ } .wea-new-top-req-content { + padding: 16px; .wea-new-table { background: #FFF; diff --git a/pc4mobx/hrmSalary/single.js b/pc4mobx/hrmSalary/single.js index 863c0a8a..1de2325b 100644 --- a/pc4mobx/hrmSalary/single.js +++ b/pc4mobx/hrmSalary/single.js @@ -10,6 +10,7 @@ import { RouterStore, syncHistoryWithStore } from "mobx-react-router"; import { Provider } from "mobx-react"; import Module from "weaHrmSalary"; +import stores from "./stores"; const routing = new RouterStore(); @@ -38,6 +39,7 @@ class Root extends React.Component { header.appendChild(link) top.$(".ant-message").remove(); window.location.hash.indexOf("mobilepayroll") === -1 && allStore.taxAgentStore.getPermission(); + window.location.hash.indexOf("mobilepayroll") !== -1 && allStore.taxAgentStore.initPageAndOptAuth(); if (window.location.hash.indexOf("payroll") !== -1) { window.localStorage.removeItem("template-basedata"); window.localStorage.removeItem("salary-showset"); diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index b198a29a..a65d8b31 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -14,6 +14,7 @@ export class TaxAgentStore { @observable roleOperatorForm = new WeaForm(); //权限-角色操作者form表单 @action initRoleOperatorForm = () => this.roleOperatorForm = new WeaForm(); @observable PageAndOptAuth = { able: false, opts: [] }; // 业务线页面权限 + @action initPageAndOptAuth = () => this.PageAndOptAuth = { able: true, opts: ["query", "admin"] };// 设置业务线页面权限 @observable tableStore = new TableStore(); // new table From f6f3a42333d45ae3777c6ce2676609ea6eb48ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 23 Sep 2024 10:37:10 +0800 Subject: [PATCH 045/110] =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 48 ------------------- .../components/roleDetailSetDialog/index.js | 5 +- .../hrmSalary/pages/roleManagement/index.js | 23 ++++++++- .../components/welfarePlanList/index.js | 6 ++- .../welfarePlan/index.js | 3 +- 5 files changed, 30 insertions(+), 55 deletions(-) diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 912e2ebe..7b5cf863 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -66,57 +66,9 @@ let getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, "hrmSalary"); getLocaleLabel = function (nextState, replace, callback) { callback(); }; - -const Home = (props) => props.children; - const SocialSecurityBenefits = (props) => props.children; const DataAcquisition = (props) => props.children; -// historicalPayroll 历史工资单查看 -// salaryAdjustmentRecords 调薪记录查看 - -// mySalaryMobile 我的薪资福利-移动端 -// mySalaryMobile 我的薪资福利-移动端 -// mySalary 我的薪资福利 -// mySalaryView 我的薪资福利-查看工资单 -// socialSecurityBenefits 社保福利 -// programme 社保福利方案 -// archives 社保福利档案 -// standingBook 社保福利台账 -// sbofflineComparison 社保福利台账线下对比 -// salaryItem 薪资项目管理 -// salaryFile 薪资档案 -// dataAcquisition 数据采集 -// CumDeduct 累计专项附加扣除 -// otherDeduct 其他免税扣除 -// cumSituation 往期累计情况 -// attendance 考勤引用 -// specialAddDeduction 专项附件扣除 -// ledger 薪资账套 -// calculate 薪资核算 -// calculateDetail 核算详情 -// DoCalcDetail 核算详情页面-新 -// CalcView 核算查看页面-新 -// OfflineCompare 薪资核算线下对比-新 -// placeOnFileDetail 核算归档详情 -// compareDetail 线下线上对比 -// payroll 工资单发放 -// declare 个税申报表 -// generateDeclarationDetail 个税单详情 -// taxRate 个税税率表 -// taxAgent 个税扣缴义务人 -// mobilepayroll 移动端工资单 -// sysconfig 系統配置 -// sysconfig-1 规则配置 -// appconfig 应用配置 -// fieldManagement 字段管理 -// analysisOfSalaryStatistics 薪酬统计分析 -// reportView 薪酬报表查看 -// externalPersonManage 非系统人员管理 -// adjustSalaryManage 档案管理 -// supplementaryCalc 补算 -// variableSalary 浮动薪酬 - const Routes = ( diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js index bfee4532..bcacf2ec 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js @@ -65,9 +65,10 @@ class Index extends Component { this.setState({ name: nextProps.name, selectedKey: nextProps.selectedKey || "baseinfo" }, () => { - this.state.selectedKey === "auth.MemberTargetTypeEnum" && this.getEnumList(); - this.state.selectedKey === "auth.MemberTargetTypeEnum" && this.getSettingRoler(nextProps.roleId); + !["auth.AuthTargetTypeEnum", "baseinfo"].includes(this.state.selectedKey) && this.getEnumList(); + !["auth.AuthTargetTypeEnum", "baseinfo"].includes(this.state.selectedKey) && this.getSettingRoler(nextProps.roleId); this.state.selectedKey === "baseinfo" && this.getRole(nextProps.roleId); + this.state.selectedKey === "auth.DataTargetTypeEnum" && this.getConnectSymbol(); }); } else { this.setState({ diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index 0e4f7fb2..b9a95a6d 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -26,7 +26,7 @@ class Index extends Component { this.state = { query: { name: "" }, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false }, - roleSetDialog: { visible: false, roleId: "", name: "" } + roleSetDialog: { visible: false, roleId: "", name: "", selectedKey: "" } }; } @@ -44,7 +44,26 @@ class Index extends Component { const { list: dataSource, columns, pageNum: current, pageSize, total } = data; this.setState({ dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, - columns: [...columns, { + columns: [..._.map(columns, o => { + if ( + o.dataIndex === "resources" || o.dataIndex === "members" || + o.dataIndex === "opts" || o.dataIndex === "datas" + ) { + const tabsKey = { + resources: "baseinfo", + members: "auth.MemberTargetTypeEnum", + opts: "auth.AuthTargetTypeEnum", + datas: "auth.DataTargetTypeEnum" + }; + return { + ...o, render: (text, record) => ( + this.showRoleSetDialog({ + ...record, selectedKey: tabsKey[o.dataIndex] + })}>{text}) + }; + } + return { ...o }; + }), { title: getLabel(111, "操作"), width: 150, dataIndex: "action", render: (__, record) => ( diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js index 1035015a..c7ee09b6 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js @@ -60,8 +60,9 @@ class Index extends Component { getList = (props) => { const { programmeStore: { planSearchForm }, selectedKey: welfareTypeEnum, customQuery, - taxAgentStore: { showOperateBtn } + taxAgentStore: { PageAndOptAuth } } = props; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const { pageInfo } = this.state; const originPayload = { ...pageInfo, welfareTypeEnum }, customPayload = { welfareTypeEnum: customQuery }, welfarePayload = { ...planSearchForm.getFormParams() }; @@ -239,7 +240,8 @@ class Index extends Component { render() { const { dataSource, columns, pageInfo, loading, copyDialog, customDialog, welfarePlanEditSlide } = this.state; - const { selectedKey, taxAgentStore: { showOperateBtn } } = this.props; + const { selectedKey, taxAgentStore: { PageAndOptAuth } } = this.props; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js index 4f7028ad..69382697 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js @@ -62,7 +62,8 @@ class Index extends Component { }; render() { - const { taxAgentStore: { showOperateBtn } } = this.props; + const { taxAgentStore: { PageAndOptAuth } } = this.props; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const { logDialogVisible, filterConditions, selectedKey, showSearchAd, isQuery, customQuery } = this.state; const tabs = _.map(tabWelfarePlanList, o => ({ ...o, title: getLabel(o.lanId, o.title) })); return ( From efa75925ad27f3e52aafad0465950b8eddb8f5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 23 Sep 2024 16:15:22 +0800 Subject: [PATCH 046/110] =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/columns.js | 6 +-- .../pages/salaryItem/customSalaryItemSlide.js | 54 +++++++++++++++---- pc4mobx/hrmSalary/pages/salaryItem/index.js | 27 +++++++--- pc4mobx/hrmSalary/pages/salaryItem/index.less | 10 ++++ .../pages/salaryItem/salaryItemsTable.js | 4 +- 5 files changed, 79 insertions(+), 22 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js index 5db2fdf3..e5942fb2 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js @@ -66,8 +66,8 @@ export const salaryItemConditions = [ value: "", options: [], multiple: true, - rules: "required|string", - viewAttr: 3, + rules: "", + viewAttr: 2, hide: true }, { @@ -118,7 +118,7 @@ export const salaryItemConditions = [ { key: "3", selected: false, showname: "3" }, { key: "4", selected: false, showname: "4" }, { key: "5", selected: false, showname: "5" }, - { key: "6", selected: true, showname: "6" }, + { key: "6", selected: false, showname: "6" }, { key: "7", selected: false, showname: "7" }, { key: "8", selected: false, showname: "8" }, { key: "9", selected: false, showname: "9" }, diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index dc2a1e81..37248849 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -3,6 +3,10 @@ import { inject, observer } from "mobx-react"; import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTools } from "ecCom"; import { WeaSwitch } from "comsMobx"; import { salaryItemConditions } from "./columns"; +import { commonEnumList } from "../../apis/archive"; +import { postFetch } from "../../util/request"; +import { getItemForm } from "../../apis/item"; + // import FormalFormModal from "./formalFormModal"; // import SalaryItemForm from "./salaryItemForm"; @@ -44,21 +48,32 @@ export default class CustomSalaryItemSlide extends React.Component { }); }; - // 保存公式成功回调 - handleSaveFormal = (data) => { - this.handleChange({ - formulaId: data.id, formulaContent: data.formula, - originFormulaContent: data.referenceType === "formula" ? data.formula : "", - originSqlContent: data.referenceType === "sql" ? data.formula : "" - }); - }; - initForm = (props) => { + initForm = async (props) => { + const { data: salaryItemForm } = props.id ? + await getItemForm({ id: props.id }) : { data: { sharedType: "0", useDefault: "0", hideDefault: "0" } }; + const [{ data: sharedTypeList }, { data: taxAgentList }] = await Promise.all([ + commonEnumList({ enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" }), + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }) + ]); this.setState({ conditions: _.map(salaryItemConditions, c => { return { ...c, items: _.map(c.items, fields => { - fields = { ...fields, label: getLabel(fields.lanId, fields.label) }; + fields = { + ...fields, label: getLabel(fields.lanId, fields.label), + value: !_.isNil(salaryItemForm[getKey(fields)]) ? String(salaryItemForm[getKey(fields)]) : fields.value + }; switch (getKey(fields)) { + case "sharedType": + fields = { + ...fields, options: _.map(sharedTypeList, o => ({ key: o.value, showname: o.defaultLabel })) + }; + break; + case "taxAgentIds": + fields = { + ...fields, options: _.map(taxAgentList, o => ({ key: String(o.id), showname: o.name })) + }; + break; case "dataType": case "valueType": case "roundingMode": @@ -77,6 +92,23 @@ export default class CustomSalaryItemSlide extends React.Component { props.salaryItemStore.itemsForm.initFormFields(this.state.conditions); }); }; + handleChangeFormItem = (res) => { + const { conditions } = this.state, [key] = _.keys(res), value = res[key].value; + this.setState({ + conditions: _.map(conditions, c => { + return { + ...c, items: _.map(c.items, fields => { + if (key === "sharedType" && getKey(fields) === "taxAgentIds") { + fields = { + ...fields, viewAttr: value === "0" ? 2 : 3, hide: value === "0" + }; + } + return fields; + }) + }; + }) + }); + }; renderForm = () => { const { salaryItemStore: { itemsForm: form } } = this.props; const { conditions } = this.state, { isFormInit } = form, formParams = form.getFormParams(); @@ -88,7 +120,7 @@ export default class CustomSalaryItemSlide extends React.Component { com: ( - + { fields.tip && { + const { salaryItemStore: { itemsForm: form } } = this.props; + form.validateForm().then(f => { + if (f.isValid) { + console.log(form.getFormParams()); + } else { + f.showErrors(); + } + }); + }; onDropMenuClick = (key, targetid = "") => { switch (key) { case "log": @@ -202,16 +211,22 @@ export default class SalaryItem extends React.Component { case "customAdd": case "edit": const { taxAgentStore: { showOperateBtn, showSalaryItemBtn } } = this.props; + const { loading } = this.state; const title = key === "edit" ? getLabel(111, "修改自定义薪资项目") : getLabel(111, "新建自定义薪资项目"); const buttons = key === "edit" ? [ , - + ] : [ - , - + , + ]; this.setState({ - customItemDialog: { visible: true, title, buttons: (showSalaryItemBtn || showOperateBtn) ? buttons : [] } + customItemDialog: { + visible: true, title, buttons: (showSalaryItemBtn || showOperateBtn) ? buttons : [], id: targetid + } }); break; case "sysAdd": diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index b80727e6..9fcd0e95 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -7,6 +7,12 @@ .salaryItems_content { height: 100%; + padding: 8px 16px; + background: #f6f6f6; + + & > .wea-new-table { + background: #FFFFFF; + } } } @@ -19,6 +25,10 @@ .wea-slide-modal-content { height: 100%; background: #f6f6f6; + + .wea-form-item-wrapper { + display: block !important; + } } .titleDialog { diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js index eee77555..83445529 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js @@ -101,12 +101,12 @@ class SalaryItemsTable extends Component { }; return ( ( - onDropMenuClick("edit", record)} + onDropMenuClick("edit", record.id)} href="javascript:void(0);">{(showOperateBtn || showSalaryItemBtn) ? getLabel(111, "编辑") : getLabel(111, "查看")} { (showOperateBtn || showSalaryItemBtn) && record.canDelete && From fd067b653f9e3d2eca48a6d75053b209445e57d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 24 Sep 2024 10:53:41 +0800 Subject: [PATCH 047/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/columns.js | 42 ++++- .../pages/salaryItem/customSalaryItemSlide.js | 114 +++++++----- pc4mobx/hrmSalary/pages/salaryItem/index.js | 162 ++++++------------ pc4mobx/hrmSalary/pages/salaryItem/index.less | 10 ++ .../pages/salaryItem/salaryItemsTable.js | 22 +-- 5 files changed, 179 insertions(+), 171 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js index e5942fb2..4cc0d47a 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js @@ -145,13 +145,14 @@ export const salaryItemConditions = [ viewAttr: 3 }, { - conditionType: "INPUT", + conditionType: "INPUTNUMBER", domkey: ["defaultValue"], fieldcol: 14, label: "默认值", lanId: 111, labelcol: 8, value: "", + otherParams: { precision: 2 }, viewAttr: 2 }, { @@ -162,7 +163,19 @@ export const salaryItemConditions = [ lanId: 111, labelcol: 8, value: "", - viewAttr: 1 + viewAttr: 3, + hide: true + }, + { + conditionType: "INPUT", + domkey: ["formulaId"], + fieldcol: 14, + label: "公式", + lanId: 111, + labelcol: 8, + value: "", + viewAttr: 3, + hide: true }, { conditionType: "INPUTNUMBER", @@ -194,6 +207,31 @@ export const salaryItemConditions = [ value: "", viewAttr: 2, otherParams: { minRows: 3 } + }, + { + conditionType: "SWITCH", + domkey: ["useInEmployeeSalary"], + fieldcol: 14, + label: "薪资档案引用", + lanId: 111, + labelcol: 8, + value: "0", + viewAttr: 2, + tipLanId: 111, + tip: "提示:开启后,该薪资项目不可删除或设为无效,取值方式会默认置为输入", + hide: true + }, + { + + conditionType: "SWITCH", + domkey: ["systemType"], + fieldcol: 14, + label: "是否系统默认", + lanId: 111, + labelcol: 8, + value: "0", + viewAttr: 2, + hide: true } ], title: "", diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 37248849..4021c714 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -2,12 +2,12 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTools } from "ecCom"; import { WeaSwitch } from "comsMobx"; +import FormalFormModal from "./formalFormModal"; import { salaryItemConditions } from "./columns"; import { commonEnumList } from "../../apis/archive"; import { postFetch } from "../../util/request"; import { getItemForm } from "../../apis/item"; -// import FormalFormModal from "./formalFormModal"; // import SalaryItemForm from "./salaryItemForm"; const getLabel = WeaLocaleProvider.getLabel; @@ -19,11 +19,7 @@ export default class CustomSalaryItemSlide extends React.Component { constructor(props) { super(props); this.state = { - conditions: [], - - showForm: false, - formalModalVisible: false, - salaryItemName: "" + conditions: [], visible: false }; } @@ -37,20 +33,16 @@ export default class CustomSalaryItemSlide extends React.Component { } } - handleChange = (params) => { - this.props.onChange({ ...this.props.request, ...params }); + handleChange = (data) => { + const { salaryItemStore: { itemsForm: form } } = this.props; + form.updateFields({ formulaContent: { value: data["formula"] }, formulaId: { value: data["id"] } }); }; - - handleShowFormal = (salaryItemName) => { - this.setState({ - formalModalVisible: true, - salaryItemName - }); - }; - initForm = async (props) => { const { data: salaryItemForm } = props.id ? - await getItemForm({ id: props.id }) : { data: { sharedType: "0", useDefault: "0", hideDefault: "0" } }; + await getItemForm({ id: props.id }) : + { + data: { sharedType: "0", useDefault: "0", hideDefault: "0", pattern: 2, dataType: "number", valueType: "1" } + }; const [{ data: sharedTypeList }, { data: taxAgentList }] = await Promise.all([ commonEnumList({ enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" }), postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }) @@ -71,16 +63,41 @@ export default class CustomSalaryItemSlide extends React.Component { break; case "taxAgentIds": fields = { - ...fields, options: _.map(taxAgentList, o => ({ key: String(o.id), showname: o.name })) + ...fields, options: _.map(taxAgentList, o => ({ key: String(o.id), showname: o.name })), + hide: String(salaryItemForm["sharedType"]) === "0" || !_.isNil(salaryItemForm["sharedType"]) }; break; case "dataType": case "valueType": - case "roundingMode": fields = { ...fields, options: _.map(fields.options, o => ({ ...o, showname: getLabel(o.lanId, o.showname) })) }; break; + case "roundingMode": + fields = { + ...fields, options: _.map(fields.options, o => ({ ...o, showname: getLabel(o.lanId, o.showname) })), + hide: String(salaryItemForm["dataType"]) === "string" + }; + break; + case "pattern": + fields = { + ...fields, hide: String(salaryItemForm["dataType"]) === "string" + }; + break; + case "defaultValue": + const otherParams = String(salaryItemForm["dataType"]) === "number" ? { precision: Number(salaryItemForm["pattern"]) } : {}; + fields = { + ...fields, otherParams, + conditionType: String(salaryItemForm["dataType"]) === "string" ? "INPUT" : "INPUTNUMBER", + hide: String(salaryItemForm["valueType"]) !== "1" + }; + break; + case "formulaContent": + fields = { + ...fields, hide: String(salaryItemForm["valueType"]) === "1", + label: String(salaryItemForm["valueType"]) === "2" ? getLabel(111, "公式") : getLabel(111, "SQL") + }; + break; default: break; } @@ -93,20 +110,38 @@ export default class CustomSalaryItemSlide extends React.Component { }); }; handleChangeFormItem = (res) => { + const { salaryItemStore: { itemsForm: form } } = this.props; const { conditions } = this.state, [key] = _.keys(res), value = res[key].value; this.setState({ conditions: _.map(conditions, c => { return { ...c, items: _.map(c.items, fields => { if (key === "sharedType" && getKey(fields) === "taxAgentIds") { + fields = { ...fields, viewAttr: value === "0" ? 2 : 3, hide: value === "0" }; + } else if (key === "dataType" && (getKey(fields) === "roundingMode" || getKey(fields) === "pattern")) { + fields = { ...fields, hide: value === "string" }; + } else if ((key === "dataType" || key === "pattern") && getKey(fields) === "defaultValue") { + const otherParams = form.getFormParams().dataType === "number" ? { precision: Number(form.getFormParams().pattern) } : {}; fields = { - ...fields, viewAttr: value === "0" ? 2 : 3, hide: value === "0" + ...fields, otherParams, conditionType: value === "string" ? "INPUT" : "INPUTNUMBER", + hide: form.getFormParams().valueType !== "1" + }; + } else if (key === "valueType" && (getKey(fields) === "formulaContent" || getKey(fields) === "defaultValue")) { + fields = { + ...fields, + label: getKey(fields) === "defaultValue" ? fields.label : form.getFormDatas().valueType.valueSpan, + hide: (getKey(fields) === "formulaContent" && value === "1") || (getKey(fields) === "defaultValue" && value !== "1") }; } return fields; }) }; }) + }, () => { + form.getFormParams().valueType === "1" && + form.updateFields({ formulaContent: { value: "" }, formulaId: { value: "" } }); + (form.getFormParams().valueType === "2" || form.getFormParams().valueType === "3") && + form.updateFields({ defaultValue: { value: "" } }); }); }; renderForm = () => { @@ -121,6 +156,10 @@ export default class CustomSalaryItemSlide extends React.Component { + { + getKey(fields) === "formulaContent" && form.getFormParams().valueType !== "1" && +
    this.setState({ visible: true })}/> + } { fields.tip && onClose()} - content={
    {this.renderForm()}
    }/> + content={
    + {this.renderForm()} + {visible && + this.setState({ visible: false })} + /> + } +
    }/> //
    // - // {formalModalVisible && - // { - // this.handleSaveFormal(data); - // }} - // onCancel={() => - // this.setState({ - // formalModalVisible: false, - // salaryItemName: "" - // })} - // />} //
    ); } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 3fa15372..24aaaaea 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -1,6 +1,6 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { Button, Dropdown, Menu, message, Modal, Switch } from "antd"; +import { Button, Dropdown, Menu, message, Modal } from "antd"; import { WeaInputSearch, WeaLocaleProvider, WeaTop } from "ecCom"; import * as API from "../../apis/item"; import SalaryItemsTable from "./salaryItemsTable"; @@ -69,9 +69,10 @@ export default class SalaryItem extends React.Component { }); }; - handleDeleteItem = () => { + handleDeleteItem = (recordId) => { const { selectedRowKeys, isQuery } = this.state; - if (_.isEmpty(selectedRowKeys)) { + const params = recordId ? [recordId] : selectedRowKeys; + if (_.isEmpty(params)) { message.warning(getLabel(111, "请勾选数据!")); return; } @@ -79,7 +80,7 @@ export default class SalaryItem extends React.Component { title: getLabel(131329, "信息确认"), content: getLabel(111, "确认删除吗?"), onOk: () => { - API.deleteItem(selectedRowKeys).then(({ status, errormsg }) => { + API.deleteItem(params).then(({ status, errormsg }) => { if (status) { message.success(getLabel(111, "操作成功!")); this.setState({ isQuery: !isQuery }); @@ -87,118 +88,56 @@ export default class SalaryItem extends React.Component { message.error(errormsg); } }); - }, - onCancel: () => { } }); }; - getColumns = () => { - const { salaryItemStore, taxAgentStore: { showSalaryItemBtn, showOperateBtn } } = this.props; - const { tableColumns } = salaryItemStore; - let columns = tableColumns.map(column => { - let newColumn = column; - newColumn.render = (text, record, index) => { //前端元素转义 - let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex]; - switch (newColumn.dataIndex) { - case "name": - return { - this.onEditItem(record, false); - }}>{text}; - case "useDefault": - case "hideDefault": - case "useInEmployeeSalary": - return ; - default: - return
    ; - } - }; - return newColumn; + handleValidateForm = () => { + return new Promise((resolve) => { + const { salaryItemStore: { itemsForm: form } } = this.props; + const { formulaId, valueType, sharedType, taxAgentIds } = form.getFormParams(); + let taxAgentValidate = true, formulaValidate = true; + if (sharedType === "1" && !taxAgentIds) taxAgentValidate = false; + if (valueType !== "1" && !formulaId) formulaValidate = false; + resolve({ taxAgentValidate, formulaValidate }); }); - columns.push({ - key: "operate", - title: "操作", - width: 185, - render: (text, record) => { - return ( - - this.onEditItem(record, true)}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"} - { - (record.canDelete && (showSalaryItemBtn || showOperateBtn)) && - this.handleDeleteItem(record)} - >{getLabel(535052, "删除")} - } - - - this.onDropMenuClick("log", record.id)}>{getLabel(545781, "操作日志")} - - - }> - - - - ); - } - }); - return [ - // { - // title: "序号", - // dataIndex: "index", - // align: "left", - // width: 60, - // render: (text, record, index) => { - // const { current, pageSize } = this.state.searchParams; - // return (current - 1) * pageSize + index + 1; - // } - // }, - ...columns]; }; - - handleSearch(value) { - const { salaryItemStore: { getTableDatas } } = this.props; - getTableDatas({ ...this.state.searchParams, current: 1, name: value }).then(res => { - this.setState({ - searchParams: { - ...this.state.searchParams, - current: 1, - total: res.total - } - }); - }); - } - - handlePageChange(value) { - const { salaryItemStore: { getTableDatas } } = this.props; - getTableDatas({ ...this.state.searchParams, name: this.state.searchValue, current: value }).then(res => { - this.setState({ - searchParams: { - ...this.state.searchParams, - current: value, - total: res.total - } - }); - }); - } - - handleShowSizeChange(searchParams) { - const { salaryItemStore: { getTableDatas } } = this.props; - getTableDatas({ ...searchParams }); - } - handleSalaryItem = (type) => { + const { customItemDialog: { id }, isQuery } = this.state; const { salaryItemStore: { itemsForm: form } } = this.props; - form.validateForm().then(f => { - if (f.isValid) { - console.log(form.getFormParams()); - } else { - f.showErrors(); - } - }); + Promise.all([form.validateForm(), this.handleValidateForm()]) + .then(([f1, f2]) => { + if (f1.isValid && f2.taxAgentValidate && f2.formulaValidate) { + const { formulaContent, valueType, dataType, defaultValue, pattern, ...formData } = form.getFormParams(); + const key = valueType === "2" ? "originFormulaContent" : valueType === "3" ? "originSqlContent" : "formulaContent"; + this.setState({ loading: true }); + API.saveItem({ + ...formData, valueType, dataType, pattern, [key]: formulaContent, id, + defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue + }).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + this.setState({ isQuery: !isQuery }, () => { + message.success(getLabel(111, "操作成功")); + type === "SAVECREATE" && form.updateFields({ + name: { value: "" }, formulaContent: { value: "" }, formulaId: { value: "" } + }); + type !== "SAVECREATE" && this.setState({ + customItemDialog: { ...this.state.customItemDialog, visible: false, id: "" } + }); + }); + + } else { + message.error(errormsg); + } + }); + } else { + !f1.isValid && f1.showErrors(); + !f2.taxAgentValidate && f1.showError("taxAgentIds", getLabel(111, "\"可见性范围\"未填写")); + !f2.formulaValidate && f1.showError("formulaId", getLabel(111, `\"${form.getFormDatas().valueType.valueSpan}\"未填写`)); + this.forceUpdate(); + } + }); }; onDropMenuClick = (key, targetid = "") => { switch (key) { @@ -229,6 +168,9 @@ export default class SalaryItem extends React.Component { } }); break; + case "delete": + this.handleDeleteItem(targetid); + break; case "sysAdd": break; default: @@ -274,7 +216,7 @@ export default class SalaryItem extends React.Component { let buttons = [ this.onDropMenuClick("customAdd")}>{getLabel(111, "新增自定义薪资项")}, - , + , this.setState({ name: val })} placeholder={getLabel(111, "请输入名称")} onSearch={() => this.setState({ isQuery: !isQuery })}/> ]; @@ -390,7 +332,7 @@ export default class SalaryItem extends React.Component { {/*新增编辑自定义薪资项目*/} this.setState({ isQuery: !isQuery })} onClose={callback => this.setState({ - customItemDialog: { ...customItemDialog, visible: false } + customItemDialog: { ...customItemDialog, visible: false, id: "" } }, () => callback && callback())}/> {/*{*/} {/* editSlideVisible &&*/} diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index 9fcd0e95..40b4e186 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -28,6 +28,16 @@ .wea-form-item-wrapper { display: block !important; + + .formula_input_div { + cursor: pointer; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 2; + } } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js index 83445529..7d1525be 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js @@ -9,7 +9,7 @@ */ import React, { Component } from "react"; import { WeaCheckbox, WeaLocaleProvider, WeaTable } from "ecCom"; -import { Dropdown, Menu, message, Modal } from "antd"; +import { Dropdown, Menu } from "antd"; import * as API from "../../apis/item"; const getLabel = WeaLocaleProvider.getLabel; @@ -54,24 +54,6 @@ class SalaryItemsTable extends Component { } }); }; - handleDeleteItem = (record) => { - Modal.confirm({ - title: getLabel(131329, "信息确认"), - content: getLabel(111, "确认删除吗?"), - onOk: () => { - API.deleteItem(selectedRowKeys).then(({ status, errormsg }) => { - if (status) { - message.success(getLabel(111, "操作成功!")); - this.getItemList(this.props); - } else { - message.error(errormsg); - } - }); - }, - onCancel: () => { - } - }); - }; render() { const { dataSource, columns, pageInfo, loading } = this.state; @@ -111,7 +93,7 @@ class SalaryItemsTable extends Component { { (showOperateBtn || showSalaryItemBtn) && record.canDelete && this.handleDeleteItem(record)}>{getLabel(111, "删除")} + onClick={() => onDropMenuClick("delete", record.id)}>{getLabel(111, "删除")} } From 2d15f19ddd492c9a750b8694d30f20b71e00de3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 24 Sep 2024 16:49:45 +0800 Subject: [PATCH 048/110] =?UTF-8?q?custom/=E8=A5=BF=E5=AE=89=E7=A7=A6?= =?UTF-8?q?=E5=8D=8E=E5=A4=A9=E7=87=83=E6=B0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CustomBrowser/index.js | 5 +- .../components/advanceInputBtn/index.js | 36 +++++ .../components/advanceInputBtn/index.less | 27 ++++ .../components/advanceSearchPannel/index.js | 98 ++++++++++++ .../roleManagement/components/conditions.js | 140 ++++++++++++++++++ .../hrmSalary/pages/roleManagement/index.js | 78 +++++++--- .../hrmSalary/pages/roleManagement/index.less | 46 +++++- pc4mobx/hrmSalary/stores/taxAgent.js | 1 + 8 files changed, 412 insertions(+), 19 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.js create mode 100644 pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.less create mode 100644 pc4mobx/hrmSalary/pages/roleManagement/components/advanceSearchPannel/index.js diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.js b/pc4mobx/hrmSalary/components/CustomBrowser/index.js index b0a9ead4..b7afc211 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/index.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.js @@ -40,7 +40,10 @@ class Index extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.value !== this.props.value && _.isEmpty(nextProps.value)) { + if ( + (nextProps.value !== this.props.value && _.isEmpty(nextProps.value)) || + (nextProps.fieldConfig.value !== this.props.fieldConfig.value && _.isEmpty(nextProps.fieldConfig.value)) + ) { this.setState({ searchKeys: [], selectedData: [] }); } } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.js new file mode 100644 index 00000000..77d46acc --- /dev/null +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.js @@ -0,0 +1,36 @@ +/* + * 业务线管理 + * 高级搜索 + * @Author: 黎永顺 + * @Date: 2024/9/24 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("taxAgentStore") +@observer +class Index extends Component { + render() { + const { taxAgentStore: { advanceForm } } = this.props; + return ( +
    + advanceForm.updateFields({ name: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
    + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.less new file mode 100644 index 00000000..556cfd69 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceInputBtn/index.less @@ -0,0 +1,27 @@ +.role-advance-search { + display: flex; + align-items: center; + position: relative; + + .wea-advanced-search { + top: 0; + left: -1px; + height: 28px; + line-height: 1; + border-radius: 0; + position: relative; + color: #474747; + padding: 4px 15px; + } + + .wea-advanced-search:hover { + border: 1px solid #dadada; + color: #474747; + } + + .text-elli { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } +} diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/advanceSearchPannel/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceSearchPannel/index.js new file mode 100644 index 00000000..fab6c856 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceSearchPannel/index.js @@ -0,0 +1,98 @@ +/* + * 业务线管理 + * 高级搜索面板 + * @Author: 黎永顺 + * @Date: 2024/9/24 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import { roleSearchConditions } from "../conditions"; +import { getSearchs } from "../../../../util"; +import { Button } from "antd"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("taxAgentStore") +@observer +class AdvanceSearchPannel extends Component { + constructor(props) { + super(props); + this.state = { conditions: [] }; + } + + componentDidMount() { + const { taxAgentStore: { advanceForm } } = this.props; + this.setState({ + conditions: _.map(roleSearchConditions, item => ({ + ...item, title: getLabel(item.lanId, item.title), + items: _.map(item.items, o => { + if (getKey(0) === "opts") { + return { + ...o, label: getLabel(o.lanId, o.label), + options: _.map(o.options, o => ({ ...o, label: getLabel(o.lanId, o.label) })) + }; + } + return { ...o, label: getLabel(o.lanId, o.label) }; + }) + })) + }, () => advanceForm.initFormFields(this.state.conditions)); + } + + handleReset = () => { + const { taxAgentStore: { advanceForm } } = this.props; + this.setState({ + conditions: _.map(roleSearchConditions, item => ({ + ...item, items: _.map(item.items, o => ({ ...o, value: "" })) + })) + }, () => advanceForm.resetForm()); + }; + handleFormChange = (val) => { + const key = _.keys(val)[0]; + const { taxAgentStore: { advanceForm } } = this.props; + if (key === "taxAgentIds" || key === "sobIds") { + this.setState({ + conditions: _.map(roleSearchConditions, item => ({ + ...item, items: _.map(item.items, o => { + if (key === getKey(o)) { + return { ...o, value: _.map(val[key], o => o.id).join(",") }; + } + return { ...o, value: advanceForm.getFormParams()[getKey(o)] }; + }) + })) + }); + } + }; + + render() { + const { taxAgentStore: { advanceForm } } = this.props; + const { conditions } = this.state; + return ( + +
    + {getSearchs(advanceForm, conditions, 2, false, this.handleFormChange)} +
    +
    +
    + + + + + + + + + +
    +
    +
    + ); + } +} + +export default AdvanceSearchPannel; + diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js b/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js index e3c1388b..4b2bd858 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js @@ -114,3 +114,143 @@ export const roleOperatorConditions = [ title: "" } ]; +export const roleSearchConditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["name"], + fieldcol: 16, + label: "名称", + lanId: 111, + labelcol: 8, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeURL: "/api/bs/hrmsalary/taxAgent/listAuth", + dataParams: { filterType: "QUERY_DATA" }, + filterByName: true, + tableProps: {}, + isSingle: false, + searchParamsKey: "name" + }, + conditionType: "CUSTOMBROWSER", + domkey: ["taxAgentIds"], + fieldcol: 16, + label: "个税扣缴义务人", + lanId: 111, + labelcol: 8, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + type: "17" + }, + conditionType: "BROWSER", + domkey: ["roleEmpIds"], + fieldcol: 16, + isQuickSearch: false, + label: "成员", + lanId: 111, + labelcol: 8, + viewAttr: 2 + }, + { + browserConditionParam: { + completeURL: "/api/bs/hrmsalary/salarysob/listAuth", + dataParams: { filterType: "QUERY_DATA" }, + filterByName: true, + tableProps: {}, + isSingle: false, + searchParamsKey: "name" + }, + conditionType: "CUSTOMBROWSER", + domkey: ["sobIds"], + fieldcol: 16, + label: "薪资账套", + lanId: 111, + labelcol: 8, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + type: "17" + }, + conditionType: "BROWSER", + domkey: ["employeeIds"], + fieldcol: 16, + isQuickSearch: false, + label: "数据", + lanId: 111, + labelcol: 8, + viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["opts"], + fieldcol: 16, + label: "权限项", + lanId: 111, + labelcol: 8, + multiple: true, + options: [ + { key: "query", showname: "查询", lanId: 111 }, + { key: "admin", showname: "管理", lanId: 111 } + ], + value: "", + viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["pages"], + fieldcol: 16, + label: "页面", + lanId: 111, + labelcol: 8, + multiple: true, + options: [ + { key: "query", showname: "查询", lanId: 111 }, + { key: "admin", showname: "管理", lanId: 111 } + ], + value: "", + viewAttr: 2 + } + ], + defaultshow: true, + title: "基本信息", + lanId: 111, + col: 2 + } +]; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index b9a95a6d..28ab4f22 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -9,12 +9,16 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaInputSearch, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom"; -import { Button, message, Modal } from "antd"; +import { WeaLocaleProvider, WeaTable, WeaTop } from "ecCom"; +import { Button, Dropdown, Menu, message, Modal } from "antd"; import * as API from "../../apis/taxAgent"; -import "./index.less"; import AddRoleDialog from "./components/addRoleDialog"; import RoleDetailSetDialog from "./components/roleDetailSetDialog"; +import AdvanceInputBtn from "./components/advanceInputBtn"; +import AdvanceSearchPannel from "./components/advanceSearchPannel"; +import LogDialog from "../../components/logViewModal"; +import cs from "classnames"; +import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -24,9 +28,10 @@ class Index extends Component { constructor(props) { super(props); this.state = { - query: { name: "" }, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false }, - roleSetDialog: { visible: false, roleId: "", name: "", selectedKey: "" } + roleSetDialog: { visible: false, roleId: "", name: "", selectedKey: "" }, + logDialogVisible: false, filterConditions: "", showSearchAd: false }; } @@ -35,8 +40,15 @@ class Index extends Component { } getRoleList = () => { - const { query, pageInfo } = this.state; - const paylaod = { ...pageInfo, ...query }; + const { taxAgentStore: { advanceForm } } = this.props, { pageInfo } = this.state; + const paylaod = { + ...pageInfo, ...advanceForm.getFormParams(), + employeeIds: !_.isEmpty(advanceForm.getFormParams()["employeeIds"]) ? advanceForm.getFormParams()["employeeIds"].split(",") : [], + opts: !_.isEmpty(advanceForm.getFormParams()["opts"]) ? advanceForm.getFormParams()["opts"].split(",") : [], + roleEmpIds: !_.isEmpty(advanceForm.getFormParams()["roleEmpIds"]) ? advanceForm.getFormParams()["roleEmpIds"].split(",") : [], + sobIds: !_.isEmpty(advanceForm.getFormParams()["sobIds"]) ? advanceForm.getFormParams()["sobIds"].split(",") : [], + taxAgentIds: !_.isEmpty(advanceForm.getFormParams()["taxAgentIds"]) ? advanceForm.getFormParams()["taxAgentIds"].split(",") : [] + }; this.setState({ loading: true }); API.getRoleList(paylaod).then(({ status, data }) => { this.setState({ loading: false }); @@ -69,8 +81,15 @@ class Index extends Component { this.showRoleSetDialog(record)}>{getLabel(111, "编辑")} - this.deleteAuthRole([record.id])}>{getLabel(111, "删除")} + this.handleDropMenuClick(e.key, record.id)}> + {getLabel(545781, "操作日志")} + + }> + + ) }] @@ -97,23 +116,39 @@ class Index extends Component { } }); }; + handleDropMenuClick = (key, targetid = "") => { + switch (key) { + case "log": + this.setState({ + logDialogVisible: true, + filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]" + }); + break; + default: + break; + } + }; render() { const { - query, dataSource, columns, pageInfo, loading, selectedRowKeys, addRoleDialog, roleSetDialog + dataSource, columns, pageInfo, loading, selectedRowKeys, addRoleDialog, roleSetDialog, + logDialogVisible, filterConditions, showSearchAd } = this.state; const { taxAgentStore: { PageAndOptAuth } } = this.props; const admin = PageAndOptAuth.opts.includes("admin"); - + const dropMenuDatas = [{ + key: "log", icon: , + content: getLabel(545781, "操作日志") + }]; const buttons = [ , , - this.setState({ query: { name } })} - onSearch={() => this.setState({ pageInfo: { ...pageInfo, current: 1 } }, - () => this.getRoleList())}/> + this.setState({ showSearchAd: true })} + onAdvanceSearch={() => this.setState({ pageInfo: { ...pageInfo, current: 1 } }, + () => this.getRoleList())}/> ]; const pagination = { ...pageInfo, @@ -134,11 +169,17 @@ class Index extends Component { !admin && buttons.shift(); !admin && buttons.shift(); return ( - } - iconBgcolor="#F14A2D" buttons={buttons} className="rolemanagement-index" - > + } iconBgcolor="#F14A2D" + buttons={buttons} className="rolemanagement-index" showDropIcon dropMenuDatas={dropMenuDatas} + onDropMenuClick={this.handleDropMenuClick}>
    +
    + this.setState({ showSearchAd: false })} + onAdSearch={() => this.setState({ + showSearchAd: false, pageInfo: { ...pageInfo, current: 1 } + }, () => this.getRoleList())}/> +
    {/*添加角色*/} @@ -156,6 +197,9 @@ class Index extends Component { callback && callback(); })}/>
    + {/*操作日志*/} + this.setState({ logDialogVisible: false })}/>
    ); } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.less b/pc4mobx/hrmSalary/pages/roleManagement/index.less index 17beeb3e..e911681c 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.less +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.less @@ -1,13 +1,57 @@ .rolemanagement-index { .rolemanagement-content { height: 100%; - overflow-y: hidden; + overflow-y: auto; padding: 16px 16px 0; background: rgb(246, 246, 246); .wea-new-table { background: #FFF; } + + .searchAdvanced-condition-hide { + display: none; + } + + .searchAdvanced-condition-container { + background: #FFF; + margin-bottom: 10px; + border: 1px solid #e5e5e5; + + .wea-search-buttons { + border-top: 1px solid #dadada; + padding: 15px 0; + } + + .wea-advanced-searchsAd { + height: 247px; + overflow: hidden auto; + + .formItem-delete { + position: absolute; + top: 0; + right: -40px; + } + + .searchAdvanced-commonSelect { + border-top: 1px solid #ebebeb; + margin: 0 25px; + padding: 10px 0; + } + + .custom-advance-largeSpacing { + padding-left: 26px; + + .link { + border: none; + border-radius: 0; + padding: 12px 10px 12px 26px; + color: #2db7f5 + } + } + + } + } } .wea-input-focus .ant-input { diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index a65d8b31..94d9898f 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -9,6 +9,7 @@ import { PAGE } from "../config"; const { TableStore } = WeaTableNew; export class TaxAgentStore { + @observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单 @observable roleForm = new WeaForm(); //权限-角色form表单 @action initRoleForm = () => this.roleForm = new WeaForm(); @observable roleOperatorForm = new WeaForm(); //权限-角色操作者form表单 From fd188c9f51e9f9285ed3d7600a307cd80361d6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 25 Sep 2024 10:02:46 +0800 Subject: [PATCH 049/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/associativeSearchMult.js | 2 +- .../components/associativeTreeMult.js | 84 +++++++++++++++++++ .../components/CustomBrowser/index.js | 28 +++++-- .../components/advanceSearchPannel/index.js | 29 +++++-- .../roleManagement/components/conditions.js | 17 ++-- .../hrmSalary/pages/roleManagement/index.js | 3 +- 6 files changed, 141 insertions(+), 22 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js index cfa0b04a..3f1dbc54 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js @@ -10,8 +10,8 @@ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; import { Button, Icon, Select } from "antd"; -import classNames from "classnames"; import { postFetch } from "../../../util/request"; +import classNames from "classnames"; const getLabel = WeaLocaleProvider.getLabel; const Option = Select.Option; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js new file mode 100644 index 00000000..f7e975c3 --- /dev/null +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeTreeMult.js @@ -0,0 +1,84 @@ +/* + * 自定义组件 + * 下拉树选择框 + * @Author: 黎永顺 + * @Date: 2024/9/24 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { TreeSelect } from "antd"; +import classNames from "classnames"; + +const getLabel = WeaLocaleProvider.getLabel; + +class AssociativeTreeMult extends Component { + constructor(props) { + super(props); + this.state = { + data: [] + }; + this.selectedData = {}; + } + + componentDidMount() { + const { treeData } = this.props; + this.setState({ data: this.filterTree(treeData) }); + } + + handleChange = (values) => { + this.selectedData = {}; + values.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + this.props.onChange && this.props.onChange(values, this.selectedData); + }; + getItemById = (id) => { + const { data } = this.state, { datas } = this.props; + if (datas[id]) return datas[id]; + if (!_.isEmpty(data)) { + for (let i = 0; i < data.length; i++) { + if (id === data[i].id) return data[i]; + } + } + }; + filterTree = (nodes) => { + const selectableNodes = []; + const recurse = (nodes) => { + nodes.forEach((node) => { + if (node.selectable) selectableNodes.push(node); + if (node.children) recurse(node.children); + }); + }; + recurse(nodes); + return selectableNodes; + }; + + render() { + const { viewAttr, selectedValues, datas, isSingle, treeData } = this.props; + const clsname = classNames({ + "required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues) + }); + const tProps = { + treeData, + multiple: true, + allowClear: false, + treeCheckable: true, + style: { width: "100%" }, + treeDefaultExpandAll: true, + value: selectedValues, + onChange: this.handleChange, + dropdownMatchSelectWidth: true, + dropdownStyle: { minWidth: 200, maxHeight: 280, overflowY: "auto" }, + getPopupContainer: (triggerNode) => triggerNode.parentNode + }; + return ( + + ); + } +} + +export default AssociativeTreeMult; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.js b/pc4mobx/hrmSalary/components/CustomBrowser/index.js index b7afc211..f77d566d 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/index.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.js @@ -9,6 +9,7 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; +import AssociativeTreeMult from "./components/associativeTreeMult"; import AssociativeSearchMult from "./components/associativeSearchMult"; import AssociativeSearchSingle from "./components/AssociativeSearchSingle"; import CustomBrowserDialog from "./components/customBrowserDialog"; @@ -64,16 +65,27 @@ class Index extends Component { }; renderMult = () => { const { fieldConfig } = this.props; + const { browserConditionParam = {} } = fieldConfig || {}; const { selectedData, searchKeys } = this.state; return (
    - + { + browserConditionParam.treeSelect ? + : + + }
    ); }; onBrowerChangeHandler = (values, datas) => { diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/advanceSearchPannel/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceSearchPannel/index.js index fab6c856..72f0970d 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/advanceSearchPannel/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/advanceSearchPannel/index.js @@ -11,6 +11,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; import { roleSearchConditions } from "../conditions"; +import { getAuthOptTree } from "../../../../apis/taxAgent"; import { getSearchs } from "../../../../util"; import { Button } from "antd"; @@ -25,16 +26,32 @@ class AdvanceSearchPannel extends Component { this.state = { conditions: [] }; } - componentDidMount() { + async componentDidMount() { const { taxAgentStore: { advanceForm } } = this.props; + const { data } = await getAuthOptTree(); this.setState({ conditions: _.map(roleSearchConditions, item => ({ ...item, title: getLabel(item.lanId, item.title), items: _.map(item.items, o => { - if (getKey(0) === "opts") { + if (getKey(o) === "opts") { return { ...o, label: getLabel(o.lanId, o.label), - options: _.map(o.options, o => ({ ...o, label: getLabel(o.lanId, o.label) })) + options: _.map(o.options, k => ({ ...k, showname: getLabel(k.lanId, k.showname) })) + }; + } else if (getKey(o) === "pages") { + return { + ...o, label: getLabel(o.lanId, o.label), + treeData: [{ + label: data.name, value: data.key, key: data.key, id: data.key, name: data.name, + children: _.map(data.modules, i => ({ + label: i.name, value: `${data.key}-${i.key}`, key: `${data.key}-${i.key}`, + id: `${data.key}-${i.key}`, name: i.name, + children: _.map(i.pages, k => ({ + label: k.name, value: k.key, key: k.key, selectable: true, + id: k.key, name: k.name + })) + })) + }] }; } return { ...o, label: getLabel(o.lanId, o.label) }; @@ -46,7 +63,7 @@ class AdvanceSearchPannel extends Component { handleReset = () => { const { taxAgentStore: { advanceForm } } = this.props; this.setState({ - conditions: _.map(roleSearchConditions, item => ({ + conditions: _.map(this.state.conditions, item => ({ ...item, items: _.map(item.items, o => ({ ...o, value: "" })) })) }, () => advanceForm.resetForm()); @@ -54,9 +71,9 @@ class AdvanceSearchPannel extends Component { handleFormChange = (val) => { const key = _.keys(val)[0]; const { taxAgentStore: { advanceForm } } = this.props; - if (key === "taxAgentIds" || key === "sobIds") { + if (key === "taxAgentIds" || key === "sobIds" || key === "pages") { this.setState({ - conditions: _.map(roleSearchConditions, item => ({ + conditions: _.map(this.state.conditions, item => ({ ...item, items: _.map(item.items, o => { if (key === getKey(o)) { return { ...o, value: _.map(val[key], o => o.id).join(",") }; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js b/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js index 4b2bd858..6a32be00 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/conditions.js @@ -233,17 +233,22 @@ export const roleSearchConditions = [ viewAttr: 2 }, { - conditionType: "SELECT", + browserConditionParam: { + completeURL: "", + dataParams: { filterType: "" }, + filterByName: true, + tableProps: {}, + isSingle: false, + treeSelect: true, + searchParamsKey: "name" + }, + conditionType: "CUSTOMBROWSER", domkey: ["pages"], fieldcol: 16, label: "页面", lanId: 111, labelcol: 8, - multiple: true, - options: [ - { key: "query", showname: "查询", lanId: 111 }, - { key: "admin", showname: "管理", lanId: 111 } - ], + treeData: [], value: "", viewAttr: 2 } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index 28ab4f22..f379e1de 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -47,7 +47,8 @@ class Index extends Component { opts: !_.isEmpty(advanceForm.getFormParams()["opts"]) ? advanceForm.getFormParams()["opts"].split(",") : [], roleEmpIds: !_.isEmpty(advanceForm.getFormParams()["roleEmpIds"]) ? advanceForm.getFormParams()["roleEmpIds"].split(",") : [], sobIds: !_.isEmpty(advanceForm.getFormParams()["sobIds"]) ? advanceForm.getFormParams()["sobIds"].split(",") : [], - taxAgentIds: !_.isEmpty(advanceForm.getFormParams()["taxAgentIds"]) ? advanceForm.getFormParams()["taxAgentIds"].split(",") : [] + taxAgentIds: !_.isEmpty(advanceForm.getFormParams()["taxAgentIds"]) ? advanceForm.getFormParams()["taxAgentIds"].split(",") : [], + pages: !_.isEmpty(advanceForm.getFormParams()["pages"]) ? advanceForm.getFormParams()["pages"].split(",") : [] }; this.setState({ loading: true }); API.getRoleList(paylaod).then(({ status, data }) => { From a4fffbcbd44e863bf2ed141ec4fb99aa7f670015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 25 Sep 2024 14:11:46 +0800 Subject: [PATCH 050/110] release/2.15.2.2409.01 --- .../pages/salaryItem/customSalaryItemSlide.js | 13 +- pc4mobx/hrmSalary/pages/salaryItem/index.js | 201 ++---------------- pc4mobx/hrmSalary/pages/salaryItem/index.less | 4 +- .../pages/salaryItem/salaryItemsTable.js | 7 +- 4 files changed, 29 insertions(+), 196 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 4021c714..28e46ef5 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -8,8 +8,6 @@ import { commonEnumList } from "../../apis/archive"; import { postFetch } from "../../util/request"; import { getItemForm } from "../../apis/item"; -// import SalaryItemForm from "./salaryItemForm"; - const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @@ -52,7 +50,8 @@ export default class CustomSalaryItemSlide extends React.Component { return { ...c, items: _.map(c.items, fields => { fields = { - ...fields, label: getLabel(fields.lanId, fields.label), + ...fields, viewAttr: props.showOperateBtn ? fields.viewAttr : 1, + label: getLabel(fields.lanId, fields.label), value: !_.isNil(salaryItemForm[getKey(fields)]) ? String(salaryItemForm[getKey(fields)]) : fields.value }; switch (getKey(fields)) { @@ -158,6 +157,7 @@ export default class CustomSalaryItemSlide extends React.Component { { getKey(fields) === "formulaContent" && form.getFormParams().valueType !== "1" && + this.props.showOperateBtn &&
    this.setState({ visible: true })}/> } { @@ -186,8 +186,7 @@ export default class CustomSalaryItemSlide extends React.Component { render() { const { onClose, salaryItemStore: { itemsForm: form } } = this.props; - // const { valueType, dataType, formulaId } = request; - const { visible, salaryItemName } = this.state; + const { visible } = this.state; return ( }
    }/> - - //
    - // - //
    ); } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 24aaaaea..7cd6da90 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -8,7 +8,6 @@ import { toDecimal_n } from "../../util"; import SystemSalaryItemModal from "./systemSalaryItemModal"; import CustomSalaryItemSlide from "./customSalaryItemSlide"; import SyncToSalaryAccountSetDialog from "./syncToSalaryAccountSetDialog"; -import "../socialSecurityBenefits/programme/index.less"; import LogDialog from "../../components/logViewModal"; import "./index.less"; @@ -21,54 +20,11 @@ export default class SalaryItem extends React.Component { this.state = { name: "", isQuery: false, loading: false, customItemDialog: { visible: false, title: "", buttons: [] },// 自定义薪资项弹窗 - - - value: "", - selectedKey: "0", - editable: false, - isAdd: false, - searchValue: "", - formalModalVisible: false, - searchParams: { current: 1, pageSize: 10, total: 0 }, - selectedRowKeys: [], - syncSalarySetDialog: { visible: false, title: "", id: "" }, + syncSalarySetDialog: { visible: false, title: "", id: "" }, // 同步到薪资账套弹窗 logDialogVisible: false, filterConditions: "[]" }; - this.record = {}; } - - componentWillMount() { // 初始化渲染页面 - // const { salaryItemStore: { getTableDatas }, salaryFileStore, taxAgentStore } = this.props; - // const { commonEnumList } = salaryFileStore; - // const { fetchTaxAgentOption } = taxAgentStore; - // fetchTaxAgentOption(); - // commonEnumList("user", { enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" }); - // getTableDatas({}).then(res => { - // this.setState({ - // searchParams: { - // ...this.state.searchParams, - // current: res.pageNum, - // total: res.total - // } - // }); - // }); - } - - onEditItem = (record, isedit) => { - this.record = record; - const { salaryItemStore: { getItemForm, setEditSlideVisible } } = this.props; - this.setState({ - editable: isedit, isAdd: false, - syncSalarySetDialog: { ...this.state.syncSalarySetDialog, id: record.id } - }); - getItemForm(record.id).then(() => { - setEditSlideVisible(true); - }).catch(({ errormsg }) => { - message.error(errormsg || ""); - }); - }; - handleDeleteItem = (recordId) => { const { selectedRowKeys, isQuery } = this.state; const params = recordId ? [recordId] : selectedRowKeys; @@ -91,7 +47,6 @@ export default class SalaryItem extends React.Component { } }); }; - handleValidateForm = () => { return new Promise((resolve) => { const { salaryItemStore: { itemsForm: form } } = this.props; @@ -134,7 +89,7 @@ export default class SalaryItem extends React.Component { } else { !f1.isValid && f1.showErrors(); !f2.taxAgentValidate && f1.showError("taxAgentIds", getLabel(111, "\"可见性范围\"未填写")); - !f2.formulaValidate && f1.showError("formulaId", getLabel(111, `\"${form.getFormDatas().valueType.valueSpan}\"未填写`)); + !f2.formulaValidate && f1.showError("formulaContent", getLabel(111, `\"${form.getFormDatas().valueType.valueSpan}\"未填写`)); this.forceUpdate(); } }); @@ -153,7 +108,11 @@ export default class SalaryItem extends React.Component { const { loading } = this.state; const title = key === "edit" ? getLabel(111, "修改自定义薪资项目") : getLabel(111, "新建自定义薪资项目"); const buttons = key === "edit" ? [ - , + , ] : [ @@ -179,34 +138,10 @@ export default class SalaryItem extends React.Component { }; render() { - const { - salaryItemStore, - salaryFileStore, - taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentOption } - } = this.props; - const { userStatusList } = salaryFileStore; + const { salaryItemStore, taxAgentStore: { showOperateBtn, showSalaryItemBtn } } = this.props; const { selectedRowKeys, logDialogVisible, filterConditions, name, isQuery, customItemDialog } = this.state; const { loading, deleteItemRequest, getTableDatas } = salaryItemStore; - const { - tableDataSource, - tableColumns, - systemItemVisible, - setSystemItemVisible, - editSlideVisible, - setEditSlideVisible, - request - } = salaryItemStore; - - const handleMenuClick = (e) => { - const { salaryItemStore: { setEditSlideVisible, initRequest } } = this.props; - if (e.key === "1") { - this.setState({ editable: true, isAdd: true }); - initRequest(); - setEditSlideVisible(true); - } else if (e.key === "2") { - setSystemItemVisible(true); - } - }; + const { systemItemVisible, setSystemItemVisible } = salaryItemStore; const menu = ( @@ -223,69 +158,6 @@ export default class SalaryItem extends React.Component { const dropMenuDatas = [ { key: "log", icon: , content: getLabel(545781, "操作日志") } ]; - // 新建和修改保存的回调 - const handleSlideSave = (continueFlag) => { - const { salaryItemStore: { saveItem, request, getTableDatas } } = this.props; - const payload = _.cloneDeep(request); - const { name, sharedType, taxAgentIds } = request; - if (!name || (sharedType === "1" && !taxAgentIds)) { - Modal.warning({ - title: "信息确认", - content: "必要信息不完整,红色*为必填项!" - }); - return; - } - const { pattern, defaultValue, dataType, ...extra } = payload; - saveItem({ - ...extra, pattern, dataType, - defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue - }, continueFlag) - .then(() => { - getTableDatas({ ...this.state.searchParams }).then(res => { - this.setState({ - searchParams: { - ...this.state.searchParams, - total: res.total - } - }); - }); - }); - }; - - const renderCustomOperate = () => { - let arrList = []; - if (this.state.isAdd) { - arrList = [ - , - - ]; - } else if (this.state.editable) { - arrList = [ - , - - ]; - } - return arrList; - }; - - const handleSaveSlideChange = (value) => { - const { salaryItemStore: { setRequest } } = this.props; - setRequest(value); - }; !(showOperateBtn || showSalaryItemBtn) && (buttons = buttons.slice(-1)); return ( @@ -298,18 +170,6 @@ export default class SalaryItem extends React.Component { onChange={val => this.setState({ selectedRowKeys: val })}/>
    - this.setState({ - syncSalarySetDialog: { - ...this.state.syncSalarySetDialog, - visible: false, title: "" - } - })} - /> - {/*操作日志*/} - this.setState({ logDialogVisible: false })}/> { systemItemVisible && } + {/*同步薪资账套*/} + this.setState({ + syncSalarySetDialog: { ...this.state.syncSalarySetDialog, visible: false, title: "" } + })}/> + {/*操作日志*/} + this.setState({ logDialogVisible: false })}/> {/*新增编辑自定义薪资项目*/} this.setState({ isQuery: !isQuery })} + showOperateBtn={showOperateBtn || showSalaryItemBtn} onClose={callback => this.setState({ customItemDialog: { ...customItemDialog, visible: false, id: "" } }, () => callback && callback())}/> - {/*{*/} - {/* editSlideVisible &&*/} - {/* */} - {/* }*/} - {/* content={*/} - {/* {*/} - {/* handleSaveSlideChange(value);*/} - {/* }}/>*/} - {/* }*/} - {/* onClose={() => setEditSlideVisible(false)}*/} - {/* />*/} - {/*}*/} ); } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index 40b4e186..496d01fd 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -10,7 +10,7 @@ padding: 8px 16px; background: #f6f6f6; - & > .wea-new-table { + .wea-new-table { background: #FFFFFF; } } @@ -27,7 +27,7 @@ background: #f6f6f6; .wea-form-item-wrapper { - display: block !important; + //display: block !important; .formula_input_div { cursor: pointer; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js index 7d1525be..2b5a5d79 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js @@ -9,7 +9,7 @@ */ import React, { Component } from "react"; import { WeaCheckbox, WeaLocaleProvider, WeaTable } from "ecCom"; -import { Dropdown, Menu } from "antd"; +import { Dropdown, Menu, Spin } from "antd"; import * as API from "../../apis/item"; const getLabel = WeaLocaleProvider.getLabel; @@ -81,7 +81,7 @@ class SalaryItemsTable extends Component { disabled: !record.canDelete }) }; - return ( + return ( ) } - ]}/>); + ]}/> + ); } } From 5ec07d20e0c275487e1860e7ee45c91ffa1569b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 25 Sep 2024 15:37:02 +0800 Subject: [PATCH 051/110] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA?= =?UTF-8?q?=E8=B5=84=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/index.js | 41 +++----- pc4mobx/hrmSalary/pages/salaryItem/index.less | 24 ++--- .../syncToSalaryAccountSetDialog.js | 3 +- .../pages/salaryItem/systemSalaryItemModal.js | 94 +++++++------------ 4 files changed, 59 insertions(+), 103 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 7cd6da90..6e8073d4 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -18,9 +18,9 @@ export default class SalaryItem extends React.Component { constructor(props) { super(props); this.state = { - name: "", isQuery: false, loading: false, + name: "", isQuery: false, loading: false, sysVisible: false, customItemDialog: { visible: false, title: "", buttons: [] },// 自定义薪资项弹窗 - syncSalarySetDialog: { visible: false, title: "", id: "" }, // 同步到薪资账套弹窗 + syncSalarySetDialog: { visible: false, id: "" }, // 同步到薪资账套弹窗 logDialogVisible: false, filterConditions: "[]" }; } @@ -109,9 +109,7 @@ export default class SalaryItem extends React.Component { const title = key === "edit" ? getLabel(111, "修改自定义薪资项目") : getLabel(111, "新建自定义薪资项目"); const buttons = key === "edit" ? [ , @@ -131,6 +129,7 @@ export default class SalaryItem extends React.Component { this.handleDeleteItem(targetid); break; case "sysAdd": + this.setState({ sysVisible: true }); break; default: break; @@ -139,12 +138,14 @@ export default class SalaryItem extends React.Component { render() { const { salaryItemStore, taxAgentStore: { showOperateBtn, showSalaryItemBtn } } = this.props; - const { selectedRowKeys, logDialogVisible, filterConditions, name, isQuery, customItemDialog } = this.state; + const { + selectedRowKeys, logDialogVisible, filterConditions, name, isQuery, customItemDialog, sysVisible + } = this.state; const { loading, deleteItemRequest, getTableDatas } = salaryItemStore; const { systemItemVisible, setSystemItemVisible } = salaryItemStore; const menu = ( - + this.onDropMenuClick(key)}> {getLabel(111, "新增系统薪资项")} ); @@ -170,31 +171,13 @@ export default class SalaryItem extends React.Component { onChange={val => this.setState({ selectedRowKeys: val })}/>
    - { - systemItemVisible && - { - setSystemItemVisible(false); - }} - onInitTableList={() => { - getTableDatas({ ...this.state.searchParams, name: this.state.searchValue }).then(res => { - this.setState({ - searchParams: { - ...this.state.searchParams, - total: res.total - } - }); - }); - }} - /> - } + {/*添加系统薪资项目*/} + this.setState({ isQuery: !isQuery })} + onCancel={(callback) => this.setState({ sysVisible: false }, () => callback && callback())}/> {/*同步薪资账套*/} this.setState({ - syncSalarySetDialog: { ...this.state.syncSalarySetDialog, visible: false, title: "" } - })}/> + onCancel={() => this.setState({ syncSalarySetDialog: { visible: false, id: "" } })}/> {/*操作日志*/} this.setState({ logDialogVisible: false })}/> diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index 496d01fd..cf539484 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -150,20 +150,20 @@ //系统薪资项添加modal .sys-salary-wrapper { - .wea-dialog-body { - height: 50vh; - overflow: hidden auto; + .sys-item-title { + display: flex; + align-items: center; + justify-content: space-between; + } - .headerSearchWrapper { - display: flex; - justify-content: flex-end; - align-items: center; - padding: 16px 20px; + .sys-item-table-box { + width: 100%; + height: 100%; + background: #F6F6F6; + padding: 8px 16px; - .wea-tab { - width: 100%; - border-bottom: none; - } + .wea-new-table { + background: #FFFFFF; } } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js index 797a6466..f97ef453 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js @@ -51,7 +51,6 @@ class SyncToSalaryAccountSetDialog extends Component { } }); }; - save = () => { const { salaryItemStore: { salarySetform }, id: salaryItemId } = this.props; salarySetform.validateForm().then(f => { @@ -80,7 +79,7 @@ class SyncToSalaryAccountSetDialog extends Component { return ( {getLabel(537558, "确定")}]} > diff --git a/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js b/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js index 2e7d169f..b1c3a1f8 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js @@ -1,8 +1,7 @@ import React from "react"; -import { WeaDialog, WeaLocaleProvider, WeaTab } from "ecCom"; -import { Button, message } from "antd"; +import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTable } from "ecCom"; +import { Button, message, Spin } from "antd"; import { getSysItemList, saveSysItem } from "../../apis/item"; -import UnifiedTable from "../../components/UnifiedTable"; import "./index.less"; const { getLabel } = WeaLocaleProvider; @@ -10,20 +9,16 @@ export default class SystemSalaryItemModal extends React.Component { constructor(props) { super(props); this.state = { - dataSource: [], - columns: [], - name: "", - loading: false, - saveLoading: false, - selectedRowKeys: [], - pageInfo: { - current: 1, pageSize: 10, total: 0 - } + dataSource: [], columns: [], name: "", loading: false, saveLoading: false, + selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 } }; } - componentDidMount() { - this.getSysItemList(); + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getSysItemList(); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ + selectedRowKeys: [], name: "" + }); } getSysItemList = () => { @@ -33,41 +28,33 @@ export default class SystemSalaryItemModal extends React.Component { this.setState({ loading: false }); if (status) { const { columns, list: dataSource, pageNum: current, pageSize, total } = data; - this.setState({ - columns: _.map(columns, item => { - return { - ...item, - render: (text) => { - return {text}; - } - }; - }), - dataSource, - pageInfo: { ...pageInfo, current, pageSize, total } - }); + this.setState({ columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } }); } }).catch(() => this.setState({ loading: false })); }; handleAdd = () => { const { selectedRowKeys } = this.state; - if (_.isEmpty(selectedRowKeys)) { - message.info(getLabel(111, "未选择任何条目")); - return; - } this.setState({ saveLoading: true }); saveSysItem(selectedRowKeys).then(({ status, errormsg }) => { this.setState({ saveLoading: false }); if (status) { message.success(getLabel(111, "添加成功")); - this.setState({ selectedRowKeys: [] }, () => { - this.props.onInitTableList(); - this.props.onCancel(); - }); + this.setState({ selectedRowKeys: [] }, () => this.props.onCancel(this.props.onSearch())); } else { message.error(errormsg); } }).catch(() => this.setState({ saveLoading: false })); }; + renderTitle = () => { + const { name, pageInfo } = this.state; + return
    + {getLabel(111, "添加系统薪资项目")} + this.setState({ name: val })} style={{ width: 200 }} + placeholder={getLabel(111, "请输入薪资项目名称")} a onSearch={() => this.setState({ + pageInfo: { ...pageInfo, current: 1 } + }, () => this.getSysItemList())}/> +
    ; + }; render() { const { selectedRowKeys, pageInfo, loading, columns, dataSource, saveLoading } = this.state; @@ -95,33 +82,20 @@ export default class SystemSalaryItemModal extends React.Component { onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) }; return ( - { - this.setState({ selectedRowKeys: [] }, () => { - this.props.onCancel(); - }); - }} style={{ width: "60vw" }} scalable - buttons={[ - - ]} - > -
    - this.setState({ name })} - onSearch={this.getSysItemList} - /> + this.sysItemRef = dom} + style={{ + width: "60vw", height: 600, minHeight: 200, minWidth: 380, + maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} title={this.renderTitle()} + buttons={[]}> +
    + + +
    -
    ); } From 112988ceba355712c8b679bcfcd748c06c6e5cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 26 Sep 2024 10:01:49 +0800 Subject: [PATCH 052/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/index.js | 26 +++++++++---------- .../pages/salaryItem/salaryItemsTable.js | 12 +++------ 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 15645de9..dbcba6cc 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -119,9 +119,10 @@ export default class SalaryItem extends React.Component { break; case "customAdd": case "edit": - const { taxAgentStore: { showOperateBtn, showSalaryItemBtn } } = this.props; - const { loading } = this.state; - const title = key === "edit" ? getLabel(111, "修改自定义薪资项目") : getLabel(111, "新建自定义薪资项目"); + const { taxAgentStore: { PageAndOptAuth } } = this.props; + const { loading } = this.state, showOperateBtn = PageAndOptAuth.opts.includes("admin"); + const editTitle = !showOperateBtn ? getLabel(111, "查看自定义薪资项目") : getLabel(111, "修改自定义薪资项目"); + const title = key === "edit" ? editTitle : getLabel(111, "新建自定义薪资项目"); const buttons = key === "edit" ? [ ]; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js index e2342e93..c4eb3b57 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js @@ -8,10 +8,10 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom"; import * as API from "../../../../../apis/welfareArchive"; -import { getTaxAgentSelectList } from "../../../../../apis/taxAgent"; import { sysinfo } from "../../../../../apis/ruleconfig"; import { getWelfareSearchsForm, welfareConditions } from "../../config"; import { getConditionDomkeys, toDecimal_n } from "../../../../../util"; +import { postFetch } from "../../../../../util/request"; import { Button, message, Modal } from "antd"; const getKey = WeaTools.getKey; @@ -39,7 +39,9 @@ class Index extends Component { } getBaseForm = async (props) => { - const [taxAgentListData, sysInfoData] = await Promise.all([getTaxAgentSelectList(), sysinfo()]); + const [taxAgentListData, sysInfoData] = await Promise.all([ + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }), sysinfo() + ]); const { archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase, runStatuses, employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData, @@ -97,7 +99,7 @@ class Index extends Component { items: _.map(o.items, g => { return { ...g, label: getLabel(g.lanId, g.label), - options: _.map(taxAgentListData.data, j => ({ key: j.id, showname: j.content })) + options: _.map(taxAgentListData.data, j => ({ key: String(j.id), showname: j.name })) }; }) }; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js index a9029a86..52bc2061 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js @@ -70,8 +70,8 @@ class Index extends Component { if (type === "init") { this.getWelfareList(this.props, true); } else if (type === "turn") { - const { record: { baseInfo, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params; - const { runStatuses, showOperateBtn } = this.props; + const { record: { baseInfoId, opts, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params; + const { runStatuses } = this.props; switch (id) { case "PAGEINFO": this.setState({ @@ -114,6 +114,7 @@ class Index extends Component { this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["fund"], schemeId: fundSchemeId }), this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["other"], schemeId: otherSchemeId }) ]); + const showOperateBtn = opts.includes("admin"); this.setState({ welfareEditSlide: { ...this.state.welfareEditSlide, visible: true, showOperateBtn, @@ -128,18 +129,18 @@ class Index extends Component { case "DEL-TO-DO": case "DEL-TO-DO-STAY": const module = (id === "ADD-TO-PAY" || id === "STAY-DEL-TO-STOP" || id === "CANCEL-STOP") ? - [baseInfo] : { ids: [baseInfo], ...interfaceParams }; + [baseInfoId] : { ids: [baseInfoId], ...interfaceParams }; this.handleWelfareOpts(_.camelCase(id), module); break; case "DEL-ARCHIVE": Modal.confirm({ title: getLabel(131329, "信息确认"), content: getLabel(388758, "确认要删除吗?"), - onOk: () => this.handleWelfareOpts(_.camelCase(id), [baseInfo]) + onOk: () => this.handleWelfareOpts(_.camelCase(id), [baseInfoId]) }); break; case "log": - this.props.onFilterLog(id, baseInfo); + this.props.onFilterLog(id, baseInfoId); break; default: break; @@ -156,7 +157,7 @@ class Index extends Component { }; getWelfareList = (props, init = false) => { const { pageInfo } = this.state; - const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount, showOperateBtn } = props; + const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount } = props; const params = { ...pageInfo, ...welfareForm.getFormParams() }; const payload = runStatuses === "ext" ? { ...params, extWelArchiveList: true } : { ...params, @@ -183,10 +184,7 @@ class Index extends Component { }, () => { const { pageInfo, selectedRowKeys, columns, dataSource } = this.state; onChangeTopTabCount(runStatuses, total, init); - this.postMessageToChild({ - dataSource, pageInfo, selectedRowKeys, runStatuses, - columns, showOperateBtn - }); + this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, runStatuses, columns }); }); } }).catch(() => this.setState({ loading: false })); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js index 4da87e27..f64404e9 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js @@ -151,7 +151,8 @@ class Index extends Component { selectedKey, topTabCount, showSearchAd, isQuery, recordDialogVisible, logDialogVisible, filterConditions, welfareImpDialog, showExtEmpsWitch } = this.state; - const { taxAgentStore: { showOperateBtn } } = this.props; + const { taxAgentStore: { PageAndOptAuth } } = this.props; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const tipList = _.find(welfareTipList, o => o.viewcondition === selectedKey).list; const tabs = _.map(tabList, o => ({ ...o, title: getLabel(o.lanId, o.title) })); return ( diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js index da42ac66..077d7bfc 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js @@ -10,7 +10,7 @@ import { WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTab, WeaTools } fr import PlanSetTable from "./planSetTable"; import { Button, message, Modal } from "antd"; import * as API from "../../../../../apis/welfareScheme"; -import { getTaxAgentSelectListAsAdmin } from "../../../../../apis/taxAgent"; +import { postFetch } from "../../../../../util/request"; import { getConditionDomkeys, getSearchs } from "../../../../../util"; import BaseValidateDialog from "./baseValidateDialog"; import { planConditons } from "../../config"; @@ -44,7 +44,7 @@ class Index extends Component { } getForm = async (props) => { - const { data: result } = await getTaxAgentSelectListAsAdmin(); + const { data: result } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); const { id, welfareTypeEnum, programmeStore: { planForm }, showOperateBtn } = props; API.getForm(id ? _.assign({ welfareTypeEnum }, { id }) : { welfareTypeEnum }).then(({ status, data }) => { if (status) { @@ -58,7 +58,7 @@ class Index extends Component { return { ...o, hide: schemeBatch["sharedType"] === "0" || _.isNil(schemeBatch["sharedType"]), viewAttr: (schemeBatch["sharedType"] === "1" && showOperateBtn) ? 3 : showOperateBtn ? o.viewAttr : 1, - options: _.map(result, k => ({ key: k.id, showname: k.content })), + options: _.map(result, k => ({ key: String(k.id), showname: k.name })), label: getLabel(o.lanId, o.label) }; } else if (getKey(o) === "paymentType" || getKey(o) === "sharedType") { From f1183af3e2f9f3b531dd2068f2212f2aa88ae60c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 26 Sep 2024 17:56:41 +0800 Subject: [PATCH 054/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 4 ++++ pc4mobx/hrmSalary/pages/roleManagement/index.js | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 4b3647ab..20997a2b 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -100,6 +100,10 @@ export const hasIconInTax = (params) => { }; /**权限-角色相关*/ +//同步业务线 +export const syncAuth = (params) => { + return postFetch("/api/bs/hrmsalary/auth/sync", params); +}; //角色列表 export const getRoleList = (params) => { return postFetch("/api/bs/hrmsalary/auth/role/list", params); diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index f379e1de..453c7229 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -39,6 +39,16 @@ class Index extends Component { this.getRoleList(); } + syncAuth = () => { + API.syncAuth().then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.getRoleList(); + } else { + message.error(errormsg); + } + }); + }; getRoleList = () => { const { taxAgentStore: { advanceForm } } = this.props, { pageInfo } = this.state; const paylaod = { @@ -141,10 +151,11 @@ class Index extends Component { key: "log", icon: , content: getLabel(545781, "操作日志") }]; - const buttons = [ + let buttons = [ , + , , this.setState({ showSearchAd: true })} @@ -167,8 +178,7 @@ class Index extends Component { const rowSelection = { selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) }; - !admin && buttons.shift(); - !admin && buttons.shift(); + !admin && (buttons = buttons.slice(-1)); return ( } iconBgcolor="#F14A2D" buttons={buttons} className="rolemanagement-index" showDropIcon dropMenuDatas={dropMenuDatas} From e09fbb332f94c5cc126b8f24c3f7602bf82e0b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 26 Sep 2024 17:59:14 +0800 Subject: [PATCH 055/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/roleManagement/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index 453c7229..89f47949 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -31,7 +31,7 @@ class Index extends Component { dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false }, roleSetDialog: { visible: false, roleId: "", name: "", selectedKey: "" }, - logDialogVisible: false, filterConditions: "", showSearchAd: false + logDialogVisible: false, filterConditions: "", showSearchAd: false, syncLoading: false }; } @@ -40,7 +40,9 @@ class Index extends Component { } syncAuth = () => { + this.setState({ syncLoading: true }); API.syncAuth().then(({ status, errormsg }) => { + this.setState({ syncLoading: false }); if (status) { message.success(getLabel(111, "操作成功!")); this.getRoleList(); @@ -143,7 +145,7 @@ class Index extends Component { render() { const { dataSource, columns, pageInfo, loading, selectedRowKeys, addRoleDialog, roleSetDialog, - logDialogVisible, filterConditions, showSearchAd + logDialogVisible, filterConditions, showSearchAd, syncLoading } = this.state; const { taxAgentStore: { PageAndOptAuth } } = this.props; const admin = PageAndOptAuth.opts.includes("admin"); @@ -155,7 +157,7 @@ class Index extends Component { , - , + , , this.setState({ showSearchAd: true })} From b4a966ea20bce5566ff4fab96b44b799a34cd399 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, 27 Sep 2024 15:32:21 +0800 Subject: [PATCH 056/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/taxAgent.js | 8 ++ .../components/customBrowserDialog.js | 68 ++++++++------ .../components/CustomBrowser/index.less | 33 +++++-- .../roleManagement/components/index.less | 19 ++++ .../roleDetailSetDialog/detailDialog.js | 92 +++++++++++++++++++ .../components/roleDetailSetDialog/index.js | 37 ++++++-- .../hrmSalary/pages/roleManagement/index.js | 29 +++++- 7 files changed, 237 insertions(+), 49 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 20997a2b..1d1509fc 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -160,3 +160,11 @@ export const getAuthOptTree = (params) => { export const getRole = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/auth/role/getRole", "GET", params); }; +//成员明细列表 +export const authMemberDetail = (params) => { + return postFetch("/api/bs/hrmsalary/auth/member/detail", params); +}; +//数据明细列表 +export const authDataDetail = (params) => { + return postFetch("/api/bs/hrmsalary/auth/data/detail", params); +}; diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js index 9eabe37a..4cb5a125 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserDialog.js @@ -97,7 +97,6 @@ class CustomBrowserDialog extends Component { } } }; - onLeftListCheck = (keys, datas) => { const { leftListSelectedData } = this.state; let targets = leftListSelectedData.concat(datas); @@ -154,6 +153,31 @@ class CustomBrowserDialog extends Component { } return bool; }; + renderTitle = () => { + const { dialogType, searchParamsKey, isSingle } = this.props, { + query, pageInfo, selectedRowKeys, singleFilterVal + } = this.state; + return (
    + {getLabel(111, "数据选择")} + { + dialogType === "table" ? + this.setState({ query: { ...query, [searchParamsKey]: value } })} + onSearch={() => { + this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => { + this.getData(); + selectedRowKeys.forEach((v) => { + let item = this.getItemById(v); + if (item) this.selectedData[v] = item; + }); + }); + }}/> : isSingle ? + this.setState({ singleFilterVal })}/> : +
    + } +
    ); + }; render() { const { @@ -161,7 +185,7 @@ class CustomBrowserDialog extends Component { singleFilterVal } = this.state; const { dialogType, tableProps: { rowKey, columns }, isSingle, searchParamsKey } = this.props; - const sheight = this.dialog ? this.dialog.state.height - 55 : 260; + const sheight = this.dialog ? this.dialog.state.height - 116 : 260; const buttons = [ , @@ -172,7 +196,7 @@ class CustomBrowserDialog extends Component { if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true; if (rightDatas && rightDatas.length > 0) rightAllActive = true; let dom = -
    +
    { !isSingle ?
    @@ -184,7 +208,7 @@ class CustomBrowserDialog extends Component {
    - +
    this.setState({ rightCheckedKeys })} onDoubleClick={this.onRightDoubleClick} />
    : - - this.setState({ singleFilterVal })}/> - this.handleRowClick(_.find(listDatas, item => item.id === id))} - data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/> - + this.handleRowClick(_.find(listDatas, item => item.id === id))} + data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/> }
    ; @@ -257,33 +278,20 @@ class CustomBrowserDialog extends Component { selectedRowKeys, onChange: selectedRowKeys => this.setState({ selectedRowKeys }) }; - dom = - this.setState({ query: { ...query, [searchParamsKey]: value } })} - onSearch={() => { - this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => { - this.getData(); - selectedRowKeys.forEach((v) => { - let item = this.getItemById(v); - if (item) this.selectedData[v] = item; - }); - }); - }}/> + dom =
    - ; +
    ; } dialogType === "table" && isSingle && buttons.splice(0, 1); return ( this.dialog = dom} title={getLabel(111, "数据选择")} - className="custom_browser_dialog" style={{ + {...this.props} initLoadCss ref={dom => this.dialog = dom} title={this.renderTitle()} + className="custom_browser_dialog" draggable={false} style={{ width: 784, height: 460, minHeight: 200, minWidth: 380, maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" - }} buttons={buttons}> - {dom} - + }} buttons={buttons}>{dom} ); } } diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.less b/pc4mobx/hrmSalary/components/CustomBrowser/index.less index 8cf2ce40..d4d61a16 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/index.less +++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.less @@ -1,10 +1,18 @@ .custom_browser_dialog { - .tableSearch { - float: right; - margin: 16px; - position: relative; - z-index: 99; - min-width: 200px; + .wea-hr-muti-dialog-title { + display: flex; + justify-content: space-between; + align-items: center; + } + + .wea-hr-muti-input-table { + background: #f6f6f6; + padding: 8px 16px; + height: 100%; + + .wea-new-table { + background: #FFF; + } } .ant-spin-nested-loading, .ant-spin-container { @@ -12,6 +20,19 @@ } .wea-hr-muti-dialog { + height: 100%; + background: #f6f6f6; + padding: 8px 16px; + + .wea-hr-muti-input-left, .wea-hr-muti-input-right { + background: #FFF; + } + + .wea-transfer-list { + background: #FFF; + border: 1px solid #e9e9e9; + } + .wea-input-focus { height: 35px !important; width: 100% !important; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/index.less b/pc4mobx/hrmSalary/pages/roleManagement/components/index.less index aaac5a7e..e471d7e0 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/index.less +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/index.less @@ -99,3 +99,22 @@ } } } + +.authDetail_dialog { + .authDetail-dialog-title { + display: flex; + justify-content: space-between; + align-items: center; + } + + .authDetail-table { + background: #f6f6f6; + padding: 8px 16px; + height: 100%; + + .wea-new-table { + background: #FFF; + } + } + +} diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js new file mode 100644 index 00000000..4c59b8bf --- /dev/null +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js @@ -0,0 +1,92 @@ +/* + * 角色详情设置弹窗 + * 成员、数据明细查询 + * @Author: 黎永顺 + * @Date: 2024/9/27 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTable } from "ecCom"; +import * as API from "../../../../apis/taxAgent"; +import "../index.less"; + +const getLabel = WeaLocaleProvider.getLabel; +const APIFOX = { + "auth.MemberTargetTypeEnum": API.authMemberDetail, + "auth.DataTargetTypeEnum": API.authDataDetail +}; + +class DetailDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, + query: { username: "" }, dataSource: [], columns: [] + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getData(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ query: { username: "" } }); + } + + getData = (props) => { + const { pageInfo, query } = this.state, { roleId, selectedKey } = props || this.props; + let payload = { ...pageInfo, ...query, roleId }; + this.setState({ loading: true }); + APIFOX[selectedKey](payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + console.log(data); + } + }); + }; + renderTitle = () => { + const { selectedKey } = this.props, { query } = this.state; + const title = selectedKey === "auth.MemberTargetTypeEnum" ? getLabel(111, "成员明细") : getLabel(111, "数据明细"); + return (
    + {title} + this.setState({ query: { username: v } })} + onSearch={v => this.setState({ pageInfo: { current: 1 } }, () => this.getData())}/> +
    ); + }; + + render() { + const { loading, dataSource, pageInfo, columns } = this.state; + const sheight = this.dialog ? this.dialog.state.height - 16 : 260; + + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.getData()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getData()); + } + }; + + return ( + this.dialog = dom} title={this.renderTitle()} + className="authDetail_dialog" style={{ + width: 784, height: 460, minHeight: 200, minWidth: 380, + maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} buttons={[]}> +
    + +
    +
    + ); + } +} + +export default DetailDialog; diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js index bcacf2ec..4dc8d2c2 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/index.js @@ -24,6 +24,7 @@ import { } from "ecCom"; import { commonEnumList } from "../../../../apis/archive"; import EditRoleDialog from "./editRoleDialog"; +import DetailDialog from "./detailDialog"; import AuthTree from "./authTree"; import * as API from "../../../../apis/taxAgent"; import { Button, Col, message, Modal, Row } from "antd"; @@ -55,6 +56,7 @@ class Index extends Component { replaceDatas: [], loading: { set: false, query: false, async: false, delete: false }, columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, editOperatorDialog: { visible: false, linkOptions: [], record: {} }, + detailDialog: { visible: false, roleId: "", selectedKey: "" }, dataTargetSettings: { link: "OR", sortedIndex: null }, conditions: [], formData: { taxAgentIds: [], sobIds: [] } }; @@ -63,7 +65,11 @@ class Index extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { this.setState({ - name: nextProps.name, selectedKey: nextProps.selectedKey || "baseinfo" + name: nextProps.name, selectedKey: nextProps.selectedKey || "baseinfo", + detailDialog: { + ...this.state.detailDialog, roleId: nextProps.roleId, + selectedKey: nextProps.selectedKey || "baseinfo" + } }, () => { !["auth.AuthTargetTypeEnum", "baseinfo"].includes(this.state.selectedKey) && this.getEnumList(); !["auth.AuthTargetTypeEnum", "baseinfo"].includes(this.state.selectedKey) && this.getSettingRoler(nextProps.roleId); @@ -220,6 +226,7 @@ class Index extends Component { this.setState({ loading: { ...this.state.loading, set: false } }); if (status) { message.success(getLabel(111, "操作成功!")); + this.props.onSearch && this.props.onSearch(); } else { message.error(errormsg); } @@ -253,6 +260,7 @@ class Index extends Component { this.setState({ async: false }); if (status) { message.success(getLabel(111, "操作成功!")); + this.props.onSearch && this.props.onSearch(); } else { message.error(errormsg); } @@ -345,17 +353,19 @@ class Index extends Component { }; render() { - const { roleId, taxAgentStore } = this.props; + const { roleId, taxAgentStore, counts } = this.props; const { selectedKey, name, options, enumType, pageInfo, columns, dataSource, loading, selectedRowKeys, editOperatorDialog, - dataTargetSettings + dataTargetSettings, detailDialog } = this.state; const { linkOptions } = editOperatorDialog; const tabs = [ - { title: getLabel(111, "基础信息"), viewcondition: "baseinfo" }, - { title: getLabel(111, "成员设置"), viewcondition: "auth.MemberTargetTypeEnum" }, - { title: getLabel(111, "功能权限"), viewcondition: "auth.AuthTargetTypeEnum" }, - { title: getLabel(111, "数据范围"), viewcondition: "auth.DataTargetTypeEnum" } + { title: getLabel(111, "基础信息"), viewcondition: "baseinfo", showcount: true, count: "resources" }, + { + title: getLabel(111, "成员设置"), viewcondition: "auth.MemberTargetTypeEnum", showcount: true, count: "members" + }, + { title: getLabel(111, "功能权限"), viewcondition: "auth.AuthTargetTypeEnum", showcount: true, count: "opts" }, + { title: getLabel(111, "数据范围"), viewcondition: "auth.DataTargetTypeEnum", showcount: true, count: "datas" } ]; const pagination = { ...pageInfo, @@ -383,6 +393,11 @@ class Index extends Component { ]; ["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && buttons.shift(); !["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && buttons.pop(); + !["auth.AuthTargetTypeEnum", "baseinfo"].includes(selectedKey) && buttons.unshift( + + ); return (
    - this.setState({ - selectedKey: v, replaceDatas: [], selectedRowKeys: [] + selectedKey: v, replaceDatas: [], selectedRowKeys: [], + detailDialog: { ...detailDialog, selectedKey: v } }, () => { taxAgentStore.roleForm.resetForm(); const { selectedKey } = this.state; @@ -464,6 +480,9 @@ class Index extends Component { onCancel={callback => this.setState({ editOperatorDialog: { ...editOperatorDialog, visible: false, record: {} } }, () => callback && callback())}/> + {/*成员、数据明细查看*/} + this.setState({ detailDialog: { ...detailDialog, visible: false } })}/> } diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.js b/pc4mobx/hrmSalary/pages/roleManagement/index.js index 89f47949..3b419943 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.js @@ -30,8 +30,11 @@ class Index extends Component { this.state = { dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false }, - roleSetDialog: { visible: false, roleId: "", name: "", selectedKey: "" }, - logDialogVisible: false, filterConditions: "", showSearchAd: false, syncLoading: false + logDialogVisible: false, filterConditions: "", showSearchAd: false, syncLoading: false, + roleSetDialog: { + visible: false, roleId: "", name: "", selectedKey: "", + counts: { datas: 0, members: 0, resources: 0, opts: 0 } + } }; } @@ -106,12 +109,30 @@ class Index extends Component { ) }] + }, () => { + const { roleSetDialog, dataSource } = this.state; + roleSetDialog.roleId && this.setState({ + roleSetDialog: { + ...roleSetDialog, counts: { + ...roleSetDialog.counts, ..._.reduce(_.keys(roleSetDialog.counts), (pre, cur) => ({ + ...pre, [cur]: _.find(dataSource, o => o.id === roleSetDialog.roleId)[cur] || 0 + }), {}) + } + } + }); }); } }); }; showRoleSetDialog = (role) => this.setState({ - roleSetDialog: { visible: true, roleId: role.id, name: role.name, selectedKey: role.selectedKey } + roleSetDialog: { + visible: true, roleId: role.id, name: role.name, selectedKey: role.selectedKey, + counts: { + ...this.state.roleSetDialog.counts, ..._.reduce(_.keys(this.state.roleSetDialog.counts), (pre, cur) => ({ + ...pre, [cur]: role[cur] || 0 + }), {}) + } + } }); deleteAuthRole = (payload) => { Modal.confirm({ @@ -204,7 +225,7 @@ class Index extends Component { {/*角色详情设置*/} this.setState({ - roleSetDialog: { ...roleSetDialog, visible: false } + roleSetDialog: { ...roleSetDialog, visible: false, roleId: "" } }, () => { this.props.taxAgentStore.initRoleForm(); callback && callback(); From 8996fa8d796c3aa5acb860799e26269b4527e76c 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, 27 Sep 2024 16:20:28 +0800 Subject: [PATCH 057/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../variableSalary/components/salaryFileList/index.js | 10 ++++++---- pc4mobx/hrmSalary/pages/variableSalary/index.js | 8 ++++---- pc4mobx/hrmSalary/pages/variableSalary/index.less | 9 +++++++++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index f3b0e52a..d68ae568 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -31,7 +31,6 @@ class Index extends Component { componentDidMount() { window.addEventListener("message", this.handleReceive, false); window.addEventListener("resize", this.handleResize, false); - this.getVariableSalaryList(); } componentWillUnmount() { @@ -40,9 +39,12 @@ class Index extends Component { } componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.taxAgentIds !== this.props.taxAgentIds && nextProps.taxAgentIds) { + this.getVariableSalaryList(nextProps); + } if (nextProps.isQuery !== this.props.isQuery) this.setState({ pageInfo: { ...this.state.pageInfo, current: 1 } - }, () => this.getVariableSalaryList()); + }, () => this.getVariableSalaryList(nextProps)); } handleReceive = async ({ data }) => { @@ -67,8 +69,8 @@ class Index extends Component { } } }; - getVariableSalaryList = () => { - const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = this.props; + getVariableSalaryList = (props) => { + const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = props || this.props; const { pageInfo } = this.state; const { departmentIds } = VSalryForm.getFormParams(); this.setState({ loading: true }); diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index 115aa93e..6401465d 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -109,15 +109,15 @@ class Index extends Component { , this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>, + this.setState({ taxAgentIds: val })}/>, this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ] : [ this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>, + this.setState({ taxAgentIds: val })}/>, this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ], diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.less b/pc4mobx/hrmSalary/pages/variableSalary/index.less index b76440d6..ac609fbd 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.less +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.less @@ -1,6 +1,15 @@ .variable_salary_wrapper { .wea-new-top-req-title > div:last-child { right: 16px !important; + + .ant-calendar-range-picker { + min-width: 100px !important; + width: 100px; + } + + .wea-input-focus { + width: 140px; + } } .wea-new-top-req-content { From ce711f9c97127a609beb94a64d23ed8f9a49c9f4 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, 27 Sep 2024 16:45:47 +0800 Subject: [PATCH 058/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/roleDetailSetDialog/detailDialog.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js index 4c59b8bf..dc70c5a3 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js +++ b/pc4mobx/hrmSalary/pages/roleManagement/components/roleDetailSetDialog/detailDialog.js @@ -29,7 +29,9 @@ class DetailDialog extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) this.getData(nextProps); - if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ query: { username: "" } }); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ + query: { username: "" }, pageInfo: { current: 1, pageSize: 10, total: 0 } + }); } getData = (props) => { @@ -39,7 +41,10 @@ class DetailDialog extends Component { APIFOX[selectedKey](payload).then(({ status, data }) => { this.setState({ loading: false }); if (status) { - console.log(data); + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } + }); } }); }; @@ -55,7 +60,7 @@ class DetailDialog extends Component { render() { const { loading, dataSource, pageInfo, columns } = this.state; - const sheight = this.dialog ? this.dialog.state.height - 16 : 260; + const sheight = this.dialog ? this.dialog.state.height - 120 : 260; const pagination = { ...pageInfo, From d4763dc2d2105f3e1ac9cd75425a6bd9e4cb2d59 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, 27 Sep 2024 18:30:31 +0800 Subject: [PATCH 059/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/salaryFileDialog/index.js | 8 ++- .../salaryFileImportDialog/index.js | 22 ++++---- .../components/salaryFileList/index.js | 15 +++-- .../components/salaryItemList/index.js | 9 +-- .../components/searchPannel/index.js | 16 +++++- .../pages/variableSalary/conditions.js | 24 ++++++++ .../hrmSalary/pages/variableSalary/index.js | 56 +++++-------------- .../hrmSalary/pages/variableSalary/index.less | 14 ++--- pc4mobx/hrmSalary/style/index.less | 4 ++ 9 files changed, 90 insertions(+), 78 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index 1635c3a4..8fbde56a 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js @@ -38,8 +38,9 @@ class Index extends Component { } } - initForm = (props) => { - const { baseTableStore: { VSSalaryFileForm }, detail, taxAgentOption } = props; + initForm = async (props) => { + const { baseTableStore: { VSSalaryFileForm }, detail } = props; + const { data: taxAgentOption } = await API.getAdminTaxAgentList(); API.getCreateForm().then(({ data }) => { this.setState({ conditions: [ @@ -48,7 +49,8 @@ class Index extends Component { if (getKey(o) === "taxAgentIds") { return { ...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label), - options: taxAgentOption, value: detail[getKey(o)] || "" + options: _.map(taxAgentOption, o => ({ key: String(o.id), showname: o.name })), + value: detail[getKey(o)] ? String(detail[getKey(o)]) : "" }; } return { diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js index c8917e45..53a96c2b 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js @@ -30,12 +30,13 @@ class Index extends Component { componentWillReceiveProps(nextProps, nextContext) { const { importDialog } = this.state; if (nextProps.visible !== this.props.visible && nextProps.visible) { - const { baseTableStore: { VSalryForm }, salaryMonth, taxAgentIds } = nextProps; - const payload = { - salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: importDialog.hasData - }; + const { baseTableStore: { VSalryForm } } = nextProps; + const payload = { ...VSalryForm.getFormParams(), hasData: importDialog.hasData }; this.setState({ - importDialog: { ...importDialog, salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` } + importDialog: { + ...importDialog, salaryMonth: VSalryForm.getFormParams().salaryMonth, + link: `${importDialog.link}?${convertToUrlString(payload)}` + } }); } else { this.setState({ @@ -48,9 +49,10 @@ class Index extends Component { } handleImport = (payload) => { - const { taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth } = importDialog; + const { taxAgentIds } = VSalryForm.getFormParams(); this.setState({ importDialog: { ...importDialog, nextloading: true } }); API.importVariableSalary({ ...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") @@ -64,14 +66,14 @@ class Index extends Component { }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); }; renderFormComponent = () => { - const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { importDialog } = this.state; const { salaryMonth: month, hasData } = importDialog; return
    { - const payload = { salaryMonth: val, hasData, taxAgentIds, ...VSalryForm.getFormParams() }; + const payload = { ...VSalryForm.getFormParams(), salaryMonth: val, hasData }; this.setState({ importDialog: { ...importDialog, salaryMonth: val, @@ -98,9 +100,9 @@ class Index extends Component { content={getLabel(543208, "导出现有数据")} helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")} onChange={val => { - const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props; + const { baseTableStore: { VSalryForm } } = this.props; const { salaryMonth } = importDialog; - const payload = { salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: val === "1" }; + const payload = { salaryMonth, ...VSalryForm.getFormParams(), hasData: val === "1" }; this.setState({ importDialog: { ...importDialog, hasData: val === "1", diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index d68ae568..12345d68 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -31,6 +31,7 @@ class Index extends Component { componentDidMount() { window.addEventListener("message", this.handleReceive, false); window.addEventListener("resize", this.handleResize, false); + this.getVariableSalaryList(); } componentWillUnmount() { @@ -39,9 +40,6 @@ class Index extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.taxAgentIds !== this.props.taxAgentIds && nextProps.taxAgentIds) { - this.getVariableSalaryList(nextProps); - } if (nextProps.isQuery !== this.props.isQuery) this.setState({ pageInfo: { ...this.state.pageInfo, current: 1 } }, () => this.getVariableSalaryList(nextProps)); @@ -69,14 +67,15 @@ class Index extends Component { } } }; - getVariableSalaryList = (props) => { - const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = props || this.props; + getVariableSalaryList = () => { + const { baseTableStore: { VSalryForm, getVariableSalaryList } } = this.props; const { pageInfo } = this.state; - const { departmentIds } = VSalryForm.getFormParams(); + const { departmentIds, taxAgentIds } = VSalryForm.getFormParams(); this.setState({ loading: true }); getVariableSalaryList({ - ...pageInfo, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(","), - ...VSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [] + ...pageInfo, ...VSalryForm.getFormParams(), + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") }).then(({ status, data }) => { this.setState({ loading: false }); if (status) { diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js index 210df203..737b34de 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js @@ -9,7 +9,7 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTable } from "ecCom"; -import { message, Modal } from "antd"; +import { message, Modal, Spin } from "antd"; import * as API from "../../../../apis/variableSalary"; const getLabel = WeaLocaleProvider.getLabel; @@ -103,9 +103,10 @@ class Index extends Component { }, () => this.getVariableSalaryItemList()); } }; - return ( - + return ( + + ); } } diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js index d5b274a9..9a541fd6 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js @@ -7,9 +7,11 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; import { Button } from "antd"; +import * as API from "../../../../apis/variableSalary"; import { inject, observer } from "mobx-react"; import { getSearchs } from "../../../../util"; import { conditions } from "../../conditions"; +import moment from "moment"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @@ -24,12 +26,19 @@ class VariableSalarySearchPannel extends Component { }; } - componentDidMount() { + async componentDidMount() { + const { data } = await API.getAdminTaxAgentList(); this.setState({ searchConditions: _.map(conditions, item => { return { ...item, items: _.map(item.items, child => { + if (getKey(child) === "taxAgentIds") { + return { + ...child, label: getLabel(child.lanId, child.label), + options: _.map(data, o => ({ key: String(o.id), showname: o.name, selected: true })) + }; + } return { ...child, label: getLabel(child.lanId, child.label) }; }) }; @@ -54,7 +63,10 @@ class VariableSalarySearchPannel extends Component { - + diff --git a/pc4mobx/hrmSalary/pages/variableSalary/conditions.js b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js index 72ff44cf..5e14461a 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/conditions.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js @@ -1,3 +1,5 @@ +import moment from "moment"; + export const conditions = [ { items: [ @@ -22,6 +24,28 @@ export const conditions = [ value: "", viewAttr: 2 }, + { + conditionType: "MONTHPICKER", + domkey: ["salaryMonth"], + fieldcol: 14, + label: "薪资所属月", + lanId: 111, + labelcol: 6, + value: moment(new Date()).format("YYYY-MM"), + viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["taxAgentIds"], + fieldcol: 14, + label: "个税扣缴义务人", + lanId: 111, + labelcol: 6, + value: "", + options: [], + multiple: true, + viewAttr: 2 + }, { browserConditionParam: { completeParams: {}, diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index 6401465d..1902c6cb 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -10,7 +10,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { WeaDatePicker, WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop, WeaSelect } from "ecCom"; +import { WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop } from "ecCom"; import * as API from "../../apis/variableSalary"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SearchPannel from "./components/searchPannel"; @@ -19,7 +19,6 @@ import SalaryFileDialog from "./components/salaryFileDialog"; import SalaryItemList from "./components/salaryItemList"; import SalaryFileList from "./components/salaryFileList"; import SalaryFileImportDialog from "./components/salaryFileImportDialog"; -import moment from "moment"; import { Button } from "antd"; import cs from "classnames"; import "./index.less"; @@ -32,27 +31,13 @@ class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "salaryFile", isQuery: false, showSearchAd: false, taxAgentIds: "", - salaryMonth: moment(new Date()).format("YYYY-MM"), taxAgentOption: [], - SIDialog: { visible: false, title: "", id: "", taxAgentOption: [] }, //薪资项目薪资编辑弹框 - SFDialog: { visible: false, title: "", detail: {}, taxAgentOption: [] }, //薪资档案编辑弹框 + selectedKey: "salaryFile", isQuery: false, showSearchAd: false, + SIDialog: { visible: false, title: "", id: "" }, //薪资项目薪资编辑弹框 + SFDialog: { visible: false, title: "", detail: {} }, //薪资档案编辑弹框 SFImpDialog: { visible: false, title: getLabel(24023, "数据导入") }//薪资档案导入 }; } - componentDidMount() { - API.getAdminTaxAgentList().then(({ status, data }) => { - if (status) { - const taxAgentOption = _.map(data, (o, i) => ({ key: String(o.id), showname: o.name })); - this.setState({ - taxAgentOption, taxAgentIds: _.map(taxAgentOption, o => o.key).join(","), - SIDialog: { ...this.state.SIDialog, taxAgentOption }, - SFDialog: { ...this.state.SFDialog, taxAgentOption } - }); - } - }); - } - handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery }); openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); handleOperate = (type, detail = {}) => { @@ -71,12 +56,12 @@ class Index extends Component { break; case "export": const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), it => it.dataIndex); - const { salaryMonth, taxAgentIds } = this.state; + const { taxAgentIds, departmentIds } = VSalryForm.getFormParams(); const payload = { ...VSalryForm.getFormParams(), taxAgentIds: !_.isEmpty(taxAgentIds) ? taxAgentIds.split(",") : [], - departmentIds: !_.isEmpty(VSalryForm.getFormParams().taxAgentIds) ? VSalryForm.getFormParams().taxAgentIds.split(",") : [], - salaryMonth, columns + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + columns }; WeaLoadingGlobal.start(); const promise = API.exportVariableSalary(payload); @@ -91,10 +76,8 @@ class Index extends Component { }; render() { - const { - selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery, salaryMonth, taxAgentOption, taxAgentIds - } = this.state; - const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm } } = this.props; + const { selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery } = this.state; + const { taxAgentStore: { showOperateBtn }, baseTableStore: { VSSalaryItemForm, VSalryForm } } = this.props; const tabs = [ { title: getLabel(111, "薪资档案"), key: "salaryFile", showDropIcon: true, @@ -107,22 +90,14 @@ class Index extends Component { buttons: showOperateBtn ? [ , , - this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val })}/>, this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ] : [ - this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>, - this.setState({ taxAgentIds: val })}/>, this.openAdvanceSearch()} onAdvanceSearch={this.handleAdvanceSearch}/> ], - children: this.handleOperate("create", data)}/> + children: !_.isEmpty(VSalryForm.getFormParams()) ? this.handleOperate("create", data)}/> : null }, { title: getLabel(111, "薪资项目"), key: "salaryItem", showDropIcon: false, dropMenuDatas: [], @@ -161,11 +136,10 @@ class Index extends Component { SFDialog: { ...SFDialog, visible: false } }, () => callback && callback())}/> {/* 薪资档案导入*/} - { - this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } }, - () => callback && this.handleAdvanceSearch()); - }}/> + { + this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } }, + () => callback && this.handleAdvanceSearch()); + }}/> ); } diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.less b/pc4mobx/hrmSalary/pages/variableSalary/index.less index ac609fbd..f38e90b8 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.less +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.less @@ -1,15 +1,6 @@ .variable_salary_wrapper { .wea-new-top-req-title > div:last-child { right: 16px !important; - - .ant-calendar-range-picker { - min-width: 100px !important; - width: 100px; - } - - .wea-input-focus { - width: 140px; - } } .wea-new-top-req-content { @@ -40,7 +31,7 @@ } .wea-advanced-searchsAd { - height: 108px; + height: 155px; overflow: hidden auto; .formItem-delete { @@ -66,6 +57,9 @@ } } + .wea-form-item-wrapper { + display: block !important; + } } } diff --git a/pc4mobx/hrmSalary/style/index.less b/pc4mobx/hrmSalary/style/index.less index 5f2c76d6..02955b0b 100644 --- a/pc4mobx/hrmSalary/style/index.less +++ b/pc4mobx/hrmSalary/style/index.less @@ -39,6 +39,10 @@ .form-dialog-layout { background: #f6f6f6; + .wea-form-item .wea-form-item-wrapper .wea-field-readonly { + line-height: 28px; + } + .wea-search-group { padding: 16px; } From 198668654ad9b638b26a9f0ffd06c609a46fd550 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, 27 Sep 2024 18:38:37 +0800 Subject: [PATCH 060/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/variableSalary/components/salaryFileDialog/index.js | 3 ++- .../pages/variableSalary/components/searchPannel/index.js | 4 ++-- pc4mobx/hrmSalary/pages/variableSalary/index.js | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index 8fbde56a..8c7a5fea 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js @@ -14,6 +14,7 @@ import { Button, message } from "antd"; import { getSearchs } from "../../../../util"; import { salaryFileConditions } from "../../conditions"; import * as API from "../../../../apis/variableSalary"; +import { postFetch } from "../../../../util/request"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -40,7 +41,7 @@ class Index extends Component { initForm = async (props) => { const { baseTableStore: { VSSalaryFileForm }, detail } = props; - const { data: taxAgentOption } = await API.getAdminTaxAgentList(); + const { data: taxAgentOption } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); API.getCreateForm().then(({ data }) => { this.setState({ conditions: [ diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js index 9a541fd6..4f68f6c0 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js @@ -7,7 +7,7 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; import { Button } from "antd"; -import * as API from "../../../../apis/variableSalary"; +import { postFetch } from "../../../../util/request"; import { inject, observer } from "mobx-react"; import { getSearchs } from "../../../../util"; import { conditions } from "../../conditions"; @@ -27,7 +27,7 @@ class VariableSalarySearchPannel extends Component { } async componentDidMount() { - const { data } = await API.getAdminTaxAgentList(); + const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }); this.setState({ searchConditions: _.map(conditions, item => { return { diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index 61b402ac..2ea8e816 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -19,7 +19,6 @@ import SalaryFileDialog from "./components/salaryFileDialog"; import SalaryItemList from "./components/salaryItemList"; import SalaryFileList from "./components/salaryFileList"; import SalaryFileImportDialog from "./components/salaryFileImportDialog"; -import { postFetch } from "../../util/request"; import { Button } from "antd"; import cs from "classnames"; import "./index.less"; From d73372e5c4bee0ade5ea541290c15760e2890a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 8 Oct 2024 10:07:23 +0800 Subject: [PATCH 061/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/roleManagement/index.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/roleManagement/index.less b/pc4mobx/hrmSalary/pages/roleManagement/index.less index e911681c..8de15ad5 100644 --- a/pc4mobx/hrmSalary/pages/roleManagement/index.less +++ b/pc4mobx/hrmSalary/pages/roleManagement/index.less @@ -2,7 +2,7 @@ .rolemanagement-content { height: 100%; overflow-y: auto; - padding: 16px 16px 0; + padding: 8px 16px 0; background: rgb(246, 246, 246); .wea-new-table { From f6789a0ea8d3e36ef8df1c4c80f27474a4b81731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 8 Oct 2024 14:08:16 +0800 Subject: [PATCH 062/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 2 +- .../pages/salary/components/baseSettings.js | 48 +++ .../pages/salary/components/comHint.js | 42 +++ .../pages/salary/components/constants.js | 294 +++++++++++++++ .../pages/salary/components/index.less | 135 +++++++ .../pages/salary/components/personalScope.js | 272 ++++++++++++++ .../salary/components/personalScopeModal.js | 191 ++++++++++ .../salary/components/personalScopeTable.js | 137 +++++++ .../pages/salary/components/taxAgentSlide.js | 342 ++++++++++++++++++ .../pages/salary/components/taxAgentTable.js | 137 +++++++ .../salary/components/taxDeclarationInfo.js | 146 ++++++++ .../salary/components/taxFillingInfoDialog.js | 132 +++++++ pc4mobx/hrmSalary/pages/salary/index.less | 43 +++ pc4mobx/hrmSalary/pages/salary/taxAgent.js | 254 +++++++++++++ 14 files changed, 2174 insertions(+), 1 deletion(-) create mode 100644 pc4mobx/hrmSalary/pages/salary/components/baseSettings.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/comHint.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/constants.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/index.less create mode 100644 pc4mobx/hrmSalary/pages/salary/components/personalScope.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js create mode 100644 pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js create mode 100644 pc4mobx/hrmSalary/pages/salary/index.less create mode 100644 pc4mobx/hrmSalary/pages/salary/taxAgent.js diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 7b5cf863..96d4af12 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -28,7 +28,7 @@ import PayrollDetail from "./pages/payroll/payrollDetail/payrollDetail"; // import Declare from "./pages/declare"; import Declare from "./pages/declare/declare"; //重构的个税申报表 import TaxRate from "./pages/taxRate"; -import TaxAgent from "./pages/taxAgent"; +import TaxAgent from "./pages/salary/taxAgent"; import CalculateDetail from "./pages/calculateDetail"; import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail"; import CompareDetail from "./pages/calculateDetail/compareDetail"; diff --git a/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js b/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js new file mode 100644 index 00000000..5e24cb5c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js @@ -0,0 +1,48 @@ +/* + * Author: 黎永顺 + * name: 基础设置 + * Description: + * Date: 2022/11/29 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions"; +import { getSearchs } from "../../../util"; + +@inject("taxAgentStore") +@observer +class BaseSettings extends Component { + + componentDidMount() { + + } + + render() { + const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = this.props; + return ( +
    + { + decentralization === "0" ? + getSearchs(salarytaxAgentForm, convertConditon(decentralizationConditions, !isChief), 1, false) : + getSearchs(salarytaxAgentForm, convertConditon(editConditions, !isChief), 1, false) + } +
    + ); + } +} + +export default BaseSettings; + +export const convertConditon = (condition, bool) => { + return _.map(condition, item => { + return { + ...item, + items: _.map(item.items, child => { + return { + ...child, + viewAttr: bool ? 1 : child.viewAttr + }; + }) + }; + }); +}; diff --git a/pc4mobx/hrmSalary/pages/salary/components/comHint.js b/pc4mobx/hrmSalary/pages/salary/components/comHint.js new file mode 100644 index 00000000..da3f5fb0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/comHint.js @@ -0,0 +1,42 @@ +/* + * Author: 黎永顺 + * name: 个税扣缴义务人小提示组件 + * Description: + * Date: 2022/11/22 + */ +import React, { Component } from "react"; +import "./index.less"; + +class ComHint extends Component { + /* + * Author: 黎永顺 + * Description: 提示语注释 + * Params: isChief=总管理员 + * Date: 2022/11/22 + */ + renderTips = () => { + const { isChief = true } = this.props; + if (isChief) { + return [ +

    1、个税扣缴义务人与档案中的个税扣缴义务人匹配,修改个税扣缴义务人名称,薪资档案的个税扣缴义务人数据同步更新;

    , +

    2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人,否则不予删除;

    , +

    3、开启分权,需维护个税扣缴义务人的管理员;当前总管理员默认有管理员的权限;

    + ]; + } else { + return []; + } + }; + + render() { + return ( +
    +
    小提示
    +
    + {this.renderTips()} +
    +
    + ); + } +} + +export default ComHint; diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js new file mode 100644 index 00000000..8682937c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -0,0 +1,294 @@ +export const fieldList = [ + { + key: "name", + label: "名称", + lanId: 33439, + type: "TEXT", + viewAttr: 1 + }, + { + key: "taxCode", + label: "税号", + lanId: 111, + type: "TEXT", + viewAttr: 3 + }, + { + key: "city", + label: "报税所属区域", + lanId: 111, + type: "SELECT", + viewAttr: 3 + }, + { + key: "areaCode", + label: "行政区划代码", + lanId: 111, + type: "TEXT", + viewAttr: 3 + }, + { + key: "passwordType", + label: "密码校验类型", + lanId: 111, + type: "RADIO", + viewAttr: 3, + options: [ + { + key: "TAX_NET_PASSWORD", + showname: "个税网报密码", + lanId: 111 + }, + { + key: "REAL_NAME_PASSWORD", + showname: "实名账号密码", + lanId: 111 + } + ] + }, + { + key: "account", + label: "实名账号", + lanId: 111, + type: "TEXT", + viewAttr: 3 + }, + { + key: "realNamePassword", + label: "实名账号密码", + lanId: 111, + type: "PASSWORD", + viewAttr: 3 + }, + { + key: "netPassword", + label: "个税网报密码", + lanId: 111, + type: "PASSWORD", + viewAttr: 3 + }, + { + key: "taxRegistrationNumber", + label: "登记序号", + type: "TEXT", + lanId: 111, + viewAttr: 1 + }, + { + key: "departmentCode", + label: "部门编码", + lanId: 111, + type: "TEXT", + viewAttr: 1 + }, + { + key: "checkStatus", + label: "报税信息验证状态", + lanId: 111, + type: "TEXT", + viewAttr: 1 + } +]; + +export const taxFillCondition = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxAgentName"], + fieldcol: 14, + label: "个税扣缴义务人", + lanId: 537996, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxRegistrationNumber"], + fieldcol: 14, + label: "登记序号", + lanId: 545138, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxpayerStatus"], + fieldcol: 14, + label: "纳税人状态", + lanId: 545139, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["legalPersonName"], + fieldcol: 14, + label: "法人姓名", + lanId: 545140, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["mobile"], + fieldcol: 14, + label: "联系电话", + lanId: 545141, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["businessAddress"], + fieldcol: 14, + label: "生产经营地址", + lanId: 545142, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["industryName"], + fieldcol: 14, + label: "行业名称", + lanId: 545143, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxAuthorities"], + fieldcol: 14, + label: "主管税务机关", + lanId: 545144, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxBranch"], + fieldcol: 14, + label: "主管税务科所", + lanId: 545145, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["divideFiling"], + fieldcol: 14, + label: "是否分部门备案", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + } + ], + defaultshow: true + } +]; +export const deptFillCondition = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["departmentName"], + fieldcol: 14, + label: "部门名称", + lanId: 536641, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["departmentCode"], + fieldcol: 14, + label: "部门编码", + lanId: 111, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true + } +]; + +export const taxFillColumns = [ + { + dataIndex: "taxCode", + title: "税号", + titleId: "", + fixed: "left" + }, + { + dataIndex: "taxAgentName", + title: "个税扣缴义务人", + titleId: "537996" + }, + { + dataIndex: "taxRegistrationNumber", + title: "登记序号", + titleId: "545138" + }, + { + dataIndex: "taxpayerStatus", + title: "纳税人状态", + titleId: "545139" + }, + { + dataIndex: "taxAuthorities", + title: "主管税务机关", + titleId: "545144" + }, + { + dataIndex: "taxBranch", + title: "主管税务科所", + titleId: "545145" + }, + { + dataIndex: "businessAddress", + title: "生产经营地址", + titleId: "545142" + }, + { + dataIndex: "industryName", + title: "行业名称", + titleId: "545143" + }, + { + dataIndex: "legalPersonName", + title: "法人姓名", + titleId: "545140" + }, + { + dataIndex: "mobile", + title: "联系电话", + titleId: "545141" + } +]; diff --git a/pc4mobx/hrmSalary/pages/salary/components/index.less b/pc4mobx/hrmSalary/pages/salary/components/index.less new file mode 100644 index 00000000..be539899 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/index.less @@ -0,0 +1,135 @@ +.taxAgentSlideContent { + .baseSettingWrapper, .taxDeclarationInfoWrapper { + padding: 12px 12px 12px 20px; + + .wea-search-group { + padding: 0; + border: 1px solid #e5e5e5; + border-bottom: none; + + .wea-content { + padding: 0; + + .wea-form-cell, .wea-form-item { + border-bottom: 1px solid #e5e5e5; + padding: 5px 10px 5px 30px; + + .wea-form-item { + padding: 0 !important; + border-bottom: none !important; + } + } + } + } + } +} + +.comHint { + width: 100%; + margin: 16px 0; + border: 1px solid #e5e5e5; + + .hintHeader { + background: #f6f6f6; + height: 40px; + border-bottom: 1px solid #e5e5e5; + padding-left: 16px; + line-height: 40px; + } + + .hintTips { + width: 100%; + color: #999; + line-height: 20px; + padding: 0 16px; + display: inline-block; + + p { + margin: 1rem 0; + } + } +} + +.slideOuterWrapper { + .wea-slide-modal-title { + height: initial; + line-height: initial; + text-align: left; + } + + .rodal-close { + z-index: 99; + top: 10px !important; + } + +} + +@media (min-width: 1260px) { + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: 100% !important; + } + } +} + +@media screen and (min-width: 1060px) and (max-width: 1260px) { + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: calc(100% - 96px) !important; + } + } +} + +//添加关联人员弹框中的下拉框样式 +.personalScopeModalWrapper { + .wea-select, .ant-select-selection, .ant-select { + width: 100%; + } + + .wea-select { + display: inline-block; + position: relative; + } + + .ant-select-selection { + height: 30px; + border-radius: 0; + } +} + +.taxfillingDialog { + .ant-modal-title { + .text-elli { + color: #111; + font-weight: 700; + } + } + + .taxfillingDialogContent { + height: 100%; + padding: 16px; + background: #f6f6f6; + overflow-y: auto; + + .wea-search-group { + padding: 0; + background: #FFF; + border: 1px solid #e5e5e5; + border-bottom: 0; + + .ant-row, .wea-form-cell { + padding: 0; + } + + .wea-form-item { + padding: 5px 16px; + border-bottom: 1px solid #e5e5e5; + } + } + + .wea-new-table { + background: #FFF; + } + + } +} diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js new file mode 100644 index 00000000..66070632 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -0,0 +1,272 @@ +/* + * Author: 黎永顺 + * name: 人员范围 + * Description: + * Date: 2022/11/30 + */ +import React, { Component } from "react"; +import { Button, message, Modal } from "antd"; +import { inject, observer } from "mobx-react"; +import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom"; +import { + taxAgentRangeDelete, + taxAgentRangeExtDelete, + taxAgentRangeExtSave, + taxAgentRangeImportData, + taxAgentRangePreview +} from "../../../apis/taxAgent"; +import { sysinfo } from "../../../apis/ruleconfig"; +import PersonalScopeTable from "./personalScopeTable"; +import PersonalScopeModal from "./personalScopeModal"; +import ImportModal from "../../../components/importModal"; +import ExternalPersonModal from "../../../components/externalPersonModal"; +import { importEmployColumns } from "../../taxAgent/columns"; + +@inject("taxAgentStore") +@observer +class PersonalScope extends Component { + constructor(props) { + super(props); + this.state = { + searchValue: "", selectedKey: "listInclude", + rowKeys: [], personalAddModal: { + visible: false, externalVisible: false, + title: "关联人员", includeType: "" + }, + previewDataSource: [], importParams: { + visible: false, + step: 0, + importResult: {} + }, extEmpsWitch: "1", //非系统人员开关, 1: 开启, 0:关闭 + loading: false + }; + this.personalScopeTableRef = null; + } + + componentDidMount() { + const { taxAgentStore: { hasIconInTax } } = this.props; + hasIconInTax(); + this.getSysinfo(); + } + + /* + * Author: 黎永顺 + * Description:非系统人员开关查询 + * Params: + * Date: 2023/11/9 + */ + getSysinfo = () => { + sysinfo().then(({ status, data }) => { + if (status) this.setState({ extEmpsWitch: data.extEmpsWitch }); + }); + }; + /* + * Author: 黎永顺 + * Description: 删除人员范围 + * Params: + * Date: 2022/11/30 + */ + taxAgentRangeDelete = () => { + Modal.confirm({ + title: "信息确认", + content: "确认要删除吗?", + onOk: () => { + const { selectedKey } = this.state; + const API = selectedKey === "listExt" ? taxAgentRangeExtDelete : taxAgentRangeDelete; + API(this.state.rowKeys).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.setState({ rowKeys: [] }, () => { + this.personalScopeTableRef.clearRowkeys(); + }); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + }; + /* + * Author: 黎永顺 + * Description:新增人员范围 + * Params: + * Date: 2022/11/30 + */ + handleAddPersonal = () => { + const { personalAddModal, selectedKey } = this.state; + this.setState({ + personalAddModal: { + ...personalAddModal, + visible: selectedKey !== "listExt", + externalVisible: selectedKey === "listExt", + includeType: selectedKey === "listInclude" ? 1 : 0 + } + }); + }; + salaryArchivePreview = (params) => { + taxAgentRangePreview(params).then(({ status, data }) => { + if (status) { + const { preview } = data; + this.setState({ + previewDataSource: preview + }); + } + }); + }; + handleImportFile = (params) => { + const { taxAgentId } = this.props; + taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, data }) => { + if (status) { + this.setState({ + importParams: { + ...this.state.importParams, + importResult: data + } + }); + } + }); + }; + /* + * Author: 黎永顺 + * Description: 保存非系统人员 + * Params: + * Date: 2023/11/9 + */ + handleSaveExtPersons = (payload = {}) => { + const { taxAgentId } = this.props; + const { personalAddModal } = this.state; + this.setState({ loading: false }); + taxAgentRangeExtSave({ taxAgentId, ...payload }).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("新增成功"); + this.setState({ + personalAddModal: { + ...personalAddModal, + externalVisible: false + } + }, () => this.personalScopeTableRef.getPersonalScopeList()); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { + selectedKey, searchValue, rowKeys, personalAddModal, + importParams, previewDataSource, extEmpsWitch, loading + } = this.state; + const { taxAgentStore: { hideIconInTax, showSalaryItemBtn }, taxAgentId } = this.props; + const topTab = [ + { + title: "管理范围", + viewcondition: "listInclude" + }, + { + title: "从范围中排除", + viewcondition: "listExclude" + }, + { + title: "非系统人员范围", + viewcondition: "listExt" + } + ]; + const btns = (hideIconInTax || showSalaryItemBtn) ? [ + , + , + , + this.setState({ searchValue })} + placeholder="请输入对象" + onSearch={() => this.personalScopeTableRef.getPersonalScopeList()} + /> + ] : [ this.setState({ searchValue })} + placeholder="请输入对象" + onSearch={() => this.personalScopeTableRef.getPersonalScopeList()} + />]; + (selectedKey === "listExclude" || selectedKey === "listExt") && btns.shift(); + return ( +
    + this.setState({ selectedKey })} + /> + this.personalScopeTableRef = dom} + taxAgentId={taxAgentId} + tabActive={selectedKey} + searchValue={searchValue} + onChangeSelectKey={rowKeys => this.setState({ rowKeys })} + /> + {/*非系统人员添加*/} + this.setState({ personalAddModal: { ...personalAddModal, externalVisible: false } })} + onExternalPersonSave={this.handleSaveExtPersons} + /> + this.personalScopeTableRef.getPersonalScopeList()} + onCancel={() => + this.setState({ + personalAddModal: { + ...personalAddModal, + visible: false, + includeType: "" + } + }) + } + /> + {importParams.visible && ( + { + this.setState({ importParams: { ...this.state.importParams, step } }); + }} + importResult={importParams.importResult} + onFinish={() => { + this.setState({ + importParams: { + ...this.state.importParams, + visible: false + } + }, () => this.personalScopeTableRef.getPersonalScopeList()); + }} + previewImport={(params) => this.salaryArchivePreview(params)} + importFile={(params) => this.handleImportFile(params)} + templateLink={`/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${taxAgentId}`} + visiable={importParams.visible} + onCancel={() => { + this.setState({ importParams: { ...this.state.importParams, visible: false } }); + }} + /> + )} +
    + ); + } +} + +export default PersonalScope; diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js new file mode 100644 index 00000000..9e4c09af --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -0,0 +1,191 @@ +/* + * Author: 黎永顺 + * name: 新增人员范围弹框 + * Description: + * Date: 2022/11/30 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; +import { Button, message, Modal } from "antd"; +import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; +import { SelectWithAll } from "../../socialSecurityBenefits/standingBookDetail/components/regAddEmployee"; +import "./index.less"; + +class PersonalScopeModal extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + employeeStatus: [], + targetTypeList: [], + targetType: "EMPLOYEE", + targetTypeIds: "", + targetTypeIdsNames: "", + status: "", + statusAll: "" + }; + } + + componentDidMount() { + this.getTaxAgentRangeForm(); + } + + getTaxAgentRangeForm = () => { + getTaxAgentRangeForm().then(({ status, data }) => { + 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 })) + }); + } + }); + }; + taxAgentRangeSave = () => { + const { status, targetTypeIds, targetType } = this.state; + const { includeType, taxAgentId, onSuccess, onCancel } = this.props; + if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = { + employeeStatus: status.split(","), + includeType, + targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), + taxAgentId + }; + this.setState({ loading: true }); + taxAgentRangeSave(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("保存成功"); + this.handleReset(); + onSuccess(); + onCancel(); + } else { + message.error(errormsg || "保存失败"); + } + }).catch(() => this.setState({ loading: true })); + }; + renderBrowser = () => { + const { targetType, targetTypeIds, targetTypeIdsNames } = this.state; + let browserType = {}; + switch (targetType) { + case "EMPLOYEE": + browserType = { ...browserType, type: 17, title: "人员选择" }; + break; + case "DEPT": + browserType = { ...browserType, type: 57, title: "部门选择" }; + break; + case "SUBCOMPANY": + browserType = { ...browserType, type: 164, title: "分部选择" }; + break; + case "POSITION": + browserType = { ...browserType, type: 278, title: "岗位选择" }; + break; + default: + break; + } + return { + this.setState({ targetTypeIds, targetTypeIdsNames }); + }} + />; + }; + handleReset = () => { + this.setState({ + targetType: "EMPLOYEE", + targetTypeIds: "", + status: "", + statusAll: "" + }); + }; + + render() { + const { onCancel, title, visible } = this.props; + const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state; + const buttons = [ + , + + ]; + return ( + { + this.handleReset(); + onCancel(); + }} + > + + +
    + this.setState({ targetType })} + /> + {this.renderBrowser()} +
    +
    + { + SelectWithAll({ + label: "选择员工状态", + options: employeeStatus, + detailtype: 2, + valueAll: statusAll, + value: status, + onChangeAll: ({ selected }) => { + if (selected) { + this.setState({ + status: _.map(employeeStatus, it => it.key).join(","), + statusAll: selected + }); + } else { + this.setState({ + status: "", + statusAll: selected + }); + } + }, + onChange: ({ selected }) => { + const bool = _.every(_.map(employeeStatus, it => it.key), item => selected.split(",").includes(item)); + if (bool) { + this.setState({ + status: selected, + statusAll: "0" + }); + } else { + this.setState({ + status: selected, + statusAll: "" + }); + } + } + }) + } +
    +
    + ); + } +} + +export default PersonalScopeModal; diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js new file mode 100644 index 00000000..59a6007b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js @@ -0,0 +1,137 @@ +/* + * Author: 黎永顺 + * name: 人员范围列表数据 + * Description: + * Date: 2022/11/30 + */ +import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import { getTaxAgentRangeListExclude, getTaxAgentRangeListInclude, taxAgentRangelistExt } from "../../../apis/taxAgent"; +import "./index.less"; +import { calcPageNo } from "../../../util"; + +const APIFox = { + listInclude: getTaxAgentRangeListInclude, + listExclude: getTaxAgentRangeListExclude, + listExt: taxAgentRangelistExt +}; + +class PersonalScopeTable extends Component { + constructor(props) { + super(props); + this.state = { + loading: { + query: false + }, + dataSource: [], + columns: [], + selectedRowKeys: [], + pageInfo: { + current: 1, + pageSize: 10, + total: 0 + } + }; + } + + componentDidMount() { + this.getPersonalScopeList(); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.tabActive !== this.props.tabActive) { + this.setState({ selectedRowKeys: [] }, () => { + this.getPersonalScopeList(nextProps.tabActive); + nextProps.onChangeSelectKey([]); + }); + } + } + + getPersonalScopeList = (tabActive = this.props.tabActive) => { + const { searchValue, taxAgentId } = this.props; + const { pageInfo, loading } = this.state; + const payload = { + taxAgentId, + targetName: searchValue, + ...pageInfo + }; + this.setState({ loading: { ...loading, query: true } }); + APIFox[tabActive](payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { pageNum: current, pageSize, total, columns, list: dataSource } = data; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + dataSource, + columns: _.map(columns, item => { + return { + ...item, + render: (text) => { + return {text}; + } + }; + }) + }); + } + }).catch(() => { + this.setState({ loading: { ...loading, query: false } }); + }); + }; + + /* + * Author: 黎永顺 + * Description: 清空选中项 + * Params: + * Date: 2022/11/30 + */ + clearRowkeys = () => { + const { pageInfo, selectedRowKeys } = this.state; + this.setState({ + selectedRowKeys: [], + pageInfo: { + ...pageInfo, + current: calcPageNo(pageInfo.total, pageInfo.current, 10, selectedRowKeys.length) + } + }, () => { + this.getPersonalScopeList(); + }); + }; + + render() { + const { dataSource, columns, pageInfo, loading, selectedRowKeys } = this.state; + const { onChangeSelectKey } = this.props; + const pagination = { + ...pageInfo, + showTotal: total => `共 ${total} 条`, + showQuickJumper: true, + pageSizeOptions: ["10", "20", "50", "100"], + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + this.getPersonalScopeList(); + }); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: (selectedRowKeys) => { + this.setState({ selectedRowKeys }, () => { + onChangeSelectKey(this.state.selectedRowKeys); + }); + } + }; + return ( + + ); + } +} + +export default PersonalScopeTable; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js new file mode 100644 index 00000000..97ebff1e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -0,0 +1,342 @@ +/* + * Author: 黎永顺 + * name: 新增/编辑个税扣缴义务人 + * Description: + * Date: 2022/11/29 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button, message, Modal } from "antd"; +import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom"; +import SlideModalTitle from "../../../components/slideModalTitle"; +import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions"; +import BaseSettings, { convertConditon } from "./baseSettings"; +import PersonalScope from "./personalScope"; +import TaxDeclarationInfo from "./taxDeclarationInfo"; +import TaxFilingInfoDialofg from "./taxFillingInfoDialog"; +import * as API from "../../../apis/taxAgent"; +import { registrationCheck } from "../../../apis/taxAgent"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; +const Step = WeaSteps.Step; + +@inject("taxAgentStore") +@observer +class TaxAgentSlide extends Component { + constructor(props) { + super(props); + this.state = { + current: 0, loading: false, verifyLoading: false, taxAgentId: "", + taxFilingInfoDialofg: { + visible: false, title: "", checkPayload: {}, + isEdit: false, jumpAll: false, loading: false, + taxAgentTaxReturnCheckFormDTO: null + } + }; + this.taxInfoRef = null; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible || nextProps.decentralization !== this.props.decentralization) { + const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = nextProps; + decentralization === "0" ? + salarytaxAgentForm.setCondition(convertConditon(decentralizationConditions, !isChief), true) : + salarytaxAgentForm.setCondition(convertConditon(editConditions, !isChief), true); + this.setState({ current: nextProps.current, taxAgentId: nextProps.taxAgentId }, () => { + if (this.state.taxAgentId) this.getTaxAgentForm(); + }); + } + } + + getTaxAgentForm = () => { + const { taxAgentId } = this.state; + const { taxAgentStore: { salarytaxAgentForm } } = this.props; + API.getTaxAgentForm({ id: taxAgentId }).then(({ status, data }) => { + if (status) { + const { name, description, adminUserIds, sortedIndex } = data; + salarytaxAgentForm.updateFields({ + name: { value: name }, + adminUserIds: { + value: _.map(adminUserIds, it => it.id.toString()).join(","), + valueSpan: _.map(adminUserIds, it => it.content).join(",") + }, + sortedIndex: { value: sortedIndex }, + description: { value: description } + }); + } + }); + }; + /* + * Author: 黎永顺 + * Description: 保存个税扣缴义务人 + * Params: + * Date: 2022/12/1 + */ + saveTaxAgent = (payload) => { + const { onOk, salaryOn } = this.props; + const { current } = this.state; + this.setState({ loading: true }); + API.saveTaxAgent(payload).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(22619, "保存成功")); + this.setState({ + current: !salaryOn ? current + 2 : current + 1, + taxAgentId: data + }, () => onOk()); + } else { + message.error(errormsg || getLabel(22620, "保存失败")); + } + }).catch(() => this.setState({ loading: false })); + }; + /* + * Author: 黎永顺 + * Description: 编辑个税扣缴义务人 + * Params: + * Date: 2022/12/1 + */ + updateTaxAgent = (payload) => { + const { onCancel } = this.props; + this.setState({ loading: true }); + API.updateTaxAgent(payload).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(31439, "更新成功")); + onCancel(true); + } else { + message.error(errormsg || getLabel(31825, "更新失败")); + } + }).catch(() => this.setState({ loading: false })); + }; + + handleSave = () => { + const { taxAgentStore: { salarytaxAgentForm } } = this.props; + const { taxAgentId } = this.state; + salarytaxAgentForm.validateForm().then((f) => { + if (f.isValid) { + const formData = salarytaxAgentForm.getFormParams(); + const payload = { + ...formData, + adminUserIds: formData.adminUserIds ? formData.adminUserIds.split(",") : [] + }; + taxAgentId ? this.updateTaxAgent({ ...payload, id: taxAgentId }) : this.saveTaxAgent(payload); + } else { + f.showErrors(); + } + }); + }; + handleSaveAndVerify = (jumpAll = false) => { + const { isEdit } = this.props, { taxAgentId, taxFilingInfoDialofg } = this.state; + const { fieldForm, fieldItem } = this.taxInfoRef.state; + const { city: cityStr, cityVal = [], netPassword, realNamePassword, ...extra } = fieldForm; + const boolean = _.every(_.filter(fieldItem, item => item.viewAttr === 3), it => fieldForm[it.key]); + if (!boolean) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } + const [nation, province, city] = cityStr ? cityStr.split("-") : []; + const proBool = _.every(cityStr ? cityStr.split("-") : [], it => it !== "undefined"); + if (!proBool) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "请展开选择报税所属区域!") + }); + return; + } + // requestType: 1:保存并验证 2:保存 + const payload = { + ...extra, nation, province, city, + taxAgentId, requestType: 1, password: netPassword || realNamePassword, + cityname: !_.isEmpty(cityVal) ? _.head(cityVal).name : "" + }; + this.setState({ verifyLoading: true }); + API.saveAndCheck(_.omitBy(payload, val => _.isNil(val))).then(({ status, data, errormsg }) => { + this.setState({ verifyLoading: false }); + if (status) { + message.success(getLabel(22619, "保存成功!")); + this.setState({ + taxFilingInfoDialofg: { + ...taxFilingInfoDialofg, visible: true, + isEdit, jumpAll, title: fieldForm.name, checkPayload: payload, + taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO || data.table.list + } + }); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }).catch(() => this.setState({ verifyLoading: false })); + }; + renderChildren = () => { + const { current, taxAgentId } = this.state; + const { decentralization, isChief } = this.props; + let CurrentDom = null; + switch (current) { + case 0: + CurrentDom = ; + break; + case 1: + CurrentDom = this.taxInfoRef = dom} taxAgentId={taxAgentId} isChief={isChief}/>; + break; + case 2: + CurrentDom = ; + break; + default: + CurrentDom = null; + break; + } + return CurrentDom; + }; + renderCustomOperate = () => { + const { isChief, isEdit, salaryOn } = this.props; + const { current, loading, verifyLoading } = this.state; + let CurrentDom = []; + //总管理员权限 + if (isChief) { + switch (current) { + case 0: + CurrentDom = [ + + ]; + break; + case 1: + const tmpV = []; + const tmpJ = [ + , + + ]; + CurrentDom = isEdit ? tmpV : [...tmpV, ...tmpJ]; + break; + case 2: + CurrentDom = (!isEdit && salaryOn) ? + [] + : []; + break; + default: + break; + } + } + return CurrentDom; + }; + handleChangeSlideTab = (current) => { + this.setState({ current: Number(current) }); + }; + + handleSubmit = (selectKey) => { + const { taxFilingInfoDialofg, taxAgentId } = this.state; + const { fieldForm } = this.taxInfoRef.state; + const { city: cityStr, cityVal = [], netPassword, realNamePassword, ...extra } = fieldForm; + const [nation, province, city] = cityStr ? cityStr.split("-") : []; + const { taxAgentTaxReturnCheckFormDTO } = taxFilingInfoDialofg; + this.setState({ + taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: true } + }); + registrationCheck({ + ...extra, nation, province, city, + taxAgentId, password: netPassword || realNamePassword, + cityname: !_.isEmpty(cityVal) ? _.head(cityVal).name : "", + ..._.find(taxAgentTaxReturnCheckFormDTO, it => it.index === selectKey) + }).then(({ status, data, errormsg }) => { + this.setState({ + taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: false } + }); + if (status) { + message.success(getLabel(22619, "保存成功!")); + this.setState({ + taxFilingInfoDialofg: { + ...taxFilingInfoDialofg, + taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO + } + }); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }).catch(() => { + this.setState({ + taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: false } + }); + }); + }; + + render() { + const tabs = [ + { key: 0, title: getLabel(82751, "基础设置") }, + { key: 1, title: getLabel(544342, "报税信息") }, + { key: 2, title: getLabel(124810, "人员范围") } + ]; + const { isEdit, title, visible, onCancel, salaryOn, taxAgentStore: { showOperateBtn } } = this.props; + const { current, taxAgentId, taxFilingInfoDialofg } = this.state; + const tabData = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs; + return ( + { + }} + selectedTab={current} + customOperate={this.renderCustomOperate()} + subItemChange={this.handleChangeSlideTab} + /> + } + content={ +
    + { + !isEdit && + + { + _.map(tabData, item => { + const { key, title } = item; + return ; + }) + } + + } + { + this.renderChildren() + } + { + const { jumpAll } = taxFilingInfoDialofg; + this.setState({ + current: jumpAll ? this.state.current + 1 : this.state.current, + taxFilingInfoDialofg: { + ...taxFilingInfoDialofg, visible: false, + taxAgentTaxReturnCheckFormDTO: null + } + }, () => { + isRefresh && this.taxInfoRef.taxReturnGetForm(); + jumpAll && this.props.onCancel(true); + }); + }} + /> +
    + } + onClose={() => onCancel()} + /> + ); + } +} + +export default TaxAgentSlide; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js new file mode 100644 index 00000000..c21d1d41 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js @@ -0,0 +1,137 @@ +/* + * Author: 黎永顺 + * name: 个税扣缴义务人列表 + * Description: + * Date: 2022/11/29 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { Dropdown, Menu } from "antd"; +import * as API from "../../../apis/taxAgent"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +class TaxAgentTable extends Component { + constructor(props) { + super(props); + this.state = { + loading: { + query: false + }, + dataSource: [], + columns: [], + pageInfo: { + current: 1, + pageSize: 10, + total: 0 + } + }; + } + + componentDidMount() { + this.getTaxAgentList(); + } + + getTaxAgentList = () => { + const { pageInfo, loading } = this.state; + const { searchValue, onOperate } = this.props; + const payload = { + name: searchValue, + ...pageInfo + }; + this.setState({ loading: { ...loading, query: true } }); + API.getTaxAgentList(payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { pageNum: current, pageSize, total, columns, list: dataSource } = data; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + dataSource, + columns: _.map(columns, item => { + if (item.dataIndex === "employeeRange") { + return { + ...item, + render: (text, record) => { + return onOperate("edit", record.id, 2)}>{text}; + } + }; + } + return { + ...item, + render: (text) => { + return {text}; + } + }; + }) + }); + } + }).catch(() => { + this.setState({ loading: { ...loading, query: false } }); + }); + }; + + render() { + const { dataSource, columns, pageInfo, loading } = this.state; + const { onOperate, isChief } = this.props; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showSizeChanger: true, + showQuickJumper: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => { + this.getTaxAgentList(); + }); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + this.getTaxAgentList(); + }); + } + }; + return ( + + + } + ]} + /> + ); + } +} + +export default TaxAgentTable; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js new file mode 100644 index 00000000..11f5e4d3 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js @@ -0,0 +1,146 @@ +/* + * Author: 黎永顺 + * name: 报税信息 + * Description: + * Date: 2022/12/1 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom"; +import { fieldList } from "./constants"; +import { taxReturnGetForm } from "../../../apis/taxAgent"; + +const { getLabel } = WeaLocaleProvider; + +class TaxDeclarationInfo extends Component { + constructor(props) { + super(props); + this.state = { + fieldForm: { + name: "", + taxCode: "", + city: "", + cityVal: [], + areaCode: null, + passwordType: "TAX_NET_PASSWORD", + account: "", + realNamePassword: "", + netPassword: null, + taxRegistrationNumber: "", + departmentCode: "", + checkStatus: "" + }, + fieldItem: [] + }; + } + + componentDidMount() { + this.setState({ + fieldItem: _.filter(_.map(fieldList, item => ({ + ...item, + label: getLabel(item.lanId, item.label), + viewAttr: this.props.isChief ? item.viewAttr : 1 + })), it => it.key !== "account" && it.key !== "realNamePassword") + }, () => { + this.taxReturnGetForm(); + }); + } + + taxReturnGetForm = () => { + const { taxAgentId } = this.props; + taxReturnGetForm({ taxAgentId }).then(({ status, data }) => { + if (status) { + const { fieldForm } = this.state; + this.setState({ + fieldForm: { + ...fieldForm, + ..._.reduce(_.keys(fieldForm), (pre, cur) => { + if (cur !== "city") { + if (cur === "checkStatus") { + const checkStatusMap = { + "NOT_COMMIT": getLabel(111, "未验证"), + "SUCCESS": getLabel(111, "成功"), + "FAIL": getLabel(111, "失败") + }; + return { ...pre, [cur]: checkStatusMap[data[cur]] }; + } + return { ...pre, [cur]: data[cur] }; + } + return { + ...pre, + [cur]: `${data["nation"]}-${data["province"]}-${data[cur]}` + }; + }, {}), + cityVal: (data["city"] && data["cityName"]) ? [{ id: data["city"], name: data["cityName"] }] : [] + } + }); + } + }); + }; + handleChangeValue = (key, value, cityVal = []) => { + const { fieldForm } = this.state; + this.setState({ + fieldForm: !_.isEmpty(cityVal) ? { + ...fieldForm, [key]: value, cityVal + } : { ...fieldForm, [key]: value } + }, () => { + if (key === "passwordType" && this.state.fieldForm.passwordType === "REAL_NAME_PASSWORD") { + this.setState({ + fieldItem: _.filter(fieldList, it => it.key !== "netPassword"), + fieldForm: { ...this.state.fieldForm, account: null, realNamePassword: null, netPassword: null } + }); + } else if (key === "passwordType" && this.state.fieldForm.passwordType === "TAX_NET_PASSWORD") { + this.setState({ + fieldItem: _.filter(fieldList, it => it.key !== "account" && it.key !== "realNamePassword"), + fieldForm: { ...this.state.fieldForm, netPassword: null, account: null, realNamePassword: null } + }); + } + }); + }; + + render() { + const { fieldItem, fieldForm } = this.state; + return ( +
    + + { + _.map(fieldItem, item => { + const { key, label, type, viewAttr, options = [] } = item; + return + { + (type === "TEXT" || type === "PASSWORD") && + this.handleChangeValue(key, v)}/> + } + { + type === "SELECT" && + { + if (!_.isEmpty(datas)) { + this.handleChangeValue(key, `1-${datas[0].pid}-${datas[0].id}`, _.map(datas, it => ({ + id: it.id, + name: it.name + }))); + } else { + this.handleChangeValue(key, "", []); + } + }} + /> + } + { + type === "RADIO" && + ({ ...it, showname: getLabel(it.lanId, it.showname) }))} + viewAttr={viewAttr} + onChange={(v) => this.handleChangeValue(key, v)}/> + } + ; + }) + } + +
    + ); + } +} + +export default TaxDeclarationInfo; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js b/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js new file mode 100644 index 00000000..3a02b4b7 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/components/taxFillingInfoDialog.js @@ -0,0 +1,132 @@ +/* + * Author: 黎永顺 + * name: 个税申报-异常、失败详情 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom"; +import { Button, message } from "antd"; +import { deptFillCondition, taxFillColumns, taxFillCondition } from "./constants"; +import { getSearchs } from "../../../util"; +import { saveDepartmentCodeAndCheck } from "../../../apis/taxAgent"; + +const { getLabel } = WeaLocaleProvider; + +@inject("taxAgentStore") +@observer +class TaxFilingInfoDialofg extends Component { + constructor(props) { + super(props); + this.state = { + selectedRowKeys: [], checkLoading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (!_.isEmpty(nextProps.taxAgentTaxReturnCheckFormDTO) && + Object.prototype.toString.call(nextProps.taxAgentTaxReturnCheckFormDTO) === "[object Object]" + ) { + const { taxAgentTaxReturnCheckFormDTO, taxAgentStore: { taxfillInfoForm, deptfillInfoForm } } = nextProps; + taxfillInfoForm.initFormFields(taxFillCondition); + deptfillInfoForm.initFormFields(deptFillCondition); + const fields = _.map(taxFillCondition[0].items, it => { + return it.domkey[0]; + }); + fields.map(item => { + taxfillInfoForm.updateFields({ + [item]: item !== "divideFiling" ? (taxAgentTaxReturnCheckFormDTO[item] || "") : (taxAgentTaxReturnCheckFormDTO[item] === "ON" ? getLabel(538048, "是") : getLabel(30587, "否")) + }); + }); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + const { taxAgentStore: { setTaxfillInfoForm, initDeptfillInfoForm } } = nextProps; + setTaxfillInfoForm(); + initDeptfillInfoForm(); + } + } + + handleSaveOrKnow = () => { + const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, checkPayload } = this.props; + if (taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是")) { + deptfillInfoForm.validateForm().then(f => { + if (f.isValid) { + this.setState({ checkLoading: true }); + saveDepartmentCodeAndCheck(_.omitBy({ ...checkPayload, ...deptfillInfoForm.getFormParams() }, val => _.isNil(val))) + .then(({ status, errormsg }) => { + this.setState({ checkLoading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onCancel(true); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ checkLoading: false })); + } else { + f.showErrors(); + } + }); + } else { + this.props.onCancel(); + } + }; + + render() { + const { selectedRowKeys, checkLoading } = this.state; + const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, taxAgentTaxReturnCheckFormDTO, loading } = this.props; + const rowSelection = { + type: "radio", + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + return ( + + {taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是") ? getLabel(537558, "保存") : getLabel(545147, "知道了")} + + ] : [ + + ] + } + style={{ + width: 850, + height: 480, + minHeight: 200, + minWidth: 380, + maxHeight: "50%", + maxWidth: "50%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
    + { + Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ? + + {getSearchs(taxfillInfoForm, taxFillCondition, 1)} + {taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是") && getSearchs(deptfillInfoForm, deptFillCondition, 1)} + : + ({ + dataIndex: o.dataIndex, + width: 200, + title: getLabel(o.titleId, o.title) + }))} + scroll={{ x: 1200 }} rowSelection={rowSelection} + /> + } +
    +
    + ); + } +} + +export default TaxFilingInfoDialofg; diff --git a/pc4mobx/hrmSalary/pages/salary/index.less b/pc4mobx/hrmSalary/pages/salary/index.less new file mode 100644 index 00000000..de04ce9f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/index.less @@ -0,0 +1,43 @@ +.salaryAgentWrapper { + .comContent { + + .customTitleWrapper { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + + .ant-btn { + margin-left: 10px; + border-radius: 0; + padding: 0; + background: transparent; + border: none; + font-size: 20px; + line-height: 20px; + } + + .ant-btn.ant-btn-primary[disabled] { + color: #d8d8d8; + } + + .ant-btn.ant-btn-primary { + color: #55a1f8; + } + } + + .tdEllipsis { + display: inline-block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + + .ant-col-10 { + span:nth-child(2) { + //margin-top: -6px; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/salary/taxAgent.js b/pc4mobx/hrmSalary/pages/salary/taxAgent.js new file mode 100644 index 00000000..4ab69a82 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salary/taxAgent.js @@ -0,0 +1,254 @@ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button, message, Modal } from "antd"; +import { WeaCheckbox, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaSearchGroup, WeaTop } from "ecCom"; +import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings"; +import ComHint from "./components/comHint"; +import TaxAgentTable from "./components/taxAgentTable"; +import TaxAgentSlide from "./components/taxAgentSlide"; +import * as API from "../../apis/taxAgent"; +import LogDialog from "../../components/logViewModal"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +@inject("taxAgentStore") +@observer +class TaxAgent extends Component { + constructor(props) { + super(props); + this.state = { + syncLoading: false, //同步人员范围loading + searchValue: "", + decentralization: "0", //启用分权 + permission: {}, + taxAgentSlideProps: { + isEdit: false, visible: false, title: getLabel(543629, "新增个税扣缴义务人"), + taxAgentId: "", current: 0, salaryOn: true + }, + logDialogVisible: false, + filterConditions: "[]" + }; + this.taxAgentTableRef = null; + } + + componentDidMount() { + this.getTaxAgentBaseForm(); + this.getPermission(); + this.apiflowBillingConfigStatus(); + } + + getTaxAgentBaseForm = () => { + API.getTaxAgentBaseForm().then(({ status, data }) => { + if (status) { + const { devolutionStatus } = data; + this.setState({ decentralization: String(devolutionStatus || 0) }); + } + }); + }; + getPermission = () => { + const { taxAgentStore: { getPermission } } = this.props; + getPermission().then(({ status, data }) => { + if (status) { + this.setState({ permission: data }); + } + }); + }; + apiflowBillingConfigStatus = () => { + const { taxAgentSlideProps } = this.state; + apiflowBillingConfigStatus().then(({ status, data }) => { + if (status) this.setState({ taxAgentSlideProps: { ...taxAgentSlideProps, salaryOn: data } }); + }); + }; + /* + * Author: 黎永顺 + * Description:开启关闭个税扣缴义务人开关 + * Params: + * Date: 2022/11/29 + */ + taxAgentBaseSave = devolutionStatus => { + this.setState({ decentralization: this.state.decentralization }, () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: `${getLabel(33703, "确认")}${devolutionStatus === "0" ? getLabel(26471, "停用") : getLabel(26472, "启用")}${getLabel(524044, "分权")}?`, + onOk: () => { + const paylaod = { devolutionStatus }; + const { taxAgentStore } = this.props; + const { taxAgentBaseSave, setSalarytaxAgentForm } = taxAgentStore; + taxAgentBaseSave(paylaod).then(({ status, errormsg }) => { + if (status) { + message.success(`${devolutionStatus === "0" ? "停用" : "启用"}分权成功`); + this.getTaxAgentBaseForm(); + this.getPermission(); + this.taxAgentTableRef.getTaxAgentList(); + setSalarytaxAgentForm(); + } else { + message.error(errormsg || `${devolutionStatus === "0" ? "停用" : "启用"}分权失败`); + } + }); + } + }); + }); + }; + /* + * Author: 黎永顺 + * Description: + * Params:添加个税扣缴义务人 + * Date: 2022/11/29 + */ + handleAddTaxAgent = () => { + this.setState({ + taxAgentSlideProps: { + ...this.state.taxAgentSlideProps, + visible: true, current: 0 + } + }); + }; + /* + * Author: 黎永顺 + * Description:启用分权 + * Params: + * Date: 2022/12/1 + */ + taxAgentRangeSync = () => { + const { taxAgentStore } = this.props; + const { taxAgentRangeSync } = taxAgentStore; + this.setState({ syncLoading: true }); + taxAgentRangeSync({}).then(({ status, data, errormsg }) => { + this.setState({ syncLoading: false }); + if (status) { + message.success(data || getLabel(30700, "操作成功")); + this.taxAgentTableRef.getTaxAgentList(); + } else { + message.error(data || errormsg || getLabel(30651, "操作失败")); + } + }); + }; + handelResetSlide = (isUpdate = false) => { + const { taxAgentStore } = this.props; + const { salarytaxAgentForm } = taxAgentStore; + this.setState({ + taxAgentSlideProps: { + ...this.state.taxAgentSlideProps, + isEdit: false, + visible: false, + title: getLabel(543629, "新增个税扣缴义务人"), + taxAgentId: "", + current: 0 + } + }, () => { + isUpdate && this.taxAgentTableRef.getTaxAgentList(); + salarytaxAgentForm.resetForm(); + }); + }; + handleOperate = (type, itemId, current = 0) => { + switch (type) { + case "edit": + this.setState({ + taxAgentSlideProps: { + ...this.state.taxAgentSlideProps, + visible: true, title: getLabel(543632, "编辑个税扣缴义务人"), + taxAgentId: itemId, current, isEdit: true + } + }); + break; + case "delete": + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(388758, "确认要删除吗?"), + onOk: () => { + API.deleteTaxAgent([itemId]).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功")); + this.taxAgentTableRef.getTaxAgentList(); + } else { + message.error(errormsg || getLabel(20462, "删除失败")); + } + }); + } + }); + break; + case "log": + this.setState({ + logDialogVisible: true, + filterConditions: itemId ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${itemId}\"}]` : "[]" + }); + break; + default: + break; + } + }; + + render() { + const { + searchValue, decentralization, taxAgentSlideProps, + permission, syncLoading, logDialogVisible, filterConditions + } = this.state; + const btns = [ + , + this.setState({ searchValue })} + placeholder={getLabel(543634, "请输入个税扣缴义务人名称")} + onSearch={() => this.taxAgentTableRef.getTaxAgentList()} + /> + ]; + const customTitle =
    + {getLabel(537996, "个税扣缴义务人")} + { + permission.isChief && + + } +
    ; + return ( +
    + } + iconBgcolor="#F14A2D" + buttons={btns} + showDropIcon onDropMenuClick={key => this.handleOperate(key)} + dropMenuDatas={[ + { + key: "log", icon: , + content: getLabel(545781, "操作日志") + } + ]} + > +
    + { + permission.isChief && + + + + + + } + + this.taxAgentTableRef = dom}/> + +
    + + this.taxAgentTableRef.getTaxAgentList()} + onCancel={(isUpdate = false) => this.handelResetSlide(isUpdate)} + /> + {/*操作日志*/} + this.setState({ logDialogVisible: false })}/> +
    +
    + ); + } +} + +export default TaxAgent; From f55898b8a08ec3e824ddc1999ae6a08e82837e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 8 Oct 2024 14:29:24 +0800 Subject: [PATCH 063/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salary/taxAgent.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/taxAgent.js b/pc4mobx/hrmSalary/pages/salary/taxAgent.js index 4ab69a82..03e55f5d 100644 --- a/pc4mobx/hrmSalary/pages/salary/taxAgent.js +++ b/pc4mobx/hrmSalary/pages/salary/taxAgent.js @@ -2,7 +2,6 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { Button, message, Modal } from "antd"; import { WeaCheckbox, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaSearchGroup, WeaTop } from "ecCom"; -import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings"; import ComHint from "./components/comHint"; import TaxAgentTable from "./components/taxAgentTable"; import TaxAgentSlide from "./components/taxAgentSlide"; @@ -35,7 +34,6 @@ class TaxAgent extends Component { componentDidMount() { this.getTaxAgentBaseForm(); this.getPermission(); - this.apiflowBillingConfigStatus(); } getTaxAgentBaseForm = () => { @@ -54,12 +52,6 @@ class TaxAgent extends Component { } }); }; - apiflowBillingConfigStatus = () => { - const { taxAgentSlideProps } = this.state; - apiflowBillingConfigStatus().then(({ status, data }) => { - if (status) this.setState({ taxAgentSlideProps: { ...taxAgentSlideProps, salaryOn: data } }); - }); - }; /* * Author: 黎永顺 * Description:开启关闭个税扣缴义务人开关 From dd82ecf44545267765ac89b1a71c65c7350b0419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 8 Oct 2024 17:57:10 +0800 Subject: [PATCH 064/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/comHint.js | 12 ++-- .../pages/salary/components/index.less | 1 + .../pages/salary/components/taxAgentSlide.js | 57 ++++++++++++++----- .../pages/salary/components/taxAgentTable.js | 6 +- pc4mobx/hrmSalary/pages/salary/index.less | 32 +++++++++++ pc4mobx/hrmSalary/pages/salary/taxAgent.js | 26 +++------ pc4mobx/hrmSalary/stores/taxAgent.js | 7 +++ 7 files changed, 103 insertions(+), 38 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/comHint.js b/pc4mobx/hrmSalary/pages/salary/components/comHint.js index da3f5fb0..aea13257 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/comHint.js +++ b/pc4mobx/hrmSalary/pages/salary/components/comHint.js @@ -5,8 +5,11 @@ * Date: 2022/11/22 */ import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; import "./index.less"; +const { getLabel } = WeaLocaleProvider; + class ComHint extends Component { /* * Author: 黎永顺 @@ -18,9 +21,10 @@ class ComHint extends Component { const { isChief = true } = this.props; if (isChief) { return [ -

    1、个税扣缴义务人与档案中的个税扣缴义务人匹配,修改个税扣缴义务人名称,薪资档案的个税扣缴义务人数据同步更新;

    , -

    2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人,否则不予删除;

    , -

    3、开启分权,需维护个税扣缴义务人的管理员;当前总管理员默认有管理员的权限;

    +

    {getLabel(111, "1、个税扣缴义务人与档案中的个税扣缴义务人匹配,修改个税扣缴义务人名称,薪资档案的个税扣缴义务人数据同步更新;")}

    , +

    {getLabel(111, "2、删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人,否则不予删除;")}

    , +

    {getLabel(111, "3、只有薪酬总管理员能够操作个税扣缴义务人的增减和开启/关闭分权;")}

    , +

    {getLabel(111, "4、开启分权,需维护个税扣缴义务人的管理员;当前总管理员默认有管理员的权限;")}

    ]; } else { return []; @@ -30,7 +34,7 @@ class ComHint extends Component { render() { return (
    -
    小提示
    +
    {getLabel(111, "小提示")}
    {this.renderTips()}
    diff --git a/pc4mobx/hrmSalary/pages/salary/components/index.less b/pc4mobx/hrmSalary/pages/salary/components/index.less index be539899..0bd7ee92 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/index.less +++ b/pc4mobx/hrmSalary/pages/salary/components/index.less @@ -28,6 +28,7 @@ width: 100%; margin: 16px 0; border: 1px solid #e5e5e5; + background: #FFF; .hintHeader { background: #f6f6f6; diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index 97ebff1e..074d2590 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -229,7 +229,6 @@ class TaxAgentSlide extends Component { handleChangeSlideTab = (current) => { this.setState({ current: Number(current) }); }; - handleSubmit = (selectKey) => { const { taxFilingInfoDialofg, taxAgentId } = this.state; const { fieldForm } = this.taxInfoRef.state; @@ -267,14 +266,48 @@ class TaxAgentSlide extends Component { }; render() { - const tabs = [ - { key: 0, title: getLabel(82751, "基础设置") }, - { key: 1, title: getLabel(544342, "报税信息") }, - { key: 2, title: getLabel(124810, "人员范围") } + const { + isEdit, title, visible, onCancel, salaryOn, decentralization, isChief, taxAgentStore: { showOperateBtn } + } = this.props; + const { current, taxAgentId, taxFilingInfoDialofg, loading, verifyLoading } = this.state; + let tabs = [ + { + key: 0, title: getLabel(82751, "基础设置"), + createBtns: [ + + ], + editBtns: [ + + ], + children: + }, + { + key: 1, title: getLabel(544342, "报税信息"), + createBtns: [ + , + + ], + editBtns: [ + + ], + children: this.taxInfoRef = dom} taxAgentId={taxAgentId} isChief={isChief}/> + }, + { + key: 2, title: getLabel(124810, "人员范围"), + createBtns: [ + + ], + editBtns: [], + children: + } ]; - const { isEdit, title, visible, onCancel, salaryOn, taxAgentStore: { showOperateBtn } } = this.props; - const { current, taxAgentId, taxFilingInfoDialofg } = this.state; - const tabData = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs; + tabs = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs; return ( { - _.map(tabData, item => { + _.map(tabs, item => { const { key, title } = item; return ; }) } } - { - this.renderChildren() - } + {_.find(tabs, o => current === o.key).children}
    - onOperate("edit", record.id)}>{getLabel(501169, "编辑")} { isChief && - onOperate("delete", record.id)}>{getLabel(535052, "删除")} } - onOperate("log", record.id)}>{getLabel(545781, "操作日志")} diff --git a/pc4mobx/hrmSalary/pages/salary/index.less b/pc4mobx/hrmSalary/pages/salary/index.less index de04ce9f..6c63517f 100644 --- a/pc4mobx/hrmSalary/pages/salary/index.less +++ b/pc4mobx/hrmSalary/pages/salary/index.less @@ -1,5 +1,37 @@ .salaryAgentWrapper { + .wea-new-top-content { + background: #f6f6f6; + padding: 8px 16px 0; + } + + .wea-new-top { + .wea-input-focus { + height: 31.36px; + line-height: 0; + } + } + .comContent { + .wea-search-group:first-child { + margin-bottom: 16px; + } + + .wea-search-group { + padding: 0; + background: #fff; + + .wea-title { + padding: 0 10px; + } + + .wea-content { + padding: 0; + + .wea-form-item { + padding-left: 18px; + } + } + } .customTitleWrapper { width: 100%; diff --git a/pc4mobx/hrmSalary/pages/salary/taxAgent.js b/pc4mobx/hrmSalary/pages/salary/taxAgent.js index 03e55f5d..300037c3 100644 --- a/pc4mobx/hrmSalary/pages/salary/taxAgent.js +++ b/pc4mobx/hrmSalary/pages/salary/taxAgent.js @@ -5,8 +5,8 @@ import { WeaCheckbox, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaSearchG import ComHint from "./components/comHint"; import TaxAgentTable from "./components/taxAgentTable"; import TaxAgentSlide from "./components/taxAgentSlide"; -import * as API from "../../apis/taxAgent"; import LogDialog from "../../components/logViewModal"; +import * as API from "../../apis/taxAgent"; import "./index.less"; const { getLabel } = WeaLocaleProvider; @@ -20,10 +20,9 @@ class TaxAgent extends Component { syncLoading: false, //同步人员范围loading searchValue: "", decentralization: "0", //启用分权 - permission: {}, taxAgentSlideProps: { isEdit: false, visible: false, title: getLabel(543629, "新增个税扣缴义务人"), - taxAgentId: "", current: 0, salaryOn: true + taxAgentId: "", current: 0, salaryOn: false }, logDialogVisible: false, filterConditions: "[]" @@ -33,7 +32,6 @@ class TaxAgent extends Component { componentDidMount() { this.getTaxAgentBaseForm(); - this.getPermission(); } getTaxAgentBaseForm = () => { @@ -44,14 +42,6 @@ class TaxAgent extends Component { } }); }; - getPermission = () => { - const { taxAgentStore: { getPermission } } = this.props; - getPermission().then(({ status, data }) => { - if (status) { - this.setState({ permission: data }); - } - }); - }; /* * Author: 黎永顺 * Description:开启关闭个税扣缴义务人开关 @@ -71,7 +61,6 @@ class TaxAgent extends Component { if (status) { message.success(`${devolutionStatus === "0" ? "停用" : "启用"}分权成功`); this.getTaxAgentBaseForm(); - this.getPermission(); this.taxAgentTableRef.getTaxAgentList(); setSalarytaxAgentForm(); } else { @@ -172,9 +161,9 @@ class TaxAgent extends Component { }; render() { + const { taxAgentStore: { PageAndOptAuth: permission } } = this.props; const { - searchValue, decentralization, taxAgentSlideProps, - permission, syncLoading, logDialogVisible, filterConditions + searchValue, decentralization, taxAgentSlideProps, syncLoading, logDialogVisible, filterConditions } = this.state; const btns = [
    ; + const showOperateBtn = permission.opts.includes("admin"); return (
    } iconBgcolor="#F14A2D" - buttons={btns} + buttons={showOperateBtn ? btns : btns.slice(1)} showDropIcon onDropMenuClick={key => this.handleOperate(key)} dropMenuDatas={[ { @@ -214,13 +204,13 @@ class TaxAgent extends Component {
    { permission.isChief && - + } - + this.taxAgentTableRef = dom}/> diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index 94d9898f..d4e25ec5 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -9,6 +9,11 @@ import { PAGE } from "../config"; const { TableStore } = WeaTableNew; export class TaxAgentStore { + @observable salarytaxAgentForm = new WeaForm(); //新版个税扣缴义务人表单实体 + @observable taxfillInfoForm = new WeaForm(); //报税信息查看form + @action setTaxfillInfoForm = () => this.taxfillInfoForm = new WeaForm(); //报税信息form初始化 + @observable deptfillInfoForm = new WeaForm(); //报税信息部门备案form + @action initDeptfillInfoForm = () => this.deptfillInfoForm = new WeaForm(); //报税信息部门备案form初始化 @observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单 @observable roleForm = new WeaForm(); //权限-角色form表单 @action initRoleForm = () => this.roleForm = new WeaForm(); @@ -52,6 +57,8 @@ export class TaxAgentStore { @action setStatisticsReportBtn = bool => (this.statisticsReportBtn = bool);//薪酬统计报表权限 @action setPayrollPermission = bool => (this.payrollPermission = bool);// 薪资核算页面权限 + @action setSalarytaxAgentForm = () => (this.salarytaxAgentForm = new WeaForm());//薪资项目权限 + // 初始化操作 @action doInit = params => { From 255e8d87602a2a8cda3469f57f2528097e3fe3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 9 Oct 2024 10:22:00 +0800 Subject: [PATCH 065/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-title/weaReqTitle/index.js | 2 +- .../custom-title/weaTopTitle/index.js | 2 +- .../pages/salary/components/baseSettings.js | 2 +- .../pages/salary/components/index.less | 17 ++++++++++ .../pages/salary/components/personalScope.js | 6 ++-- .../salary/components/personalScopeTable.js | 7 ++-- .../pages/salary/components/taxAgentSlide.js | 33 +++++-------------- pc4mobx/hrmSalary/pages/salary/index.less | 26 +++++++++++++++ 8 files changed, 61 insertions(+), 34 deletions(-) diff --git a/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js b/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js index 69766076..7ff800ce 100644 --- a/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js +++ b/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js @@ -7,7 +7,7 @@ class Index extends Component { render() { return ( } iconBgcolor="#F14A2D" + title={this.props.title || getLabel(111, "编辑账套")} icon={} iconBgcolor="#F14A2D" showDropIcon={false} tabDatas={this.props.tabDatas} {...this.props} /> ); diff --git a/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js b/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js index d265c8eb..0e90c2e2 100644 --- a/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js +++ b/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js @@ -6,7 +6,7 @@ const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { render() { return ( - } + } iconBgcolor="#F14A2D" {...this.props}/> ); } diff --git a/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js b/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js index 5e24cb5c..a534feb0 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js +++ b/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js @@ -20,7 +20,7 @@ class BaseSettings extends Component { render() { const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = this.props; return ( -
    +
    { decentralization === "0" ? getSearchs(salarytaxAgentForm, convertConditon(decentralizationConditions, !isChief), 1, false) : diff --git a/pc4mobx/hrmSalary/pages/salary/components/index.less b/pc4mobx/hrmSalary/pages/salary/components/index.less index 0bd7ee92..921c6451 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/index.less +++ b/pc4mobx/hrmSalary/pages/salary/components/index.less @@ -1,4 +1,21 @@ .taxAgentSlideContent { + height: 100%; + background: #F6F6F6; + + .ant-steps { + margin: 0 0 20px 0 !important; + padding-top: 20px; + } + + .personal-scope { + padding: 8px 16px; + height: 100%; + + .wea-tab, .wea-new-table { + background: #FFF; + } + } + .baseSettingWrapper, .taxDeclarationInfoWrapper { padding: 12px 12px 12px 20px; diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js index 66070632..37356d3d 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -191,18 +191,18 @@ class PersonalScope extends Component { value={searchValue} onChange={searchValue => this.setState({ searchValue })} placeholder="请输入对象" - onSearch={() => this.personalScopeTableRef.getPersonalScopeList()} + onSearch={() => this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1)} /> ] : [ this.setState({ searchValue })} placeholder="请输入对象" - onSearch={() => this.personalScopeTableRef.getPersonalScopeList()} + onSearch={() => this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1)} />]; (selectedKey === "listExclude" || selectedKey === "listExt") && btns.shift(); return ( -
    +
    { + getPersonalScopeList = (tabActive = this.props.tabActive, current) => { const { searchValue, taxAgentId } = this.props; const { pageInfo, loading } = this.state; const payload = { - taxAgentId, - targetName: searchValue, - ...pageInfo + taxAgentId, targetName: searchValue, ...pageInfo, current: current || pageInfo.current }; this.setState({ loading: { ...loading, query: true } }); APIFox[tabActive](payload).then(({ status, data }) => { @@ -129,6 +127,7 @@ class PersonalScopeTable extends Component { pagination={pagination} loading={loading.query} columns={columns} + scroll={{ y: `calc(100vh - 230px)` }} /> ); } diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index 074d2590..1a6140cd 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -8,12 +8,13 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { Button, message, Modal } from "antd"; import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom"; -import SlideModalTitle from "../../../components/slideModalTitle"; import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions"; import BaseSettings, { convertConditon } from "./baseSettings"; import PersonalScope from "./personalScope"; import TaxDeclarationInfo from "./taxDeclarationInfo"; import TaxFilingInfoDialofg from "./taxFillingInfoDialog"; +import WeaTopTitle from "../../../components/custom-title/weaTopTitle"; +import WeaReqTitle from "../../../components/custom-title/weaReqTitle"; import * as API from "../../../apis/taxAgent"; import { registrationCheck } from "../../../apis/taxAgent"; import "./index.less"; @@ -226,9 +227,6 @@ class TaxAgentSlide extends Component { } return CurrentDom; }; - handleChangeSlideTab = (current) => { - this.setState({ current: Number(current) }); - }; handleSubmit = (selectKey) => { const { taxFilingInfoDialofg, taxAgentId } = this.state; const { fieldForm } = this.taxInfoRef.state; @@ -267,7 +265,7 @@ class TaxAgentSlide extends Component { render() { const { - isEdit, title, visible, onCancel, salaryOn, decentralization, isChief, taxAgentStore: { showOperateBtn } + isEdit, title, visible, onCancel, salaryOn, decentralization, isChief, taxAgentStore: { PageAndOptAuth } } = this.props; const { current, taxAgentId, taxFilingInfoDialofg, loading, verifyLoading } = this.state; let tabs = [ @@ -308,28 +306,15 @@ class TaxAgentSlide extends Component { } ]; tabs = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); return ( { - }} - selectedTab={current} - customOperate={this.renderCustomOperate()} - subItemChange={this.handleChangeSlideTab} - /> + !taxAgentId ? current === o.key).createBtns}/> : + current === o.key).editBtns : []} + tabDatas={tabs} selectedKey={String(current)} title={title} + onChange={cur => this.setState({ current: parseInt(cur) })}/> } content={
    diff --git a/pc4mobx/hrmSalary/pages/salary/index.less b/pc4mobx/hrmSalary/pages/salary/index.less index 6c63517f..e6dacf00 100644 --- a/pc4mobx/hrmSalary/pages/salary/index.less +++ b/pc4mobx/hrmSalary/pages/salary/index.less @@ -72,4 +72,30 @@ //margin-top: -6px; } } + + .taxAgentSlide { + .wea-slide-modal-title { + height: auto; + line-height: normal; + text-align: left; + background: #FFF; + + .wea-new-top .ant-col-10 { + padding-right: 45px !important; + } + } + + .rodal-close { + z-index: 99; + top: 10px !important; + } + + .wea-new-top-req-wapper .wea-new-top-req-title > div:last-child { + right: 45px !important; + } + + .wea-slide-modal-content { + height: 100%; + } + } } From b23662c09eb82229403c2d2318bba7892bdd3872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 9 Oct 2024 11:10:21 +0800 Subject: [PATCH 066/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/personalScope.js | 5 +- .../pages/salary/components/taxAgentSlide.js | 63 ++----------------- 2 files changed, 7 insertions(+), 61 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js index 37356d3d..fa392444 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -157,7 +157,8 @@ class PersonalScope extends Component { selectedKey, searchValue, rowKeys, personalAddModal, importParams, previewDataSource, extEmpsWitch, loading } = this.state; - const { taxAgentStore: { hideIconInTax, showSalaryItemBtn }, taxAgentId } = this.props; + const { taxAgentStore: { PageAndOptAuth }, taxAgentId } = this.props; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const topTab = [ { title: "管理范围", @@ -172,7 +173,7 @@ class PersonalScope extends Component { viewcondition: "listExt" } ]; - const btns = (hideIconInTax || showSalaryItemBtn) ? [ + const btns = showOperateBtn ? [ - ]; - break; - case 1: - const tmpV = []; - const tmpJ = [ - , - - ]; - CurrentDom = isEdit ? tmpV : [...tmpV, ...tmpJ]; - break; - case 2: - CurrentDom = (!isEdit && salaryOn) ? - [] - : []; - break; - default: - break; - } - } - return CurrentDom; - }; handleSubmit = (selectKey) => { const { taxFilingInfoDialofg, taxAgentId } = this.state; const { fieldForm } = this.taxInfoRef.state; @@ -299,7 +243,7 @@ class TaxAgentSlide extends Component { key: 2, title: getLabel(124810, "人员范围"), createBtns: [ + onClick={() => this.setState({ current: !salaryOn ? current - 2 : current - 1 })}>{getLabel(1876, "上一步")} ], editBtns: [], children: @@ -311,7 +255,8 @@ class TaxAgentSlide extends Component { current === o.key).createBtns}/> : + !this.props.taxAgentId ? + current === o.key).createBtns}/> : current === o.key).editBtns : []} tabDatas={tabs} selectedKey={String(current)} title={title} onChange={cur => this.setState({ current: parseInt(cur) })}/> From 94a4d3a93005dee9046fcea8eb64a2608346d006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 9 Oct 2024 14:51:55 +0800 Subject: [PATCH 067/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/constants.js | 32 +++- .../salary/components/personalScopeModal.js | 169 ++++++++++-------- pc4mobx/hrmSalary/stores/taxAgent.js | 2 + 3 files changed, 128 insertions(+), 75 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index 8682937c..58da8c6b 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -238,7 +238,6 @@ export const deptFillCondition = [ defaultshow: true } ]; - export const taxFillColumns = [ { dataIndex: "taxCode", @@ -292,3 +291,34 @@ export const taxFillColumns = [ titleId: "545141" } ]; +export const personScopeConditions = [ + { + items: [ + { + conditionType: "SELECT_LINKAGE", + domkey: ["targetParams"], + fieldcol: 16, + label: "对象类型", + lanId: 111, + labelcol: 8, + options: [], + rules: "required|string", + selectLinkageDatas: {}, + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["employeeStatus"], + fieldcol: 16, + label: "选择员工状态", + lanId: 111, + labelcol: 8, + value: "", + detailtype: "2", + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index 9e4c09af..a5ad7786 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -5,17 +5,23 @@ * Date: 2022/11/30 */ import React, { Component } from "react"; -import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { WeaBrowser, WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { Button, message, Modal } from "antd"; import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; -import { SelectWithAll } from "../../socialSecurityBenefits/standingBookDetail/components/regAddEmployee"; -import "./index.less"; +import { personScopeConditions } from "./constants"; +import { getSearchs } from "../../../util"; +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("taxAgentStore") +@observer class PersonalScopeModal extends Component { constructor(props) { super(props); this.state = { - loading: false, + loading: false, conditions: [], employeeStatus: [], targetTypeList: [], targetType: "EMPLOYEE", @@ -26,8 +32,15 @@ class PersonalScopeModal extends Component { }; } + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentRangeForm(); + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + this.props.taxAgentStore.initPersonScopeForm(); + } + } + componentDidMount() { - this.getTaxAgentRangeForm(); + // this.getTaxAgentRangeForm(); } getTaxAgentRangeForm = () => { @@ -36,8 +49,22 @@ class PersonalScopeModal extends Component { 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 })) - }); + employeeStatus: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })), + 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 })) + }; + } + return { + ...o, label: getLabel(o.lanId, o.label), + options: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })) + }; + }) + })) + }, () => this.props.taxAgentStore.personScopeForm.initFormFields(this.state.conditions)); } }); }; @@ -111,78 +138,72 @@ class PersonalScopeModal extends Component { }; render() { - const { onCancel, title, visible } = this.props; - const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state; + const { onCancel, title, visible, taxAgentStore: { personScopeForm } } = this.props; + const { employeeStatus, targetTypeList, targetType, status, statusAll, loading, conditions } = this.state; const buttons = [ , ]; return ( - { - this.handleReset(); - onCancel(); - }} - > - - -
    - this.setState({ targetType })} - /> - {this.renderBrowser()} -
    -
    - { - SelectWithAll({ - label: "选择员工状态", - options: employeeStatus, - detailtype: 2, - valueAll: statusAll, - value: status, - onChangeAll: ({ selected }) => { - if (selected) { - this.setState({ - status: _.map(employeeStatus, it => it.key).join(","), - statusAll: selected - }); - } else { - this.setState({ - status: "", - statusAll: selected - }); - } - }, - onChange: ({ selected }) => { - const bool = _.every(_.map(employeeStatus, it => it.key), item => selected.split(",").includes(item)); - if (bool) { - this.setState({ - status: selected, - statusAll: "0" - }); - } else { - this.setState({ - status: selected, - statusAll: "" - }); - } - } - }) - } -
    + { + this.handleReset(); + onCancel(); + }}> +
    {getSearchs(personScopeForm, conditions, 1, false)}
    + {/**/} + {/* */} + {/*
    */} + {/* this.setState({ targetType })}*/} + {/* />*/} + {/* {this.renderBrowser()}*/} + {/*
    */} + {/* */} + {/* {*/} + {/* SelectWithAll({*/} + {/* label: "选择员工状态",*/} + {/* options: employeeStatus,*/} + {/* detailtype: 2,*/} + {/* valueAll: statusAll,*/} + {/* value: status,*/} + {/* onChangeAll: ({ selected }) => {*/} + {/* if (selected) {*/} + {/* this.setState({*/} + {/* status: _.map(employeeStatus, it => it.key).join(","),*/} + {/* statusAll: selected*/} + {/* });*/} + {/* } else {*/} + {/* this.setState({*/} + {/* status: "",*/} + {/* statusAll: selected*/} + {/* });*/} + {/* }*/} + {/* },*/} + {/* onChange: ({ selected }) => {*/} + {/* const bool = _.every(_.map(employeeStatus, it => it.key), item => selected.split(",").includes(item));*/} + {/* if (bool) {*/} + {/* this.setState({*/} + {/* status: selected,*/} + {/* statusAll: "0"*/} + {/* });*/} + {/* } else {*/} + {/* this.setState({*/} + {/* status: selected,*/} + {/* statusAll: ""*/} + {/* });*/} + {/* }*/} + {/* }*/} + {/* })*/} + {/* }*/} + {/*
    */}
    ); } diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index d4e25ec5..45fe8041 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -12,6 +12,8 @@ export class TaxAgentStore { @observable salarytaxAgentForm = new WeaForm(); //新版个税扣缴义务人表单实体 @observable taxfillInfoForm = new WeaForm(); //报税信息查看form @action setTaxfillInfoForm = () => this.taxfillInfoForm = new WeaForm(); //报税信息form初始化 + @observable personScopeForm = new WeaForm(); //个税扣缴义务人新增人员form + @action initPersonScopeForm = () => this.personScopeForm = new WeaForm(); //个税扣缴义务人新增人员form初始化 @observable deptfillInfoForm = new WeaForm(); //报税信息部门备案form @action initDeptfillInfoForm = () => this.deptfillInfoForm = new WeaForm(); //报税信息部门备案form初始化 @observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单 From cd768fff67e12635c0cc98cbad4b39b528dcc451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 9 Oct 2024 17:02:14 +0800 Subject: [PATCH 068/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/constants.js | 21 +++++++++++---- .../salary/components/personalScopeModal.js | 26 ++++++++++++++----- 2 files changed, 36 insertions(+), 11 deletions(-) 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)}
    {/**/} {/* Date: Fri, 11 Oct 2024 10:01:46 +0800 Subject: [PATCH 069/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/constants.js | 137 +++++++++++++++-- .../salary/components/personalScopeModal.js | 142 ++++++++++-------- 2 files changed, 202 insertions(+), 77 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index b457ae44..ac81a719 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -302,20 +302,9 @@ export const personScopeConditions = [ lanId: 111, labelcol: 6, options: [], - rules: "required|string", - selectLinkageDatas: { - EMPLOYEE: { - conditionType: "TEXTAREA", - domkey: ["target"], - fieldcol: 24, - label: "", - labelcol: 0, - value: "", - rules: "required|string", - viewAttr: 3 - } - }, - viewAttr: 3 + viewAttr: 3, + rules: "selectLinkageRequired", + selectLinkageDatas: {} }, { conditionType: "SELECT", @@ -326,10 +315,126 @@ export const personScopeConditions = [ labelcol: 6, value: "", detailtype: "2", - rules: "required|string", + rules: "required", viewAttr: 3 - } + }, ], defaultshow: true } ]; +export const scopeSelectLinkageDatas = { + EMPLOYEE:{ + browserConditionParam: { + completeParams: {}, + dataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + pageSize: 10, + linkUrl: "", + type: "17", + viewAttr: 3, + rules:'required', + title: "" + }, + conditionType: "BROWSER", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required", + viewAttr: 3 + }, + DEPT:{ + browserConditionParam: { + completeParams: {}, + dataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + pageSize: 10, + linkUrl: "", + type: "57", + viewAttr: 3, + rules:'required', + title: "" + }, + conditionType: "BROWSER", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required", + viewAttr: 3 + }, + SUBCOMPANY:{ + browserConditionParam: { + completeParams: {}, + dataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + pageSize: 10, + linkUrl: "", + type: "164", + viewAttr: 3, + rules:'required', + title: "" + }, + conditionType: "BROWSER", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required", + viewAttr: 3 + }, + POSITION:{ + browserConditionParam: { + completeParams: {}, + dataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + pageSize: 10, + linkUrl: "", + type: "278", + viewAttr: 3, + rules:'required', + title: "" + }, + conditionType: "BROWSER", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required", + viewAttr: 3 + }, + SQL: { + conditionType: "TEXTAREA", + domkey: ["target"], + fieldcol: 24, + label: "", + labelcol: 0, + value: "", + rules: "required", + viewAttr: 3 + } +}; diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index f8aced8d..9ad50c15 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -6,11 +6,11 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaBrowser, WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; +import { WeaSwitch } from "comsMobx"; +import { WeaBrowser, WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { Button, message, Modal } from "antd"; import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; -import { personScopeConditions } from "./constants"; -import { getSearchs } from "../../../util"; +import { personScopeConditions, scopeSelectLinkageDatas } from "./constants"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -33,9 +33,7 @@ class PersonalScopeModal extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentRangeForm(); - if (nextProps.visible !== this.props.visible && !nextProps.visible) { - this.props.taxAgentStore.initPersonScopeForm(); - } + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.initPersonScopeForm(); } componentDidMount() { @@ -52,15 +50,13 @@ class PersonalScopeModal extends Component { if (getKey(o) === "employeeStatus") { return { ...o, label: getLabel(o.lanId, o.label), - options: [ - { key: "ALL", showname: getLabel(111, "全选") }, - ..._.map(employeeStatus, it => ({ key: it.id, showname: it.name })) - ] + options: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })) }; } return { ...o, label: getLabel(o.lanId, o.label), - options: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })) + options: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })), + selectLinkageDatas: scopeSelectLinkageDatas[_.head(targetTypeList).id] }; }) })) @@ -69,33 +65,44 @@ class PersonalScopeModal extends Component { }); }; taxAgentRangeSave = () => { - const { status, targetTypeIds, targetType } = this.state; - const { includeType, taxAgentId, onSuccess, onCancel } = this.props; - if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) { - Modal.warning({ - title: "信息确认", - content: "必要信息不完整,红色*为必填项!" - }); - return; - } - const payload = { - employeeStatus: status.split(","), - includeType, - targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), - taxAgentId - }; - this.setState({ loading: true }); - taxAgentRangeSave(payload).then(({ status, errormsg }) => { - this.setState({ loading: false }); - if (status) { - message.success("保存成功"); - this.handleReset(); - onSuccess(); - onCancel(); + 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 payload = { + employeeStatus: status.split(","), + includeType, + targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), + taxAgentId + }; + this.setState({ loading: true }); + taxAgentRangeSave(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("保存成功"); + this.handleReset(); + onSuccess(); + onCancel(); + } else { + message.error(errormsg || "保存失败"); + } + }).catch(() => this.setState({ loading: true })); } else { - message.error(errormsg || "保存失败"); + f.showErrors(); + this.forceUpdate(); } - }).catch(() => this.setState({ loading: true })); + }); }; renderBrowser = () => { const { targetType, targetTypeIds, targetTypeIdsNames } = this.state; @@ -128,27 +135,44 @@ class PersonalScopeModal extends Component { }} />; }; + renderForm = () => { + const { taxAgentStore: { personScopeForm } } = this.props; + const { conditions, employeeStatus } = this.state, { isFormInit } = personScopeForm, + formParams = personScopeForm.getFormParams(); + const checked = formParams.employeeStatus && _.every(_.map(employeeStatus, o => o.id), k => formParams.employeeStatus.indexOf(k) !== -1); + let group = []; + isFormInit && conditions.map(c => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + { + getKey(fields) === "employeeStatus" && + + } + + ), + hide: fields.hide + }); + }); + group.push(); + }); + return group; + }; + handleChangeAll = (val) => { + const { taxAgentStore: { personScopeForm } } = this.props, { employeeStatus } = this.state; + 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; - 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", - targetTypeIds: "", - status: "", - statusAll: "" - }); + console.log(params, key, value); }; render() { @@ -156,15 +180,11 @@ class PersonalScopeModal extends Component { const { employeeStatus, targetTypeList, targetType, status, statusAll, loading, conditions } = this.state; const buttons = [ , - + ]; return ( - { - this.handleReset(); - onCancel(); - }}> -
    {getSearchs(personScopeForm, conditions, 1, false, this.handleChange)}
    + +
    {this.renderForm()}
    {/**/} {/* Date: Fri, 11 Oct 2024 11:11:06 +0800 Subject: [PATCH 070/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=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 ( From 167c2c5a2013addca927c488d237455ec0e5dc60 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 15:19:38 +0800 Subject: [PATCH 071/110] =?UTF-8?q?feature/2.15.1.2407.01-=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/index.less | 12 ++ .../pages/salary/components/personalScope.js | 106 ++++++---------- .../salary/components/personalScopeModal.js | 113 ++---------------- 3 files changed, 56 insertions(+), 175 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/index.less b/pc4mobx/hrmSalary/pages/salary/components/index.less index 921c6451..9eed4669 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/index.less +++ b/pc4mobx/hrmSalary/pages/salary/components/index.less @@ -14,6 +14,18 @@ .wea-tab, .wea-new-table { background: #FFF; } + + .icon-refresh { + display: flex; + justify-content: center; + align-items: center; + width: 20px; + height: 20px; + color: #fff; + background: #55a1f8; + cursor: pointer; + border-radius: 3px; + } } .baseSettingWrapper, .taxDeclarationInfoWrapper { diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js index 698d181d..451fbda8 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -5,22 +5,22 @@ * Date: 2022/11/30 */ import React, { Component } from "react"; -import { Button, message, Modal } from "antd"; +import { message, Modal } from "antd"; import { inject, observer } from "mobx-react"; -import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom"; +import { WeaButtonIcon, WeaInputSearch, WeaLocaleProvider, WeaTab } from "ecCom"; import { taxAgentRangeDelete, taxAgentRangeExtDelete, taxAgentRangeExtSave, - taxAgentRangeImportData, - taxAgentRangePreview + taxAgentRangeImportData } from "../../../apis/taxAgent"; import { sysinfo } from "../../../apis/ruleconfig"; import PersonalScopeTable from "./personalScopeTable"; import PersonalScopeModal from "./personalScopeModal"; -import ImportModal from "../../../components/importModal"; +import ImportDialog from "../../../components/importDialog"; import ExternalPersonModal from "../../../components/externalPersonModal"; -import { importEmployColumns } from "../../taxAgent/columns"; + +const getLabel = WeaLocaleProvider.getLabel; @inject("taxAgentStore") @observer @@ -28,17 +28,14 @@ class PersonalScope extends Component { constructor(props) { super(props); this.state = { - searchValue: "", selectedKey: "listInclude", - rowKeys: [], personalAddModal: { - visible: false, externalVisible: false, - title: "关联人员", includeType: "" - }, - previewDataSource: [], importParams: { - visible: false, - step: 0, - importResult: {} - }, extEmpsWitch: "1", //非系统人员开关, 1: 开启, 0:关闭 - loading: false + searchValue: "", selectedKey: "listInclude", rowKeys: [], loading: false, + extEmpsWitch: "1", //非系统人员开关, 1: 开启, 0:关闭 + personalAddModal: { visible: false, externalVisible: false, title: getLabel(111, "关联人员"), includeType: "" }, + importParams: { + visible: false, title: getLabel(111, "数据导入"), nextloading: false, importResult: {}, imageId: "", + link: `/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${props.taxAgentId}`, + previewUrl: "/api/bs/hrmsalary/taxAgent/range/preview" + } }; this.personalScopeTableRef = null; } @@ -103,26 +100,15 @@ class PersonalScope extends Component { } }); }; - salaryArchivePreview = (params) => { - taxAgentRangePreview(params).then(({ status, data }) => { - if (status) { - const { preview } = data; - this.setState({ - previewDataSource: preview - }); - } - }); - }; handleImportFile = (params) => { - const { taxAgentId } = this.props; - taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, data }) => { + const { taxAgentId } = this.props, { importParams } = this.state; + this.setState({ importParams: { ...importParams, nextloading: true } }); + taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, errormsg, data }) => { + this.setState({ importParams: { ...importParams, nextloading: false } }); if (status) { - this.setState({ - importParams: { - ...this.state.importParams, - importResult: data - } - }); + this.setState({ importParams: { ...importParams, importResult: data } }); + } else { + message.warning(errormsg); } }); }; @@ -153,10 +139,7 @@ class PersonalScope extends Component { }; render() { - const { - selectedKey, searchValue, rowKeys, personalAddModal, - importParams, previewDataSource, extEmpsWitch, loading - } = this.state; + const { selectedKey, searchValue, rowKeys, personalAddModal, importParams, extEmpsWitch, loading } = this.state; const { taxAgentStore: { PageAndOptAuth }, taxAgentId } = this.props; const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const topTab = [ @@ -174,12 +157,9 @@ class PersonalScope extends Component { } ]; const btns = showOperateBtn ? [ - , + { + this.setState({ importParams: { ...importParams, visible: true } }); + }}>, callback && callback()) } /> - {importParams.visible && ( - { - this.setState({ importParams: { ...this.state.importParams, step } }); - }} - importResult={importParams.importResult} - onFinish={() => { - this.setState({ - importParams: { - ...this.state.importParams, - visible: false - } - }, () => this.personalScopeTableRef.getPersonalScopeList()); - }} - previewImport={(params) => this.salaryArchivePreview(params)} - importFile={(params) => this.handleImportFile(params)} - templateLink={`/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${taxAgentId}`} - visiable={importParams.visible} - onCancel={() => { - this.setState({ importParams: { ...this.state.importParams, visible: false } }); - }} - /> - )} + this.setState({ importParams: { ...importParams, imageId } })} + nextUplaodCallback={imageId => this.handleImportFile({ imageId })} + onResetImportResult={() => this.setState(({ + importParams: { ...importParams, importResult: {}, imageId: "" } + }))} + onCancel={(callback) => this.setState({ + importParams: { ...importParams, visible: false } + }, () => callback && this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1))}/>
    ); } diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index ab9d5dcb..3e649880 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -7,7 +7,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 { WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { Button, message } from "antd"; import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; import { personScopeConditions, scopeSelectLinkageDatas } from "./constants"; @@ -21,13 +21,7 @@ class PersonalScopeModal extends Component { constructor(props) { super(props); this.state = { - loading: false, conditions: [], - employeeStatus: [], - targetType: "EMPLOYEE", - targetTypeIds: "", - targetTypeIdsNames: "", - status: "", - statusAll: "" + loading: false, conditions: [], employeeStatus: [] }; } @@ -36,10 +30,6 @@ class PersonalScopeModal extends Component { if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.initPersonScopeForm(); } - componentDidMount() { - // this.getTaxAgentRangeForm(); - } - getTaxAgentRangeForm = () => { getTaxAgentRangeForm().then(({ status, data }) => { if (status) { @@ -73,9 +63,11 @@ class PersonalScopeModal extends Component { const { employeeStatus, targetType, target } = personScopeForm.getFormParams(); const { includeType, taxAgentId } = this.props; const payload = { - includeType, taxAgentId, - employeeStatus: employeeStatus.split(","), - targetParams: _.map(target.split(","), it => ({ targetType, targetId: it })) + includeType, taxAgentId, employeeStatus: employeeStatus.split(","), + targetParams: _.map(target.split(","), it => ({ + targetType, targetId: targetType === "SQL" ? "0" : it, + target: targetType === "SQL" ? target : "" + })) }; this.setState({ loading: true }); taxAgentRangeSave(payload).then(({ status, errormsg }) => { @@ -92,37 +84,6 @@ class PersonalScopeModal extends Component { } }); }; - renderBrowser = () => { - const { targetType, targetTypeIds, targetTypeIdsNames } = this.state; - let browserType = {}; - switch (targetType) { - case "EMPLOYEE": - browserType = { ...browserType, type: 17, title: "人员选择" }; - break; - case "DEPT": - browserType = { ...browserType, type: 57, title: "部门选择" }; - break; - case "SUBCOMPANY": - browserType = { ...browserType, type: 164, title: "分部选择" }; - break; - case "POSITION": - browserType = { ...browserType, type: 278, title: "岗位选择" }; - break; - default: - break; - } - return { - this.setState({ targetTypeIds, targetTypeIdsNames }); - }} - />; - }; renderForm = () => { const { taxAgentStore: { personScopeForm } } = this.props; const { conditions, employeeStatus } = this.state, { isFormInit } = personScopeForm, @@ -158,68 +119,14 @@ class PersonalScopeModal extends Component { }; render() { - const { onCancel, title, visible, taxAgentStore: { personScopeForm } } = this.props; - const { employeeStatus, targetTypeList, targetType, status, statusAll, loading, conditions } = this.state; + const { title, taxAgentStore: { personScopeForm } } = this.props, { loading } = this.state; const buttons = [ - , - + , + ]; return (
    {this.renderForm()}
    - {/**/} - {/* */} - {/*
    */} - {/* this.setState({ targetType })}*/} - {/* />*/} - {/* {this.renderBrowser()}*/} - {/*
    */} - {/* */} - {/* {*/} - {/* SelectWithAll({*/} - {/* label: "选择员工状态",*/} - {/* options: employeeStatus,*/} - {/* detailtype: 2,*/} - {/* valueAll: statusAll,*/} - {/* value: status,*/} - {/* onChangeAll: ({ selected }) => {*/} - {/* if (selected) {*/} - {/* this.setState({*/} - {/* status: _.map(employeeStatus, it => it.key).join(","),*/} - {/* statusAll: selected*/} - {/* });*/} - {/* } else {*/} - {/* this.setState({*/} - {/* status: "",*/} - {/* statusAll: selected*/} - {/* });*/} - {/* }*/} - {/* },*/} - {/* onChange: ({ selected }) => {*/} - {/* const bool = _.every(_.map(employeeStatus, it => it.key), item => selected.split(",").includes(item));*/} - {/* if (bool) {*/} - {/* this.setState({*/} - {/* status: selected,*/} - {/* statusAll: "0"*/} - {/* });*/} - {/* } else {*/} - {/* this.setState({*/} - {/* status: selected,*/} - {/* statusAll: ""*/} - {/* });*/} - {/* }*/} - {/* }*/} - {/* })*/} - {/* }*/} - {/*
    */}
    ); } From 4b11f39155725679c2137104cef94eaa2aaa2ac6 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Wed, 16 Oct 2024 11:18:10 +0800 Subject: [PATCH 072/110] =?UTF-8?q?feature/2.15.2.2409.01=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E4=B8=9A=E5=8A=A1=E7=BA=BF=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../variableSalary/components/salaryFileList/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index f924adff..6634dbd8 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -17,6 +17,7 @@ import { getSearchs } from "../../../../util"; import { extraConditions } from "../../conditions"; import AdvanceInputBtn from "../advanceInputBtn"; import SearchPannel from "../searchPannel"; +import { postFetch } from "../../../../util/request"; import { toJS } from "mobx"; import cs from "classnames"; @@ -36,7 +37,7 @@ class Index extends Component { } async componentDidMount() { - const { data: taxAgentOption } = await API.getAdminTaxAgentList(); + const { data: taxAgentOption } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }); this.setState({ condtions: _.map(extraConditions, item => { return { @@ -44,7 +45,7 @@ class Index extends Component { if (getKey(child) === "taxAgentIds") { return { ...child, label: getLabel(child.lanId, child.label), - options: _.map(taxAgentOption, o => ({ key: o.id, showname: o.content })) + options: _.map(taxAgentOption, o => ({ key: String(o.id), showname: o.name })) }; } return { ...child, label: getLabel(child.lanId, child.label) }; @@ -100,7 +101,8 @@ class Index extends Component { getVariableSalaryList = () => { const { baseTableStore: { VSalryForm, VExtraSalryForm, getVariableSalaryList } } = this.props; const { pageInfo } = this.state; - const { taxAgentIds } = VExtraSalryForm.getFormParams(), { departmentIds } = VSalryForm.getFormParams();this.setState({ loading: true }); + const { taxAgentIds } = VExtraSalryForm.getFormParams(), { departmentIds } = VSalryForm.getFormParams(); + this.setState({ loading: true }); getVariableSalaryList({ ...pageInfo, ...VSalryForm.getFormParams(), ...VExtraSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], From ef86c4faeffb83881584c5ce4824ef055788ec7b Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 25 Oct 2024 09:49:15 +0800 Subject: [PATCH 073/110] release/2.16.1.2410.01 --- .../pages/socialSecurityBenefits/standingBook/standingBook.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js index be80202c..ca615429 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js @@ -79,7 +79,7 @@ class StandingBook extends Component { this.setState({ accountDialog: { ...this.state.accountDialog, visible: false } }, () => { - this.wfListRef.wrappedInstance.getWelfareRecordList(); + this.wfListRef.getWelfareRecordList(); const calcPayload = { ...payload, creator }; window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?${convertToUrlString(calcPayload)}`); }); @@ -138,7 +138,7 @@ class StandingBook extends Component { onSearch={(payload) => { this.setState({ queryForm: { ...queryForm, ...payload } - }, () => this.wfListRef.wrappedInstance.getWelfareRecordList()); + }, () => this.wfListRef.getWelfareRecordList()); }} onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })} /> From 000f36ec0eff3449ae02677fb32b1b428c90e9be Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Mon, 28 Oct 2024 14:57:09 +0800 Subject: [PATCH 074/110] =?UTF-8?q?feature/2.15.2.2409.01=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E4=B8=9A=E5=8A=A1=E7=BA=BF=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fieldManagement/components/fieldSlide.js | 25 +++++++++---------- .../fieldManagement/components/fieldTable.js | 7 +++--- .../hrmSalary/pages/fieldManagement/index.js | 5 ++-- .../salaryFileAdvanceSearchPannel/index.js | 6 ++--- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js index 8a6533ee..047ced9c 100644 --- a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js +++ b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js @@ -22,6 +22,7 @@ import SlideModalTitle from "../../../components/slideModalTitle"; import { getSalaryFieldForm, saveSalaryField } from "../../../apis/fieldManage"; import { commonEnumList } from "../../../apis/payrollFiles"; import { dataTypeOptions, patternOptions, roundingModeOptions } from "../../salaryItem/options"; +import { postFetch } from "../../../util/request"; const getLabel = WeaLocaleProvider.getLabel; @@ -44,15 +45,17 @@ class FieldSlide extends Component { pattern: "2", sortedIndex: "", width: "", - description: "" + description: "", + taxAgentOption: [] }; } componentDidMount() { - const { taxAgentStore } = this.props; this.commonEnumList(); - const { fetchTaxAgentOption } = taxAgentStore; - fetchTaxAgentOption(); + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }) + .then(({ status, data }) => { + if (status) this.setState({ taxAgentOption: _.map(data, o => ({ key: String(o.id), showname: o.name })) }); + }); } componentWillReceiveProps(nextProps, nextContext) { @@ -203,13 +206,8 @@ class FieldSlide extends Component { }; render() { - const { - title, - visible, - record: { id: editId }, - taxAgentStore: { taxAgentOption, showSalaryItemBtn, showOperateBtn }, - onCancel - } = this.props; + const { title, visible, record: { id: editId }, onCancel, taxAgentStore: { PageAndOptAuth } } = this.props; + const admin = PageAndOptAuth.opts.includes("admin"); const { loading, name, @@ -224,7 +222,8 @@ class FieldSlide extends Component { pattern, sortedIndex, width, - description + description, + taxAgentOption } = this.state; return ( } diff --git a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js index 840da963..d470705b 100644 --- a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js +++ b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js @@ -57,7 +57,8 @@ class FieldTable extends Component { getColumns = () => { const { columns } = this.state; const { taxAgentStore, onEditLedger, onDeleteLedger } = this.props; - const { showSalaryItemBtn, showOperateBtn } = taxAgentStore; + const { PageAndOptAuth } = taxAgentStore; + const admin = PageAndOptAuth.opts.includes("admin"); return _.map([...columns, { dataIndex: "operate", display: true, @@ -72,9 +73,9 @@ class FieldTable extends Component { item.render = (text, record) => { return
    onEditLedger(record)}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"} + onClick={() => onEditLedger(record)}>{admin ? "编辑" : "查看"} { - record.canDelete && (showSalaryItemBtn || showOperateBtn) && + record.canDelete && admin && onDeleteLedger(record)}>删除 } } iconBgcolor="#F14A2D" className="fieldManageWrapper" - buttons={(showSalaryItemBtn || showOperateBtn) ? btns : btns.slice(-1)} + buttons={admin ? btns : btns.slice(-1)} showDropIcon onDropMenuClick={this.onDropMenuClick} dropMenuDatas={[ { diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js index 3f164873..bf066c7f 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js @@ -11,7 +11,7 @@ import { inject, observer } from "mobx-react"; import { getSearchs } from "../../../../util"; import * as API from "../../../../apis/payrollFiles"; import { salaryFileSearchConditions } from "../../config"; -import { getTaxAgentSelectList } from "../../../../apis/taxAgent"; +import { postFetch } from "../../../../util/request"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @@ -29,7 +29,7 @@ class salaryFileAdvanceSearchPannel extends Component { async componentDidMount() { const [{ data: userStatusList }, { data: taxAgentList }] = await Promise.all([ API.commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }), - getTaxAgentSelectList() + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }) ]); this.setState({ searchConditions: _.map(salaryFileSearchConditions, item => { @@ -44,7 +44,7 @@ class salaryFileAdvanceSearchPannel extends Component { } else if (getKey(child) === "taxAgentIds") { return { ...child, - options: _.map(taxAgentList, o => ({ key: o.id, showname: o.content })) + options: _.map(taxAgentList, o => ({ key: String(o.id), showname: o.name })) }; } return { ...child }; From e4800170a8f277484a3689f5f6eeaf27a984efaa Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 31 Oct 2024 15:13:57 +0800 Subject: [PATCH 075/110] =?UTF-8?q?feature/2.15.2.2409.01=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E4=B8=9A=E5=8A=A1=E7=BA=BF=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ledgerBaseSetting.js | 9 ++++---- pc4mobx/hrmSalary/pages/ledgerPage/index.js | 21 ++++++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js index ab35da97..d0651065 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js @@ -157,7 +157,7 @@ class LedgerBaseSetting extends Component { }; render() { - const { editId, record } = this.props; + const { editId, record, PageAndOptAuth } = this.props; const { baseForm, settingBaseInfo } = this.state; const { canEdit, taxAgentId } = settingBaseInfo; let taxAgentIdDisabled = false, taxableItemsDisabled = false; @@ -169,8 +169,7 @@ class LedgerBaseSetting extends Component { { _.map(baseForm, item => { const { key, label, type, options = [], children = [], multiple = false } = item; - taxAgentIdDisabled = false; - // taxAgentIdDisabled = key === "taxAgentId" && editId && taxAgentId; + taxAgentIdDisabled = key === "taxAgentId" && editId && !PageAndOptAuth.isChief; taxableItemsDisabled = key === "taxableItems" && editId; return : type === "SELECT" ? this.handleChangeField(key, v)}/> : type === "CUSTOM" ? { + const { taxAgentStore } = this.props; + const { PageAndOptAuth } = taxAgentStore; + if (!PageAndOptAuth.isAdminEnable && !PageAndOptAuth.isChief) { + Modal.info({ + title: getLabel(111, "提示"), + content: getLabel(111, "业务线人员新建账套后,需联系总管理员,将该账套加入所属业务线。"), + onOk: () => this.setState({ slideparams: { ...this.state.slideparams, visible: true } }) + }); + } else { + this.setState({ slideparams: { ...this.state.slideparams, visible: true } }); + } + }; render() { const { logDialogVisible, filterConditions, doSearch, slideparams } = this.state; @@ -57,9 +70,7 @@ class Index extends Component { const { PageAndOptAuth } = taxAgentStore; const admin = PageAndOptAuth.opts.includes("admin"); const btns = [ - , + , this.setState({ doSearch: !doSearch })}/> ]; return ( @@ -78,7 +89,7 @@ class Index extends Component { this.onDropMenuClick(type, targetid)}/> this.setState({ doSearch: !doSearch })} /> From 2e94324bb730ebf62151c2e494d2ffe264d7b91e Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Mon, 4 Nov 2024 16:33:32 +0800 Subject: [PATCH 076/110] =?UTF-8?q?feature/2.15.2.2409.01=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E4=B8=9A=E5=8A=A1=E7=BA=BF=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salary/components/personalScope.js | 13 +++--- .../salary/components/personalScopeModal.js | 45 ++++++++++++++----- .../salary/components/personalScopeTable.js | 5 ++- 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js index 451fbda8..b051642f 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -30,7 +30,9 @@ class PersonalScope extends Component { this.state = { searchValue: "", selectedKey: "listInclude", rowKeys: [], loading: false, extEmpsWitch: "1", //非系统人员开关, 1: 开启, 0:关闭 - personalAddModal: { visible: false, externalVisible: false, title: getLabel(111, "关联人员"), includeType: "" }, + personalAddModal: { + visible: false, externalVisible: false, title: getLabel(111, "关联人员"), includeType: "", record: {} + }, importParams: { visible: false, title: getLabel(111, "数据导入"), nextloading: false, importResult: {}, imageId: "", link: `/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${props.taxAgentId}`, @@ -89,11 +91,11 @@ class PersonalScope extends Component { * Params: * Date: 2022/11/30 */ - handleAddPersonal = () => { + handleAddPersonal = (record = {}) => { const { personalAddModal, selectedKey } = this.state; this.setState({ personalAddModal: { - ...personalAddModal, + ...personalAddModal, record, visible: selectedKey !== "listExt", externalVisible: selectedKey === "listExt", includeType: selectedKey === "listInclude" ? 1 : 0 @@ -166,7 +168,7 @@ class PersonalScope extends Component { disabled={_.isEmpty(rowKeys)} onClick={this.taxAgentRangeDelete} />, - , + this.handleAddPersonal()}/>, this.setState({ rowKeys })} + onEditScope={this.handleAddPersonal} /> {/*非系统人员添加*/} this.personalScopeTableRef.getPersonalScopeList()} onCancel={(callback) => this.setState({ - personalAddModal: { ...personalAddModal, visible: false, includeType: "" } + personalAddModal: { ...personalAddModal, visible: false, includeType: "", record: {} } }, () => callback && callback()) } /> diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index 3e649880..040db1e1 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react"; import { WeaSwitch } from "comsMobx"; import { WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { Button, message } from "antd"; -import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent"; +import { getTaxAgentRangeForm, taxAgentRangeEdit, taxAgentRangeSave } from "../../../apis/taxAgent"; import { personScopeConditions, scopeSelectLinkageDatas } from "./constants"; const getKey = WeaTools.getKey; @@ -26,11 +26,12 @@ class PersonalScopeModal extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentRangeForm(); + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentRangeForm(nextProps); if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.initPersonScopeForm(); } - getTaxAgentRangeForm = () => { + getTaxAgentRangeForm = (props) => { + const { record } = props; getTaxAgentRangeForm().then(({ status, data }) => { if (status) { const { employeeStatus, targetTypeList } = data; @@ -39,16 +40,39 @@ class PersonalScopeModal extends Component { ...item, items: _.map(item.items, o => { if (getKey(o) === "employeeStatus") { return { - ...o, label: getLabel(o.lanId, o.label), + ...o, label: getLabel(o.lanId, o.label), value: !_.isEmpty(record) ? record.status : "", options: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })) }; } return { - ...o, label: getLabel(o.lanId, o.label), + ...o, label: getLabel(o.lanId, o.label), viewAttr: !_.isEmpty(record) ? 1 : 3, options: _.map(targetTypeList, it => ({ - key: it.id, showname: it.name, selected: it.id === "EMPLOYEE" + key: it.id, showname: it.name, + selected: !_.isEmpty(record) ? it.id === record.targetType : it.id === "EMPLOYEE" })), - selectLinkageDatas: { ...scopeSelectLinkageDatas } + selectLinkageDatas: { + ..._.reduce(_.keys(scopeSelectLinkageDatas), (pre, cur) => { + if (cur !== "SQL") { + return { + ...pre, + [cur]: { + ...scopeSelectLinkageDatas[cur], + browserConditionParam: { + ...scopeSelectLinkageDatas[cur].browserConditionParam, + isSingle: true, + replaceDatas: !_.isEmpty(record) ? [{ + id: String(record.targetId), + name: record.targetName + }] : [] + } + } + }; + } + return { + ...pre, [cur]: { ...scopeSelectLinkageDatas[cur], value: !_.isEmpty(record) ? record.target : "" } + }; + }, {}) + } }; }) })) @@ -57,20 +81,21 @@ class PersonalScopeModal extends Component { }); }; taxAgentRangeSave = () => { - const { taxAgentStore: { personScopeForm } } = this.props; + const { taxAgentStore: { personScopeForm }, record = {} } = this.props; personScopeForm.validateForm().then(f => { if (f.isValid) { const { employeeStatus, targetType, target } = personScopeForm.getFormParams(); const { includeType, taxAgentId } = this.props; const payload = { - includeType, taxAgentId, employeeStatus: employeeStatus.split(","), + includeType, taxAgentId, employeeStatus: employeeStatus.split(","), id: record.id, targetParams: _.map(target.split(","), it => ({ targetType, targetId: targetType === "SQL" ? "0" : it, target: targetType === "SQL" ? target : "" })) }; this.setState({ loading: true }); - taxAgentRangeSave(payload).then(({ status, errormsg }) => { + const API = !_.isEmpty(record) ? taxAgentRangeEdit : taxAgentRangeSave; + API(payload).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { message.success(getLabel(111, "操作成功!")); diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js index 87bf46cb..e09e2ea9 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeTable.js @@ -64,7 +64,10 @@ class PersonalScopeTable extends Component { columns: _.map(columns, item => { return { ...item, - render: (text) => { + render: (text, record) => { + if (item.dataIndex === "targetName") { + return this.props.onEditScope(record)}>{text}; + } return {text}; } }; From fb3a5c8d96b81a9acdf4262519045cd5704628f1 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Wed, 6 Nov 2024 10:34:36 +0800 Subject: [PATCH 077/110] =?UTF-8?q?feature/2.15.2.2409.01=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E4=B8=9A=E5=8A=A1=E7=BA=BF=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index dbcba6cc..f9f8dcc1 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -22,7 +22,7 @@ export default class SalaryItem extends React.Component { name: "", isQuery: false, loading: false, sysVisible: false, customItemDialog: { visible: false, title: "", buttons: [] },// 自定义薪资项弹窗 syncSalarySetDialog: { visible: false, id: "" }, // 同步到薪资账套弹窗 - logDialogVisible: false, filterConditions: "[]", + logDialogVisible: false, filterConditions: "[]", selectedRowKeys: [], salaryItemImpDialog: { visible: false, title: getLabel(24023, "数据导入") } }; } From 4473d8dad5a42b70f28f90a60de867af14112eb1 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 19 Nov 2024 09:56:29 +0800 Subject: [PATCH 078/110] =?UTF-8?q?feature/2.15.2.2411.01=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E7=BA=BF-=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/components/index.js | 111 ------------------ pc4mobx/hrmSalary/config.js | 3 +- pc4mobx/hrmSalary/index.js | 2 + pc4mobx/hrmSalary/pages/datapush/index.js | 59 ++++++++++ pc4mobx/hrmSalary/pages/datapush/index.less | 0 .../hrmSalary/pages/variableSalary/index.js | 1 - pc4mobx/hrmSalary/stores/baseForm.js | 60 +--------- 7 files changed, 67 insertions(+), 169 deletions(-) delete mode 100644 pc4mobx/hrmSalary/components/index.js create mode 100644 pc4mobx/hrmSalary/pages/datapush/index.js create mode 100644 pc4mobx/hrmSalary/pages/datapush/index.less diff --git a/pc4mobx/hrmSalary/components/index.js b/pc4mobx/hrmSalary/components/index.js deleted file mode 100644 index 74d0b74a..00000000 --- a/pc4mobx/hrmSalary/components/index.js +++ /dev/null @@ -1,111 +0,0 @@ -import React from "react"; -import { inject, observer } from "mobx-react"; -import { toJS } from "mobx"; - -import { Button } from "antd"; -import { WeaLogView } from "comsMobx"; -import { WeaLocaleProvider, WeaNewScroll, WeaTop } from "ecCom"; - -import { getSearchs, renderLoading, renderNoright } from "../util"; // 从util文件引入公共的方法 - -const getLabel = WeaLocaleProvider.getLabel; -const WeaLogViewComp = WeaLogView.Component; - -@inject("baseFormStore") -@observer -export default class BaseForm extends React.Component { - componentWillMount() { // 初始化渲染页面 - const { baseFormStore: { doInit } } = this.props; - doInit(); - } - - componentWillReceiveProps(nextProps) { - const { baseFormStore: { doInit } } = this.props; - if (this.props.location.key !== nextProps.location.key) { // 手动刷新、切换菜单 重新初始化 - doInit(); - } - } - - // 渲染右键菜单和顶部下拉菜单 - getRightMenu() { - const { baseFormStore: { setLogVisible, saveForm } } = this.props; - let btnArr = [ - { - key: "BTN_SAVE", - icon: , - content: `${getLabel(86, "保存")}`, - onClick: () => saveForm() - }, - { - key: "log", - content: getLabel(83, "日志"), - icon: , - onClick: () => setLogVisible(true) - }]; - return btnArr; - } - - render() { - /* 页面渲染说明: - 1、判断是否无权限: 是显示无权限页面 - 2、渲染form页面: - 2-1: WeaRightMenu 右键菜单 - 2-2: WeaTop: 顶部: 包括下拉菜单 - 2-3: renderLoading: 加载数据中的loading效果(统一封装在util中) - 2-4: WeaNewScroll 顶部以下超长滚动处理 - 2-5: 通过getSearchs方法渲染form - */ - const { baseFormStore } = this.props; - const { - loading, - hasRight, - form, - condition, - logVisible, - logStore, - saveLoading, - setLogVisible, - saveForm - } = baseFormStore; // 从后台取数据 和 方法 - - if (!hasRight && !loading) { // 无权限处理 - return renderNoright(); - } - - const btns = [ // 顶部按钮 - - ]; - const collectParams = { // 收藏功能配置 - favname: "基础表单", - favouritetype: 1, - objid: 0, - link: "wui/index.html#/ns_demo01/index", - importantlevel: 1 - }; - return ( - } // 左侧图标 - iconBgcolor="#F14A2D" // 左侧图标背景色 - buttons={btns} // 顶部按钮: 这里是保存按钮,不需要可以不显示 - buttonSpace={10} // 按钮之间的间隔 - showDropIcon={true} // 是否显示右侧下拉按钮 - dropMenuDatas={this.getRightMenu()} // 下拉菜单(和页面的右键菜单相同) - dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 - > - {loading ? renderLoading() : - - {getSearchs(form, toJS(condition), 1)} - - } - setLogVisible(false)} // 关闭日志弹框时的操作:设置logVisible属性为false - logStore={logStore} // 日志的store - logType="1" // 模块编码: 该参数要根据模块来给 - logSmallType="1" // 细分模块编码: 该参数要根据模块来给 - /> - - ); - } -} diff --git a/pc4mobx/hrmSalary/config.js b/pc4mobx/hrmSalary/config.js index ba422c79..ca719497 100644 --- a/pc4mobx/hrmSalary/config.js +++ b/pc4mobx/hrmSalary/config.js @@ -18,5 +18,6 @@ export const PAGE = { "salaryField": ["/hrmSalary/fieldManagement"], //字段管理 "salaryItem": ["/hrmSalary/salaryItem"], //薪资项目管理 "siScheme": ["/socialSecurityBenefits/programme"], //社保福利方案 - "report": ["/hrmSalary/analysisOfSalaryStatistics", "/hrmSalary/reportView"] //报表 + "report": ["/hrmSalary/analysisOfSalaryStatistics", "/hrmSalary/reportView"], //报表 + "dataPush": ["/hrmSalary/datapush"] //数据推送 }; diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 281bf1de..42d08cee 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -54,6 +54,7 @@ import AdjustSalaryManage from "./pages/adjustSalaryManage"; import TopologyMap from "./pages/topologyMap"; import SupplementaryCalc from "./pages/supplementaryCalc"; import VariableSalary from "./pages/variableSalary"; +import Datapush from "./pages/datapush"; import Layout from "./layout"; import stores from "./stores"; import "./style/index"; @@ -116,6 +117,7 @@ const Routes = ( + diff --git a/pc4mobx/hrmSalary/pages/datapush/index.js b/pc4mobx/hrmSalary/pages/datapush/index.js new file mode 100644 index 00000000..dd7d1c3b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/datapush/index.js @@ -0,0 +1,59 @@ +/* + * 数据推送 + * + * @Author: 黎永顺 + * @Date: 2024/11/19 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaLocaleProvider, WeaReqTop } from "ecCom"; +import { Button } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("taxAgentStore", "baseFormStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "datapush", isQuery: false + }; + } + + handleOperate = () => { + }; + + render() { + const { selectedKey } = this.state; + const { taxAgentStore: { PageAndOptAuth }, baseFormStore: { form } } = this.props; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); + const tabs = [ + { + title: getLabel(111, "数据推送"), key: "datapush", showDropIcon: false, dropMenuDatas: [], + buttons: showOperateBtn ? [ + + ] : [], + children: null + } + ]; + return ( + } selectedKey={selectedKey} + iconBgcolor="#F14A2D" tabDatas={tabs} className="datapush_wrapper" buttonSpace={10} + buttons={_.find(tabs, o => selectedKey === o.key).buttons} + onChange={selectedKey => this.setState({ selectedKey })} + showDropIcon={_.find(tabs, o => selectedKey === o.key).showDropIcon} onDropMenuClick={this.handleOperate} + dropMenuDatas={_.find(tabs, o => selectedKey === o.key).dropMenuDatas} + > + {_.find(tabs, o => selectedKey === o.key).children} + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/datapush/index.less b/pc4mobx/hrmSalary/pages/datapush/index.less new file mode 100644 index 00000000..e69de29b diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index 08fa8aa9..639355ea 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -19,7 +19,6 @@ import SalaryItemList from "./components/salaryItemList"; import SalaryFileList from "./components/salaryFileList"; import SalaryFileImportDialog from "./components/salaryFileImportDialog"; import { Button, message } from "antd"; -import cs from "classnames"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; diff --git a/pc4mobx/hrmSalary/stores/baseForm.js b/pc4mobx/hrmSalary/stores/baseForm.js index 3eb3a57e..65a4e574 100644 --- a/pc4mobx/hrmSalary/stores/baseForm.js +++ b/pc4mobx/hrmSalary/stores/baseForm.js @@ -1,64 +1,12 @@ import { action, observable } from "mobx"; -import { message } from "antd"; -import { WeaForm, WeaLogView } from "comsMobx"; -import { WeaLocaleProvider } from "ecCom"; +import { WeaForm } from "comsMobx"; -import * as API from "../apis"; // 引入API接口文件 - -const { LogStore } = WeaLogView; -const getLabel = WeaLocaleProvider.getLabel; export class BaseFormStore { + // 全局设置仓库 @observable form = new WeaForm(); // 规则渲染form - - @observable logStore = new LogStore(); - @observable condition = []; // 存储后台得到的form数据 - @observable saveLoading = false; // 保存状态处理:保证保存的时候接口只走一次 - @observable loading = true; // 页面初始化的loading状态:数据加载成功前后前使用 - @observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 + @action("初始化form表单") initForm = () => this.form = new WeaForm(); @observable logVisible = false; // 控制日志弹框的显影 - - @action // 初始化操作: 一般用来初始化获取后台数据 - doInit = () => { - this.getBaseForm(); - }; - - @action // 获得form配置数据 - getBaseForm = () => { - API.getBaseForm().then(action(result => { - this.loading = false; - this.hasRight = result.hasRight; - if (result.hasRight) { - this.condition = result.condition; - this.form.initFormFields(result.condition); - } - })); - }; - - @action // 保存 - saveForm = () => { - this.form.validateForm().then(action(f => { // 表单的校验: 直接使用form的validateForm方法即可 - if (f.isValid) { // 校验听过: 走保存接口 - this.saveLoading = true; - const params = this.form.getFormParams(); - API.saveForm(params).then(action( - result => { - this.saveLoading = false; - if (result.api_status) { // 保存成功: 1、给出提示 2、刷新form数据 - message.success(`${getLabel(18758, "保存成功")}`); - this.getBaseForm(); - } else { - message.error(`${getLabel(22620, "保存失败")}`); - } - } - )); - } else { - f.showErrors(); - } - })); - }; - - @action + @action("日志显隐开关") setLogVisible = bool => this.logVisible = bool; - } From da79b1b7ffc6d9c81ef4c804904621800e1215b6 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 19 Nov 2024 13:28:04 +0800 Subject: [PATCH 079/110] =?UTF-8?q?feature/2.15.2.2411.01=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E7=BA=BF-=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/datapush.js | 5 +++ .../datapush/components/datapushList/index.js | 39 +++++++++++++++++++ pc4mobx/hrmSalary/pages/datapush/index.js | 3 +- pc4mobx/hrmSalary/pages/datapush/index.less | 18 +++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 pc4mobx/hrmSalary/apis/datapush.js create mode 100644 pc4mobx/hrmSalary/pages/datapush/components/datapushList/index.js diff --git a/pc4mobx/hrmSalary/apis/datapush.js b/pc4mobx/hrmSalary/apis/datapush.js new file mode 100644 index 00000000..8287005c --- /dev/null +++ b/pc4mobx/hrmSalary/apis/datapush.js @@ -0,0 +1,5 @@ +import { postFetch } from "../util/request"; +// 推送配置列表 +export const getPushSettingList = (params) => { + return postFetch("/api/bs/hrmsalary/push/setting/list", params); +}; diff --git a/pc4mobx/hrmSalary/pages/datapush/components/datapushList/index.js b/pc4mobx/hrmSalary/pages/datapush/components/datapushList/index.js new file mode 100644 index 00000000..bcb3eb68 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/datapush/components/datapushList/index.js @@ -0,0 +1,39 @@ +/* + * 数据推送列表 + * + * @Author: 黎永顺 + * @Date: 2024/11/19 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import * as API from "../../../../apis/datapush"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + componentDidMount() { + this.getPushSettingList(); + } + + getPushSettingList = () => { + const payload = {}; + API.getPushSettingList(payload).then(({ status, data }) => { + if (status) { + console.log(data); + } + }); + }; + + render() { + return ( +
    + +
    + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/datapush/index.js b/pc4mobx/hrmSalary/pages/datapush/index.js index dd7d1c3b..e94935d4 100644 --- a/pc4mobx/hrmSalary/pages/datapush/index.js +++ b/pc4mobx/hrmSalary/pages/datapush/index.js @@ -10,6 +10,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaReqTop } from "ecCom"; +import DatapushList from "./components/datapushList"; import { Button } from "antd"; import "./index.less"; @@ -38,7 +39,7 @@ class Index extends Component { buttons: showOperateBtn ? [ ] : [], - children: null + children: } ]; return ( diff --git a/pc4mobx/hrmSalary/pages/datapush/index.less b/pc4mobx/hrmSalary/pages/datapush/index.less index e69de29b..a6b2b1f0 100644 --- a/pc4mobx/hrmSalary/pages/datapush/index.less +++ b/pc4mobx/hrmSalary/pages/datapush/index.less @@ -0,0 +1,18 @@ +.datapush_wrapper { + .wea-new-top-req-title > div:last-child { + right: 16px !important; + } + + .wea-new-top-req-content { + padding: 8px 16px 0 16px; + + .wea-new-table { + background: #FFF; + } + + .ant-spin-nested-loading, .ant-spin-container { + height: 100% !important; + } + + } +} From a2c5fdc5ec81be6082f129c040e19cf0b4da4ba7 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 19 Nov 2024 18:58:39 +0800 Subject: [PATCH 080/110] =?UTF-8?q?feature/2.15.2.2411.01=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E7=BA=BF-=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/datapush.js | 13 ++ .../datapush/components/DPDialog/index.js | 128 ++++++++++++++++++ .../datapush/components/datapushList/index.js | 65 +++++++-- .../hrmSalary/pages/datapush/conditions.js | 76 +++++++++++ pc4mobx/hrmSalary/pages/datapush/index.js | 53 ++++++-- pc4mobx/hrmSalary/pages/datapush/index.less | 62 +++++++++ 6 files changed, 379 insertions(+), 18 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/datapush/components/DPDialog/index.js create mode 100644 pc4mobx/hrmSalary/pages/datapush/conditions.js diff --git a/pc4mobx/hrmSalary/apis/datapush.js b/pc4mobx/hrmSalary/apis/datapush.js index 8287005c..5260d269 100644 --- a/pc4mobx/hrmSalary/apis/datapush.js +++ b/pc4mobx/hrmSalary/apis/datapush.js @@ -1,5 +1,18 @@ +import { WeaTools } from "ecCom"; import { postFetch } from "../util/request"; // 推送配置列表 export const getPushSettingList = (params) => { return postFetch("/api/bs/hrmsalary/push/setting/list", params); }; +// 保存推送配置 +export const savePushSetting = (params) => { + return postFetch("/api/bs/hrmsalary/push/setting/save", params); +}; +// 删除推送配置 +export const deletePushSetting = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/push/setting/delete", "GET", params); +}; +// 推送配置明细列表 +export const getPushItemList = (params) => { + return postFetch("/api/bs/hrmsalary/push/item/list", params); +}; diff --git a/pc4mobx/hrmSalary/pages/datapush/components/DPDialog/index.js b/pc4mobx/hrmSalary/pages/datapush/components/DPDialog/index.js new file mode 100644 index 00000000..4c76dd1e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/datapush/components/DPDialog/index.js @@ -0,0 +1,128 @@ +/* + * 数据推送 + * 新增编辑 + * @Author: 黎永顺 + * @Date: 2024/11/19 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaButtonIcon, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTable, WeaTools } from "ecCom"; +import { postFetch } from "../../../../util/request"; +import * as API from "../../../../apis/datapush"; +import { conditions } from "../../conditions"; +import { getSearchs } from "../../../../util"; +import { Button, message } from "antd"; + +const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; + +@inject("baseFormStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false, columns: [], dataSource: [] + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + document.querySelector(".datapush_wrapper").classList.add("zIndex0-weaslide-title"); + this.initForm(nextProps); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + document.querySelector(".datapush_wrapper").classList.remove("zIndex0-weaslide-title"); + this.props.baseFormStore.initForm(); + } + } + + initForm = async (props) => { + const { detail } = props; + const { data: salarySobList } = await postFetch("/api/bs/hrmsalary/salarysob/listAuth", { filterType: "ADMIN_DATA" }); + this.setState({ + conditions: _.map(conditions, item => ({ + ...item, title: getLabel(item.lanId, item.title), items: _.map(item.items, o => { + o = { ...o, label: getLabel(o.lanId, o.label), value: detail[getKey(o)] ? String(detail[getKey(o)]) : "" }; + if (getKey(o) === "salarySobIds") { + return { + ...o, value: detail[getKey(o)] ? detail[getKey(o)] : "", + options: _.map(salarySobList, o => ({ key: String(o.id), showname: o.name })) + }; + } + return { ...o }; + }) + })) + }, () => { + props.baseFormStore.form.initFormFields(this.state.conditions); + !_.isEmpty(detail) && this.getPushItemList(props); + }); + }; + getPushItemList = ({ detail }) => { + const { id: settingId } = detail; + API.getPushItemList({ settingId }).then(({ status, data }) => { + if (status) { + const { columns, list: dataSource } = data; + this.setState({ dataSource, columns }); + } + }); + }; + save = () => { + const { baseFormStore: { form }, detail } = this.props; + form.validateForm().then(f => { + if (f.isValid) { + const { salarySobIds, ...payload } = form.getFormParams(); + this.setState({ loading: true }); + API.savePushSetting({ ...payload, salarySobIds: salarySobIds.split(","), id: detail.id }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功")); + this.props.onClose(this.props.onSearch()); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + renderTitle = () => { + const { loading } = this.state, { title } = this.props; + return
    +
    +
    +
    {title}
    +
    +
    + +
    +
    ; + }; + + render() { + const { baseFormStore: { form }, detail } = this.props, { conditions, columns, dataSource } = this.state; + return ( + {getSearchs(form, conditions, 2, false)} + { + !_.isEmpty(detail) && + +
    + +
    + +
    + } +
    } + />); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/datapush/components/datapushList/index.js b/pc4mobx/hrmSalary/pages/datapush/components/datapushList/index.js index bcb3eb68..83b83ac1 100644 --- a/pc4mobx/hrmSalary/pages/datapush/components/datapushList/index.js +++ b/pc4mobx/hrmSalary/pages/datapush/components/datapushList/index.js @@ -8,31 +8,78 @@ * @description: */ import React, { Component } from "react"; -import { WeaLocaleProvider } from "ecCom"; +import { WeaCheckbox, WeaLocaleProvider, WeaTable } from "ecCom"; import * as API from "../../../../apis/datapush"; const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { + constructor(props) { + super(props); + this.state = { + columns: [], dataSource: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 } + }; + } + componentDidMount() { this.getPushSettingList(); } - getPushSettingList = () => { - const payload = {}; + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.isQuery !== this.props.isQuery) this.setState({ + pageInfo: { ...this.state.pageInfo, current: 1 } + }, () => this.getPushSettingList(nextProps)); + } + + getPushSettingList = (props) => { + const { pageInfo } = this.state, { query } = props || this.props; + const payload = { ...pageInfo, ...query }; + this.setState({ loading: true }); API.getPushSettingList(payload).then(({ status, data }) => { + this.setState({ loading: false }); if (status) { - console.log(data); + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + dataSource: _.map(dataSource, o => ({ + ...o, salarySobs: _.map(o.salarySobs, k => k.name).join(","), + salarySobIds: _.map(o.salarySobs, k => k.id).join(",") + })), + columns: [..._.map(columns, o => { + if (o.dataIndex === "able") return { + ...o, render: v => () + }; + return { ...o }; + }), { + title: getLabel(111, "操作"), dataIndex: "opts", width: 120, render: (__, record) => ( + this.props.onChange("edit", record)}>{getLabel(111, "编辑")} + this.props.onChange("del", record.id)}>{getLabel(111, "删除")} + ) + }] + }); } }); }; render() { - return ( -
    - -
    - ); + const { columns, dataSource, loading, pageInfo } = this.state; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getPushSettingList()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getPushSettingList()); + } + }; + return (); } } diff --git a/pc4mobx/hrmSalary/pages/datapush/conditions.js b/pc4mobx/hrmSalary/pages/datapush/conditions.js new file mode 100644 index 00000000..5ab37972 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/datapush/conditions.js @@ -0,0 +1,76 @@ +// 推送配置表单 +export const conditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["name"], + fieldcol: 14, + label: "任务名称", + lanId: 111, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SWITCH", + domkey: ["able"], + fieldcol: 14, + label: "是否启用", + lanId: 111, + labelcol: 6, + value: "0", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["salarySobIds"], + fieldcol: 14, + label: "薪资账套", + lanId: 111, + labelcol: 6, + value: "", + multiple: true, + options: [], + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["tableName"], + fieldcol: 14, + label: "数据表名", + lanId: 111, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["modeName"], + fieldcol: 14, + label: "建模名称", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["modeId"], + fieldcol: 14, + label: "建模ID", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + } + ], + title: "基础信息", + lanId: 111, + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/datapush/index.js b/pc4mobx/hrmSalary/pages/datapush/index.js index e94935d4..1bbf5add 100644 --- a/pc4mobx/hrmSalary/pages/datapush/index.js +++ b/pc4mobx/hrmSalary/pages/datapush/index.js @@ -9,9 +9,11 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaLocaleProvider, WeaReqTop } from "ecCom"; +import { WeaInputSearch, WeaLocaleProvider, WeaReqTop } from "ecCom"; +import * as API from "../../apis/datapush"; import DatapushList from "./components/datapushList"; -import { Button } from "antd"; +import DatapushDialog from "./components/DPDialog"; +import { Button, message, Modal } from "antd"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -22,24 +24,54 @@ class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "datapush", isQuery: false + selectedKey: "datapush", isQuery: false, query: { name: "" }, + DPDialog: { visible: false, title: "", detail: {} } //数据推送弹框 }; } - handleOperate = () => { + handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery }); + handleOperate = (type, detail = {}) => { + switch (type) { + case "create": + case "edit": + const title = type === "create" ? getLabel(111, "新建") : getLabel(111, "编辑"); + this.setState({ DPDialog: { visible: true, title, detail } }); + break; + case "del": + Modal.confirm({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "确认要删除吗?"), + onOk: () => { + API.deletePushSetting({ id: detail }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "删除成功")); + this.handleAdvanceSearch(); + } else { + message.error(errormsg); + } + }); + } + }); + break; + default: + break; + } }; render() { - const { selectedKey } = this.state; - const { taxAgentStore: { PageAndOptAuth }, baseFormStore: { form } } = this.props; + const { selectedKey, DPDialog, isQuery, query } = this.state; + const { taxAgentStore: { PageAndOptAuth } } = this.props; const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const tabs = [ { title: getLabel(111, "数据推送"), key: "datapush", showDropIcon: false, dropMenuDatas: [], buttons: showOperateBtn ? [ - - ] : [], - children: + , + this.setState({ query: { ...query, name: v } })}/> + ] : [ this.setState({ query: { ...query, name: v } })}/>], + children: } ]; return ( @@ -52,6 +84,9 @@ class Index extends Component { dropMenuDatas={_.find(tabs, o => selectedKey === o.key).dropMenuDatas} > {_.find(tabs, o => selectedKey === o.key).children} + {/*数据推送框*/} + this.setState({ DPDialog: { ...DPDialog, visible: false } })} + onSearch={this.handleAdvanceSearch}/> ); } diff --git a/pc4mobx/hrmSalary/pages/datapush/index.less b/pc4mobx/hrmSalary/pages/datapush/index.less index a6b2b1f0..d96d8b5e 100644 --- a/pc4mobx/hrmSalary/pages/datapush/index.less +++ b/pc4mobx/hrmSalary/pages/datapush/index.less @@ -14,5 +14,67 @@ height: 100% !important; } + .pushdata_create_dialog { + .scroller { + background: #f6f6f6; + } + + .pushdata_detail { + .opts { + width: 100%; + display: flex; + justify-content: flex-end; + align-items: center; + padding: 8px; + } + } + + .wea-slide-modal-title { + border-bottom: 1px solid #ebebeb; + } + + .titleDialog { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 46px 0 16px; + + .titleCol { + flex: 1; + display: flex; + align-items: center; + } + + .titleLeftBox { + .titleIcon { + color: #fff; + margin: 0; + width: 40px; + height: 40px; + line-height: 40px; + font-size: 22px; + display: flex; + align-items: center; + justify-content: center; + background: #F14A2D; + border-radius: 50%; + } + + .title { + font-size: 14px; + color: #333; + padding-left: 6px; + } + } + + .titleRightBox { + justify-content: flex-end; + + button:last-child { + margin-left: 10px; + } + } + } + } } } From 18a87cb45c463177d5a5d2536ef9d3dba41baaae Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Wed, 20 Nov 2024 15:30:14 +0800 Subject: [PATCH 081/110] =?UTF-8?q?feature/2.15.2.2411.01=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E7=BA=BF-=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/datapush.js | 8 ++ .../datapush/components/DPDialog/index.js | 67 +++++++-- .../components/PDDialog/customTreeSelect.js | 90 ++++++++++++ .../datapush/components/PDDialog/index.js | 135 ++++++++++++++++++ .../hrmSalary/pages/datapush/conditions.js | 61 +++++++- pc4mobx/hrmSalary/pages/datapush/index.less | 54 +++++++ pc4mobx/hrmSalary/stores/baseForm.js | 2 + 7 files changed, 403 insertions(+), 14 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/datapush/components/PDDialog/customTreeSelect.js create mode 100644 pc4mobx/hrmSalary/pages/datapush/components/PDDialog/index.js diff --git a/pc4mobx/hrmSalary/apis/datapush.js b/pc4mobx/hrmSalary/apis/datapush.js index 5260d269..3b2adc5c 100644 --- a/pc4mobx/hrmSalary/apis/datapush.js +++ b/pc4mobx/hrmSalary/apis/datapush.js @@ -16,3 +16,11 @@ export const deletePushSetting = (params) => { export const getPushItemList = (params) => { return postFetch("/api/bs/hrmsalary/push/item/list", params); }; +// 保存推送配置明细 +export const savePushItemList = (params) => { + return postFetch("/api/bs/hrmsalary/push/item/save", params); +}; +// 删除推送配置明细 +export const deletePushItemList = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/push/item/delete", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/pages/datapush/components/DPDialog/index.js b/pc4mobx/hrmSalary/pages/datapush/components/DPDialog/index.js index 4c76dd1e..bbd174fb 100644 --- a/pc4mobx/hrmSalary/pages/datapush/components/DPDialog/index.js +++ b/pc4mobx/hrmSalary/pages/datapush/components/DPDialog/index.js @@ -10,22 +10,23 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaButtonIcon, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTable, WeaTools } from "ecCom"; +import PDetailDialog from "../PDDialog"; import { postFetch } from "../../../../util/request"; import * as API from "../../../../apis/datapush"; import { conditions } from "../../conditions"; import { getSearchs } from "../../../../util"; -import { Button, message } from "antd"; +import { Button, message, Modal } from "antd"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; -@inject("baseFormStore") -@observer +@inject("baseFormStore") @observer class Index extends Component { constructor(props) { super(props); this.state = { - conditions: [], loading: false, columns: [], dataSource: [] + conditions: [], loading: false, columns: [], dataSource: [], + PDDialog: { visible: false, title: "", settingId: "", detail: {} } //推送明细弹框 }; } @@ -61,15 +62,52 @@ class Index extends Component { !_.isEmpty(detail) && this.getPushItemList(props); }); }; - getPushItemList = ({ detail }) => { + getPushItemList = (props) => { + const { detail } = props || this.props; const { id: settingId } = detail; API.getPushItemList({ settingId }).then(({ status, data }) => { if (status) { const { columns, list: dataSource } = data; - this.setState({ dataSource, columns }); + this.setState({ + dataSource, columns: [...columns, { + title: getLabel(111, "操作"), width: 120, render: (__, record) => ( + this.handleOpts("edit", record)}>{getLabel(111, "编辑")} + this.handleOpts("del", record.id)}>{getLabel(111, "删除")} + ) + }], + PDDialog: { ...this.state.PDDialog, settingId } + }); } }); }; + handleOpts = (type, detail = {}) => { + switch (type) { + case "edit": + const { PDDialog } = this.state; + this.setState({ PDDialog: { ...PDDialog, visible: true, title: getLabel(111, "编辑"), detail } }); + break; + case "del": + Modal.confirm({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "确认要删除吗?"), + onOk: () => { + API.deletePushItemList({ id: detail }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "删除成功")); + this.getPushItemList(); + } else { + message.error(errormsg); + } + }); + } + }); + break; + default: + break; + } + }; save = () => { const { baseFormStore: { form }, detail } = this.props; form.validateForm().then(f => { @@ -105,21 +143,24 @@ class Index extends Component { }; render() { - const { baseFormStore: { form }, detail } = this.props, { conditions, columns, dataSource } = this.state; + const { baseFormStore: { form }, detail } = this.props, { conditions, columns, dataSource, PDDialog } = this.state; return ( {getSearchs(form, conditions, 2, false)} - { - !_.isEmpty(detail) && + {!_.isEmpty(detail) &&
    - + this.setState({ + PDDialog: { ...PDDialog, visible: true, title: getLabel(111, "新建") } + })}/>
    - -
    - } + + this.setState({ PDDialog: { ...PDDialog, visible: false } })}/> + }
    } />); } diff --git a/pc4mobx/hrmSalary/pages/datapush/components/PDDialog/customTreeSelect.js b/pc4mobx/hrmSalary/pages/datapush/components/PDDialog/customTreeSelect.js new file mode 100644 index 00000000..eae803cd --- /dev/null +++ b/pc4mobx/hrmSalary/pages/datapush/components/PDDialog/customTreeSelect.js @@ -0,0 +1,90 @@ +/* + * 数据推送 + * 自定义薪资项目选择树 + * @Author: 黎永顺 + * @Date: 2024/11/20 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { TreeSelect } from "antd"; +import { formualSearchField, formualSearchGroup } from "../../../../apis/item"; +import cs from "classnames"; + +const getLabel = WeaLocaleProvider.getLabel; +const TreeNode = TreeSelect.TreeNode; + +class CustomTreeSelect extends Component { + constructor(props) { + super(props); + this.state = { sourceList: [] }; + } + + componentDidMount() { + formualSearchGroup({ referenceType: "sql" }).then(({ status, data }) => { + if (status) this.setState({ sourceList: _.map(data, o => ({ ...o, isLeaf: true })) }); + }); + } + + getSourceItem = (sourceId) => { + formualSearchField({ sourceId, extendParam: { referenceType: "sql" } }).then(({ status, data }) => { + if (status) { + this.setState({ + sourceList: _.map(this.state.sourceList, o => { + if (o.key === sourceId) return { + ...o, + children: _.map(data, k => ({ key: k.fieldId, value: k.name, fieldType: k.fieldType, isLeaf: false })) + }; + return { ...o }; + }) + }); + } + }); + }; + generateTreeNodes = (data) => { + const treeNodes = [], showData = [...data]; + showData.map((item) => { + let title = ( +
    + {item.value} + { + item.fieldType ? + {item.fieldType === "number" ? getLabel(111, "数字") : getLabel(111, "文本")} : + + } +
    + ); + treeNodes.push(); + }); + return treeNodes; + }; + handleSelect = (nodeValue) => { + const { form } = this.props, { sourceList } = this.state; + const [source, item] = nodeValue.split("_"); + const itemName = _.find(_.find(sourceList, o => o.key === source).children, k => k.key === nodeValue).value; + form.updateFields({ item, itemName, source }); + }; + + render() { + const { sourceList } = this.state, { form } = this.props; + const { source, item } = form.getFormParams(); + return ( + this.getSourceItem(node.props.value)} + onSelect={this.handleSelect}> + { + _.map(sourceList, o => ( + + {this.generateTreeNodes(o.children || [])} + )) + } + + ); + } +} + +export default CustomTreeSelect; diff --git a/pc4mobx/hrmSalary/pages/datapush/components/PDDialog/index.js b/pc4mobx/hrmSalary/pages/datapush/components/PDDialog/index.js new file mode 100644 index 00000000..d2abc335 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/datapush/components/PDDialog/index.js @@ -0,0 +1,135 @@ +/* + * 数据推送 + * 推送明细新增编辑 + * @Author: 黎永顺 + * @Date: 2024/11/20 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; +import CustomTreeSelect from "./customTreeSelect"; +import { commonEnumList } from "../../../../apis/ruleconfig"; +import * as API from "../../../../apis/datapush"; +import { PDConditions } from "../../conditions"; +import { WeaSwitch } from "comsMobx"; +import { Button, message } from "antd"; + + +const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; + +@inject("baseFormStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.initForm(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.baseFormStore.initFormExtra(); + } + + initForm = async (props) => { + const { detail = {} } = props; + const { data: fieldType } = await commonEnumList({ enumClass: "com.engine.salary.enums.push.PushItemFieldEnum" }); + this.setState({ + conditions: _.map(PDConditions, item => ({ + ...item, items: _.map(item.items, o => { + o = { ...o, label: getLabel(o.lanId, o.label), value: detail[getKey(o)] ? String(detail[getKey(o)]) : "" }; + if (getKey(o) === "fieldType") { + return { + ...o, value: detail[getKey(o)] ? String(detail[getKey(o)]) : "", + options: _.map(fieldType, o => ({ key: o.enum, showname: o.defaultLabel })) + }; + } + return { ...o }; + }) + })) + }, () => { + props.baseFormStore.formExtra.initFormFields(this.state.conditions); + }); + }; + + renderRuleForm = () => { + const { conditions } = this.state; + const { baseFormStore: { formExtra } } = this.props, { isFormInit } = formExtra; + const formParams = formExtra.getFormParams(); + let group = []; + isFormInit && conditions && conditions.map(c => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + { + getKey(fields) === "item" ? + + + { + _.isEmpty(formParams.item) && + + + + } + + : + } + ), + colSpan: 1, + hide: fields.hide + }); + }); + !_.isEmpty(items) && group.push( + ); + }); + return group; + }; + save = () => { + const { baseFormStore: { formExtra }, id, settingId } = this.props; + formExtra.validateForm().then(f => { + if (f.isValid) { + const payload = formExtra.getFormParams(); + this.setState({ loading: true }); + API.savePushItemList({ ...payload, settingId, id }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功")); + this.props.onCancel(this.props.onSearch()); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { loading } = this.state; + return ( + {getLabel(111, "取消")}, + + ]} + > +
    {this.renderRuleForm()}
    +
    + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/datapush/conditions.js b/pc4mobx/hrmSalary/pages/datapush/conditions.js index 5ab37972..b419a334 100644 --- a/pc4mobx/hrmSalary/pages/datapush/conditions.js +++ b/pc4mobx/hrmSalary/pages/datapush/conditions.js @@ -73,4 +73,63 @@ export const conditions = [ lanId: 111, defaultshow: true } -]; +];// 推送配置表单 +export const PDConditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["item"], + fieldcol: 14, + label: "薪资项目", + lanId: 111, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["itemName"], + fieldcol: 14, + label: "字段名称", + lanId: 111, + labelcol: 6, + viewAttr: 2, + hide: true + }, + { + conditionType: "INPUT", + domkey: ["source"], + fieldcol: 14, + label: "字段名称", + lanId: 111, + labelcol: 6, + viewAttr: 2, + hide: true + }, + { + conditionType: "INPUT", + domkey: ["fieldName"], + fieldcol: 14, + label: "字段名称", + lanId: 111, + labelcol: 6, + viewAttr: 2 + }, + { + conditionType: "SELECT", + domkey: ["fieldType"], + fieldcol: 14, + label: "字段类型", + lanId: 111, + labelcol: 6, + value: "", + options: [], + viewAttr: 2 + } + ], + title: "", + defaultshow: true + } +];// 推送详细配置表单 diff --git a/pc4mobx/hrmSalary/pages/datapush/index.less b/pc4mobx/hrmSalary/pages/datapush/index.less index d96d8b5e..57ea36c8 100644 --- a/pc4mobx/hrmSalary/pages/datapush/index.less +++ b/pc4mobx/hrmSalary/pages/datapush/index.less @@ -78,3 +78,57 @@ } } } + +.custom_item_treeselect { + .weapp-excel-code-action-list-variable-tip { + display: none; + } +} + +.no-child-item { + .ant-select-tree-switcher { + display: none !important; + } + + .ant-select-tree-node-content-wrapper { + width: 100%; + } + + .weapp-excel-code-action-list-variable { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + + .weapp-excel-code-action-list-variable-name { + height: 20px; + line-height: 18px; + -webkit-flex: 1 1; + flex: 1 1; + overflow: hidden; + text-overflow: ellipsis; + word-break: keep-all; + white-space: nowrap; + cursor: pointer; + } + + .danger { + color: rgb(255, 102, 106) !important; + border: 1px solid rgb(255, 193, 195) !important; + background-color: rgb(255, 223, 224) !important; + } + + .weapp-excel-code-action-list-variable-tip { + width: 40px; + height: 20px; + line-height: 18px; + text-align: center; + vertical-align: middle; + color: rgb(255, 205, 80); + border: 1px solid rgb(255, 222, 138); + background-color: rgb(255, 245, 219); + border-radius: 2px; + } + } +} + diff --git a/pc4mobx/hrmSalary/stores/baseForm.js b/pc4mobx/hrmSalary/stores/baseForm.js index 65a4e574..c4d10349 100644 --- a/pc4mobx/hrmSalary/stores/baseForm.js +++ b/pc4mobx/hrmSalary/stores/baseForm.js @@ -6,6 +6,8 @@ export class BaseFormStore { // 全局设置仓库 @observable form = new WeaForm(); // 规则渲染form @action("初始化form表单") initForm = () => this.form = new WeaForm(); + @observable formExtra = new WeaForm(); // 规则渲染form + @action("初始化form表单") initFormExtra = () => this.formExtra = new WeaForm(); @observable logVisible = false; // 控制日志弹框的显影 @action("日志显隐开关") setLogVisible = bool => this.logVisible = bool; From 571026ebf84d0f50e02ceb63463a850a89217317 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 21 Nov 2024 14:10:47 +0800 Subject: [PATCH 082/110] =?UTF-8?q?feature/2.15.2.2411.01=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E7=BA=BF-=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/associativeSearchMult.js | 13 +++-- .../components/customBrowserDialog.js | 2 + .../components/CustomBrowser/index.js | 10 +--- .../datapush/components/DPDialog/index.js | 10 ++-- .../components/PDDialog/customTreeSelect.js | 10 ++-- .../datapush/components/PDDialog/index.js | 53 +++---------------- .../hrmSalary/pages/datapush/conditions.js | 32 +++++++---- .../hrmSalary/pages/datapush/formRender.js | 51 ++++++++++++++++++ pc4mobx/hrmSalary/style/index.less | 2 +- 9 files changed, 101 insertions(+), 82 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/datapush/formRender.js diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js index 3f1dbc54..562ea657 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/associativeSearchMult.js @@ -33,18 +33,17 @@ class AssociativeSearchMult extends Component { } } - handleSearch = (value) => { - this.setState({ loading: true }); - this.getData(value); - }; + handleSearch = (value) => this.getData(value); getData = (name = "") => { - const { browserConditionParam } = this.props; + const { browserConditionParam, tags } = this.props; + if (tags) return; const { completeURL, filterByName, searchParamsKey, convertDatasource, dataParams = {} } = browserConditionParam; if (_.trim(name)) { let payload = { ...dataParams }; searchParamsKey && (payload = { ...payload, [searchParamsKey]: name, current: 1, pageSize: 9999 }); + this.setState({ loading: true }); postFetch(completeURL, payload).then(({ status, data }) => { this.setState({ loading: false }); if (status && data.list) { @@ -105,7 +104,7 @@ class AssociativeSearchMult extends Component { render() { const { data, dropdownWidth } = this.state; - const { viewAttr, selectedValues, datas, isSingle, browserConditionParam = {} } = this.props; + const { viewAttr, selectedValues, datas, isSingle, browserConditionParam = {}, tags } = this.props; const clsname = classNames({ "required": (viewAttr === 3 || viewAttr === "3") && _.isEmpty(selectedValues), "mr12": viewAttr === "3" && _.isEmpty(selectedValues), @@ -127,7 +126,7 @@ class AssociativeSearchMult extends Component { ); } let options = data.map(d => ); - selectedValues && selectedValues.map((v) => { + !tags && selectedValues && selectedValues.map((v) => { v && options.unshift(); }); const select =