From 506490116f42954a6fca33b10a9a5da277d119eb 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, 27 Dec 2022 13:46:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E5=B7=AE=E4=BF=9D=E5=AD=98=E9=BB=98?= =?UTF-8?q?=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/standingBook.js | 4 + .../components/adjustTable.js | 2 +- .../components/adjustmentDefaultSlide.js | 126 ++++++++++++++++++ .../components/adjustmentSlide.js | 81 +++++++---- .../standingBookDetail/components/index.less | 6 +- 5 files changed, 190 insertions(+), 29 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 9f8b28b1..dd2d4225 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -323,6 +323,10 @@ export const getCompensationComTotal = (params) => { export const compensationSave = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/compensationSave", params); }; +//社保调差默认配置保存 +export const compensationConfigSave = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/compensationConfigSave", 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 index 07313d27..e88f17bf 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js @@ -69,7 +69,7 @@ class AdjustTable extends Component { 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 })) + targetOptions: _.map([it.targetOptions], child => ({ key: child.id, showname: child.name })) }; }), columns: _.map(columns, item => { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js new file mode 100644 index 00000000..6229ca63 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js @@ -0,0 +1,126 @@ +/* + * Author: 黎永顺 + * name: 默认调差弹框 + * Description: + * Date: 2022/12/27 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Alert, message } from "antd"; +import { WeaSlideModal, WeaTable } from "ecCom"; +import SlideModalTitle from "../../../../components/slideModalTitle"; +import { compensationConfigSave } from "../../../../apis/standingBook"; +import "./index.less"; + +@inject("taxAgentStore") +@observer +class AdjustmentDefaultSlide extends Component { + constructor(props) { + super(props); + this.state = { + loading: false + }; + } + + handleSaveDefAdjustment = () => { + const { dataSource } = this.props; + const payload = _.map(dataSource, it => { + return { + paymentOrganization: it.paymentOrganization, + categoryType: it.categoryType, + welfareType: it.welfareType, + target: it.target, + adjustTo: it.adjustTo, + employeeId: it.employeeId + }; + }); + this.setState({ loading: true }); + compensationConfigSave(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("保存成功"); + } else { + message.error(errormsg || "保存失败"); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { visible, onCancel, taxAgentStore: { showOperateBtn }, dataSource } = this.props; + const { loading } = this.state; + const columns = [ + { + dataIndex: "target", title: "调差对象", + render: (text, record) => { + return ( + {_.map(record.targetOptions, it => it.showname).join(",")} + ); + } + }, + { + dataIndex: "welfareType", title: "统计调差福利", + render: (text, record) => { + return ( + 社保 + ); + } + }, + { + dataIndex: "categoryType", title: "统计调差福利类型(单位)", + render: (text, record) => { + return ( + {_.map(record.categoryTypeOptions, it => it.showname).join(",")} + ); + } + }, + { + dataIndex: "adjustTo", title: "调差到(单位)", + render: (text, record) => { + return ( + {_.find(record.adjustToOptions, it => it.key === record.adjustTo).showname} + ); + } + } + ]; + return ( + + } + content={ +
+ + +
+ } + onClose={onCancel} + /> + ); + } +} + +export default AdjustmentDefaultSlide; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js index 978dbd9f..90fe32b1 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js @@ -10,9 +10,10 @@ 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"; +import AdjustmentDefaultSlide from "./adjustmentDefaultSlide"; +import "./index.less"; @inject("taxAgentStore") @@ -23,7 +24,11 @@ class AdjustmentSlide extends Component { this.state = { current: 0, loading: false, - taxAgentId: "" + taxAgentId: "", + adjustDefSlide: { + visible: false, + dataSource: [] + } }; this.adjustTableRef = null; } @@ -76,37 +81,63 @@ class AdjustmentSlide extends Component { } }).catch(() => this.setState({ loading: false })); }; + handleSetasDefault = () => { + const { adjustDefSlide } = this.state; + this.setState({ + adjustDefSlide: { + ...adjustDefSlide, + visible: true, + dataSource: _.filter(this.adjustTableRef.state.dataSource, it => it.status) + } + }) + ; + }; renderCustomOperate = () => { return [ - + , + ]; }; render() { const { title, visible, onCancel, taxAgentStore: { showOperateBtn } } = this.props; - const { loading } = this.state; + const { loading, adjustDefSlide } = this.state; return ( - - } - content={ this.adjustTableRef = dom} visible={visible}/>} - onClose={onCancel} - /> +
+ + } + content={ this.adjustTableRef = dom} visible={visible}/>} + onClose={onCancel} + /> + { + this.setState({ + adjustDefSlide: { + ...adjustDefSlide, + visible: false, + dataSource: [] + } + }); + }} + /> +
); } } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index e266ce39..14a06006 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -107,7 +107,7 @@ } //调差抽屉 -.adjustmentWrapper { +.adjustmentWrapper, .adjustDefSlideWrapper { .wea-slide-modal-title { height: initial; line-height: initial; @@ -131,7 +131,7 @@ } @media (min-width: 1260px) { - .adjustmentWrapper { + .adjustmentWrapper, .adjustDefSlideWrapper { .reqTopWrapper .wea-new-top-req-title > div:first-child > div { max-width: 100% !important; } @@ -139,7 +139,7 @@ } @media screen and (min-width: 1060px) and (max-width: 1260px) { - .adjustmentWrapper { + .adjustmentWrapper, .adjustDefSlideWrapper { .reqTopWrapper .wea-new-top-req-title > div:first-child > div { max-width: calc(100% - 96px) !important; }