diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 371a8763..013bddee 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -509,3 +509,58 @@ export const updateLockStatus = (params) => { body: JSON.stringify(params) }).then(res => res.json()); }; +// 社保福利台账合计接口 +export const siaccountDetailCommonListSum = (params) => { + return fetch("/api/bs/hrmsalary/siaccount/detail/common/list/sum", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + 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", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index 785c2791..58c2ec3d 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -359,3 +359,7 @@ export const getAvailableSalaryGroupSet = (params) => { export const getAvailableSalaryItemSet = (params) => { return postFetch("/api/bs/hrmsalary/salaryBill/template/getAvailableSalaryItemSet", params); }; +//工资单发放-查看详情页面列表合计行数据 +export const salaryBillSendSum = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/send/sum", params); +}; diff --git a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js index fcb80bf7..8b38ba01 100644 --- a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js +++ b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js @@ -97,7 +97,15 @@ class PersonalScopeTable extends Component { ...pageInfo, showTotal: total => `共 ${total} 条`, showQuickJumper: true, + showSizeChanger: true, pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => { + this.getPersonalScopeList(); + }); + }, onChange: current => { this.setState({ pageInfo: { ...pageInfo, current } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js index 86b4be54..cd2c9c44 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js @@ -23,11 +23,12 @@ export default class AcctResultImportModal extends React.Component { componentWillMount() { const { id } = this.props; if (id) { - let modalParam = { ...this.state.modalParam }; - modalParam.salaryAcctRecordId = id; - this.setState({ - modalParam - }); + this.getImportField(); + // let modalParam = { ...this.state.modalParam }; + // modalParam.salaryAcctRecordId = id; + // this.setState({ + // modalParam + // }); } else { this.setState({ modalParam: { ...this.state.modalParam, salaryAcctRecordId: "123" } @@ -35,6 +36,19 @@ export default class AcctResultImportModal extends React.Component { } } + getImportField=()=>{ + const { calculateStore: { getImportField }, id } = this.props; + getImportField(id).then(data => { + this.setState({ + modalParam:{ + ...this.state.modalParam, + salaryAcctRecordId: id, + salaryItemIds: data.checkItems.join(",") + } + }); + }); + } + // 获取模板 handleAccResultTemplateLink() { const { isStandingBook, standingBookTabKey, standingBookType } = this.props; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js index d6353ffc..f288cc35 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js @@ -2,8 +2,7 @@ import React from "react"; import { Button, Col, Row } from "antd"; import { inject, observer } from "mobx-react"; import { WeaCheckbox, WeaDialog } from "ecCom"; - -const APIFox = {}; +import { cacheImportField } from "../../../../apis/calculate"; @inject("calculateStore", "standingBookStore") @observer @@ -39,13 +38,25 @@ export default class SelectFieldModal extends React.Component { if (this.props.fieldData.inputItems) { sqlItems = this.props.fieldData.sqlItems; } - fieldData.formulaItems = formulaItems; - fieldData.inputItems = inputItems; - fieldData.sqlItems = sqlItems; - - this.setState({ - fieldData + fieldData.formulaItems = _.map(formulaItems, item => { + if (data.checkItems.includes(item.salaryItemId)) { + return { ...item, checked: true }; + } + return { ...item }; }); + fieldData.inputItems = _.map(inputItems, item => { + if (data.checkItems.includes(item.salaryItemId)) { + return { ...item, checked: true }; + } + return { ...item }; + }); + fieldData.sqlItems = _.map(sqlItems, item => { + if (data.checkItems.includes(item.salaryItemId)) { + return { ...item, checked: true }; + } + return { ...item }; + }); + this.setState({ fieldData }); this.fieldData = fieldData; }); } else { @@ -97,10 +108,19 @@ export default class SelectFieldModal extends React.Component { } // 添加按钮点击回调 - handleAddClick() { + handleAddClick = async () => { + //薪资核算详情页面的导入表单字段缓存功能 + if (window.location.hash.indexOf("calculateDetail") !== -1) { + const { status } = await this.cacheImportField(); + } this.props.onAdd(this.fieldData); this.props.onCancel(); - } + }; + cacheImportField = () => { + const salaryItemList = _.reduce(_.keys(this.fieldData), (pre, cur) => ([...pre, ...this.fieldData[cur]]), []); + const salaryItems = _.map(_.filter(salaryItemList, it => !!it.checked), item => item.salaryItemId); + return cacheImportField({ salaryItems }); + }; // 标题checkbox点击 handleTitleCheckboxChange(value, flag) { @@ -160,9 +180,7 @@ export default class SelectFieldModal extends React.Component { this.props.onCancel(); }} buttons={[ - + ]} >
diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index 668a798e..0f857405 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), "*"); @@ -209,7 +209,7 @@ export default class CalculateDetail extends React.Component { ); } else if (e.key == "3") { window.open( - "/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=" + this.id + "&ids=" + `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${this.id}&ids=&${convertToUrlString(this.state.searchItemsValue)}` ); } }; 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 2034ceda..579cb872 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js @@ -82,77 +82,79 @@ class DataTables extends Component { }); } }; + const getColumns = _.map(columns, item => { + const { dataIndex } = item; + if (dataIndex === "username") { + return { + ...item, + render: (text, record) => { + return window.pointerXY(e)} + title={text} + > + {text} + ; + } + }; + } else if (dataIndex === "operate") { + return { + ...item, + render: (text, record) => ( +
+ { + !isSpecial && + + onViewDetails(record)}>查看明细 + { + showOperateBtn && + onTableOperate(e, record)}> + 编辑 + 删除 + } title=""> + + + } + + } + { + isSpecial && + + { + showOperateBtn && + + onTableOperate({ key: "handleAddData" }, record)}>编辑 + onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>删除 + + } + + } +
+ ) + }; + } else { + return { + ...item, + render: (text) => { + return {text} ; + } + }; + } + }); return { - const { dataIndex } = item; - if (dataIndex === "username") { - return { - ...item, - render: (text, record) => { - return window.pointerXY(e)} - title={text} - > - {text} - ; - } - }; - } else if (dataIndex === "operate") { - return { - ...item, - render: (text, record) => ( -
- { - !isSpecial && - - onViewDetails(record)}>查看明细 - { - showOperateBtn && - onTableOperate(e, record)}> - 编辑 - 删除 - } title=""> - - - } - - } - { - isSpecial && - - { - showOperateBtn && - - onTableOperate({ key: "handleAddData" }, record)}>编辑 - onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>删除 - - } - - } -
- ) - }; - } else { - return { - ...item, - render: (text) => { - return {text} ; - } - }; - } - })} + columns={getColumns} dataSource={dataSource} pagination={pagination} loading={loading.query} + 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/declare/generateDeclarationDetail.js b/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js index b72af3c1..cdfe5a73 100644 --- a/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js +++ b/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js @@ -1,72 +1,95 @@ import React from "react"; import CustomTab from "../../components/customTab"; -import { Button } from "antd"; -import "./index.less"; import { inject, observer } from "mobx-react"; import { getQueryString } from "../../util/url"; -import CustomPaginationTable from "../../components/customPaginationTable"; +import * as API from "../../apis/declare"; +import { Button } from "antd"; +import UnifiedTable from "../../components/UnifiedTable"; +import "./index.less"; -@inject("declareStore") +@inject("taxAgentStore") @observer export default class GenerateDeclarationDetail extends React.Component { constructor(props) { super(props); - this.id = getQueryString("id"); - this.pageInfo = { current: 1, pageSize: 10 }; + this.state = { + loading: false, + dataSource: [], + columns: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, + declareInfo: {} + }; } componentWillMount() { - const { declareStore: { getDetailList, getDeclareInfo } } = this.props; - getDetailList(this.id); - getDeclareInfo(this.id); + this.getDetailList(); + this.getDeclareInfo(); } - // 导出 - handleExport() { - const url = `${window.location.origin}/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=${this.id}`; - window.open(url, "_self"); - } - - getColumns() { - const { declareStore: { datailColumns } } = this.props; - let columns = [...datailColumns]; - return columns.map(item => { - item = { ...item }; - item.width = "150px"; - if (item.dataIndex == "employeeName") { - item.fixed = "left"; + getDetailList = () => { + const { pageInfo } = this.state; + const payload = { + ...pageInfo, taxDeclarationIdStr: getQueryString("id") + }; + this.setState({ loading: true }); + API.getDetailList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, + pageInfo: { + ...pageInfo, + current, pageSize, total + }, + columns: _.map(_.filter(columns, it => it.dataIndex !== "jobNum"), item => { + if (item.dataIndex === "username") { + return { + ...item, + render: (text, record) => { + return window.pointerXY(e)} + title={text} + > + {text} + ; + } + }; + } + return { + ...item, + render: (text) => { + return {text}; + } + }; + }) + }); } - return item; }); - } - - handlePageChange() { - const { declareStore: { getDetailList, getDeclareInfo } } = this.props; - getDetailList(this.id, this.pageInfo); - } - + }; + getDeclareInfo = () => { + API.getDeclareInfo({ taxDeclarationId: getQueryString("id") }).then(({ status, data: declareInfo }) => { + if (status) this.setState({ declareInfo }); + }); + }; + // 导出 + handleExport = () => { + const url = `${window.location.origin}/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=${getQueryString("id")}`; + window.open(url, "_self"); + }; render() { - const { - declareStore: { - detailDataSource, - detailTableStore, - declareInfo, - datailColumns, - detailPageInfo - } - } = this.props; + const { declareInfo, loading, pageInfo, columns, dataSource } = this.state; + const { taxAgentStore: { showOperateBtn } } = this.props; const renderRightOperation = () => { return (
- +
); }; - const renderLeftOperation = () => { return (
@@ -75,32 +98,37 @@ export default class GenerateDeclarationDetail extends React.Component {
); }; + const pagination = { + ...pageInfo, + showTotal: (total) => `共 ${total} 条`, + pageSizeOptions: ["10", "20", "50", "100"], + showSizeChanger: true, + showQuickJumper: true, + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.getDetailList()); + }, + onChange: (current) => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getDetailList()); + } + }; return (
- { - this.pageInfo.current = value; - this.handlePageChange(); - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = { current, pageSize }; - this.handlePageChange(); - }} +
diff --git a/pc4mobx/hrmSalary/pages/declare/index.js b/pc4mobx/hrmSalary/pages/declare/index.js index b0ec9c95..b56d1f1a 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.js +++ b/pc4mobx/hrmSalary/pages/declare/index.js @@ -47,7 +47,11 @@ export default class Declare extends React.Component { if (status) { const { columns, list: dataSource, total, pageNum: current, pageSize } = data; this.setState({ - columns, dataSource, total, current, pageSize + columns, dataSource, + pageInfo: { + ...pageInfo, + total, current, pageSize + } }); } }).catch(() => this.setState({ loading: false })); @@ -67,9 +71,11 @@ export default class Declare extends React.Component { }; handleDataPageChange = (current, pageSize = 10) => { this.setState({ - ...this.state.pageInfo, - current, - pageSize + pageInfo: { + ...this.state.pageInfo, + current, + pageSize + } }, () => this.getDeclareList()); }; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js index 63d31658..cfe0f90b 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js @@ -290,7 +290,7 @@ const initPeriodStr = (periodStrType, types, fromDay) => { str = `至上上月最后一天`; } else { tmpDate = moment(new Date(`${moment(tmpDate).format("YYYY-MM")}-0${fromDay}`)) - .add(is_31H ? 30 : 29, "days"); + .add(is_31H ? 30 : 27, "days"); str = `至上月${moment(tmpDate).date()}号`; } break; @@ -302,7 +302,7 @@ const initPeriodStr = (periodStrType, types, fromDay) => { str = `至上月最后一天`; } else { tmpDate = moment(new Date(`${moment(tmpDate).format("YYYY-MM")}-0${fromDay}`)) - .add(is_31 ? 30 : 29, "days"); + .add(is_31 ? 30 : 27, "days"); str = `至本月${moment(tmpDate).date()}号`; } break; @@ -314,7 +314,7 @@ const initPeriodStr = (periodStrType, types, fromDay) => { str = `至本月最后一天`; } else { tmpDate = moment(new Date(`${moment(tmpDate).format("YYYY-MM")}-0${fromDay}`)) - .add(is_31K ? 30 : 29, "days"); + .add(is_31K ? 30 : 27, "days"); str = `至下月${moment(tmpDate).date()}号`; } break; 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/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 c4edde49..6c0a5a3f 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js @@ -1,12 +1,13 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { toJS } from "mobx"; -import { WeaHelpfulTip, WeaTab, WeaTop } from "ecCom"; -import { Button, Menu } from "antd"; -import "./index.less"; +import { WeaHelpfulTip, WeaTab } from "ecCom"; +import { Button, Spin } from "antd"; import { getQueryString } from "../../../util/url"; +import { removePropertyCondition } from "../../../util/response"; import { getSearchs } from "../../../util"; -import CustomPaginationTable from "../../../components/customPaginationTable"; +import { getPayrollDetailList, getPayrollDetailSa, getPayrollInfo, salaryBillSendSum } from "../../../apis/payroll"; +import { sysConfCodeRule } from "../../../apis/ruleconfig"; +import "./index.less"; @inject("payrollStore") @observer @@ -14,226 +15,193 @@ export default class PayrollDetail extends React.Component { constructor(props) { super(props); this.state = { - currentId: "", - current: 1 + salarySendDetailBaseInfo: {}, loading: false, + condition: [], dataSource: [], columns: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, + salaryBillSendSum: {}, showSum: false }; - this.pageInfo = { current: 1, pageSize: 10 }; } componentWillMount() { - let id = getQueryString("id"); - this.setState({ currentId: id }); - const { payrollStore: { getPayrollInfo, getPayrollDetailList, getPayrollDetailSa } } = this.props; - getPayrollInfo(id); - getPayrollDetailList({ salarySendId: id }); - getPayrollDetailSa(); + this.getPayrollDetailList(); } - // 撤回 - handleWithdraw(record) { - const { payrollStore } = this.props; - const { withdrawPayroll, getInfoList } = payrollStore; - withdrawPayroll({ - ids: [record.id], - salarySendId: this.state.currentId - }).then(() => { - getInfoList({ - salarySendId: this.state.currentId - }); - }); + componentDidMount() { + this.getPayrollInfo(); + this.getPayrollDetailSa(); + window.addEventListener("message", this.handleReceiveMessage, false); } - // 发送 - handleGrant(record) { - const { payrollStore } = this.props; - const { grantPayroll, getInfoList } = payrollStore; - grantPayroll({ - ids: [record.id], - salarySendId: this.state.currentId - }).then(() => { - getInfoList({ - salarySendId: this.state.currentId - }); - }); + componentWillUnmount() { + window.removeEventListener("message", this.handleReceiveMessage, false); } - getColumns() { - const { payrollStore } = this.props; - const { salarySendDetailTableStore } = payrollStore; - const { columns } = salarySendDetailTableStore; - if (!columns) { - return []; - } - let result = columns.filter(item => item.hide == "false").map(item => { - item = { ...item }; - if (item.dataIndex == "operation") { - item.render = (text, record) => { - if (text == "ALREADYSEND") { - return ( - { - this.handleWithdraw(record); - }}>撤回 - ); - } else { - return ( - { - this.handleGrant(record); - }}>发送 - ); + handleReceiveMessage = async ({ data }) => { + const { dataSource, columns, pageInfo } = this.state; + const childFrameObj = document.getElementById("atdTable"); + const { type, payload } = data; + if (type === "turn") { + const { id, params: { size: pageSize, pageNum: current, total } } = payload; + if (id && id === "PAGEINFO") { + this.setState({ + pageInfo: { + ...pageInfo, + current, + pageSize, + total } - }; + }, () => this.getPayrollDetailList({ child: id })); + } + } + 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 + }), "*"); + this.getPayrollDetailList({ child: type }); + } + }; + getPayrollInfo = () => { + const id = getQueryString("id"); + getPayrollInfo({ id }).then(({ status, data }) => { + if (status) { + this.setState({ salarySendDetailBaseInfo: data }); } - return item; }); - return result; - } - - // 导出所选 - handleExportSelected() { - - } - - // 导出全部 + }; + getPayrollDetailSa = () => { + const { payrollStore } = this.props; + const { detailListConditionForm } = payrollStore; + getPayrollDetailSa().then(({ status, data }) => { + if (status) { + const condition = removePropertyCondition(data.condition); + this.setState({ condition }, () => { + detailListConditionForm.initFormFields(this.state.condition); + }); + } + }); + }; + getPayrollDetailList = (extra = {}) => { + const childFrameObj = document.getElementById("atdTable"); + const { pageInfo } = this.state; + const { child, ...extraParams } = extra; + const salarySendId = getQueryString("id"); + const { payrollStore } = this.props; + const { detailListConditionForm: form } = payrollStore; + const payload = { salarySendId, ...pageInfo, ...extraParams, ...form.getFormParams() }; + this.setState({ loading: true }); + getPayrollDetailList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, datas: dataSource, pageInfo: pages } = data; + const { pageNum: current, pageSize, total } = pages; + this.setState({ + dataSource, + columns: _.map(columns, (item, index) => ({ + dataIndex: item.column, title: item.text, width: item.width, + fixed: index <= 2 ? "left" : null + })), + pageInfo: { ...pageInfo, current, pageSize, total } + }, () => { + const { pageInfo, dataSource, columns, salaryBillSendSum, showSum } = this.state; + (child === "PAGEINFO" || child === "init") && + childFrameObj.contentWindow.postMessage(JSON.stringify({ + dataSource, + columns, + pageInfo, showSum, + salaryBillSendSum + }), "*"); + }); + } + }).catch(() => this.setState({ loading: false })); + }; + salaryBillSendSum = () => { + const salarySendId = getQueryString("id"); + return salaryBillSendSum({ salarySendId }); + }; + sysConfCodeRule = () => { + return sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }); + }; handleExportAll = () => { - // const { payrollStore } = this.props; - // const { exportDetailList } = payrollStore - // exportDetailList({salarySendId: this.state.currentId}) - const url = `${window.location.origin}/api/bs/hrmsalary/salaryBill/send/exportDetailList?salarySendId=${this.state.currentId}`; + const salarySendId = getQueryString("id"); + const url = `${window.location.origin}/api/bs/hrmsalary/salaryBill/send/exportDetailList?salarySendId=${salarySendId}`; window.open(url, "_self"); }; - - getSearchsAdQuick() { - const handleMenuClick = (e) => { - switch (e.key) { - case "1": - this.handleExportSelected(); - break; - } - }; - const menu = ( - - 导出所选 - - ); - return ( - // {this.handleExportAll()}}>导出全部 - - ); - // return (
) - } - - - // 分页 - handleDataPageChange(value) { - const { payrollStore: { getPayrollInfo, getPayrollDetailList, getPayrollDetailSa } } = this.props; - getPayrollDetailList({ salarySendId: this.state.currentId, ...this.pageInfo }); - } - - - handleShowSizeChange(pageInfo) { - const { payrollStore: { getPayrollInfo, getPayrollDetailList, getPayrollDetailSa } } = this.props; - getPayrollDetailList({ salarySendId: this.state.currentId, ...pageInfo }); - } - - handleSearch=()=> { - const { payrollStore: { getPayrollDetailList, setDetailListShowSearchAd } } = this.props; - setDetailListShowSearchAd(false); - getPayrollDetailList({ salarySendId: this.state.currentId, ...this.pageInfo }); - } + handleSearch = () => this.getPayrollDetailList({ child: "PAGEINFO", current: 1 }); render() { + const { salarySendDetailBaseInfo, condition, loading } = this.state; const { payrollStore } = this.props; - const { - setDetailListShowSearchAd, - detailListShowSearchAd, - getPayrollDetailList, - detailListCondition, - detailListConditionForm, - salarySendDetailBaseInfo, - salarySendDetailTableStore, - salarySendDetailDataSource, - salarySendDetailPageInfo - } = payrollStore; + const { setDetailListShowSearchAd, detailListShowSearchAd, detailListConditionForm } = payrollStore; + const { salaryMonth, template, sendNum, sendTotal } = salarySendDetailBaseInfo; const adBtn = [ - // 高级搜索内部按钮 - , - , - + , + , + ]; return (
- } // 左侧图标 - iconBgcolor="#F14A2D" // 左侧图标背景色 - showDropIcon={true} // 是否显示下拉按钮 - buttons={[this.getSearchsAdQuick()]} - > setDetailListShowSearchAd(bool)} //高级搜索面板受控 - searchsAd={getSearchs(detailListConditionForm, toJS(detailListCondition), 2)} // 高级搜索内部数据 - buttonsAd={adBtn} // 高级搜索内部按钮 - onSearch={() => { - this.handleSearch(); - }} // 点搜索按钮时的回调 - // searchsAdQuick={this.getSearchsAdQuick()} - onSearchChange={v => detailListConditionForm.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值 - searchsBaseValue={detailListConditionForm.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步 + searchType={["base", "advanced"]} searchsBasePlaceHolder="请输入姓名" + buttons={[]} + showSearchAd={detailListShowSearchAd} setShowSearchAd={bool => setDetailListShowSearchAd(bool)} + searchsAd={getSearchs(detailListConditionForm, condition, 2)} + buttonsAd={adBtn} onSearch={this.handleSearch} + onSearchChange={v => detailListConditionForm.updateFields({ username: v })} + searchsBaseValue={detailListConditionForm.getFormParams().username} />
- 薪资所属月:{salarySendDetailBaseInfo.salaryMonth} + 薪资所属月:{salaryMonth} } placement="topLeft" /> - 工资单模板:{salarySendDetailBaseInfo.template} + 工资单模板:{template}
- 已发放:{salarySendDetailBaseInfo.sendNum}/{salarySendDetailBaseInfo.sendTotal} + 已发放:{sendNum}/{sendTotal}
- - { - this.pageInfo.current = value; - this.handleDataPageChange(value); - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = { current, pageSize }; - this.handleShowSizeChange(this.pageInfo); - }} - /> + +