diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 5182ea00..592597ac 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -205,3 +205,11 @@ export const cacheWelfareListField = (params) => { export const cacheBalanceWelfareList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/cacheBalanceWelfareList", params); }; +// 社保福利台账正常缴纳-增加人员并核算 +export const addSocialAcctEmp = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/addSocialAcctEmp", params); +}; +// 社保福利台账正常缴纳-增加人员并核算 +export const deleteSocialAcctEmp = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/deleteSocialAcctEmp", params); +}; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index c7117046..3cbab8da 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -14,6 +14,13 @@ .wea-search-tab, .wea-input-focus { background: #f1f1f1; + + i { + font-size: 20px; + cursor: pointer; + vertical-align: middle; + color: #55a1f8; + } } .normalWapper { @@ -60,20 +67,14 @@ .tabOption { display: flex; align-items: center; - padding: 8px 20px; + padding: 8px 0; justify-content: flex-end; - i.icon-coms-Batch-delete, i.icon-coms-Add-to, button { + i { + font-size: 20px; cursor: pointer; - margin-right: 10px; - } - - .anticon-search { - margin-right: 0px; - } - - .wea-input-focus-btn { - margin-right: 0px; + vertical-align: middle; + color: #55a1f8; } } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index aa2ea15d..fa802cdc 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -7,7 +7,7 @@ import React, { Component } from "react"; import { Button, Col, Icon, message, Modal, Row, Spin, Tooltip } from "antd"; import { inject, observer } from "mobx-react"; -import { WeaBrowser, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; +import { WeaBrowser, WeaButtonIcon, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; import { calcPageNo } from "../../../../util"; import { getQueryString } from "../../../../util/url"; import ProgressModal from "../../../../components/progressModal"; @@ -16,8 +16,8 @@ import AdjustmentSlide from "./adjustmentSlide"; import { getCalculateProgress } from "../../../../apis/calculate"; import RegEditDetial from "./regEditDetial"; import SupplementarySlide from "./supplementarySlide"; -import _ from "lodash"; import "./index.less"; +import { addSocialAcctEmp, deleteSocialAcctEmp } from "../../../../apis/standingBook"; const getLabel = WeaLocaleProvider.getLabel; @inject("standingBookStore") @@ -61,7 +61,8 @@ export default class NormalIndex extends Component { }, showSum: false, siaccountSum: {}, - showSearchAd: false + showSearchAd: false, + normalPayer: "" }; this.timer = null; this.timerDelete = null; @@ -167,85 +168,11 @@ export default class NormalIndex extends Component { }); }; - handleSave = () => { - const { - siaccountCommonSave, - siaccountSupplementarySave, - form - } = this.props.standingBookStore; - const { billMonth, selectedKey, paymentOrganization } = this.props; - if (selectedKey === "1") { - const { includes, excludes } = form.getFormParams(); - const payload = { - billMonth, - includes: includes.split(","), - excludes: _.isEmpty(excludes) ? excludes.split(",") : [] - }; - siaccountCommonSave(payload).then(() => { - message.success("添加成功"); - this.getNormalList({ - billMonth, - paymentOrganization, - current: this.state.current - }); - this.setState({ - addProps: { - ...this.state.addProps, - title: "", - visible: false - } - }); - }); - } else { - const paymentOrganization = getQueryString("paymentOrganization"); - form.validateForm().then(f => { - if (f.isValid) { - const { - includes, - billMonth: billMonthList, - excludes, - projects - } = form.getFormParams(); - const payload = { - billMonth, - billMonthList: billMonthList.split(","), - includes: includes.split(","), - // excludes: excludes.split(","), - projects: projects.split(","), - paymentOrganization - }; - siaccountSupplementarySave(payload).then(() => { - message.success("添加成功"); - this.getSupplementaryList({ - billMonth, - current: this.state.current, - paymentOrganization - }); - this.setState( - { - addProps: { - ...this.state.addProps, - title: "", - visible: false - } - }, - () => { - form.resetForm(); - } - ); - }); - } else { - f.showErrors(); - this.setState({ date: new Date() }); // 改变一个state的变量,强制页面刷新 - } - }); - } - }; getNormalList = async (payload = {}) => { const { getNormalList } = this.props.standingBookStore; getNormalList({ ...payload, pageSize: this.state.pageSize }).then(({ list, columns = [], total }) => { this.setState({ - tableData: { list, total, columns } + tableData: { list, total, columns }, normalPayer: "" }, () => this.postMessageToChild()); }); }; @@ -341,16 +268,7 @@ export default class NormalIndex extends Component { }); } }; - handleAdd = () => { - this.setState({ - addProps: { - ...this.state.addProps, - title: "添加缴纳人员", - visible: true - } - }); - }; - + handleAdd = () => this.setState({ addProps: { ...this.state.addProps, title: "添加缴纳人员", visible: true } }); handleCommonAccountClick = () => { const { billMonth, selectedKey, paymentOrganization } = this.props; const { commonAccount } = this.props.standingBookStore; @@ -410,7 +328,43 @@ export default class NormalIndex extends Component { }, 600); }); }; + handleAddSocialAcctEmp = () => { + const { billMonth, paymentOrganization } = this.props, { normalPayer } = this.state; + addSocialAcctEmp({ billMonth, paymentOrganization, includes: normalPayer.split(",") }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功")); + this.getNormalList({ + billMonth, paymentOrganization, + current: calcPageNo(this.state.tableData.total, this.state.current, 10, normalPayer.split(",").length) + }); + } else { + message.error(errormsg); + } + }); + }; + handleDeleteNormalPayer = () => { + Modal.confirm({ + title: getLabel(111, "确认信息"), + content: getLabel(111, "确认删除勾选的数据吗?"), + onOk: () => { + const { billMonth, paymentOrganization } = this.props, { selectedRowKeys: ids } = this.state; + deleteSocialAcctEmp({ billMonth, paymentOrganization, ids }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.getNormalList({ + billMonth, + paymentOrganization, + current: calcPageNo(this.state.tableData.total, this.state.current, 10, ids.length) + }); + } else { + message.error(errormsg); + } + }); + } + }); + }; handleExport = () => { const { billMonth, selectedKey, paymentOrganization } = this.props; const urlObj = { @@ -475,40 +429,48 @@ export default class NormalIndex extends Component { render() { const { remarks, billMonth, selectedKey, paymentOrganization, standingBookStore } = this.props; - const { addProps, adjustSlide, importParams, returnEditPersonSlide, showSearchAd } = this.state; + const { addProps, adjustSlide, importParams, returnEditPersonSlide, showSearchAd, selectedRowKeys } = this.state; const { loading } = standingBookStore; const btn1 = [ - , - + , + ]; const btn2 = [ + , + this.setState({ normalPayer: ids }, () => this.handleAddSocialAcctEmp())} + > + + , , - ]; const btn3 = [ - + }} title={getLabel(111, "线下对比")}/> ]; const btn4 = [ - + this.setState({ + importParams: { + ...importParams, visible: true, + tmpUrl: selectedKey === "1" ? "exportSiaccountWelfareImporttemplate" : "exportSiaccountWelfaresupplyimporttemplatetemplate" + } + })} title={getLabel(111, "导入")}/> ]; const btn5 = [ - + ]; let btn = []; (this.props.type !== "detail" && this.props.selectedKey == "3") && (btn = [...btn, ...btn1]); (selectedKey === "1" && this.props.type !== "detail") && (btn = [...btn, ...btn2]); - selectedKey === "1" && (btn = [...btn, ...btn3]); - this.props.type !== "detail" && (btn = [...btn, ...btn4]); - btn = [...btn, ...btn5]; + btn = [...btn5, ...btn]; + this.props.type !== "detail" && (btn = [...btn4, ...btn]); + selectedKey === "1" && (btn = [...btn3, ...btn]); return (
{ diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js index 015156ac..f88362f5 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js @@ -5,11 +5,12 @@ * LastEditTime: 2022-05-09 15:07:56 */ import React, { Component } from "react"; -import { Button, Icon, Spin, Tooltip } from "antd"; +import { Icon, Spin, Tooltip } from "antd"; import { inject, observer } from "mobx-react"; -import { WeaNewScroll, WeaTable } from "ecCom"; +import { WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom"; import "./index.less"; +const getLabel = WeaLocaleProvider.getLabel; @inject("standingBookStore") @observer export default class OverViewIndex extends Component { @@ -113,7 +114,7 @@ export default class OverViewIndex extends Component {
- +
{/* table */}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js index 0c6de7cc..816f8b98 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js @@ -1,6 +1,15 @@ import React, { Component } from "react"; -import { Button, Col, Row } from "antd"; -import { WeaBrowser, WeaFormItem, WeaHelpfulTip, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; +import { Col, Row } from "antd"; +import { + WeaBrowser, + WeaButtonIcon, + WeaFormItem, + WeaHelpfulTip, + WeaInput, + WeaLocaleProvider, + WeaSearchGroup, + WeaTab +} from "ecCom"; import { getQueryString } from "../../../../util/url"; const getLabel = WeaLocaleProvider.getLabel; @@ -37,21 +46,22 @@ class RegTop extends Component { placement="bottomRight" width={250} />, - + onChange("export")} title={getLabel(111, "导出")}/> ]; if (!type) { const [dom1, ...extra] = dom; const domBtn = regtopType === "regression" ? - [] : + [ onChange("add")}/>] : [ - , - + onChange("add")}/>, + onChange("import")} title={getLabel(111, "导入")}/> ]; dom = [ dom1, - , ...domBtn, ...extra + onChange("delete")}/>, ...domBtn, ...extra ]; } return dom;