From 7d3abf70bfdca730cfd8bbb659ed99774c489474 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, 25 Nov 2022 17:37:26 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E9=80=80=E5=B7=AE=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../standingBookDetail/components/index.less | 3 + .../components/regAddEmployee.js | 48 +++--- .../components/regSelect.js | 151 ++++++++++++++++++ 3 files changed, 172 insertions(+), 30 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 8fec2dbd..8c5cfa33 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -93,3 +93,6 @@ } } } +//退差人员选择框 +.regSelectWrapper{ +} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js index 82cad6e9..822cc0c7 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js @@ -7,7 +7,7 @@ import React, { Component } from "react"; import { WeaDatePicker, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; import { Button, Modal } from "antd"; -import { Select } from "../../../ruleConfig"; +import RegSelect from "./regSelect"; import * as API from "../../../../apis/standingBook"; class RegAddEmployee extends Component { @@ -77,12 +77,6 @@ class RegAddEmployee extends Component { handleSave = () => { const { baseInfo, returnPersonInfo, selectPersonInfo } = this.state; const { onSave } = this.props; - const payload = { - recessionMonthList: baseInfo.billMonth.split(","), - projects: baseInfo.itemsAll ? ["0"] : baseInfo.items.split(","), - includes: returnPersonInfo.employee.split(","), - excludes: selectPersonInfo.employee.split(",") - }; if (_.isEmpty(baseInfo.billMonth) || _.isEmpty(baseInfo.items) || _.isEmpty(returnPersonInfo.employee)) { Modal.warning({ title: "信息确认", @@ -90,6 +84,12 @@ class RegAddEmployee extends Component { }); return; } + const payload = { + recessionMonthList: baseInfo.billMonth.split(","), + projects: baseInfo.itemsAll ? ["0"] : baseInfo.items.split(","), + includes: returnPersonInfo.employee, + excludes: selectPersonInfo.employee + }; onSave(payload); }; @@ -143,38 +143,26 @@ class RegAddEmployee extends Component { ]; const returnPersonItems = [ { - com: Select({ - multiple: true, - label: "对象", - viewAttr: 3, - showSearch: true, - options: returnPersonInfo.employeeOptions, - value: returnPersonInfo.employee, - onChange: ({ selected }) => { - this.setState({ returnPersonInfo: { ...returnPersonInfo, employee: selected } }); - } - }) + com: this.setState({ returnPersonInfo: { ...returnPersonInfo, employee: selected } })} + /> } ]; const selectPersonItems = [ { - com: Select({ - multiple: true, - label: "选择人员", - viewAttr: 2, - showSearch: true, - options: selectPersonInfo.employeeOptions, - value: selectPersonInfo.employee, - onChange: ({ selected }) => { - this.setState({ selectPersonInfo: { ...selectPersonInfo, employee: selected } }); - } - }) + com: this.setState({ selectPersonInfo: { ...selectPersonInfo, employee: selected } })} + /> } ]; return ( diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js new file mode 100644 index 00000000..76b6954c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js @@ -0,0 +1,151 @@ +/* + * Author: 黎永顺 + * name: 退差人员选择弹框 + * Description: + * Date: 2022/11/25 + */ +import React, { Component } from "react"; +import { Button, Tag } from "antd"; +import { WeaDialog, WeaFormItem, WeaInputSearch, WeaTable } from "ecCom"; +import * as API from "../../../../apis/standingBook"; +import "./index.less"; + +class RegSelect extends Component { + constructor(props) { + super(props); + this.state = { + userName: "", + visible: false, + loading: false, + selectedRow: [], + dataSource: [], + pageInfo: { + pageNum: 1, + pageSize: 10, + total: 0 + } + }; + } + + getEmployeeListByTaxAgent = (params = {}) => { + const { pageInfo } = this.state; + const payload = { + ...pageInfo, + ...params + }; + this.setState({ loading: true }); + API.getEmployeeListByTaxAgent(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { list: dataSource, pageNum, pageSize, total } = data; + this.setState({ + dataSource, + pageInfo: { ...pageInfo, pageNum, pageSize, total } + }); + } + }); + }; + handleSave = () => { + const { onChange } = this.props; + const { selectedRow } = this.state; + this.setState({ + visible: false + }, () => { + const selected = _.map(selectedRow, it => it.employeeId); + onChange({ selected }); + }); + }; + handleClose = (key) => { + const { onChange } = this.props; + const { selectedRow } = this.state; + this.setState({ + selectedRow: _.filter(selectedRow, it => it.employeeId !== key) + }, () => { + const selected = _.map(selectedRow, it => it.employeeId); + onChange({ selected }); + }); + }; + + render() { + const { visible, loading, dataSource, pageInfo, selectedRow, userName } = this.state; + const { label, viewAttr } = this.props; + const pagination = { + current: pageInfo.pageNum, + pageSize: pageInfo.pageSize, + total: pageInfo.total, + showTotal: total => `共 ${total} 条`, + showQuickJumper: true, + onChange: (current) => { + this.setState({ pageInfo: { ...pageInfo, pageNum: current } }, () => { + this.getEmployeeListByTaxAgent(); + }); + } + }; + const rowSelection = { + selectedRowKeys: _.map(selectedRow, it => it.employeeId), + onChange: (selectedRowKeys, rowKey) => { + this.setState({ selectedRow: _.uniqWith([...selectedRow, ...rowKey], _.isEqual) }); + } + }; + const buttons = [ + , + + ]; + return ( +
+ + {selectedRow.map(tag => + this.handleClose(tag.employeeId)}> + {tag.username} + + )} + + { + _.isEmpty(selectedRow) && viewAttr === 3 && + + + + } + + this.setState({ visible: false })} + title="人员" + visible={visible} + loading={loading} + style={{ width: 680, height: 500 }} + hasScroll + buttons={buttons} + > +
+ this.setState({ userName })} + onSearch={() => this.getEmployeeListByTaxAgent({ userName })} + /> +
+ +
+
+ ); + } +} + +export default RegSelect; From 1f9e071b25db2bcd76107592820d52418ce8e318 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, 28 Nov 2022 11:17:38 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=80=E5=B7=AE?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=80=89=E6=8B=A9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../standingBookDetail/components/regSelect.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js index 76b6954c..853c2880 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js @@ -47,10 +47,10 @@ class RegSelect extends Component { }; handleSave = () => { const { onChange } = this.props; - const { selectedRow } = this.state; this.setState({ visible: false }, () => { + const { selectedRow } = this.state; const selected = _.map(selectedRow, it => it.employeeId); onChange({ selected }); }); @@ -61,6 +61,7 @@ class RegSelect extends Component { this.setState({ selectedRow: _.filter(selectedRow, it => it.employeeId !== key) }, () => { + const { selectedRow } = this.state; const selected = _.map(selectedRow, it => it.employeeId); onChange({ selected }); }); From 3ac1e4ea6bed0c83d14a31997e1bb6265ec5804e 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, 28 Nov 2022 16:24:33 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=80=E5=B7=AE?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=80=89=E6=8B=A9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/regSelect.js | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js index 853c2880..7155f9b4 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regSelect.js @@ -17,6 +17,7 @@ class RegSelect extends Component { userName: "", visible: false, loading: false, + selectedRowKeys: [], selectedRow: [], dataSource: [], pageInfo: { @@ -50,9 +51,8 @@ class RegSelect extends Component { this.setState({ visible: false }, () => { - const { selectedRow } = this.state; - const selected = _.map(selectedRow, it => it.employeeId); - onChange({ selected }); + const { selectedRowKeys } = this.state; + onChange({ selected: selectedRowKeys }); }); }; handleClose = (key) => { @@ -62,13 +62,15 @@ class RegSelect extends Component { selectedRow: _.filter(selectedRow, it => it.employeeId !== key) }, () => { const { selectedRow } = this.state; - const selected = _.map(selectedRow, it => it.employeeId); - onChange({ selected }); + this.setState({ + selectedRowKeys: _.map(selectedRow, it => it.employeeId) + }); + onChange({ selected: _.map(selectedRow, it => it.employeeId) }); }); }; render() { - const { visible, loading, dataSource, pageInfo, selectedRow, userName } = this.state; + const { visible, loading, dataSource, pageInfo, selectedRowKeys, selectedRow, userName } = this.state; const { label, viewAttr } = this.props; const pagination = { current: pageInfo.pageNum, @@ -83,9 +85,17 @@ class RegSelect extends Component { } }; const rowSelection = { - selectedRowKeys: _.map(selectedRow, it => it.employeeId), - onChange: (selectedRowKeys, rowKey) => { - this.setState({ selectedRow: _.uniqWith([...selectedRow, ...rowKey], _.isEqual) }); + selectedRowKeys: selectedRowKeys, + onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }), + onSelect: (record, selected) => { + if (selected) { + this.setState({ selectedRow: [...selectedRow, record] }); + } else { + this.setState({ selectedRow: _.xorWith(selectedRow, [record], _.isEqual) }); + } + }, + onSelectAll: (selected, selectedRows, changeRows) => { + this.setState({ selectedRow: _.xorWith(selectedRow, changeRows, _.isEqual) }); } }; const buttons = [ From d54f829f729d1b890a6ee5bb8510e4387fb2a208 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 Dec 2022 13:54:30 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=B0=83=E5=B7=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../standingBookDetail/components/normal.js | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index 67abafe6..f824f383 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -44,6 +44,7 @@ export default class NormalIndex extends Component { } }; this.timer = null; + this.timerDelete = null; } componentDidMount() { @@ -61,6 +62,9 @@ export default class NormalIndex extends Component { if (this.timer) { clearInterval(this.timer); } + if (this.timerDelete) { + clearInterval(this.timerDelete); + } } componentWillReceiveProps(nextProps) { @@ -270,14 +274,46 @@ export default class NormalIndex extends Component { title: "确认信息", content: "确认删除勾选的数据吗?", onOk: () => { + this.setState({ + progressVisible: true + }, () => { + this.timerDelete = setInterval(() => { + if (this.state.progress !== 100) { + this.setState({ + progress: this.state.progress + 10 + }); + } else { + clearInterval(this.timerDelete); + this.setState({ + progressVisible: false, + progress: 0 + }, () => { + message.success("删除成功"); + selectedKey === "1" + ? this.getNormalList({ + billMonth, + paymentOrganization, + current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length) + }) + : this.getSupplementaryList({ + billMonth, + current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length), + paymentOrganization + }); + }); + } + }, 800); + }); + siaccountCommonDelete({ billMonth, includes, ids, paymentOrganization }).then(() => { + clearInterval(this.timerDelete); message.success("删除成功"); - this.setState({ selectedRowKeys: [] }); + this.setState({ selectedRowKeys: [], progressVisible: false, progress: 0 }); selectedKey === "1" ? this.getNormalList({ billMonth, @@ -290,6 +326,7 @@ export default class NormalIndex extends Component { paymentOrganization }); }); + }, onCancel: () => { } @@ -331,7 +368,7 @@ export default class NormalIndex extends Component { this.timer = setInterval(() => { if (this.state.progress !== 100) { this.setState({ - progress: this.state.progress + 20 + progress: this.state.progress + 10 }); } else { clearInterval(this.timer); @@ -352,7 +389,7 @@ export default class NormalIndex extends Component { current: this.state.current }); } - }, 800); + }, 1000); }); }); } @@ -489,6 +526,8 @@ export default class NormalIndex extends Component { + } { @@ -501,6 +540,7 @@ export default class NormalIndex extends Component { } {/*核算进度条*/} { this.setState({ progressVisible: false, progress: 0 }); From 62cccbc7ac8c947dfee7711d0e01135c426ed482 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 Dec 2022 14:21:08 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E8=B0=83=E5=B7=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/adjustmentSlide.js | 78 +++++++++++++++++++ .../standingBookDetail/components/normal.js | 24 +++++- 2 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js new file mode 100644 index 00000000..4233c2b8 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js @@ -0,0 +1,78 @@ +/* + * Author: 黎永顺 + * name: 调差 + * Description: + * Date: 2022/12/5 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaSlideModal, WeaSteps } from "ecCom"; +import { Button } from "antd"; +import SlideModalTitle from "../../../../components/slideModalTitle"; +import "./index.less"; + +const Step = WeaSteps.Step; +const tabs = [ + { key: 0, title: "基础设置" }, + { key: 1, title: "报税信息" }, + { key: 2, title: "人员范围" } +]; + +@inject("taxAgentStore") +@observer +class AdjustmentSlide extends Component { + constructor(props) { + super(props); + this.state = { + current: 0, + loading: false, + taxAgentId: "" + }; + this.taxInfoRef = null; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible) { + } + } + + renderCustomOperate = () => { + return [ + + ]; + }; + + render() { + const { title, visible, onCancel, taxAgentStore: { showOperateBtn } } = this.props; + return ( + + } + content={ +
+ table +
+ } + onClose={onCancel} + /> + ); + } +} + +export default AdjustmentSlide; + diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index f824f383..5892b500 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -13,6 +13,7 @@ import { calcPageNo, getSearchs } from "../../../../util"; import { getQueryString } from "../../../../util/url"; import ProgressModal from "../../../../components/progressModal"; import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal"; +import AdjustmentSlide from "./adjustmentSlide"; import _ from "lodash"; import "./index.less"; @@ -30,6 +31,10 @@ export default class NormalIndex extends Component { title: "", visible: false }, + adjustSlide: { + title: "调差", + visible: false + }, tableData: { list: [], columns: [], @@ -407,7 +412,7 @@ export default class NormalIndex extends Component { render() { const { remarks, billMonth, selectedKey, paymentOrganization } = this.props; - const { selectedRowKeys, addProps, date, importParams } = this.state; + const { selectedRowKeys, addProps, adjustSlide, importParams } = this.state; const { loading, form, @@ -527,6 +532,12 @@ export default class NormalIndex extends Component { this.handleCommonAccountClick(); }}>核算 } @@ -613,6 +624,17 @@ export default class NormalIndex extends Component { scroll={{ x: 1200, y: "calc(100vh - 233px)" }} /> + { + this.setState({ + adjustSlide: { + ...adjustSlide, + visible: false + } + }); + }} + /> ); From a6150192f0430a63e4e840ea0eb2fbcd6f8662ad 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 Dec 2022 14:28:38 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E8=B0=83=E5=B7=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/standingBook.js | 7 ++++- .../components/adjustmentSlide.js | 14 ++++----- .../standingBookDetail/components/index.less | 31 +++++++++++++++++++ 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 24da62d4..bcc24408 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -266,6 +266,11 @@ export const getPaymentById = ({ id }) => { mode: "cors", headers: { "Content-Type": "application/json" - }, + } }).then(res => res.json()); }; + +//获取调差列表 +export const getCompensationList = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/compensationList", params); +}; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js index 4233c2b8..3fda39bf 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js @@ -6,17 +6,11 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaSlideModal, WeaSteps } from "ecCom"; +import { WeaButtonIcon, WeaSlideModal } from "ecCom"; import { Button } from "antd"; import SlideModalTitle from "../../../../components/slideModalTitle"; import "./index.less"; -const Step = WeaSteps.Step; -const tabs = [ - { key: 0, title: "基础设置" }, - { key: 1, title: "报税信息" }, - { key: 2, title: "人员范围" } -]; @inject("taxAgentStore") @observer @@ -28,7 +22,6 @@ class AdjustmentSlide extends Component { loading: false, taxAgentId: "" }; - this.taxInfoRef = null; } componentWillReceiveProps(nextProps, nextContext) { @@ -38,6 +31,11 @@ class AdjustmentSlide extends Component { renderCustomOperate = () => { return [ + , + , ]; }; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 8c5cfa33..a8a378d9 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -96,3 +96,34 @@ //退差人员选择框 .regSelectWrapper{ } + +//调差抽屉 +.adjustmentWrapper { + .wea-slide-modal-title { + height: initial; + line-height: initial; + text-align: left; + } + + .rodal-close { + z-index: 99; + top: 10px !important; + } + +} + +@media (min-width: 1260px) { + .adjustmentWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: 100% !important; + } + } +} + +@media screen and (min-width: 1060px) and (max-width: 1260px) { + .adjustmentWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: calc(100% - 96px) !important; + } + } +} From 672e697170a46bc946fbbe434c0ca6efc808013a 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, 6 Dec 2022 11:34:19 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=B0=83=E5=B7=AE=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BF=9D=E5=AD=98=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/standingBook.js | 26 ++ .../components/adjustTable.js | 428 ++++++++++++++++++ .../components/adjustmentSlide.js | 71 ++- .../standingBookDetail/components/index.less | 12 +- 4 files changed, 521 insertions(+), 16 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index bcc24408..745b3706 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -269,8 +269,34 @@ export const getPaymentById = ({ id }) => { } }).then(res => res.json()); }; +//获取社保福利项列表 +export const compensationCategoryType = ({ id }) => { + return fetch(`/api/bs/hrmsalary/siaccount/compensationCategoryType?id=${id}`, { + method: "GET", + mode: "cors", + headers: { + "Content-Type": "application/json" + } + }).then(res => res.json()); +}; //获取调差列表 export const getCompensationList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/compensationList", params); }; +//获取可调差的人员列表 +export const getEmployeeListToCompensation = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/getEmployeeListToCompensation", params); +}; +//获取当前调差行-公司方支出总计 +export const getCompensationComTotal = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/compensationComTotal", params); +}; +//社保调差保存 +export const compensationSave = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/compensationSave", params); +}; +//撤回调差数据 +export const compensationBack = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/compensationBack", params); +}; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js new file mode 100644 index 00000000..a15527d0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js @@ -0,0 +1,428 @@ +/* + * Author: 黎永顺 + * name: 调差列表 + * Description: + * Date: 2022/12/5 + */ +import React, { Component } from "react"; +import { WeaHelpfulTip, WeaInputNumber, WeaSelect, WeaTableEdit } from "ecCom"; +import { message, Modal } from "antd"; +import { + compensationBack, + compensationCategoryType, + compensationSave, + getCompensationComTotal, + getCompensationList, + getEmployeeListToCompensation +} from "../../../../apis/standingBook"; +import { getQueryString } from "../../../../util/url"; +import "./index.less"; + +class AdjustTable extends Component { + constructor(props) { + super(props); + this.state = { + loading: { + query: false + }, + dataSource: [], + columns: [], + selectedRowKeys: [], + targetOptions: [] + }; + } + + componentDidMount() { + this.getCompensationList().then(r => { + }); + } + + componentWillReceiveProps(nextProps, nextContext) { + } + + getCompensationList = async () => { + const { pageInfo, loading } = this.state; + const billMonth = getQueryString("billMonth"); + const paymentOrganization = getQueryString("paymentOrganization"); + const [adjustmentObjEnum] = await Promise.all([this.getEmployeeListToCompensation()]); + const { status, data: list } = adjustmentObjEnum; + this.setState({ targetOptions: list }); + const targetOptions = status ? _.map(list, it => ({ + key: it.employeeId.toString(), + showname: it.username + })) : []; + const payload = { + paymentOrganization, + billMonth, + ...pageInfo + }; + this.setState({ loading: { ...loading, query: true } }); + getCompensationList(payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { columns, data: dataSource } = data; + this.setState({ + dataSource: _.map(dataSource, it => { + return { + ...it, + welfareType: it.welfareType.toString(), + target: it.employeeId.toString(), + adjustTo: it.adjustTo.toString(), + adjustToOptions: _.map(it.categoryTypeOptions, child => ({ key: child.id, showname: child.content })), + categoryTypeOptions: _.map(it.categoryTypeOptions, child => ({ key: child.id, showname: child.content })), + targetOptions: _.map(it.targetOptions, child => ({ key: child.id, showname: child.name })) + }; + }), + columns: _.map(columns, item => { + const { dataIndex } = item; + switch (dataIndex) { + case "target": + item.com = [ + { + type: "custom", + key: "target", + width: 220, + render: (text, record, index, onEdit) => { + return ( + this.handleChangeTableItem("target", v, index)} + /> + ); + } + } + ]; + break; + case "welfareType": + item.com = [ + { + width: 220, + type: "custom", + key: "welfareType", + render: (text, record, index, onEdit) => ( + this.handleChangeTableItem("welfareType", v, index)} + /> + ) + } + ]; + break; + case "categoryType": + item.com = [ + { + width: 220, + type: "custom", + key: "categoryType", + render: (text, record, index, onEdit) => ( + this.handleChangeTableItem("categoryType", v, index)} + /> + ) + } + ]; + break; + case "countryTotal": + item.com = [ + { + width: 220, + type: "custom", + key: "countryTotal", + render: (text, record, index, onEdit) => ( + this.handleChangeTableItem("countryTotal", v, index)} + /> + ) + } + ]; + break; + case "companyTotal": + item.com = [ + { + width: 220, + type: "custom", + key: "companyTotal", + render: (text, record, index, onEdit) => ( + this.handleChangeTableItem("companyTotal", v, index)} + /> + ) + } + ]; + break; + case "adjustmentTotal": + item.title = + {item.title} + + ; + item.com = [ + { + width: 220, + type: "custom", + key: "adjustmentTotal", + render: (text, record, index, onEdit) => ( + this.handleChangeTableItem("adjustmentTotal", v, index)} + /> + ) + } + ]; + break; + case "adjustTo": + item.com = [ + { + width: 220, + type: "custom", + key: "adjustTo", + render: (text, record, index, onEdit) => { + return ( + this.handleChangeTableItem("adjustTo", v, index)} + /> + ); + } + } + ]; + break; + default: + break; + } + return { ...item, display: true, width: "20%" }; + }) + }); + } + }).catch(() => { + this.setState({ loading: { ...loading, query: false } }); + }); + }; + compensationCategoryType = (id, index) => { + const { dataSource } = this.state; + compensationCategoryType({ id }).then(({ status, data }) => { + if (status) { + this.setState({ + dataSource: _.map(dataSource, (item, idx) => { + if (index === idx) { + return { + ...item, + adjustTo: "", + adjustToOptions: [], + categoryType: "", + categoryTypeOptions: _.map(data, child => ({ key: child.id, showname: child.content })) + }; + } else { + return { ...item }; + } + }) + }); + } + }); + }; + getEmployeeListToCompensation = () => { + const billMonth = getQueryString("billMonth"); + const paymentOrganization = getQueryString("paymentOrganization"); + const payload = { + billMonth, paymentOrganization, + pageNum: 1, pageSize: 100 + }; + return getEmployeeListToCompensation(payload); + }; + getCompensationComTotal = (payload, index, categoryType) => { + const { dataSource } = this.state; + getCompensationComTotal(payload).then(({ status, data }) => { + if (status && !_.isEmpty(data)) { + this.setState({ + dataSource: _.map(dataSource, (item, idx) => { + if (index === idx) { + return { + ...item, + companyTotal: data[0].totalNum, + adjustToOptions: categoryType ? _.map(categoryType.split(","), tmpV => { + return _.find(item.categoryTypeOptions, tmpJ => tmpJ.key === tmpV); + }) : [] + }; + } else { + return { ...item }; + } + }) + }); + } + } + ); + }; + handleChangeCom = (dataSource) => { + this.setState({ dataSource }); + }; + handleChangeTableItem = (filedItemkey, value, index) => { + const { dataSource, targetOptions } = this.state; + this.setState({ + dataSource: _.map(dataSource, (item, idx) => { + if (index === idx) { + return { ...item, [filedItemkey]: value }; + } else { + return { ...item }; + } + }) + }, () => { + const paymentOrganization = getQueryString("paymentOrganization"); + if (filedItemkey === "target") { + this.compensationCategoryType(_.find(targetOptions, it => it.employeeId == value).target, index); + } else if (filedItemkey === "categoryType") { + _.map(this.state.dataSource, (it, itdx) => { + const bool = it.target && it.categoryType; + if (bool && itdx === index) { + const payload = { + paymentOrganization, + target: _.find(targetOptions, child => child.employeeId == it.target).target, + employeeId: it.target, + categoryType: it.categoryType + }; + this.getCompensationComTotal([payload], itdx, it.categoryType); + } + }); + } else if (filedItemkey === "countryTotal") { + this.setState({ + dataSource: _.map(this.state.dataSource, (child, childidx) => { + if (index === childidx) { + return { + ...child, + adjustmentTotal: (Number(child.countryTotal) - Number(child.companyTotal)).toFixed(2) + }; + } else { + return { ...child }; + } + }) + }); + } + }); + }; + + handleClick = (record) => { + const { status, id, paymentOrganization, billMonth } = record; + const { targetOptions } = this.state; + if (status) { + Modal.confirm({ + title: "信息确认", + content: "确定撤回吗?撤回后该笔调差将失效!", + onOk: () => { + const payload = { id, paymentOrganization, billMonth }; + compensationBack(payload).then(({ status, data, errormsg }) => { + if (status) { + message.success(data || "撤回成功"); + this.getCompensationList().then(r => { + }); + } else { + message.error(errormsg || "撤回失败"); + } + }); + }, + onCancel: () => { + } + }); + } else { + Modal.confirm({ + title: "信息确认", + content: "确定保存吗?保存后数据将即时更新到台账!", + onOk: () => { + const { adjustToOptions, categoryTypeOptions, key, target, ...extraParams } = record; + const month = getQueryString("billMonth"); + const paymentOrg = getQueryString("paymentOrganization"); + const bool = _.every(Object.keys(record), child => !!record[child]); + if (!bool) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = { + ...extraParams, + employeeId: target, + target: _.find(targetOptions, child => child.employeeId == target).target, + billMonth: month, + paymentOrganization: paymentOrg + }; + compensationSave([payload]).then(({ status, data, errormsg }) => { + if (status) { + const { data: dataMsg } = data; + message.success(dataMsg || "保存成功"); + this.getCompensationList().then(r => { + }); + } else { + message.error(errormsg || "保存失败"); + } + }); + }, + onCancel: () => { + } + }); + } + }; + getRowSelection = (rowSelection) => { + let sel = { ...rowSelection }; + sel.getCheckboxProps = (record) => { + return { disabled: record.status }; + }; + return sel; + }; + + render() { + const { dataSource, columns, selectedRowKeys } = this.state; + + return ( + { + const { status } = record; + return this.handleClick(record)}>{status ? "撤回" : "保存"}; + } + } + ] + } + datas={dataSource} + onChange={this.handleChangeCom} + selectedRowKeys={selectedRowKeys} + getRowSelection={this.getRowSelection} + tableProps={{ x: 800 }} + /> + ); + } +} + +export default AdjustTable; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js index 3fda39bf..a7fdc244 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js @@ -6,10 +6,13 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaButtonIcon, WeaSlideModal } from "ecCom"; -import { Button } from "antd"; +import { WeaSlideModal } from "ecCom"; +import { Button, message, Modal } from "antd"; import SlideModalTitle from "../../../../components/slideModalTitle"; +import AdjustTable from "./adjustTable"; import "./index.less"; +import { getQueryString } from "../../../../util/url"; +import { compensationSave } from "../../../../apis/standingBook"; @inject("taxAgentStore") @@ -22,6 +25,7 @@ class AdjustmentSlide extends Component { loading: false, taxAgentId: "" }; + this.adjustTableRef = null; } componentWillReceiveProps(nextProps, nextContext) { @@ -29,25 +33,66 @@ class AdjustmentSlide extends Component { } } + handleSave = () => { + let { dataSource, targetOptions } = this.adjustTableRef.state; + dataSource = _.filter(dataSource, it => !it.id); + const billMonth = getQueryString("billMonth"); + const paymentOrganization = getQueryString("paymentOrganization"); + let bool = true; + _.map(dataSource, item => { + bool = _.every(Object.keys(item), child => !!item[child]); + }); + if (_.isEmpty(dataSource)) { + Modal.warning({ + title: "信息确认", + content: "请添加调差项!" + }); + return; + } else if (!bool) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = _.map(dataSource, item => { + const { adjustToOptions, categoryTypeOptions, target, ...extraParams } = item; + return { + ...extraParams, + employeeId: target, + target: _.find(targetOptions, child => child.employeeId == target).target, + billMonth, + paymentOrganization + }; + }); + this.setState({ loading: true }); + compensationSave(payload).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + const { data: dataMsg } = data; + message.success(dataMsg || "保存成功"); + this.adjustTableRef.getCompensationList().then(r => { + }); + } else { + message.error(errormsg || "保存失败"); + } + }).catch(() => this.setState({ loading: false })); + }; renderCustomOperate = () => { return [ - , - , - + ]; }; render() { const { title, visible, onCancel, taxAgentStore: { showOperateBtn } } = this.props; + const { loading } = this.state; return ( } - content={ -
- table -
- } + content={ this.adjustTableRef = dom}/>} onClose={onCancel} /> ); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index a8a378d9..c3f0ab99 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -93,8 +93,9 @@ } } } + //退差人员选择框 -.regSelectWrapper{ +.regSelectWrapper { } //调差抽屉 @@ -110,6 +111,15 @@ top: 10px !important; } + .wea-table-edit table { + table-layout: fixed; + + .text-elli { + display: inline-block; + width: 100%; + } + } + } @media (min-width: 1260px) {