diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 592597ac..9d0f9f46 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -15,10 +15,18 @@ export const getTabList = (params) => { export const getNormalList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/common/list", params); }; +//社会福利台账-获取正常缴纳列表合计行 +export const getNormalListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/common/list/sum", params); +}; //社会福利台账-获取补缴列表 export const getSupplementaryList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list", params); }; +//社会福利台账-获取补缴列表合计 +export const getSupplementaryListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list/sum", params); +}; //社会福利台账-获取总览列表 export const getOverViewList = (params) => { @@ -122,10 +130,18 @@ export const saveRecession = (params) => { export const recessionList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params); }; +//查询退差列表合计行 +export const recessionListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list/sum", params); +}; //查询补差列表 export const balanceList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list", params); }; +//查询补差列表合计行 +export const balanceListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list/sum", params); +}; //删除退差数据 export const delRecession = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/delRecession", params); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js index 2fb3f37c..b853b734 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js @@ -10,12 +10,10 @@ import { WeaSlideModal } from "ecCom"; import { Button, message, Modal } from "antd"; import SlideModalTitle from "../../../../components/slideModalTitle"; import AdjustTable from "./adjustTable"; -import { getQueryString } from "../../../../util/url"; import { compensationSave } from "../../../../apis/standingBook"; import AdjustmentDefaultSlide from "./adjustmentDefaultSlide"; import "./index.less"; - @inject("taxAgentStore") @observer class AdjustmentSlide extends Component { @@ -35,10 +33,9 @@ class AdjustmentSlide extends Component { handleSave = () => { const requireKeys = ["adjustTo", "adjustmentTotal", "categoryType", "companyTotal", "countryTotal", "target", "welfareType"]; + const { billMonth, paymentOrganization } = this.props; let { dataSource, targetOptions } = this.adjustTableRef.state; dataSource = _.filter(dataSource, it => (!it.id || !it.status)); - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); let bool = true; _.map(dataSource, item => { bool = _.every(requireKeys, child => !!item[child]); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 3cbab8da..919e4d78 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -13,7 +13,12 @@ } .wea-search-tab, .wea-input-focus { - background: #f1f1f1; + background: #F1F1F1; + padding-right: 0 !important; + + .wea-advanced-search { + background: #FFF + } i { font-size: 20px; @@ -30,6 +35,18 @@ overflow: hidden; padding: 0 16px; + .wea-tab .wea-search-container .wea-advanced-search { + right: -1px !important; + } + + .wea-tab .wea-search-tab { + padding-right: 0; + + .wea-advanced-search { + background: #FFF; + } + } + .tableWrapper { flex: 1; overflow: hidden; @@ -94,7 +111,7 @@ overflow: hidden; display: flex; flex-direction: column; - padding: 16px; + padding: 0 16px 16px 16px; .tableWrapper { flex: 1; @@ -133,26 +150,6 @@ } } } - - .wea-new-top { - .ant-btn { - border-radius: 0; - padding: 0; - background: transparent; - border: none; - font-size: 18px; - line-height: 18px; - } - - .ant-btn.ant-btn-primary[disabled] { - color: #d8d8d8; - background: transparent; - } - - .ant-btn.ant-btn-primary { - color: #2db7f5; - } - } } //补差添加人员弹框 diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js index d0085fd7..c5e05729 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js @@ -7,8 +7,6 @@ import React, { Component } from "react"; import RegTop from "./regTop"; import { message, Modal } from "antd"; -import { WeaNewScroll } from "ecCom"; -import { getQueryString } from "../../../../util/url"; import * as API from "../../../../apis/standingBook"; import { calcPageNo } from "../../../../util"; import RegList from "./regList"; @@ -16,6 +14,7 @@ import RegEditDetial from "./regEditDetial"; import AddCompensationPersonnelDialog from "./addCompensationPersonnelDialog"; import StandingBookCalcImportDialog from "./standingBookCalcImportDialog"; import "./index.less"; +import { convertToUrlString } from "../../../../util/url"; class MakeupDifference extends Component { constructor(props) { @@ -43,9 +42,7 @@ class MakeupDifference extends Component { delBalance = () => { const { selectKey: ids } = this.state; - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); - const payload = { ids, billMonth, paymentOrganization }; + const payload = { ids, ..._.pick(this.props, ["billMonth", "paymentOrganization"]) }; API.delBalance(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); @@ -64,8 +61,6 @@ class MakeupDifference extends Component { const workcode = this.regTopRef.state.workcode; const departmentIds = this.regTopRef.state.departmentIds ? this.regTopRef.state.departmentIds.split(",") : []; const subCompanyIds = this.regTopRef.state.subCompanyIds ? this.regTopRef.state.subCompanyIds.split(",") : []; - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); switch (key) { case "delete": Modal.confirm({ @@ -78,13 +73,13 @@ class MakeupDifference extends Component { this.setState({ importDiffModal: { ...importDiffModal, visible: true, - importparams: { billMonth: getQueryString("billMonth") } + importparams: { ..._.pick(this.props, ["billMonth"]) } } }); break; case "export": - const url = `${window.location.origin}/api/bs/hrmsalary/welfare/balance/export?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; - window.open(url, "_self"); + const url = `/api/bs/hrmsalary/welfare/balance/export?${convertToUrlString(_.pick(this.props, ["billMonth", "paymentOrganization"]))}`; + window.open(url, "_blank"); break; case "search": this.diffListRef.recessionList({ userName: name, workcode, departmentIds, subCompanyIds, current: 1 }); @@ -92,7 +87,7 @@ class MakeupDifference extends Component { case "add": this.setState({ addPersonalDialog: { - ...addPersonalDialog, visible: true, paymentOrganization, billMonth + ...addPersonalDialog, ..._.pick(this.props, ["billMonth", "paymentOrganization"]), visible: true } }); break; @@ -117,42 +112,40 @@ class MakeupDifference extends Component { }; render() { - const billMonth = getQueryString("billMonth"); const { selectKey, importDiffModal, returnEditPersonSlide, addPersonalDialog } = this.state; return (
this.regTopRef = dom} - billMonth={billMonth} onChange={this.handleChangeOpt} selectKey={selectKey} />
- - this.diffListRef = dom} - onChangeRowkey={(selectKey) => this.setState({ selectKey })} - onEdit={this.handleEdit} - /> - {/*编辑弹框*/} - - {/*添加补差人员*/} - this.setState({ - addPersonalDialog: { - ...addPersonalDialog, - visible: false - } - }, () => isRefresh && this.diffListRef.recessionList())} - /> - {/*导入补差*/} - this.setState({ - importDiffModal: { ...importDiffModal, visible: false } - }, () => isInit && this.diffListRef.recessionList())}/> - + this.diffListRef = dom} + onChangeRowkey={(selectKey) => this.setState({ selectKey })} + onEdit={this.handleEdit} + /> + {/*编辑弹框*/} + + {/*添加补差人员*/} + this.setState({ + addPersonalDialog: { + ...addPersonalDialog, + visible: false + } + }, () => isRefresh && this.diffListRef.recessionList())} + /> + {/*导入补差*/} + this.setState({ + importDiffModal: { ...importDiffModal, visible: false } + }, () => isInit && this.diffListRef.recessionList())}/>
); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index fa802cdc..f6f6f010 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -6,96 +6,52 @@ */ import React, { Component } from "react"; import { Button, Col, Icon, message, Modal, Row, Spin, Tooltip } from "antd"; -import { inject, observer } from "mobx-react"; import { WeaBrowser, WeaButtonIcon, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; +import * as API from "../../../../apis/standingBook"; +import { getCalculateProgress } from "../../../../apis/calculate"; +import { sysConfCodeRule } from "../../../../apis/ruleconfig"; import { calcPageNo } from "../../../../util"; -import { getQueryString } from "../../../../util/url"; +import { convertToUrlString } from "../../../../util/url"; import ProgressModal from "../../../../components/progressModal"; import StandingBookCalcImportDialog from "./standingBookCalcImportDialog"; import AdjustmentSlide from "./adjustmentSlide"; -import { getCalculateProgress } from "../../../../apis/calculate"; import RegEditDetial from "./regEditDetial"; import SupplementarySlide from "./supplementarySlide"; import "./index.less"; -import { addSocialAcctEmp, deleteSocialAcctEmp } from "../../../../apis/standingBook"; const getLabel = WeaLocaleProvider.getLabel; -@inject("standingBookStore") -@observer + export default class NormalIndex extends Component { constructor(props) { super(props); this.state = { - date: "", - current: 1, - pageSize: 10, - selectedRowKeys: [], - addProps: { - title: "", - visible: false - }, - adjustSlide: { - title: "调差", - visible: false - }, - tableData: { - list: [], - columns: [], - total: 0 - }, - searchValue: "", - workcode: "", - departmentIds: "", - subCompanyIds: "", - progressVisible: false, - progress: 0, - fieldData: {}, //选中的表单头信息 - importParams: { //导入信息的弹框表示 + pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], showSearchAd: false, loading: false, + formParams: { userName: "", workcode: "", departmentIds: [], subCompanyIds: [] }, + addProps: { title: "", visible: false }, adjustSlide: { title: "调差", visible: false }, + progressVisible: false, progress: 0, importParams: { //导入信息的弹框表示 visible: false, fieldUrl: "getWelfareList", tmpUrl: "exportSiaccountWelfareImporttemplate", cacheUrl: "cacheWelfareListField", importUrl: "importInsuranceAcctDetail", importparams: {} }, - returnEditPersonSlide: { - title: "", - editId: "", - visible: false - }, - showSum: false, - siaccountSum: {}, - showSearchAd: false, - normalPayer: "" + returnEditPersonSlide: { title: "", editId: "", visible: false }, + columns: [], dataSource: [], sumRow: {}, normalPayer: "" }; this.timer = null; this.timerDelete = null; } componentDidMount() { - const { selectedKey, location } = this.props; - const { current } = this.state; - const billMonth = location.query.billMonth; - const paymentOrganization = location.query.paymentOrganization; - selectedKey === "1" - ? this.getNormalList({ billMonth, current, paymentOrganization }) - : this.getSupplementaryList({ billMonth, current, paymentOrganization }); window.addEventListener("message", this.handleReceive, false); } - handleReceive = async ({ data }) => { - const { type, payload: { id, params } = {} } = data; + handleReceive = ({ data }) => { + const { type, payload: { id, params } = {} } = data, { selectedKey } = this.props; if (type === "init") { - this.postMessageToChild(); + selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); } else if (type === "turn") { if (id === "PAGEINFO") { const { pageNum: current, size: pageSize } = params; - this.setState({ current, pageSize }, () => { - const { billMonth, paymentOrganization, selectedKey } = this.props; - const { current, pageSize } = this.state; - selectedKey === "1" ? - this.getNormalList({ - billMonth, current, pageSize, paymentOrganization - }) : - this.getSupplementaryList({ - billMonth, current, pageSize, paymentOrganization - }); + this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => { + selectedKey === "1" ? this.getNormalList(true) : this.getSupplementaryList(true); }); } else if (id === "ROWSELECT") { const { selectedRowKeys } = params; @@ -107,184 +63,125 @@ export default class NormalIndex extends Component { }; componentWillUnmount() { - if (this.timer) { - clearInterval(this.timer); - } - if (this.timerDelete) { - clearInterval(this.timerDelete); - } + if (this.timer) clearInterval(this.timer); + if (this.timerDelete) clearInterval(this.timerDelete); window.removeEventListener("message", this.handleReceive, false); } componentWillReceiveProps(nextProps) { - if (nextProps.selectedKey != this.props.selectedKey) { - const { billMonth, paymentOrganization } = nextProps; + if (nextProps.selectedKey !== this.props.selectedKey) { this.setState({ - current: 1, selectedRowKeys: [] + pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], dataSource: [], sumRow: {}, + addProps: { title: "", visible: false }, returnEditPersonSlide: { title: "", editId: "", visible: false } }, () => { - const { current } = this.state; - nextProps.selectedKey === "1" - ? this.getNormalList({ billMonth, current, paymentOrganization }) - : this.getSupplementaryList({ billMonth, current, paymentOrganization }); + nextProps.selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); }); } } postMessageToChild = () => { - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); const childFrameObj = document.getElementById("atdTable"); - const { current, pageSize, tableData, selectedRowKeys, showSum, siaccountSum, searchValue: userName } = this.state; - const { list: dataSource, total, columns } = tableData; - const pageInfo = { current, pageSize, total }; - childFrameObj.contentWindow.postMessage(JSON.stringify({ - dataSource, columns, pageInfo, - selectedRowKeys, selectedKey: this.props.selectedKey, - sumpayload: { billMonth, paymentOrganization, userName }, - showOperates: !getQueryString("type") + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ + ..._.pick(this.state, ["dataSource", "columns", "pageInfo", "selectedRowKeys", "sumRow"]), + showOperates: !this.props.type }), "*"); }; - - handleSearch = () => { - const { billMonth, selectedKey, paymentOrganization } = this.props; - selectedKey === "1" - ? this.getNormalList({ - billMonth, - current: 1, - paymentOrganization, - userName: this.state.searchValue, - workcode: this.state.workcode, - departmentIds: this.state.departmentIds ? this.state.departmentIds.split(",") : [], - subCompanyIds: this.state.subCompanyIds ? this.state.subCompanyIds.split(",") : [] - }) - : this.getSupplementaryList({ - billMonth, - current: 1, - paymentOrganization, - userName: this.state.searchValue, - workcode: this.state.workcode, - departmentIds: this.state.departmentIds ? this.state.departmentIds.split(",") : [], - subCompanyIds: this.state.subCompanyIds ? this.state.subCompanyIds.split(",") : [] - }); - }; - - getNormalList = async (payload = {}) => { - const { getNormalList } = this.props.standingBookStore; - getNormalList({ ...payload, pageSize: this.state.pageSize }).then(({ list, columns = [], total }) => { - this.setState({ - tableData: { list, total, columns }, normalPayer: "" - }, () => this.postMessageToChild()); + handleSearch = () => this.props.selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); + getNormalList = (pageTurning = false) => { + const { pageInfo, formParams } = this.state; + const payload = { ..._.pick(this.props, ["billMonth", "paymentOrganization"]) }; + this.setState({ loading: true }); + API.getNormalList({ ...payload, ...pageInfo, ...formParams }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { pageInfo: { columns, list: dataSource, pageNum: current, pageSize, total } } = data; + this.setState({ pageInfo: { current, pageSize, total }, columns, dataSource }, () => this.postMessageToChild()); + } + }); + sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }).then(({ status, data }) => { + if (status && data === "1" && !pageTurning) { + API.getNormalListSum({ ...payload, ...pageInfo, ...formParams }) + .then(({ status: sumStatus, data: sumData }) => { + if (sumStatus) this.setState({ sumRow: sumData.sumRow }, () => this.postMessageToChild()); + }); + } }); }; - getSupplementaryList = async (payload = {}) => { - const { getSupplementaryList } = this.props.standingBookStore; - getSupplementaryList({ - ...payload, pageSize: this.state.pageSize - }).then(({ list, columns = [], total }) => { - this.setState({ - tableData: { list, columns, total } - }, () => this.postMessageToChild()); + getSupplementaryList = (pageTurning = false) => { + const { pageInfo, formParams } = this.state; + const payload = { ..._.pick(this.props, ["billMonth", "paymentOrganization"]) }; + this.setState({ loading: true }); + API.getSupplementaryList({ ...payload, ...pageInfo, ...formParams }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { pageInfo: { columns, list: dataSource, pageNum: current, pageSize, total } } = data; + this.setState({ pageInfo: { current, pageSize, total }, columns, dataSource }, () => this.postMessageToChild()); + } + }); + sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }).then(({ status, data }) => { + if (status && data === "1" && !pageTurning) { + API.getSupplementaryListSum({ ...payload, ...pageInfo, ...formParams }) + .then(({ status: sumStatus, data: sumData }) => { + if (sumStatus) this.setState({ sumRow: sumData.sumRow }, () => this.postMessageToChild()); + }); + } }); - }; - onSelectChange = selectedRowKeys => { - this.setState({ selectedRowKeys }); }; handleBatchDelete = () => { - const { siaccountCommonDelete } = this.props.standingBookStore; - const { list } = this.state.tableData; - const { selectedRowKeys } = this.state; + const { selectedRowKeys, dataSource, pageInfo } = this.state; const { billMonth, selectedKey, paymentOrganization } = this.props; - if (_.isEmpty(selectedRowKeys)) { - message.warning("未勾选数据!"); - } else { - const includes = _.map( - _.filter(list, it => selectedRowKeys.includes(it.id)), - item => item.employeeId - ); - const ids = _.map( - _.filter(list, it => selectedRowKeys.includes(it.id)), - item => item.id - ); - Modal.confirm({ - 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: [], progressVisible: false, progress: 0 }); - 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 + const includes = _.map(_.filter(dataSource, it => selectedRowKeys.includes(it.id)), item => item.employeeId); + const ids = _.map(_.filter(dataSource, it => selectedRowKeys.includes(it.id)), item => item.id); + Modal.confirm({ + title: getLabel(111, "确认信息"), + content: getLabel(111, "确认删除勾选的数据吗?"), + 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, pageInfo: { + ...pageInfo, current: calcPageNo(pageInfo.total, pageInfo.current, 10, includes.length) + } + }, () => { + message.success(getLabel(111, "操作成功!")); + selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); }); + } + }, 800); + }); + API.siaccountCommonDelete({ billMonth, includes, ids, paymentOrganization }) + .then(() => { + clearInterval(this.timerDelete); + this.setState({ + selectedRowKeys: [], progressVisible: false, progress: 0, pageInfo: { + ...pageInfo, current: calcPageNo(pageInfo.total, pageInfo.current, 10, includes.length) + } + }, () => { + message.success(getLabel(111, "操作成功!")); + selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); + }); }); - }, - onCancel: () => { - } - }); - } + } + }); }; - handleAdd = () => this.setState({ addProps: { ...this.state.addProps, title: "添加缴纳人员", visible: true } }); + handleAdd = () => this.setState({ + addProps: { ...this.state.addProps, title: getLabel(111, "添加缴纳人员"), visible: true } + }); handleCommonAccountClick = () => { - const { billMonth, selectedKey, paymentOrganization } = this.props; - const { commonAccount } = this.props.standingBookStore; - commonAccount({ billMonth, paymentOrganization, includes: [] }); - this.setState({ - progressVisible: true - }, () => { + const { billMonth, paymentOrganization, selectedKey } = this.props; + const promise = API.commonAccount({ ..._.pick(this.props, ["billMonth", "paymentOrganization"]), includes: [] }); + this.setState({ progressVisible: true }, () => { this.timer = setInterval(() => { getCalculateProgress(billMonth, paymentOrganization).then(({ status, data }) => { if (status) { if (!data.status) { clearInterval(this.timer); - this.setState({ - progressVisible: false, - progress: 0 - }); + this.setState({ progressVisible: false, progress: 0 }); message.error(data.message); } if (this.state.progress !== 100) { @@ -294,86 +191,68 @@ export default class NormalIndex extends Component { } else { clearInterval(this.timer); this.setState({ - progressVisible: false, - progress: 0 + progressVisible: false, progress: 0 }, () => { - message.success("核算成功"); - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current: this.state.current - }) - : this.getSupplementaryList({ - billMonth, - paymentOrganization, - current: this.state.current - }); + message.success(getLabel(111, "操作成功!")); + this.getNormalList(); }); } } else { clearInterval(this.timer); - this.setState({ - progressVisible: false, - progress: 0 - }); + this.setState({ progressVisible: false, progress: 0 }); } }).catch(() => { clearInterval(this.timer); - this.setState({ - progressVisible: false, - progress: 0 - }); + this.setState({ progressVisible: false, progress: 0 }); }); }, 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); - } - }); + const { normalPayer, pageInfo } = this.state, { current, pageSize, total } = pageInfo; + API.addSocialAcctEmp({ + ..._.pick(this.props, ["billMonth", "paymentOrganization"]), includes: normalPayer.split(",") + }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功")); + this.setState({ + pageInfo: { ...pageInfo, current: calcPageNo(total, current, pageSize, normalPayer.split(",").length) } + }, () => this.getNormalList()); + } 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); - } - }); - + const { selectedRowKeys: ids, pageInfo } = this.state, { current, pageSize, total } = pageInfo; + API.deleteSocialAcctEmp({ ..._.pick(this.props, ["billMonth", "paymentOrganization"]), ids }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ + selectedRowKeys: [], + pageInfo: { ...pageInfo, current: calcPageNo(total, current, pageSize, ids.length) } + }, () => this.getNormalList()); + } else { + message.error(errormsg); + } + }); } }); }; handleExport = () => { - const { billMonth, selectedKey, paymentOrganization } = this.props; + const { selectedKey } = this.props; const urlObj = { "1": "/api/bs/hrmsalary/welfare/common/export", "3": "/api/bs/hrmsalary/welfare/supplementary/export" }; const url = `${window.location - .origin}${urlObj[selectedKey]}?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; - window.open(url, "_self"); + .origin}${urlObj[selectedKey]}?${convertToUrlString(_.pick(this.props, ["billMonth", "paymentOrganization"]))}`; + window.open(url, "_blank"); }; handleEditNormalStandingBook = (record) => { const { userName, id: editId } = record; @@ -387,50 +266,36 @@ export default class NormalIndex extends Component { this.setState({ returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" } }, () => { - if (refreshList) { - const { current } = this.state; - const { billMonth, selectedKey, paymentOrganization } = this.props; - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current - }) - : this.getSupplementaryList({ - billMonth, - paymentOrganization, - current - }); - } + if (refreshList) this.props.selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); }); }; getSearchs = () => { - return + const { formParams } = this.state, { workcode, departmentIds, subCompanyIds } = formParams; + return - - this.setState({ workcode: v })} - /> + + this.setState({ formParams: { ...formParams, workcode: v } })}/> this.setState({ departmentIds: v })}/> + isSingle={false} value={departmentIds.join(",")} type={57} + onChange={v => this.setState({ formParams: { ...formParams, departmentIds: v.split(",") } })}/> this.setState({ subCompanyIds: v })}/> + isSingle={false} value={subCompanyIds.join(",")} type={164} + onChange={v => this.setState({ formParams: { ...formParams, subCompanyIds: v.split(",") } })}/> ; }; render() { - const { remarks, billMonth, selectedKey, paymentOrganization, standingBookStore } = this.props; - const { addProps, adjustSlide, importParams, returnEditPersonSlide, showSearchAd, selectedRowKeys } = this.state; - const { loading } = standingBookStore; + const { remarks, billMonth, selectedKey, paymentOrganization, type } = this.props; + const { + formParams, addProps, adjustSlide, importParams, returnEditPersonSlide, + showSearchAd, selectedRowKeys, loading + } = this.state; const btn1 = [ , @@ -441,13 +306,13 @@ export default class NormalIndex extends Component { , this.setState({ normalPayer: ids }, () => this.handleAddSocialAcctEmp())} - > + onChange={ids => this.setState({ normalPayer: ids }, () => this.handleAddSocialAcctEmp())}> , - , - + , + ]; const btn3 = [ { @@ -466,10 +331,10 @@ export default class NormalIndex extends Component { ]; let btn = []; - (this.props.type !== "detail" && this.props.selectedKey == "3") && (btn = [...btn, ...btn1]); - (selectedKey === "1" && this.props.type !== "detail") && (btn = [...btn, ...btn2]); + (type !== "detail" && selectedKey === "3") && (btn = [...btn, ...btn1]); + (selectedKey === "1" && type !== "detail") && (btn = [...btn, ...btn2]); btn = [...btn5, ...btn]; - this.props.type !== "detail" && (btn = [...btn4, ...btn]); + type !== "detail" && (btn = [...btn4, ...btn]); selectedKey === "1" && (btn = [...btn3, ...btn]); return (
@@ -478,20 +343,16 @@ export default class NormalIndex extends Component {
- 账单月份 - + {getLabel(111, "账单月份")} + - - {billMonth} - + {billMonth}
- 备注: - - {remarks} - + {getLabel(111, "备注:")} + {remarks}
} @@ -499,39 +360,26 @@ export default class NormalIndex extends Component { datas={[]} selectedKey="" advanceHeight={200} searchsAd={this.getSearchs()} searchType={["base", "advanced"]} showSearchAd={showSearchAd} setShowSearchAd={bool => this.setState({ showSearchAd: bool })} - onSearchChange={searchValue => this.setState({ searchValue })} + onSearchChange={userName => this.setState({ formParams: { ...formParams, userName } })} buttons={btn} onSearch={this.handleSearch} onAdSearch={this.handleSearch} - onAdReset={() => this.setState({ workcode: "" })} searchsBasePlaceHolder="请输入员工姓名" - /> - { - this.setState({ - addProps: { - ...addProps, - visible: false - } - }, () => { - isRefresh && this.getSupplementaryList({ - billMonth, - current: this.state.current, - paymentOrganization - }); - }); - }} - /> + onAdReset={() => this.setState({ + formParams: { userName: "", workcode: "", departmentIds: [], subCompanyIds: [] } + })}/> + {/*添加补缴弹框*/} + { + this.setState({ addProps: { ...addProps, visible: false } }, () => { + isRefresh && this.getSupplementaryList(); + }); + }}/> {/*核算进度条*/} { - this.setState({ progressVisible: false, progress: 0 }); - }} - progress={this.state.progress} - /> + onCancel={() => this.setState({ progressVisible: false, progress: 0 })} + progress={this.state.progress}/> {/*导入弹框*/} - this.setState({ importParams: { ...importParams, visible: false } }, () => isInit && this.handleSearch())}/> @@ -547,17 +395,9 @@ export default class NormalIndex extends Component { {/*编辑弹框*/} - { - this.setState({ - adjustSlide: { - ...adjustSlide, - visible: false - } - }); - }} - /> + {/*调差*/} + this.setState({ adjustSlide: { ...adjustSlide, visible: false } })}/>
); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js index f88362f5..acb72e00 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js @@ -6,107 +6,68 @@ */ import React, { Component } from "react"; import { Icon, Spin, Tooltip } from "antd"; -import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom"; +import { getOverViewList } from "../../../../apis/standingBook"; import "./index.less"; +import { convertToUrlString } from "../../../../util/url"; const getLabel = WeaLocaleProvider.getLabel; -@inject("standingBookStore") -@observer export default class OverViewIndex extends Component { constructor(props) { super(props); this.state = { - selectedRowKeys: [], - current: 1, - pageSize: 10, - tableData: { - list: [], - columns: [], - total: 0 - } + dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false }; } componentDidMount() { - const { billMonth, paymentOrganization } = this.props; - this.getOverViewList({ billMonth, paymentOrganization }); + this.getOverViewList(); } - getOverViewList = (payload = {}) => { - const { getOverViewList } = this.props.standingBookStore; - getOverViewList({ ...payload, current: 1 }).then( - ({ list, columns = [], total }) => { - columns = _.map( - _.filter(columns, (it) => it.dataIndex !== "id"), - (it) => { - // if (it.dataIndex === "employeeId") { - // it = { - // ...it, - // width: 150, - // fixed: 'left' - // } - // } - return { - ...it, - title: ( + getOverViewList = () => { + const { pageInfo } = this.state; + this.setState({ loading: true }); + getOverViewList({ ..._.pick(this.props, ["billMonth", "paymentOrganization"]), ...pageInfo }) + .then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { current, pageSize, total }, + columns: _.map(columns, (it) => ({ + ...it, title: ( ) - }; - } - ); - this.setState({ - tableData: { - list, - columns, - total - } - }); - } - ); + })) + }); + } + }); }; handleExport = () => { - const { billMonth, paymentOrganization } = this.props; - const url = `${window.location - .origin}/api/bs/hrmsalary/welfare/overView/export?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; - window.open(url, "_self"); + const url = `/api/bs/hrmsalary/welfare/overView/export?${convertToUrlString(_.pick(this.props, ["billMonth", "paymentOrganization"]))}`; + window.open(url, "_blank"); }; render() { - const { remarks, billMonth, selectedKey, paymentOrganization } = this.props; - const { selectedRowKeys } = this.state; - const { loading } = this.props.standingBookStore; - let { list, columns, total } = this.state.tableData; + const { pageInfo, loading, dataSource, columns } = this.state, { billMonth } = this.props; const pagination = { - total, - showTotal: (total) => `共 ${total} 条`, - showSizeChanger: true, + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, showQuickJumper: true, + showSizeChanger: true, pageSizeOptions: ["10", "20", "50", "100"], onShowSizeChange: (current, pageSize) => { - this.setState({ current, pageSize }); - this.getOverViewList({ - billMonth, current, - pageSize, paymentOrganization - }); + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getOverViewList()); }, - onChange: (current) => { - this.setState({ current }); - this.getOverViewList({ - billMonth, current, - pageSize: this.state.pageSize, paymentOrganization - }); - } + onChange: current => this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getOverViewList()) }; return (
- 账单月份 - + {getLabel(111, "账单月份")} + @@ -120,14 +81,8 @@ export default class OverViewIndex extends Component {
- +
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js index c311d035..793b5acc 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js @@ -8,7 +8,6 @@ import React, { Component } from "react"; import { WeaDatePicker, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; import { Button, Modal } from "antd"; import RegSelect from "./regSelect"; -import * as API from "../../../../apis/standingBook"; class RegAddEmployee extends Component { constructor(props) { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js index 979cccc9..c37db36c 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js @@ -5,10 +5,9 @@ * Date: 2022/11/23 */ import React, { Component } from "react"; -import { WeaInputNumber, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTable } from "ecCom"; -import { message } from "antd"; +import { WeaInputNumber, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTable, WeaTop } from "ecCom"; +import { Button, message } from "antd"; import * as API from "../../../../apis/standingBook"; -import SlideModalTitle from "../../../../components/slideModalTitle"; import { regColumns } from "../constant"; import { toDecimal_n } from "../../../../util"; @@ -20,37 +19,19 @@ class RegEditDetial extends Component { this.state = { loading: false, listMap: [ - { - key: "social", - label: "社保", - dataSource: [], - columns: [] - }, - { - key: "fund", - label: "公积金", - dataSource: [], - columns: [] - }, - { - key: "other", - label: "企业年金及其他福利", - dataSource: [], - columns: [] - } + { key: "social", label: getLabel(111, "社保"), dataSource: [], columns: [] }, + { key: "fund", label: getLabel(111, "公积金"), dataSource: [], columns: [] }, + { key: "other", label: getLabel(111, "企业年金及其他福利"), dataSource: [], columns: [] } ] }; } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.editId !== this.props.editId && nextProps.editId) { - this.getPaymentById(nextProps.editId); - } + if (nextProps.editId !== this.props.editId && nextProps.editId) this.getPaymentById(nextProps.editId); } handleSave = () => { - const { editId, onCancel } = this.props; - const { listMap } = this.state; + const { editId, onCancel } = this.props, { listMap } = this.state; const [socialData, foundData, otherData] = listMap; let payload = { id: editId, @@ -100,8 +81,7 @@ class RegEditDetial extends Component { }); }; handleChange = (type, dataIndex, value, record) => { - const { listMap } = this.state; - const [socialData, foundData, otherData] = listMap; + const { listMap } = this.state, [socialData, foundData, otherData] = listMap; switch (type) { case "social": const sociallist = _.map(socialData.dataSource, item => { @@ -139,7 +119,6 @@ class RegEditDetial extends Component { default: break; } - }; getPaymentById = (id) => { const payload = { id }; @@ -257,39 +236,26 @@ class RegEditDetial extends Component { const { visible, title, onCancel } = this.props; const { listMap, loading } = this.state; return ( - - } - content={ -
- { - _.map(listMap, item => { - const { key, label, dataSource, columns } = item; - return - - ; - }) - } -
- } - onClose={() => onCancel()} - showMask={true} - /> - ); + } iconBgcolor="#F14A2D" + buttons={[]}/> + } + content={ + + { + _.map(listMap, item => { + const { key, label, dataSource, columns } = item; + return + + ; + }) + } + + } + onClose={() => onCancel()}/>); } } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js index 849cb407..08f65301 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js @@ -6,36 +6,27 @@ */ import React, { Component } from "react"; import { Spin } from "antd"; -import { getQueryString } from "../../../../util/url"; +import { sysConfCodeRule } from "../../../../apis/ruleconfig"; import * as API from "../../../../apis/standingBook"; import "./index.less"; const APIFox = { "regression": API.recessionList, - "difference": API.balanceList + "regressionSum": API.recessionListSum, + "difference": API.balanceList, + "differenceSum": API.balanceListSum }; class RegList extends Component { constructor(props) { super(props); this.state = { - columns: [], - dataSource: [], - selectedRowKeys: [], - loading: { - query: false - }, - datalistPayload: {}, - pageInfo: { - current: 1, - pageSize: 10, - total: 0 - } + columns: [], dataSource: [], selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, sumRow: {} }; } componentDidMount() { - this.recessionList(); window.addEventListener("message", this.handleReceive, false); } @@ -43,11 +34,11 @@ class RegList extends Component { const { onEdit, onChangeRowkey } = this.props; const { type, payload: { id, params } = {} } = data; if (type === "init") { - this.postMessageToChild(); + this.recessionList(); } else if (type === "turn") { if (id === "PAGEINFO") { const { pageNum: current, size: pageSize } = params; - this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.recessionList()); + this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.recessionList({}, true)); } else if (id === "ROWSELECT") { const { selectedRowKeys } = params; this.setState({ selectedRowKeys }); @@ -58,24 +49,15 @@ class RegList extends Component { } }; postMessageToChild = () => { - const paymentStatus = this.props.type === "difference" ? "4" : "3"; - const creator = Number(getQueryString("creator")); - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); const childFrameObj = document.getElementById("atdTable"); - const { pageInfo, dataSource, columns, selectedRowKeys, datalistPayload } = this.state; - childFrameObj.contentWindow.postMessage(JSON.stringify({ - dataSource, columns, pageInfo, - selectedRowKeys, selectedKey: this.props.type, - sumpayload: { billMonth, paymentOrganization, creator, paymentStatus, ...datalistPayload }, - showOperates: !getQueryString("type") + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ + ..._.pick(this.state, ["dataSource", "columns", "pageInfo", "selectedRowKeys", "sumRow"]), + showOperates: !this.props.type }), "*"); }; componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.visible !== this.props.visible) { - this.recessionList(); - } + if (nextProps.visible !== this.props.visible) this.recessionList(); } componentWillUnmount() { @@ -85,41 +67,37 @@ class RegList extends Component { handleResetSelectRowKeys = (selectedRowKeys) => { this.setState({ selectedRowKeys }); }; - recessionList = (module) => { - const { type } = this.props; - const { loading, pageInfo } = this.state; - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); - const creator = Number(getQueryString("creator")); - const paymentStatus = type === "difference" ? "4" : "3"; + recessionList = (module, pageTurning = false) => { + const { regType } = this.props, { pageInfo } = this.state; + const paymentStatus = regType === "difference" ? "4" : "3"; const payload = { - billMonth, paymentStatus, - creator, paymentOrganization, - ...pageInfo, - ...module + ...pageInfo, ...module, paymentStatus, + ..._.pick(this.props, ["billMonth", "paymentOrganization", "creator"]) }; - this.setState({ loading: { ...loading, query: true } }); - APIFox[type](payload).then(({ status, data }) => { - this.setState({ loading: { ...loading, query: false } }); + this.setState({ loading: true }); + APIFox[regType](payload).then(({ status, data }) => { + this.setState({ loading: false }); if (status) { const { pageInfo: list } = data; const { columns, list: dataSource, pageNum: current, pageSize, total } = list; this.setState({ - pageInfo: { ...pageInfo, current, pageSize, total }, - dataSource, - columns, - datalistPayload: module + pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, columns }, () => this.postMessageToChild()); } - }).catch(() => { - this.setState({ loading: { ...loading, query: false } }); + }); + sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }).then(({ status, data }) => { + if (status && data === "1" && !pageTurning) { + APIFox[`${regType}Sum`](payload).then(({ status: sumStatus, data: sumData }) => { + if (sumStatus) this.setState({ sumRow: sumData.sumRow }, () => this.postMessageToChild()); + }); + } }); }; render() { const { loading } = this.state; return ( - +