diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index e44dfc25..013bddee 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -520,6 +520,39 @@ export const siaccountDetailCommonListSum = (params) => { body: JSON.stringify(params) }).then(res => res.json()); }; +// 社保福利台账补缴合计接口 +export const siaccountDetailSupplementaryListSum = (params) => { + return fetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list/sum", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +// 社保福利台账退差合计接口 +export const siaccountDetailRecessionListSum = (params) => { + return fetch("/api/bs/hrmsalary/siaccount/detail/recession/list/sum", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +// 社保福利台账补差合计接口 +export const siaccountDetailBalanceListSum = (params) => { + return fetch("/api/bs/hrmsalary/siaccount/detail/balance/list/sum", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 导入薪资核算添加表头字段缓存 export const cacheImportField = (params) => { return fetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", { diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js index bacbe74c..f288cc35 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js @@ -109,7 +109,10 @@ export default class SelectFieldModal extends React.Component { // 添加按钮点击回调 handleAddClick = async () => { - const { status } = await this.cacheImportField(); + //薪资核算详情页面的导入表单字段缓存功能 + if (window.location.hash.indexOf("calculateDetail") !== -1) { + const { status } = await this.cacheImportField(); + } this.props.onAdd(this.fieldData); this.props.onCancel(); }; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js index 1c276127..9fc924e1 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js @@ -1,7 +1,7 @@ import React from "react"; import ImportModal from "../../components/importModal"; import { inject, observer } from "mobx-react"; -import { getQueryString } from "../../util/url"; +import { convertToUrlString, getQueryString } from "../../util/url"; @inject("calculateStore", "standingBookStore") @observer @@ -35,7 +35,12 @@ export default class CompareDetailImportModal extends React.Component { if (this.props.id) { url = "/api/bs/hrmsalary/salaryacct/comparisonresult/importtemplate/export?salaryAcctRecordId=" + this.props.id; } else { - url = `/api/bs/hrmsalary/siaccount/comparisonwelfare/importtemplate/export`; + const payload = { + billMonth: getQueryString("billMonth"), + paymentOrganization: getQueryString("paymentOrganization"), + paymentStatus: 0 + }; + url = `/api/bs/hrmsalary/siaccount/comparisonwelfare/importtemplate/export?${convertToUrlString(payload)}`; } window.open(url); } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index 668a798e..f0cf2f8d 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -4,7 +4,7 @@ import { inject, observer } from "mobx-react"; import SalaryDetail from "./salaryDetail"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { WeaBrowser, WeaCheckbox, WeaDropdown, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom"; -import { getQueryString } from "../../util/url"; +import { convertToUrlString, getQueryString } from "../../util/url"; import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal"; import ProgressModal from "../../components/progressModal"; @@ -172,7 +172,7 @@ export default class CalculateDetail extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctresult/list", selectedRowKeys: [], queryParams: { - salaryAcctRecordId, + salaryAcctRecordId } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -208,8 +208,11 @@ export default class CalculateDetail extends React.Component { this.id ); } else if (e.key == "3") { + const { searchItemsValue } = this.state; + const { consolidatedTaxation, ...extra } = searchItemsValue; + const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation }; window.open( - "/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=" + this.id + "&ids=" + `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${this.id}&ids=&${convertToUrlString(payload)}` ); } }; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index 4e5d734f..fca6e52a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js @@ -56,17 +56,17 @@ class Index extends Component { }; handleChangeSalaryMonth = (salaryMonth) => this.setState({ salaryMonth }, () => this.attendanceTableRef.getAttendanceList({ salaryYearMonth: _.compact(this.state.salaryMonth) })); handleAddAttendFileds = () => this.fieldMangRef.handleTriggerAttendFileds(); - handleImportAttendanceData= ()=>{ + handleImportAttendanceData = () => { this.attendanceTableRef.handleImportAttendanceData({ visiable: true, params: {}, step: 0, columns: [], slideDataSource: [], importResult: [] }); - } - handleQuoteAttendanceData= ()=>{ + }; + handleQuoteAttendanceData = () => { this.attendanceTableRef.handleQuoteAttendanceData({ visible: true, title: "引用考勤数据" }); - } + }; render() { const { selectedKey, salaryMonth, fieldName } = this.state; @@ -82,7 +82,7 @@ class Index extends Component { return (
this.setState({ selectedKey: v })} searchsBaseValue={fieldName} onSearchChange={fieldName => this.setState({ fieldName })} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 731b6cc9..0e106ae3 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -19,6 +19,7 @@ import ImportFormCom from "./components/importFormCom"; import TableRecord from "../components/tableRecord"; import { dataCollectCondition, modalColumns } from "./columns"; import { removePropertyCondition } from "../../../util/response"; +import { convertToUrlString } from "../../../util/url"; import Layout from "../layout"; import moment from "moment"; @@ -52,6 +53,7 @@ class Index extends Component { slideDataSource: [] }, exportPayloadUrl: "", + exportPayloadType: false, advanceCondition: null }; this.tableRef = null; @@ -160,9 +162,11 @@ class Index extends Component { * Date: 2023/2/20 */ handleExportAll = () => { - const { declareMonth, taxAgentId } = this.state; + const { cumDeductStore: { form } } = this.props; + const { declareMonth, taxAgentId, exportPayloadType } = this.state; this.setState({ - exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}` + exportPayloadType: !exportPayloadType, + exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}&${convertToUrlString(form.getFormParams())}` }); }; /* @@ -173,12 +177,13 @@ class Index extends Component { */ handleExportSelect = () => { const { selectedRowKeys: ids } = this.tableRef.state; - const { declareMonth, taxAgentId } = this.state; + const { declareMonth, taxAgentId, exportPayloadType } = this.state; if (ids.length === 0) { message.warning("请选择需要导出的数据"); return; } this.setState({ + exportPayloadType: !exportPayloadType, exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpDeduction/export?ids=${ids.join(",")}&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}` }); }; @@ -497,7 +502,7 @@ class Index extends Component { const { taxAgentStore: { showOperateBtn }, cumDeductStore: { form } } = this.props; const { declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, - importPayload + importPayload, exportPayloadType } = this.state; const tablePayload = { declareMonth: [declareMonth], taxAgentId }; return ( @@ -505,6 +510,7 @@ class Index extends Component { onResizeWindowInnerWidth={this.handleResize} slidePayload={slidePayload} onClose={this.handleCloseSlide} onSave={this.handleSaveData} slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl} + exportPayloadType={exportPayloadType} form={form} condition={advanceCondition} onAdSearch={this.handleAdSearch} onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport} importPayload={importPayload} onImportFile={this.handleImportFile} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index ef5e134b..78c77a40 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -28,6 +28,7 @@ import { dataCollectCondition, taxOptions } from "./columns"; import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; import { situationModalColumns } from "../cumDeduct/columns"; +import { convertToUrlString } from "../../../util/url"; @inject("taxAgentStore", "cumSituationStore") @observer @@ -59,6 +60,7 @@ class Index extends Component { slideDataSource: [] }, exportPayloadUrl: "", + exportPayloadType: false, advanceCondition: null }; this.tableRef = null; @@ -277,9 +279,11 @@ class Index extends Component { * Date: 2023/2/20 */ handleExportAll = () => { - const { declareMonth, taxAgentId, year } = this.state; + const { cumSituationStore: { form } } = this.props; + const { declareMonth, taxAgentId, year, exportPayloadType } = this.state; this.setState({ - exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpSituation/export?ids=&year=${year}&taxYearMonth=${year}-${declareMonth}&taxAgentId=${taxAgentId}` + exportPayloadType: !exportPayloadType, + exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpSituation/export?ids=&year=${year}&taxYearMonth=${year}-${declareMonth}&taxAgentId=${taxAgentId}&${convertToUrlString(form.getFormParams())}` }); }; /* @@ -290,12 +294,13 @@ class Index extends Component { */ handleExportSelect = () => { const { selectedRowKeys: ids } = this.tableRef.state; - const { declareMonth, taxAgentId, year } = this.state; + const { declareMonth, taxAgentId, year, exportPayloadType } = this.state; if (ids.length === 0) { message.warning("请选择需要导出的数据"); return; } this.setState({ + exportPayloadType: !exportPayloadType, exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpSituation/export?ids=${ids.join(",")}&year=${year}&taxYearMonth=${year}-${declareMonth}&taxAgentId=${taxAgentId}` }); }; @@ -511,7 +516,7 @@ class Index extends Component { const { taxAgentStore: { showOperateBtn }, cumSituationStore: { form } } = this.props; const { declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, - importPayload, year + importPayload, year, exportPayloadType } = this.state; const tablePayload = { taxYearMonth: `${year}-${declareMonth}`, year, taxAgentId }; return ( @@ -519,6 +524,7 @@ class Index extends Component { onResizeWindowInnerWidth={this.handleResize} slidePayload={slidePayload} onClose={this.handleCloseSlide} onSave={this.handleSaveData} slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl} + exportPayloadType={exportPayloadType} form={form} condition={advanceCondition} onAdSearch={this.handleAdSearch} onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport} importPayload={{ ...importPayload, importOpts: { taxYearMonth: importPayload.importOpts.declareMonth } }} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js b/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js index 8bc29bd1..579cb872 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js @@ -154,7 +154,7 @@ class DataTables extends Component { dataSource={dataSource} pagination={pagination} loading={loading.query} - xWidth={getColumns.length * 120} + xWidth={getColumns.length * 150} />; } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js b/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js index ed2969e8..631d0586 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js @@ -30,7 +30,7 @@ class Layout extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.exportPayloadUrl !== this.props.exportPayloadUrl) { + if (nextProps.exportPayloadType !== this.props.exportPayloadType) { /* * Author: 黎永顺 * Description:导出数据采集数据 diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js index cb2efd8f..6f542381 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js @@ -103,6 +103,15 @@ export const dataCollectCondition = [ labelcol: 8, value: "", viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["privatePension"], + fieldcol: 14, + label: "个人养老金", + labelcol: 8, + value: "", + viewAttr: 2 } ], title: "数据采集", diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index caa24c1f..5e5aec09 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -29,6 +29,7 @@ import { dataCollectCondition } from "./columns"; import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; import { otherModalColumns } from "../cumDeduct/columns"; +import { convertToUrlString } from "../../../util/url"; @inject("taxAgentStore", "otherDeductStore") @observer @@ -59,6 +60,7 @@ class Index extends Component { slideDataSource: [] }, exportPayloadUrl: "", + exportPayloadType: false, advanceCondition: null }; this.tableRef = null; @@ -250,9 +252,11 @@ class Index extends Component { * Date: 2023/2/20 */ handleExportAll = () => { - const { declareMonth, taxAgentId } = this.state; + const { otherDeductStore: { form } } = this.props; + const { declareMonth, taxAgentId, exportPayloadType } = this.state; this.setState({ - exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/otherDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}` + exportPayloadType: !exportPayloadType, + exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/otherDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}&${convertToUrlString(form.getFormParams())}` }); }; /* @@ -263,12 +267,13 @@ class Index extends Component { */ handleExportSelect = () => { const { selectedRowKeys: ids } = this.tableRef.state; - const { declareMonth, taxAgentId } = this.state; + const { declareMonth, taxAgentId, exportPayloadType } = this.state; if (ids.length === 0) { message.warning("请选择需要导出的数据"); return; } this.setState({ + exportPayloadType: !exportPayloadType, exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/otherDeduction/export?ids=${ids.join(",")}&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}` }); }; @@ -504,7 +509,7 @@ class Index extends Component { const { taxAgentStore: { showOperateBtn }, otherDeductStore: { form } } = this.props; const { declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, - importPayload + importPayload, exportPayloadType } = this.state; const tablePayload = { declareMonth: [declareMonth], taxAgentId }; return ( @@ -512,6 +517,7 @@ class Index extends Component { onResizeWindowInnerWidth={this.handleResize} slidePayload={slidePayload} onClose={this.handleCloseSlide} onSave={this.handleSaveData} slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl} + exportPayloadType={exportPayloadType} form={form} condition={advanceCondition} onAdSearch={this.handleAdSearch} onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport} importPayload={importPayload} onImportFile={this.handleImportFile} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index 2629381c..5ea6f81c 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -21,6 +21,7 @@ import { condition } from "./components/condition"; import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; import { specialModalColumns } from "../cumDeduct/columns"; +import { convertToUrlString } from "../../../util/url"; @inject("taxAgentStore", "specialAddStore") @observer @@ -49,6 +50,7 @@ class Index extends Component { slideDataSource: [] }, exportPayloadUrl: "", + exportPayloadType: false, advanceCondition: null }; this.tableRef = null; @@ -207,9 +209,11 @@ class Index extends Component { * Date: 2023/2/20 */ handleExportAll = () => { - const { taxAgentId } = this.state; + const { specialAddStore: { advanceForm } } = this.props; + const { taxAgentId, exportPayloadType } = this.state; this.setState({ - exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=&taxAgentId=${taxAgentId}` + exportPayloadType: !exportPayloadType, + exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=&taxAgentId=${taxAgentId}&${convertToUrlString(advanceForm.getFormParams())}` }); }; /* @@ -220,12 +224,13 @@ class Index extends Component { */ handleExportSelect = () => { const { selectedRowKeys: ids } = this.tableRef.state; - const { taxAgentId } = this.state; + const { taxAgentId, exportPayloadType } = this.state; if (ids.length === 0) { message.warning("请选择需要导出的数据"); return; } this.setState({ + exportPayloadType: !exportPayloadType, exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=${ids.join(",")}&taxAgentId=${taxAgentId}` }); }; @@ -414,7 +419,8 @@ class Index extends Component { render() { const { taxAgentStore: { showOperateBtn }, specialAddStore: { advanceForm } } = this.props; const { - taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, importPayload + taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, importPayload, + exportPayloadType } = this.state; const tablePayload = { taxAgentId }; return ( @@ -422,6 +428,7 @@ class Index extends Component { onResizeWindowInnerWidth={this.handleResize} slidePayload={slidePayload} onClose={this.handleCloseSlide} onSave={this.handleSaveData} slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl} + exportPayloadType={exportPayloadType} form={advanceForm} condition={advanceCondition} onAdSearch={this.handleAdSearch} onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport} importPayload={importPayload} onImportFile={this.handleImportFile} diff --git a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js index 9e4370ca..2d40f912 100644 --- a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js +++ b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js @@ -232,17 +232,17 @@ class FieldSlide extends Component { {/* />*/} {/* */} {/*}*/} - - this.handleChangeFields("useDefault", value)} - /> - - + {/**/} + {/* this.handleChangeFields("useDefault", value)}*/} + {/* />*/} + {/* */} + {/**/} { const { list, baseInfo, onChange, inputStr } = props; - const { salaryCycleType, salaryCycleFromDay, attendCycleType, attendCycleFromDay, canEdit } = baseInfo; - const salaryCycleStrObj = initPeriodStr("inputStr", salaryCycleType, salaryCycleFromDay); - const attendCycleStrObj = initPeriodStr("inputStr", attendCycleType, attendCycleFromDay); + const { canEdit } = baseInfo; + const selectInfo = buildEditBasicInfo(baseInfo); return { _.map(list, item => { @@ -221,20 +226,12 @@ const CustomSelect = (props) => { }) } {inputStr === "salaryCycleStrObj" ? salaryCycleStrObj.inputStr : attendCycleStrObj.inputStr} + className="desc">{inputStr === "salaryCycleStrObj" ? selectInfo.salaryCycleInfo.salaryPeriodTip : selectInfo.attendCycleInfo.attendancePeriodTip} ; }; const MonthCycleDesc = (props) => { - const { - taxCycleType, - socialSecurityCycleType, - salaryCycleFromDay, - salaryCycleType, - attendCycleType, - attendCycleFromDay - } = props; - const salaryCycleStrObj = initPeriodStr("salaryCycleStr", salaryCycleType, salaryCycleFromDay); - const attendCycleStrObj = initPeriodStr("attendCycleStr", attendCycleType, attendCycleFromDay); + const { taxCycleType, socialSecurityCycleType } = props; + const selectInfo = buildEditBasicInfo({ ...props }); return
月份周期说明
@@ -245,28 +242,131 @@ const MonthCycleDesc = (props) => {
根据您当前的选择,相应的周期为:
薪资周期
- {getStartDate(salaryCycleType, salaryCycleFromDay)}至 - {salaryCycleStrObj.date} + {selectInfo.salaryCycleInfo.salaryPeriodStart}至 + {selectInfo.salaryCycleInfo.salaryPeriodEnd}
税款所属期
{getMonth(taxCycleType)}
考勤取值周期
- {getStartDate(attendCycleType, attendCycleFromDay)}至 - {attendCycleStrObj.date} + {selectInfo.attendCycleInfo.attendancePeriodStart}至 + {selectInfo.attendCycleInfo.attendancePeriodEnd}
福利台账月份
引用{getMonth(socialSecurityCycleType)}的福利台账数据
; }; - -// 获取开始日期 -const getStartDate = (salaryCycleType, day) => { - day = Number(day); - return getMonth(salaryCycleType) + "-" + (day < 10 ? "0" + day : day); +const buildEditBasicInfo = (editBasicInfo) => { + const { attendCycleType, salaryCycleType } = editBasicInfo; + const now = new Date(); + let nowYear = now.getFullYear(); + let nowMonth = now.getMonth() + 1; + let tmpV = {}; + // 薪资联动 + switch (salaryCycleType) { + case "1" : + tmpV["salaryCycleInfo"] = buildSalaryInfo(editBasicInfo, -2, nowYear, nowMonth); + break; + case "2" : + tmpV["salaryCycleInfo"] = buildSalaryInfo(editBasicInfo, -1, nowYear, nowMonth); + break; + case "3" : + tmpV["salaryCycleInfo"] = buildSalaryInfo(editBasicInfo, 0, nowYear, nowMonth); + break; + case "4" : + tmpV["salaryCycleInfo"] = buildSalaryInfo(editBasicInfo, 1, nowYear, nowMonth); + break; + } + // 考勤联动 + switch (attendCycleType) { + case "1" : + tmpV["attendCycleInfo"] = buildAttendanceInfo(editBasicInfo, -2, nowYear, nowMonth); + break; + case "2" : + tmpV["attendCycleInfo"] = buildAttendanceInfo(editBasicInfo, -1, nowYear, nowMonth); + break; + case "3" : + tmpV["attendCycleInfo"] = buildAttendanceInfo(editBasicInfo, 0, nowYear, nowMonth); + break; + case "4" : + tmpV["attendCycleInfo"] = buildAttendanceInfo(editBasicInfo, 1, nowYear, nowMonth); + break; + } + return tmpV; }; +/* + * Author: 黎永顺 + * Description:构建薪资周期联动信息 + * Params: + * Date: 2023/4/17 + */ +const buildSalaryInfo = (editBasicInfo, monthCal, nowYear, nowMonth) => { + const { salaryCycleFromDay } = editBasicInfo; + let salaryCycleFromDayNum = Number(salaryCycleFromDay), customInfo = {}; + const basicInfo = generateBasicInfo(monthCal, nowYear, nowMonth); + const { nowMonthStr, nextMonthStr, year, month } = basicInfo; + customInfo.salaryYear = year; + customInfo.salaryMonth = month; + if (salaryCycleFromDayNum === 1) { + customInfo.salaryPeriodTip = "至" + nowMonthStr + "最后一天"; + customInfo.salaryPeriodStart = customInfo.salaryYear + "-" + + prefixAddZero(customInfo.salaryMonth, 2) + "-01"; + customInfo.salaryPeriodEnd = customInfo.salaryYear + "-" + + prefixAddZero(customInfo.salaryMonth, 2) + "-" + + prefixAddZero(getMonthDays(customInfo.salaryYear, customInfo.salaryMonth), 2); + } else { + customInfo.salaryPeriodTip = "至" + nextMonthStr + (salaryCycleFromDayNum - 1) + "号"; + customInfo.salaryPeriodStart = customInfo.salaryYear + "-" + + prefixAddZero(customInfo.salaryMonth, 2) + "-" + prefixAddZero(salaryCycleFromDayNum, 2); + let year = customInfo.salaryYear; + let month = customInfo.salaryMonth; + if (month === "12") { + year = Number(year) + 1; + month = 1; + } else { + month = Number(month) + 1; + } + customInfo.salaryPeriodEnd = year + "-" + + prefixAddZero(month, 2) + "-" + + prefixAddZero(salaryCycleFromDayNum - 1, 2); + } + return customInfo; +}; +const buildAttendanceInfo = (editBasicInfo, monthCal, nowYear, nowMonth) => { + const { attendCycleFromDay } = editBasicInfo; + let attendCycleFromDayNum = Number(attendCycleFromDay), customInfo = {}; + + const basicInfo = generateBasicInfo(monthCal, nowYear, nowMonth); + const { nowMonthStr, nextMonthStr } = basicInfo; + let year = basicInfo.year; + let month = basicInfo.month; + + if (attendCycleFromDayNum === 1) { + customInfo.attendancePeriodTip = "至" + nowMonthStr + "最后一天"; + + customInfo.attendancePeriodStart = year + "-" + + prefixAddZero(month, 2) + "-01"; + customInfo.attendancePeriodEnd = year + "-" + + prefixAddZero(month, 2) + "-" + + prefixAddZero(getMonthDays(year, month), 2); + } else { + customInfo.attendancePeriodTip = "至" + nextMonthStr + (attendCycleFromDayNum - 1) + "号"; + customInfo.attendancePeriodStart = year + "-" + + prefixAddZero(month, 2) + "-" + prefixAddZero(attendCycleFromDayNum, 2); + if (month === "12") { + year = (Number(year) + 1).toString(); + month = "1"; + } else { + month = (Number(month) + 1).toString(); + } + customInfo.attendancePeriodEnd = year + "-" + + prefixAddZero(month, 2) + "-" + + prefixAddZero(attendCycleFromDayNum - 1, 2); + } + return customInfo; +}; const getMonth = (salaryCycleType) => { switch (salaryCycleType) { case "1": // 上上月 @@ -279,62 +379,3 @@ const getMonth = (salaryCycleType) => { return getAddMonthYearMonth(1); } }; -const initPeriodStr = (periodStrType, types, fromDay) => { - let str = "", tmpDate = null; - switch (types) { - case "1": - tmpDate = moment().subtract(2, "month"); - const is_31H = moment(tmpDate, "YYYY-MM").daysInMonth() === 31; - if (fromDay == 1) { - tmpDate = moment().subtract(2, "month").endOf("month"); - str = `至上上月最后一天`; - } else { - tmpDate = moment(new Date(`${moment(tmpDate).format("YYYY-MM")}-0${fromDay}`)) - .add(is_31H ? 30 : 27, "days"); - str = `至上月${moment(tmpDate).date()}号`; - } - break; - case "2": - tmpDate = moment().subtract(1, "month"); - const is_31 = moment(tmpDate, "YYYY-MM").daysInMonth() === 31; - if (fromDay == 1) { - tmpDate = moment().subtract(1, "month").endOf("month"); - str = `至上月最后一天`; - } else { - tmpDate = moment(new Date(`${moment(tmpDate).format("YYYY-MM")}-0${fromDay}`)) - .add(is_31 ? 30 : 27, "days"); - str = `至本月${moment(tmpDate).date()}号`; - } - break; - case "3": - tmpDate = moment().add(0, "month"); - const is_31K = moment(tmpDate, "YYYY-MM").daysInMonth() === 31; - if (fromDay == 1) { - tmpDate = moment().endOf("month"); - str = `至本月最后一天`; - } else { - tmpDate = moment(new Date(`${moment(tmpDate).format("YYYY-MM")}-0${fromDay}`)) - .add(is_31K ? 30 : 27, "days"); - str = `至下月${moment(tmpDate).date()}号`; - } - break; - case "4": - tmpDate = moment().add(1, "month"); - const is_31L = moment(tmpDate, "YYYY-MM").daysInMonth() === 31; - if (fromDay == 1) { - tmpDate = moment().add(1, "month").endOf("month"); - str = `至下月最后一天`; - } else { - tmpDate = moment(new Date(`${moment(tmpDate).format("YYYY-MM")}-0${fromDay}`)) - .add(is_31L ? 30 : 29, "days"); - str = `至下下月${moment(tmpDate).date()}号`; - } - break; - default: - break; - } - return { - [periodStrType]: str, - date: moment(tmpDate).format("YYYY-MM-DD") - }; -}; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js index 736867cf..abcf4aa1 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js @@ -301,10 +301,10 @@ class LedgerSalaryItem extends Component { * Params: * Date: 2023/3/8 */ - handleMoveSalaryItem = (moveToItemId, items) => { + handleMoveSalaryItem = (moveToItemId, items, titleName) => { const { itemGroups } = this.state; const { salaryItemGroupId: deleteItemId, id, key } = items; - if (moveToItemId === deleteItemId) return; + if (moveToItemId === deleteItemId || (deleteItemId === "0" && titleName === "未分类")) return; this.setState({ itemGroups: _.map(itemGroups, it => { if (moveToItemId === it.uuid) { diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js index 20562453..de378287 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js @@ -13,6 +13,7 @@ export default class LedgerSalaryItemAddModal extends React.Component { name: "", selectedRowKeys: [], dataSource: [], + dataSourceCopy: [], columns: [], pageInfo: { current: 1, @@ -24,7 +25,7 @@ export default class LedgerSalaryItemAddModal extends React.Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visivle && nextProps.visible) { - this.setState({ selectedRowKeys: [] }, () => { + this.setState({ selectedRowKeys: [], dataSourceCopy: [] }, () => { this.listSalaryItem(); }); } @@ -32,7 +33,7 @@ export default class LedgerSalaryItemAddModal extends React.Component { listSalaryItem = () => { const { itemGroups } = this.props; - const { name, pageInfo, loading } = this.state; + const { name, pageInfo, loading, dataSourceCopy } = this.state; let excludeIds = []; itemGroups.map(item => { item.items && item.items.map(i => { @@ -50,6 +51,7 @@ export default class LedgerSalaryItemAddModal extends React.Component { if (status) { const { pageNum: current, pageSize, total, columns, list: dataSource } = data; this.setState({ + dataSourceCopy: [...dataSourceCopy, ...dataSource], pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, columns @@ -80,11 +82,11 @@ export default class LedgerSalaryItemAddModal extends React.Component { }; handleAdd = () => { - const { dataSource, selectedRowKeys } = this.state; + const { dataSourceCopy, selectedRowKeys } = this.state; const { onAddSalaryItems, id, onCancel, itemGroups } = this.props; const arrItems = _.find(itemGroups, it => it.uuid === id).items || []; let selectItems = []; - dataSource.map((item) => { + dataSourceCopy.map((item) => { item = { ...item }; selectedRowKeys.map((key, keyIdx) => { if (item.id === key) { diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js index d1017f60..f6e4e295 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js @@ -175,11 +175,11 @@ class LedgerSalaryItemNormal extends Component { }); }; handleSubmitMoveTo = () => { - const { onMoveSalaryItem } = this.props; + const { onMoveSalaryItem, dataSource } = this.props; const { moveModalPayload } = this.state; const { record, value } = moveModalPayload; this.handleCancelMove(); - onMoveSalaryItem(value, record); + onMoveSalaryItem(value, record, _.find(dataSource, it => (it.id === value || it.uuid === value)).name); }; render() { diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js index 28508dce..925e04e7 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js @@ -25,7 +25,7 @@ class LedgerSalaryItemTable extends Component { const { dataSource, onHandleItemhide } = this.props; onHandleItemhide( _.map([...dataSource], item => { - if (id === item.id) { + if (id === item.id || id === item.key) { return { ...item, itemHide: String(value) @@ -48,7 +48,14 @@ class LedgerSalaryItemTable extends Component { }; render() { - const { dataSource, onDropCategoryItem, onChangeSelectedRowKeys, onEditFormnul, selectedRowKeys, onMoveTo } = this.props; + const { + dataSource, + onDropCategoryItem, + onChangeSelectedRowKeys, + onEditFormnul, + selectedRowKeys, + onMoveTo + } = this.props; const rowSelection = { selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }, () => { @@ -58,7 +65,7 @@ class LedgerSalaryItemTable extends Component { disabled: !record.canDelete }) }; - const checkValue = _.every(dataSource, it => it.itemHide && it.itemHide === "1") ? "1" : "0"; + const checkValue = (!_.isEmpty(dataSource) && _.every(dataSource, it => it.itemHide && it.itemHide === "1")) ? "1" : "0"; const columns = [ { title: "名称", @@ -102,7 +109,7 @@ class LedgerSalaryItemTable extends Component { width: 80, render: (text, record) => this.handleChangeItem(value, record.id)} + onChange={value => this.handleChangeItem(value, record.id || record.key)} /> }, { diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index dc79d451..4d08a972 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -24,7 +24,8 @@ export default class MobilePayroll extends React.Component { const type = getQueryString("type"); this.id = getQueryString("id"); const { mySalaryStore: { init } } = this.props; - type !== "phone" && init(false); + // type !== "phone" && init(false); + init(false); this.getMySalaryBill(this.id); } diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js index 6c0a5a3f..03ff17c6 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js @@ -5,8 +5,7 @@ import { Button, Spin } from "antd"; import { getQueryString } from "../../../util/url"; import { removePropertyCondition } from "../../../util/response"; import { getSearchs } from "../../../util"; -import { getPayrollDetailList, getPayrollDetailSa, getPayrollInfo, salaryBillSendSum } from "../../../apis/payroll"; -import { sysConfCodeRule } from "../../../apis/ruleconfig"; +import { getPayrollDetailList, getPayrollDetailSa, getPayrollInfo } from "../../../apis/payroll"; import "./index.less"; @inject("payrollStore") @@ -17,8 +16,7 @@ export default class PayrollDetail extends React.Component { this.state = { salarySendDetailBaseInfo: {}, loading: false, condition: [], dataSource: [], columns: [], - pageInfo: { current: 1, pageSize: 10, total: 0 }, - salaryBillSendSum: {}, showSum: false + pageInfo: { current: 1, pageSize: 10, total: 0 } }; } @@ -54,16 +52,11 @@ export default class PayrollDetail extends React.Component { } } if (type === "init") { - const { status, data: sysData } = await this.sysConfCodeRule(); - const { data: { sumRow } } = await this.salaryBillSendSum(); - const salaryBillSendSum = _.reduce(_.keys(sumRow), (pre, cur) => (_.assign(pre, { [`${cur}_salaryItem`]: sumRow[cur] })), {}); - this.setState({ showSum: status && sysData === "1", salaryBillSendSum }); childFrameObj.contentWindow.postMessage(JSON.stringify({ dataSource, columns, pageInfo, - showSum: status && sysData === "1", - salaryBillSendSum + sumpayload: { salarySendId: getQueryString("id") } }), "*"); this.getPayrollDetailList({ child: type }); } @@ -110,25 +103,18 @@ export default class PayrollDetail extends React.Component { })), pageInfo: { ...pageInfo, current, pageSize, total } }, () => { - const { pageInfo, dataSource, columns, salaryBillSendSum, showSum } = this.state; + const { pageInfo, dataSource, columns } = this.state; (child === "PAGEINFO" || child === "init") && childFrameObj.contentWindow.postMessage(JSON.stringify({ dataSource, columns, - pageInfo, showSum, - salaryBillSendSum + pageInfo, + sumpayload: { salarySendId: getQueryString("id") } }), "*"); }); } }).catch(() => this.setState({ loading: false })); }; - salaryBillSendSum = () => { - const salarySendId = getQueryString("id"); - return salaryBillSendSum({ salarySendId }); - }; - sysConfCodeRule = () => { - return sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }); - }; handleExportAll = () => { const salarySendId = getQueryString("id"); const url = `${window.location.origin}/api/bs/hrmsalary/salaryBill/send/exportDetailList?salarySendId=${salarySendId}`; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index ba1ef02d..3a8ad7ab 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -491,7 +491,8 @@ export default class Archives extends React.Component { break; case "suspend": dom =
-
1、数据进入【待减员】规则:①员工的人事状态属性从在职变成非在职,且在【在缴员工】里;②【在缴员工】里档案维护了缴纳终止月且小于等于当前月;③个税扣缴义务人发生调整;④某员工分权时在原个税扣缴义务人下处于【在缴员工】里但又将该员工添加到其他的个税扣缴义务人下的情况;
+ {/*④某员工分权时在原个税扣缴义务人下处于【在缴员工】里但又将该员工添加到其他的个税扣缴义务人下的情况;*/} +
1、数据进入【待减员】规则:①员工的人事状态属性从在职变成非在职,且在【在缴员工】里;②【在缴员工】里档案维护了缴纳终止月且小于等于当前月;③个税扣缴义务人发生调整;
2、【待减员】为是否不再缴纳的待办状态,数据是从【在缴员工】中复制的,若不处理列表中的待办数据,也不影响社保福利核算;【待减员】维护的数据和【在缴员工】数据是同步的;
3、点击【减员】前先维护最后缴纳月,所有有起始缴纳月的福利项的最后缴纳月都小于等于当前月且无未归档的核算数据的档案才能减员成功,减员成功后数据进入【停缴员工】;
{/*
4、数据进入【待减员】规则的第四种情况下,若还需要在当前个税扣缴义务人下进行缴纳的话,当前该员工的【待减员】数据进行【删除待办】操作即可;若不在该个税扣缴义务人下继续缴纳,维护好最后缴纳月后进行【减员】操作,员工进入【停缴员工】;
*/} @@ -500,7 +501,7 @@ export default class Archives extends React.Component { default: dom =
1、不需要缴纳社保福利的员工,保存在【停缴员工】;
-
2、【停缴员工】点击取消停缴,数据会回退到上次的位置(从【待减员】减员到停缴员工的,点击停缴返回到【在缴员工】,不返回到【待减员】);
+ {/*
2、【停缴员工】点击取消停缴,数据会回退到上次的位置(从【待减员】减员到停缴员工的,点击停缴返回到【在缴员工】,不返回到【待减员】);
*/} {/*
3、若员工的社保福利从一个个税扣缴义务人下转到另一个个税扣缴义务人下去缴纳,则在转后的个税扣缴义务人的【待增员】中进行增员操作成功后,员工进入待【在缴员工】,而在原个税扣缴义务人下的【停缴员工】中,该员工数据将会被删除;是否开启分权员工的档案数据都只保存一份;
*/}
; break; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 1373bb3d..9ed9d668 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -77,6 +77,9 @@ .tableWrapper { flex: 1; overflow: hidden; + .ant-spin-nested-loading, .ant-spin-container { + height: 100%; + } } .tdEllipsis { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index b3b61565..f0a6cf0e 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -13,8 +13,7 @@ import { getQueryString } from "../../../../util/url"; import ProgressModal from "../../../../components/progressModal"; import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal"; import AdjustmentSlide from "./adjustmentSlide"; -import { getCalculateProgress, siaccountDetailCommonListSum } from "../../../../apis/calculate"; -import { sysConfCodeRule } from "../../../../apis/ruleconfig"; +import { getCalculateProgress } from "../../../../apis/calculate"; import RegEditDetial from "./regEditDetial"; import SupplementarySlide from "./supplementarySlide"; import _ from "lodash"; @@ -76,13 +75,7 @@ export default class NormalIndex extends Component { handleReceive = async ({ data }) => { const { type, payload: { id, params } = {} } = data; if (type === "init") { - const { selectedKey } = this.props; - const { status, data: sysData } = await this.sysConfCodeRule(); - const { data: { sumRow: siaccountSum } } = await this.siaccountDetailCommonListSum(); - this.setState({ - showSum: selectedKey === "1" && status && sysData === "1", - siaccountSum - }, () => this.postMessageToChild()); + this.postMessageToChild(); } else if (type === "turn") { if (id === "PAGEINFO") { const { pageNum: current, size: pageSize } = params; @@ -105,13 +98,6 @@ export default class NormalIndex extends Component { } } }; - sysConfCodeRule = () => { - return sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }); - }; - siaccountDetailCommonListSum = () => { - const { billMonth, paymentOrganization } = this.props; - return siaccountDetailCommonListSum({ billMonth, paymentOrganization }); - }; componentWillUnmount() { if (this.timer) { @@ -138,20 +124,22 @@ export default class NormalIndex extends Component { } postMessageToChild = () => { + const billMonth = getQueryString("billMonth"); + const paymentOrganization = getQueryString("paymentOrganization"); const childFrameObj = document.getElementById("atdTable"); - const { current, pageSize, tableData, selectedRowKeys, showSum, siaccountSum } = this.state; + 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, showSum, siaccountSum, + selectedRowKeys, selectedKey: this.props.selectedKey, + sumpayload: { billMonth, paymentOrganization, userName }, showOperates: !getQueryString("type") }), "*"); }; handleSearch(value) { const { billMonth, selectedKey, paymentOrganization } = this.props; - const { current } = this.state; selectedKey === "1" ? this.getNormalList({ billMonth, @@ -242,27 +230,19 @@ export default class NormalIndex extends Component { } }; getNormalList = async (payload = {}) => { - const { status, data: sysData } = await this.sysConfCodeRule(); - const { data: { sumRow: siaccountSum } } = await this.siaccountDetailCommonListSum(); const { getNormalList } = this.props.standingBookStore; getNormalList({ ...payload }).then(({ list, columns = [], total }) => { this.setState({ - showSum: this.props.selectedKey === "1" && status && sysData === "1", - siaccountSum, tableData: { list, total, columns } }, () => this.postMessageToChild()); }); }; getSupplementaryList = async (payload = {}) => { - const { status, data: sysData } = await this.sysConfCodeRule(); - const { data: { sumRow: siaccountSum } } = await this.siaccountDetailCommonListSum(); const { getSupplementaryList } = this.props.standingBookStore; getSupplementaryList({ ...payload }).then(({ list, columns = [], total }) => { this.setState({ - showSum: this.props.selectedKey === "1" && status && sysData === "1", - siaccountSum, tableData: { list, columns, total } }, () => this.postMessageToChild()); }); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js index 87f373f4..e904adb9 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js @@ -270,7 +270,7 @@ class RegEditDetial extends Component { }
} - onClose={onCancel} + onClose={() => onCancel()} showMask={true} /> ); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js index 50eea2cc..32168268 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js @@ -5,7 +5,7 @@ * Date: 2022/11/23 */ import React, { Component } from "react"; -import { WeaTable } from "ecCom"; +import { Spin } from "antd"; import { getQueryString } from "../../../../util/url"; import * as API from "../../../../apis/standingBook"; import "./index.less"; @@ -25,6 +25,7 @@ class RegList extends Component { loading: { query: false }, + datalistPayload: {}, pageInfo: { current: 1, pageSize: 10, @@ -35,14 +36,52 @@ class RegList extends Component { componentDidMount() { this.recessionList(); + window.addEventListener("message", this.handleReceive, false); } + handleReceive = async ({ data }) => { + const { onEdit, onChangeRowkey } = this.props; + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.postMessageToChild(); + } else if (type === "turn") { + if (id === "PAGEINFO") { + const { pageNum: current, size: pageSize } = params; + this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.recessionList()); + } else if (id === "ROWSELECT") { + const { selectedRowKeys } = params; + this.setState({ selectedRowKeys }); + onChangeRowkey(selectedRowKeys); + } else if (id === "EDIT") { + onEdit(params); + } + } + }; + postMessageToChild = () => { + const paymentStatus = "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") + }), "*"); + }; + componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible) { this.recessionList(); } } + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + handleResetSelectRowKeys = (selectedRowKeys) => { this.setState({ selectedRowKeys }); }; @@ -68,105 +107,26 @@ class RegList extends Component { this.setState({ pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, - columns: _.map(_.filter(columns, it => it.dataIndex !== "id"), items => { - if (items.dataIndex === "employeeId") { - return { - ...items, - width: 110, - title: "姓名", - render: (text, r) => { - const { userName } = r; - return ( - {userName} - ); - } - }; - } else if (items.dataIndex === "costCenter") { - return { - ...items, - width: 110, - render: (text, r) => { - const { costCenter } = r; - return ( - {costCenter.name || ""} - ); - } - }; - } - return { - ...items, - title: , - width: 120, - render: (text) => { - return {text}; - } - }; - }) - }); + columns, + datalistPayload: module + }, () => this.postMessageToChild()); } }).catch(() => { this.setState({ loading: { ...loading, query: false } }); }); }; - handleChangeRow = (selectedRowKeys) => { - const { onChangeRowkey } = this.props; - this.setState({ selectedRowKeys }); - onChangeRowkey(selectedRowKeys); - }; render() { - const { loading, pageInfo, selectedRowKeys, dataSource, columns } = this.state; - const { onEdit } = this.props; - const pagination = { - ...pageInfo, - showTotal: total => `共 ${total} 条`, - showQuickJumper: true, - showSizeChanger: true, - pageSizeOptions: ["10", "20", "50", "100"], - onShowSizeChange: (current, pageSize) => { - this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => { - this.recessionList(); - }); - }, - onChange: (current) => { - this.setState({ pageInfo: { ...pageInfo, current } }, () => { - this.recessionList(); - }); - } - }; - const rowSelection = { - selectedRowKeys, - onChange: this.handleChangeRow - }; + const { loading } = this.state; return ( - { - return ( - - ); - } - } - ] : [...columns]} - dataSource={dataSource} - loading={loading.query} - pagination={pagination} - rowSelection={rowSelection} - scroll={{ x: 900 }} - /> + +