From d47d74f856d74da7d9b7d267f67e8b01211c1ea2 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 21 Feb 2025 17:43:08 +0800 Subject: [PATCH 01/29] =?UTF-8?q?release/3.0.0.2502.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/components/pcTemplate/content.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/components/pcTemplate/content.js b/pc4mobx/hrmSalary/components/pcTemplate/content.js index 6bc3c60e..1665ac9e 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/content.js +++ b/pc4mobx/hrmSalary/components/pcTemplate/content.js @@ -10,7 +10,7 @@ class Content extends Component { const { onlyOneGrup, showData } = dealTemplate(_.filter(itemTypeList, o => !!o), "pc"); return (
-
+
{theme || ""}
From f211fadcb8ef74732c48b796ec1e060b32eb58c9 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 27 Feb 2025 16:53:46 +0800 Subject: [PATCH 02/29] =?UTF-8?q?release/3.0.0.2502.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PersonalScopeTable/index.js | 4 +-- .../ledgerPage/components/copyLedgerModal.js | 2 +- .../pages/ledgerPage/components/index.less | 4 +++ .../components/ledgerAccountApprRule.js | 8 +++-- .../components/ledgerAccountSalaryItemsSet.js | 31 ++++++++++++------- .../components/ledgerBaseSetting.js | 2 +- .../components/ledgerSalaryItemBaseInfo.js | 4 +-- .../components/ledgerSalaryItemNormal.js | 1 + .../components/ledgerSalaryItemTable.js | 8 ++--- .../components/adjustmentDefaultSlide.js | 3 +- .../components/supplementarySlide.js | 5 +-- .../components/welfarePlanEditSlide/index.js | 2 +- 12 files changed, 46 insertions(+), 28 deletions(-) diff --git a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js index d8824c8b..a053cfa7 100644 --- a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js +++ b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js @@ -95,7 +95,7 @@ class PersonalScopeTable extends Component { render() { const { dataSource, columns, pageInfo, loading, selectedRowKeys } = this.state; - const { onChangeSelectKey } = this.props; + const { onChangeSelectKey, showOperateBtn } = this.props; const pagination = { ...pageInfo, showTotal: total => `共 ${total} 条`, @@ -128,7 +128,7 @@ class PersonalScopeTable extends Component { return ( { const { ledgerStore } = this.props; const { copyForm: form } = ledgerStore; - postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }) + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }) .then(({ status, data }) => { if (status) { const conditions = _.map(copyConditions, it => { diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less index 5ed5c65c..3680c269 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less @@ -147,6 +147,10 @@ display: flex; align-items: center; + .wea-ignore-node i { + display: none; + } + .wea-sortable-grid-item { display: inline-block; border: none; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js index 1a19b304..3cdb2983 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js @@ -61,10 +61,11 @@ class LedgerAccountApprRule extends Component { } renderForm = (form, conditions) => { - const { saveSalarySobId, editId } = this.props; + const { saveSalarySobId, editId, record } = this.props; const { approvalItemGroup } = this.state; const { isFormInit } = form; const formParams = form.getFormParams(); + const showOperateBtn = editId ? record.opts.includes("admin") : true; let group = []; isFormInit && conditions && conditions.map(c => { let items = []; @@ -76,8 +77,8 @@ class LedgerAccountApprRule extends Component { wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} tipPosition="bottom" > - + ), hide: fields.hide }); @@ -89,6 +90,7 @@ class LedgerAccountApprRule extends Component { tipPosition="bottom" > this.setState({ approvalItemGroup: _.map(approvalItemGroup, o => ({ ...o, diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js index 1f53c37b..7a4ee3cc 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js @@ -55,26 +55,29 @@ class LedgerAccountSalaryItemsSet extends Component { render() { const { editDialog, salaryItemDialog } = this.state; - const { datas } = this.props; + const { datas, showOperateBtn = true } = this.props; return (
- this.setState({ - editDialog: { visible: true, title: getLabel(111, "添加分类") } - })}/> - + { + showOperateBtn && this.setState({ + editDialog: { visible: true, title: getLabel(111, "添加分类") } + })}/> + }
({ ...o, filter: !showOperateBtn }))} onChange={list => this.props.onChange(list)} renderNodeItem={(item) => { return
{item.groupName} - + { + showOperateBtn && + this.setState({ editDialog: { visible: true, groupName: item.groupName, groupId: item.id, title: getLabel(111, "分类名称编辑") @@ -82,14 +85,17 @@ class LedgerAccountSalaryItemsSet extends Component { })}/> this.handleDeleteClick(item)}/> + } - this.handleAddSalaryItems(item)}/> + { + showOperateBtn && this.handleAddSalaryItems(item)}/> + }
{ !_.isEmpty(item.approvalItems) ? ({ ...o, filter: !showOperateBtn }))} onChange={(items) => this.props.onChange( _.map(datas, child => { if (child.id === item.id) { @@ -102,7 +108,10 @@ class LedgerAccountSalaryItemsSet extends Component { return
{filed.salaryItemName}
- this.handleDeleteClick(item, filed)}/> + { + showOperateBtn && + this.handleDeleteClick(item, filed)}/> + }
; }} diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js index d0651065..dea5364c 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js @@ -106,7 +106,7 @@ class LedgerBaseSetting extends Component { }); }; getTaxAgentSelectListAsAdmin = () => { - postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }) + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }) .then(({ status, data }) => { if (status) { this.setState({ diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js index cef3b2e6..e0440379 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js @@ -51,17 +51,17 @@ class LedgerSalaryItemBaseInfo extends Component { render() { const { dataSource, onChangeSortableList, onPreview, editId, record } = this.props; + const admin = editId ? record.opts.includes("admin") : true; const { empFieldListOptions } = this.state; const options = _.map(empFieldListOptions, o => ({ ...o, disabled: _.map(dataSource, g => g.fieldId).includes(o.key) })); if (_.isEmpty(dataSource) || _.isEmpty(options)) return null; - const admin = editId ? record.opts.includes("admin") : true; return ( }>
({ ...o, filter: !admin }))} draggableType="icon" onChange={onChangeSortableList} renderNodeItem={(item) => { diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js index c7dd907d..ff15f166 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js @@ -182,6 +182,7 @@ class LedgerSalaryItemNormal extends Component { > childItem.uuid === uuid).items} salarySobId={editId || saveSalarySobId} selectedRowKeys={field.selectedRowKeys || []} diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js index 4f126ef9..76808a84 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js @@ -231,7 +231,7 @@ class LedgerSalaryItemTable extends Component { render() { const { salaryItemPayload, editFormulModal, originRecord } = this.state; - const { onHandleItemhide } = this.props; + const { onHandleItemhide, showOperateBtn } = this.props; const { tableData, dataSource, onDropCategoryItem, onChangeSelectedRowKeys, selectedRowKeys, onMoveTo @@ -315,16 +315,16 @@ class LedgerSalaryItemTable extends Component { record.id || record.key} - rowSelection={rowSelection} + rowSelection={showOperateBtn ? rowSelection : null} dataSource={tableData} - columns={columns} + columns={showOperateBtn ? columns : _.filter(columns, o => (o.dataIndex !== "operate" && o.dataIndex !== "itemHide"))} onRow={(record, index) => ({ index, moveRow: record })} pagination={false} onDrop={onDropCategoryItem} - draggable={dataSource.length === tableData.length} + draggable={dataSource.length === tableData.length && showOperateBtn} /> { perDisabled: !_.includes(_.map(itemList, o => o.paymentScopeSign), "per"), perValidNum: !_.isEmpty(_.filter(itemList, i => i.paymentScopeSign === "per")) ? _.filter(itemList, i => i.paymentScopeSign === "per")[0].validNum : 2, comDisabled: !_.includes(_.map(itemList, o => o.paymentScopeSign), "com"), - comValidNum: !_.isEmpty(_.filter(itemList, i => i.paymentScopeSign === "com")) ? _.filter(itemList, i => i.paymentScopeSign === "com")[0].validNum : 2, + comValidNum: !_.isEmpty(_.filter(itemList, i => i.paymentScopeSign === "com")) ? _.filter(itemList, i => i.paymentScopeSign === "com")[0].validNum : 2 }); }); return endList.push(data); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js index 077d7bfc..0fcf5898 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js @@ -63,7 +63,7 @@ class Index extends Component { }; } else if (getKey(o) === "paymentType" || getKey(o) === "sharedType") { return { - ...o, label: getLabel(o.lanId, o.label), + ...o, label: getLabel(o.lanId, o.label), viewAttr: showOperateBtn ? o.viewAttr : 1, options: _.map(o.options, k => ({ ...k, showname: getLabel(k.lanId, k.showname) })) }; } From bdfc9513c822b27f3075b2e05cf183acca9c632c Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 27 Feb 2025 18:25:52 +0800 Subject: [PATCH 03/29] =?UTF-8?q?release/3.0.0.2502.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payroll/components/waterMarkSetModal.js | 26 ++++++++++++------- .../pages/payroll/templateBaseSettings.js | 23 ++++++++-------- .../components/grantTableList/index.js | 4 +-- .../hrmSalary/pages/payrollRelease/index.js | 4 ++- .../components/salaryFileDialog/index.js | 9 ++++--- .../components/salaryFileList/index.js | 9 ++++--- .../components/salaryItemList/index.js | 9 ++++--- .../hrmSalary/pages/variableSalary/index.js | 11 ++++---- 8 files changed, 55 insertions(+), 40 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payroll/components/waterMarkSetModal.js b/pc4mobx/hrmSalary/pages/payroll/components/waterMarkSetModal.js index 927e1fbd..cc58acc7 100644 --- a/pc4mobx/hrmSalary/pages/payroll/components/waterMarkSetModal.js +++ b/pc4mobx/hrmSalary/pages/payroll/components/waterMarkSetModal.js @@ -90,7 +90,7 @@ class WaterMarkSetModal extends Component { }; render() { - const { wmClassify, wmNoTransparent, wmRotate, wmImg, wmcontSet } = this.state; + const { wmClassify, wmNoTransparent, wmRotate, wmImg, wmcontSet } = this.state, { showOperateBtn } = this.props; return (
- this.setState({ wmcontSet: { ...wmcontSet, visible: true } })}/> + { + showOperateBtn && + this.setState({ wmcontSet: { ...wmcontSet, visible: true } })}/> + } { _.isEmpty(wmcontSet.textSet) ? : this.setState({ wmNoTransparent })} /> this.setState({ wmRotate })} /> -
- - -
+ { + showOperateBtn && +
+ + +
+ } {/* 水印内容设置弹框*/} this.setState({ diff --git a/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js b/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js index 7d2edc9c..55f518cd 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js +++ b/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js @@ -104,6 +104,7 @@ class TemplateBaseSettings extends Component { }; render() { + const { showOperateBtn } = this.props; const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state; const { ackStatus, feedbackStatus, autoAckDays, feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting; const { monthType = "SALARY_DATE", limitMonth, burningAfterReadingMin } = salaryBillViewingLimitSetting; @@ -111,14 +112,14 @@ class TemplateBaseSettings extends Component { - this.setState({ watermarkStatus, watermark: "DEFAULT" })}/> { watermarkStatus === "1" && {getLabel(111, "水印设置")}
} - this.setState({ watermarkSet: { ...watermarkSet, visible: false } })} onChange={wmSetting => this.setState({ wmSetting })} /> @@ -143,7 +144,7 @@ class TemplateBaseSettings extends Component { - this.setState({ ackFeedbackSetting: { ...ackFeedbackSetting, ackStatus, autoAckDays: 7 @@ -155,7 +156,7 @@ class TemplateBaseSettings extends Component { this.setState({ ackFeedbackSetting: { @@ -170,7 +171,7 @@ class TemplateBaseSettings extends Component { } - this.setState({ ackFeedbackSetting: { ...ackFeedbackSetting, feedbackStatus @@ -182,7 +183,7 @@ class TemplateBaseSettings extends Component { this.setState({ ackFeedbackSetting: { ...ackFeedbackSetting, feedBackUrl @@ -191,7 +192,7 @@ class TemplateBaseSettings extends Component { this.setState({ ackFeedbackSetting: { ...ackFeedbackSetting, mobileFeedbackUrl @@ -207,12 +208,12 @@ class TemplateBaseSettings extends Component { this.setState({ salaryBillViewingLimitSetting: { ...salaryBillViewingLimitSetting, monthType } - })} + })} viewAttr={2} disabled={!showOperateBtn} options={[ { key: "SALARY_DATE", showname: getLabel(111, "薪资所属月"), selected: true }, { key: "SEND_DATE", showname: getLabel(111, "发放日期") } ]}/> - this.setState({ salaryBillViewingLimitSetting: { ...salaryBillViewingLimitSetting, limitMonth @@ -226,7 +227,7 @@ class TemplateBaseSettings extends Component {
{getLabel(111, "首次查看")} - this.setState({ salaryBillViewingLimitSetting: { ...salaryBillViewingLimitSetting, burningAfterReadingMin diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js index fbe07cb7..4bdb7293 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js @@ -140,7 +140,7 @@ class Index extends Component { >{getLabel(83110, "查看详情")} } { - sendNum === sendTotal && !showGrant && + (!record.opts.includes("admin") || (sendNum === sendTotal && !showGrant)) && this.handleOpts(e, record)}> {getLabel(545781, "操作日志")} @@ -151,7 +151,7 @@ class Index extends Component { } { - sendNum !== sendTotal && !showGrant && + sendNum !== sendTotal && !showGrant && record.opts.includes("admin") && this.handleOpts(e, record)}> {getLabel(543603, "更新模板")} diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/index.js index b601298a..cad4fc94 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/index.js @@ -86,7 +86,9 @@ class Index extends Component { return reqBtns; }; renderContent = () => { + const { taxAgentStore: { PageAndOptAuth } } = this.props; const { selectedKey, queryParams, isRefresh } = this.state; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); let dom = null; switch (selectedKey) { case "grant": @@ -104,7 +106,7 @@ class Index extends Component { break; case "watermark": dom = this.baseSetRef = dom} + ref={dom => this.baseSetRef = dom} showOperateBtn={showOperateBtn} onChangeLoading={loading => this.setState({ baseSetSaveLoading: loading })} />; break; diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js index a655f21c..81075f89 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js @@ -68,7 +68,7 @@ class Index extends Component { label: o.name, labelcol: 6, value: detail[`${String(o.id)}_variableItem`] || "", - viewAttr: 2, dataType: o.dataType + viewAttr: !_.isEmpty(detail) ? detail.viewAttr : 2, dataType: o.dataType })), title: "", col: 2, defaultshow: true @@ -119,14 +119,17 @@ class Index extends Component { }); }; renderTitle = () => { - const { loading } = this.state, { title } = this.props; + const { loading } = this.state, { title, detail } = this.props; return
{title}
- + { + (_.isEmpty(detail) || detail.viewAttr === 2) && + + }
; }; diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js index c204be4e..f7309e98 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js @@ -91,7 +91,8 @@ class Index extends Component { this.handleDelete([params.id]); break; case "EDIT": - this.handleView(params.id); + case "VIEW": + this.handleView(params.id, id === "VIEW"); break; default: break; @@ -118,9 +119,9 @@ class Index extends Component { } }); }; - handleView = (id) => { + handleView = (id, view) => { API.getVariableSalaryDetail({ id }).then(({ status, data }) => { - if (status) this.props.onViewSalaryFile(data.data); + if (status) this.props.onViewSalaryFile({ ...data.data, viewAttr: view ? 1 : 2 }); }); }; handleDelete = (ids) => { @@ -157,7 +158,7 @@ class Index extends Component { const i18n = { "操作": getLabel(30585, "操作"), "编辑": getLabel(111, "编辑"), "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), - "删除": getLabel(111, "删除") + "删除": getLabel(111, "删除"), "查看": getLabel(111, "查看") }; const childFrameObj = document.getElementById("unitTable"); childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js index d131e375..e58ea887 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js @@ -46,7 +46,7 @@ class Index extends Component { columns: [ ..._.filter(columns, o => o.dataIndex !== "id"), { - title: getLabel(111, "操作"), dataIndex: "oprate", + title: getLabel(111, "操作"), dataIndex: "operate", render: (__, record) => ( this.handleEdit(record.id)}>{getLabel(111, "编辑")} @@ -85,7 +85,7 @@ class Index extends Component { }; render() { - const { columns, dataSource, loading, pageInfo } = this.state; + const { columns, dataSource, loading, pageInfo } = this.state, { showOperateBtn } = this.props; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -104,8 +104,9 @@ class Index extends Component { } }; return ( - + o.dataIndex !== "operate")} + dataSource={dataSource} loading={loading} bordered pagination={pagination} + scroll={{ y: `calc(100vh - 170px)` }}/> ); } diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js index 639355ea..a8aaa626 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js @@ -109,11 +109,12 @@ class Index extends Component { })}>{getLabel(111, "新建")}, ] : [], - children: this.setState({ - SIDialog: { visible: true, id: data.id, title: getLabel(111, "编辑薪资项目") } - }, () => VSSalaryItemForm.updateFields({ - name: data.name, dataType: data.dataType - }))}/> + children: this.setState({ + SIDialog: { visible: true, id: data.id, title: getLabel(111, "编辑薪资项目") } + }, () => VSSalaryItemForm.updateFields({ + name: data.name, dataType: data.dataType + }))}/> } ]; return ( From 7656d78fa0a893e896f2ff1546da454d26938c70 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 6 Mar 2025 15:43:43 +0800 Subject: [PATCH 04/29] =?UTF-8?q?feature/3.0.0.2502.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF-=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E5=8F=B0=E8=B4=A6=E5=A2=9E=E5=87=8F=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../standingBookDetail/components/index.less | 7 +++++ .../standingBookDetail/components/normal.js | 27 +++++++++---------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index c7117046..1de7cd5b 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -14,6 +14,13 @@ .wea-search-tab, .wea-input-focus { background: #f1f1f1; + + i { + font-size: 20px; + cursor: pointer; + vertical-align: middle; + color: #2db7f5; + } } .normalWapper { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index aa2ea15d..e671ea8b 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -483,32 +483,31 @@ export default class NormalIndex extends Component { ]; const btn2 = [ , - ]; const btn3 = [ - + }} title={getLabel(111, "线下对比")}/> ]; const btn4 = [ - + this.setState({ + importParams: { + ...importParams, visible: true, + tmpUrl: selectedKey === "1" ? "exportSiaccountWelfareImporttemplate" : "exportSiaccountWelfaresupplyimporttemplatetemplate" + } + })} title={getLabel(111, "导入")}/> ]; const btn5 = [ - + ]; let btn = []; (this.props.type !== "detail" && this.props.selectedKey == "3") && (btn = [...btn, ...btn1]); (selectedKey === "1" && this.props.type !== "detail") && (btn = [...btn, ...btn2]); - selectedKey === "1" && (btn = [...btn, ...btn3]); - this.props.type !== "detail" && (btn = [...btn, ...btn4]); - btn = [...btn, ...btn5]; + btn = [...btn5, ...btn]; + this.props.type !== "detail" && (btn = [...btn4, ...btn]); + selectedKey === "1" && (btn = [...btn3, ...btn]); return (
{ From 5c6ecef51a4f0f4ab1dbba165230327e57d50f9f Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 6 Mar 2025 16:13:49 +0800 Subject: [PATCH 05/29] =?UTF-8?q?feature/3.0.0.2502.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF-=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E5=8F=B0=E8=B4=A6=E5=A2=9E=E5=87=8F=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../standingBookDetail/components/index.less | 18 ++++-------- .../standingBookDetail/components/normal.js | 13 ++++++--- .../standingBookDetail/components/overView.js | 7 +++-- .../standingBookDetail/components/regTop.js | 28 +++++++++++++------ 4 files changed, 38 insertions(+), 28 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 1de7cd5b..3cbab8da 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -19,7 +19,7 @@ font-size: 20px; cursor: pointer; vertical-align: middle; - color: #2db7f5; + color: #55a1f8; } } @@ -67,20 +67,14 @@ .tabOption { display: flex; align-items: center; - padding: 8px 20px; + padding: 8px 0; justify-content: flex-end; - i.icon-coms-Batch-delete, i.icon-coms-Add-to, button { + i { + font-size: 20px; cursor: pointer; - margin-right: 10px; - } - - .anticon-search { - margin-right: 0px; - } - - .wea-input-focus-btn { - margin-right: 0px; + vertical-align: middle; + color: #55a1f8; } } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index e671ea8b..1da82c0b 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -7,7 +7,7 @@ import React, { Component } from "react"; import { Button, Col, Icon, message, Modal, Row, Spin, Tooltip } from "antd"; import { inject, observer } from "mobx-react"; -import { WeaBrowser, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; +import { WeaBrowser, WeaButtonIcon, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; import { calcPageNo } from "../../../../util"; import { getQueryString } from "../../../../util/url"; import ProgressModal from "../../../../components/progressModal"; @@ -475,13 +475,18 @@ export default class NormalIndex extends Component { render() { const { remarks, billMonth, selectedKey, paymentOrganization, standingBookStore } = this.props; - const { addProps, adjustSlide, importParams, returnEditPersonSlide, showSearchAd } = this.state; + const { addProps, adjustSlide, importParams, returnEditPersonSlide, showSearchAd, selectedRowKeys } = this.state; const { loading } = standingBookStore; const btn1 = [ - , - + , + ]; const btn2 = [ + , + , , diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js index 015156ac..f88362f5 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js @@ -5,11 +5,12 @@ * LastEditTime: 2022-05-09 15:07:56 */ import React, { Component } from "react"; -import { Button, Icon, Spin, Tooltip } from "antd"; +import { Icon, Spin, Tooltip } from "antd"; import { inject, observer } from "mobx-react"; -import { WeaNewScroll, WeaTable } from "ecCom"; +import { WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom"; import "./index.less"; +const getLabel = WeaLocaleProvider.getLabel; @inject("standingBookStore") @observer export default class OverViewIndex extends Component { @@ -113,7 +114,7 @@ export default class OverViewIndex extends Component {
- +
{/* table */}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js index 0c6de7cc..816f8b98 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js @@ -1,6 +1,15 @@ import React, { Component } from "react"; -import { Button, Col, Row } from "antd"; -import { WeaBrowser, WeaFormItem, WeaHelpfulTip, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; +import { Col, Row } from "antd"; +import { + WeaBrowser, + WeaButtonIcon, + WeaFormItem, + WeaHelpfulTip, + WeaInput, + WeaLocaleProvider, + WeaSearchGroup, + WeaTab +} from "ecCom"; import { getQueryString } from "../../../../util/url"; const getLabel = WeaLocaleProvider.getLabel; @@ -37,21 +46,22 @@ class RegTop extends Component { placement="bottomRight" width={250} />, - + onChange("export")} title={getLabel(111, "导出")}/> ]; if (!type) { const [dom1, ...extra] = dom; const domBtn = regtopType === "regression" ? - [] : + [ onChange("add")}/>] : [ - , - + onChange("add")}/>, + onChange("import")} title={getLabel(111, "导入")}/> ]; dom = [ dom1, - , ...domBtn, ...extra + onChange("delete")}/>, ...domBtn, ...extra ]; } return dom; From 93dde8230a081c150521b833cfa2e061b2c1a430 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Mon, 10 Mar 2025 14:48:15 +0800 Subject: [PATCH 06/29] release/2.19.1.2501.01 --- .../doCalc/components/salaryEditCalc/editSalaryCalcSlide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js index 9da20706..5deeaecd 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js @@ -91,7 +91,7 @@ class EditSalaryCalcSlide extends Component { save = () => { const { id: salaryAcctEmpId } = this.props; const { issuedAndReissueItems, itemsByGroup, baseInfo } = this.state; - if (_.every(baseInfo, it => !it.canEdit || (it.canEdit && !it.fieldValue))) { + if (!_.every(baseInfo, (item) => (!item.canEdit || !!item.fieldValue))) { Modal.warning({ title: getLabel(131329, "信息确认"), content: getLabel(518702, "必要信息不完整,红色*为必填项!") From f7bf13bd69f51f86beb887ca427d153be8b85eb3 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Mon, 10 Mar 2025 14:50:07 +0800 Subject: [PATCH 07/29] =?UTF-8?q?release/3.0.0.2502.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doCalc/components/salaryEditCalc/editSalaryCalcSlide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js index 9da20706..5deeaecd 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js @@ -91,7 +91,7 @@ class EditSalaryCalcSlide extends Component { save = () => { const { id: salaryAcctEmpId } = this.props; const { issuedAndReissueItems, itemsByGroup, baseInfo } = this.state; - if (_.every(baseInfo, it => !it.canEdit || (it.canEdit && !it.fieldValue))) { + if (!_.every(baseInfo, (item) => (!item.canEdit || !!item.fieldValue))) { Modal.warning({ title: getLabel(131329, "信息确认"), content: getLabel(518702, "必要信息不完整,红色*为必填项!") From bc79bfe16e9ed86075effe02ce51c4089668fc77 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Mon, 10 Mar 2025 15:31:26 +0800 Subject: [PATCH 08/29] =?UTF-8?q?feature/3.0.0.2502.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF-=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E5=8F=B0=E8=B4=A6=E5=A2=9E=E5=87=8F=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/standingBook.js | 8 ++ .../standingBookDetail/components/normal.js | 136 ++++++------------ 2 files changed, 55 insertions(+), 89 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 5182ea00..592597ac 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -205,3 +205,11 @@ export const cacheWelfareListField = (params) => { export const cacheBalanceWelfareList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/cacheBalanceWelfareList", params); }; +// 社保福利台账正常缴纳-增加人员并核算 +export const addSocialAcctEmp = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/addSocialAcctEmp", params); +}; +// 社保福利台账正常缴纳-增加人员并核算 +export const deleteSocialAcctEmp = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/deleteSocialAcctEmp", params); +}; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index 1da82c0b..fa802cdc 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -16,8 +16,8 @@ import AdjustmentSlide from "./adjustmentSlide"; import { getCalculateProgress } from "../../../../apis/calculate"; import RegEditDetial from "./regEditDetial"; import SupplementarySlide from "./supplementarySlide"; -import _ from "lodash"; import "./index.less"; +import { addSocialAcctEmp, deleteSocialAcctEmp } from "../../../../apis/standingBook"; const getLabel = WeaLocaleProvider.getLabel; @inject("standingBookStore") @@ -61,7 +61,8 @@ export default class NormalIndex extends Component { }, showSum: false, siaccountSum: {}, - showSearchAd: false + showSearchAd: false, + normalPayer: "" }; this.timer = null; this.timerDelete = null; @@ -167,85 +168,11 @@ export default class NormalIndex extends Component { }); }; - handleSave = () => { - const { - siaccountCommonSave, - siaccountSupplementarySave, - form - } = this.props.standingBookStore; - const { billMonth, selectedKey, paymentOrganization } = this.props; - if (selectedKey === "1") { - const { includes, excludes } = form.getFormParams(); - const payload = { - billMonth, - includes: includes.split(","), - excludes: _.isEmpty(excludes) ? excludes.split(",") : [] - }; - siaccountCommonSave(payload).then(() => { - message.success("添加成功"); - this.getNormalList({ - billMonth, - paymentOrganization, - current: this.state.current - }); - this.setState({ - addProps: { - ...this.state.addProps, - title: "", - visible: false - } - }); - }); - } else { - const paymentOrganization = getQueryString("paymentOrganization"); - form.validateForm().then(f => { - if (f.isValid) { - const { - includes, - billMonth: billMonthList, - excludes, - projects - } = form.getFormParams(); - const payload = { - billMonth, - billMonthList: billMonthList.split(","), - includes: includes.split(","), - // excludes: excludes.split(","), - projects: projects.split(","), - paymentOrganization - }; - siaccountSupplementarySave(payload).then(() => { - message.success("添加成功"); - this.getSupplementaryList({ - billMonth, - current: this.state.current, - paymentOrganization - }); - this.setState( - { - addProps: { - ...this.state.addProps, - title: "", - visible: false - } - }, - () => { - form.resetForm(); - } - ); - }); - } else { - f.showErrors(); - this.setState({ date: new Date() }); // 改变一个state的变量,强制页面刷新 - } - }); - } - }; getNormalList = async (payload = {}) => { const { getNormalList } = this.props.standingBookStore; getNormalList({ ...payload, pageSize: this.state.pageSize }).then(({ list, columns = [], total }) => { this.setState({ - tableData: { list, total, columns } + tableData: { list, total, columns }, normalPayer: "" }, () => this.postMessageToChild()); }); }; @@ -341,16 +268,7 @@ export default class NormalIndex extends Component { }); } }; - handleAdd = () => { - this.setState({ - addProps: { - ...this.state.addProps, - title: "添加缴纳人员", - visible: true - } - }); - }; - + handleAdd = () => this.setState({ addProps: { ...this.state.addProps, title: "添加缴纳人员", visible: true } }); handleCommonAccountClick = () => { const { billMonth, selectedKey, paymentOrganization } = this.props; const { commonAccount } = this.props.standingBookStore; @@ -410,7 +328,43 @@ export default class NormalIndex extends Component { }, 600); }); }; + handleAddSocialAcctEmp = () => { + const { billMonth, paymentOrganization } = this.props, { normalPayer } = this.state; + addSocialAcctEmp({ billMonth, paymentOrganization, includes: normalPayer.split(",") }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功")); + this.getNormalList({ + billMonth, paymentOrganization, + current: calcPageNo(this.state.tableData.total, this.state.current, 10, normalPayer.split(",").length) + }); + } else { + message.error(errormsg); + } + }); + }; + handleDeleteNormalPayer = () => { + Modal.confirm({ + title: getLabel(111, "确认信息"), + content: getLabel(111, "确认删除勾选的数据吗?"), + onOk: () => { + const { billMonth, paymentOrganization } = this.props, { selectedRowKeys: ids } = this.state; + deleteSocialAcctEmp({ billMonth, paymentOrganization, ids }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.getNormalList({ + billMonth, + paymentOrganization, + current: calcPageNo(this.state.tableData.total, this.state.current, 10, ids.length) + }); + } else { + message.error(errormsg); + } + }); + } + }); + }; handleExport = () => { const { billMonth, selectedKey, paymentOrganization } = this.props; const urlObj = { @@ -485,8 +439,12 @@ export default class NormalIndex extends Component { ]; const btn2 = [ , - , + onClick={this.handleDeleteNormalPayer}/>, + this.setState({ normalPayer: ids }, () => this.handleAddSocialAcctEmp())} + > + + , , From 6aa12027b8441a1ebb2be9bc6da1c60cfcb304c6 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Mon, 10 Mar 2025 18:11:59 +0800 Subject: [PATCH 09/29] =?UTF-8?q?release/3.0.0.2502.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../standingBookDetail/components/regTop.js | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js index 816f8b98..771cc129 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js @@ -27,7 +27,6 @@ class RegTop extends Component { } renderTopBtns = () => { - const { name } = this.state; const { onChange, selectKey, type: regtopType } = this.props; const type = getQueryString("type"); let dom = [ @@ -50,18 +49,18 @@ class RegTop extends Component { ]; if (!type) { const [dom1, ...extra] = dom; - const domBtn = regtopType === "regression" ? - [ onChange("add")}/>] : - [ - onChange("add")}/>, - onChange("import")} title={getLabel(111, "导入")}/> - ]; - dom = [ - dom1, + const domBtn = [ onChange("add")}/>]; + dom = regtopType === "regression" ? [ + dom1, ...extra, onChange("delete")}/>, ...domBtn, ...extra + onClick={() => onChange("delete")}/>, ...domBtn + ] : [ + dom1, + onChange("import")} title={getLabel(111, "导入")}/>, + ...extra, + onChange("delete")}/>, ...domBtn ]; } return dom; From 645c9ff5ebd1b25bfd1b9c11755a53d270fbbf3b Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 11 Mar 2025 09:38:06 +0800 Subject: [PATCH 10/29] =?UTF-8?q?release/3.0.0.2502.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salary/components/constants.js | 2 +- .../pages/salary/components/personalScopeModal.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index dc2422a0..7d6ad232 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -297,7 +297,7 @@ export const personScopeConditions = [ { conditionType: "SELECT_LINKAGE", domkey: ["targetType"], - fieldcol: 18, + fieldcol: 16, label: "对象类型", lanId: 111, labelcol: 6, diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index ce15691d..70a5c202 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -7,7 +7,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaSwitch } from "comsMobx"; -import { WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; +import { WeaCheckbox, WeaDialog, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { Button, message } from "antd"; import { getTaxAgentRangeForm, taxAgentRangeEdit, taxAgentRangeSave } from "../../../apis/taxAgent"; import { personScopeConditions, scopeSelectLinkageDatas } from "./constants"; @@ -129,6 +129,14 @@ class PersonalScopeModal extends Component { onChange={this.handleChangeAll}/> } + { + personScopeForm.getFormParams().targetType === "SQL" && getKey(fields) === "targetType" && + 1、sql需返回人员id
2、sql结尾不需要 ; go /等符号
使用例子:定义获取岗位是开发的人员
select id from hrmresource where JOBTITLE = 17") }}/> + }/> + } ), hide: fields.hide }); From 00c212a523319a55e0bf520e9d8ac0a8b060f347 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Wed, 12 Mar 2025 13:56:01 +0800 Subject: [PATCH 11/29] =?UTF-8?q?release/3.0.1.2503.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/socialSecurityBenefits/welfarePlan/index.less | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less index 0c19ca25..85bff0ff 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less @@ -103,6 +103,14 @@ } .welfare-plan-edit-layout { + .ant-table-content { + padding-left: 208px; + + .ant-table-fixed-left { + top: 1px; + } + } + .flex-center { display: flex; align-items: center; From 4a3a6766ba2571a662e9a8a6a5f7d6d8f01d4161 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Wed, 12 Mar 2025 13:56:44 +0800 Subject: [PATCH 12/29] =?UTF-8?q?release/3.0.1.2503.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/socialSecurityBenefits/welfarePlan/index.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less index 85bff0ff..0f6ff199 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less @@ -104,7 +104,7 @@ .welfare-plan-edit-layout { .ant-table-content { - padding-left: 208px; + padding-left: 208px !important; .ant-table-fixed-left { top: 1px; From f7dfcdf8a6671aec026e60fb9a3f08ff9006a887 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Wed, 12 Mar 2025 13:57:48 +0800 Subject: [PATCH 13/29] release/2.19.1.2501.01 --- .../pages/socialSecurityBenefits/welfarePlan/index.less | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less index 0c19ca25..0f6ff199 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less @@ -103,6 +103,14 @@ } .welfare-plan-edit-layout { + .ant-table-content { + padding-left: 208px !important; + + .ant-table-fixed-left { + top: 1px; + } + } + .flex-center { display: flex; align-items: center; From 2fd0dfcf500e465a31ee98961d11461a9db91bf7 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 13 Mar 2025 15:19:40 +0800 Subject: [PATCH 14/29] =?UTF-8?q?feature/3.0.1.2503.01-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF-=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E5=8F=B0=E8=B4=A6=E6=98=8E=E7=BB=86=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/standingBook.js | 16 + .../components/adjustmentSlide.js | 5 +- .../standingBookDetail/components/index.less | 41 +- .../components/makeupDifference.js | 69 +-- .../standingBookDetail/components/normal.js | 528 ++++++------------ .../standingBookDetail/components/overView.js | 109 ++-- .../components/regAddEmployee.js | 1 - .../components/regEditDetial.js | 90 +-- .../standingBookDetail/components/regList.js | 80 +-- .../standingBookDetail/components/regTop.js | 4 +- .../components/regression.js | 25 +- .../standingBookCalcImportDialog.js | 10 +- .../components/supplementarySlide.js | 83 ++- .../standingBookDetail/index.js | 66 +-- 14 files changed, 412 insertions(+), 715 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 592597ac..9d0f9f46 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -15,10 +15,18 @@ export const getTabList = (params) => { export const getNormalList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/common/list", params); }; +//社会福利台账-获取正常缴纳列表合计行 +export const getNormalListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/common/list/sum", params); +}; //社会福利台账-获取补缴列表 export const getSupplementaryList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list", params); }; +//社会福利台账-获取补缴列表合计 +export const getSupplementaryListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list/sum", params); +}; //社会福利台账-获取总览列表 export const getOverViewList = (params) => { @@ -122,10 +130,18 @@ export const saveRecession = (params) => { export const recessionList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params); }; +//查询退差列表合计行 +export const recessionListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list/sum", params); +}; //查询补差列表 export const balanceList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list", params); }; +//查询补差列表合计行 +export const balanceListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list/sum", params); +}; //删除退差数据 export const delRecession = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/delRecession", params); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js index 2fb3f37c..b853b734 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js @@ -10,12 +10,10 @@ import { WeaSlideModal } from "ecCom"; import { Button, message, Modal } from "antd"; import SlideModalTitle from "../../../../components/slideModalTitle"; import AdjustTable from "./adjustTable"; -import { getQueryString } from "../../../../util/url"; import { compensationSave } from "../../../../apis/standingBook"; import AdjustmentDefaultSlide from "./adjustmentDefaultSlide"; import "./index.less"; - @inject("taxAgentStore") @observer class AdjustmentSlide extends Component { @@ -35,10 +33,9 @@ class AdjustmentSlide extends Component { handleSave = () => { const requireKeys = ["adjustTo", "adjustmentTotal", "categoryType", "companyTotal", "countryTotal", "target", "welfareType"]; + const { billMonth, paymentOrganization } = this.props; let { dataSource, targetOptions } = this.adjustTableRef.state; dataSource = _.filter(dataSource, it => (!it.id || !it.status)); - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); let bool = true; _.map(dataSource, item => { bool = _.every(requireKeys, child => !!item[child]); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 3cbab8da..919e4d78 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -13,7 +13,12 @@ } .wea-search-tab, .wea-input-focus { - background: #f1f1f1; + background: #F1F1F1; + padding-right: 0 !important; + + .wea-advanced-search { + background: #FFF + } i { font-size: 20px; @@ -30,6 +35,18 @@ overflow: hidden; padding: 0 16px; + .wea-tab .wea-search-container .wea-advanced-search { + right: -1px !important; + } + + .wea-tab .wea-search-tab { + padding-right: 0; + + .wea-advanced-search { + background: #FFF; + } + } + .tableWrapper { flex: 1; overflow: hidden; @@ -94,7 +111,7 @@ overflow: hidden; display: flex; flex-direction: column; - padding: 16px; + padding: 0 16px 16px 16px; .tableWrapper { flex: 1; @@ -133,26 +150,6 @@ } } } - - .wea-new-top { - .ant-btn { - border-radius: 0; - padding: 0; - background: transparent; - border: none; - font-size: 18px; - line-height: 18px; - } - - .ant-btn.ant-btn-primary[disabled] { - color: #d8d8d8; - background: transparent; - } - - .ant-btn.ant-btn-primary { - color: #2db7f5; - } - } } //补差添加人员弹框 diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js index d0085fd7..c5e05729 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js @@ -7,8 +7,6 @@ import React, { Component } from "react"; import RegTop from "./regTop"; import { message, Modal } from "antd"; -import { WeaNewScroll } from "ecCom"; -import { getQueryString } from "../../../../util/url"; import * as API from "../../../../apis/standingBook"; import { calcPageNo } from "../../../../util"; import RegList from "./regList"; @@ -16,6 +14,7 @@ import RegEditDetial from "./regEditDetial"; import AddCompensationPersonnelDialog from "./addCompensationPersonnelDialog"; import StandingBookCalcImportDialog from "./standingBookCalcImportDialog"; import "./index.less"; +import { convertToUrlString } from "../../../../util/url"; class MakeupDifference extends Component { constructor(props) { @@ -43,9 +42,7 @@ class MakeupDifference extends Component { delBalance = () => { const { selectKey: ids } = this.state; - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); - const payload = { ids, billMonth, paymentOrganization }; + const payload = { ids, ..._.pick(this.props, ["billMonth", "paymentOrganization"]) }; API.delBalance(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); @@ -64,8 +61,6 @@ class MakeupDifference extends Component { const workcode = this.regTopRef.state.workcode; const departmentIds = this.regTopRef.state.departmentIds ? this.regTopRef.state.departmentIds.split(",") : []; const subCompanyIds = this.regTopRef.state.subCompanyIds ? this.regTopRef.state.subCompanyIds.split(",") : []; - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); switch (key) { case "delete": Modal.confirm({ @@ -78,13 +73,13 @@ class MakeupDifference extends Component { this.setState({ importDiffModal: { ...importDiffModal, visible: true, - importparams: { billMonth: getQueryString("billMonth") } + importparams: { ..._.pick(this.props, ["billMonth"]) } } }); break; case "export": - const url = `${window.location.origin}/api/bs/hrmsalary/welfare/balance/export?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; - window.open(url, "_self"); + const url = `/api/bs/hrmsalary/welfare/balance/export?${convertToUrlString(_.pick(this.props, ["billMonth", "paymentOrganization"]))}`; + window.open(url, "_blank"); break; case "search": this.diffListRef.recessionList({ userName: name, workcode, departmentIds, subCompanyIds, current: 1 }); @@ -92,7 +87,7 @@ class MakeupDifference extends Component { case "add": this.setState({ addPersonalDialog: { - ...addPersonalDialog, visible: true, paymentOrganization, billMonth + ...addPersonalDialog, ..._.pick(this.props, ["billMonth", "paymentOrganization"]), visible: true } }); break; @@ -117,42 +112,40 @@ class MakeupDifference extends Component { }; render() { - const billMonth = getQueryString("billMonth"); const { selectKey, importDiffModal, returnEditPersonSlide, addPersonalDialog } = this.state; return (
this.regTopRef = dom} - billMonth={billMonth} onChange={this.handleChangeOpt} selectKey={selectKey} />
- - this.diffListRef = dom} - onChangeRowkey={(selectKey) => this.setState({ selectKey })} - onEdit={this.handleEdit} - /> - {/*编辑弹框*/} - - {/*添加补差人员*/} - this.setState({ - addPersonalDialog: { - ...addPersonalDialog, - visible: false - } - }, () => isRefresh && this.diffListRef.recessionList())} - /> - {/*导入补差*/} - this.setState({ - importDiffModal: { ...importDiffModal, visible: false } - }, () => isInit && this.diffListRef.recessionList())}/> - + this.diffListRef = dom} + onChangeRowkey={(selectKey) => this.setState({ selectKey })} + onEdit={this.handleEdit} + /> + {/*编辑弹框*/} + + {/*添加补差人员*/} + this.setState({ + addPersonalDialog: { + ...addPersonalDialog, + visible: false + } + }, () => isRefresh && this.diffListRef.recessionList())} + /> + {/*导入补差*/} + this.setState({ + importDiffModal: { ...importDiffModal, visible: false } + }, () => isInit && this.diffListRef.recessionList())}/>
); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index fa802cdc..f6f6f010 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -6,96 +6,52 @@ */ import React, { Component } from "react"; import { Button, Col, Icon, message, Modal, Row, Spin, Tooltip } from "antd"; -import { inject, observer } from "mobx-react"; import { WeaBrowser, WeaButtonIcon, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; +import * as API from "../../../../apis/standingBook"; +import { getCalculateProgress } from "../../../../apis/calculate"; +import { sysConfCodeRule } from "../../../../apis/ruleconfig"; import { calcPageNo } from "../../../../util"; -import { getQueryString } from "../../../../util/url"; +import { convertToUrlString } from "../../../../util/url"; import ProgressModal from "../../../../components/progressModal"; import StandingBookCalcImportDialog from "./standingBookCalcImportDialog"; import AdjustmentSlide from "./adjustmentSlide"; -import { getCalculateProgress } from "../../../../apis/calculate"; import RegEditDetial from "./regEditDetial"; import SupplementarySlide from "./supplementarySlide"; import "./index.less"; -import { addSocialAcctEmp, deleteSocialAcctEmp } from "../../../../apis/standingBook"; const getLabel = WeaLocaleProvider.getLabel; -@inject("standingBookStore") -@observer + export default class NormalIndex extends Component { constructor(props) { super(props); this.state = { - date: "", - current: 1, - pageSize: 10, - selectedRowKeys: [], - addProps: { - title: "", - visible: false - }, - adjustSlide: { - title: "调差", - visible: false - }, - tableData: { - list: [], - columns: [], - total: 0 - }, - searchValue: "", - workcode: "", - departmentIds: "", - subCompanyIds: "", - progressVisible: false, - progress: 0, - fieldData: {}, //选中的表单头信息 - importParams: { //导入信息的弹框表示 + pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], showSearchAd: false, loading: false, + formParams: { userName: "", workcode: "", departmentIds: [], subCompanyIds: [] }, + addProps: { title: "", visible: false }, adjustSlide: { title: "调差", visible: false }, + progressVisible: false, progress: 0, importParams: { //导入信息的弹框表示 visible: false, fieldUrl: "getWelfareList", tmpUrl: "exportSiaccountWelfareImporttemplate", cacheUrl: "cacheWelfareListField", importUrl: "importInsuranceAcctDetail", importparams: {} }, - returnEditPersonSlide: { - title: "", - editId: "", - visible: false - }, - showSum: false, - siaccountSum: {}, - showSearchAd: false, - normalPayer: "" + returnEditPersonSlide: { title: "", editId: "", visible: false }, + columns: [], dataSource: [], sumRow: {}, normalPayer: "" }; this.timer = null; this.timerDelete = null; } componentDidMount() { - const { selectedKey, location } = this.props; - const { current } = this.state; - const billMonth = location.query.billMonth; - const paymentOrganization = location.query.paymentOrganization; - selectedKey === "1" - ? this.getNormalList({ billMonth, current, paymentOrganization }) - : this.getSupplementaryList({ billMonth, current, paymentOrganization }); window.addEventListener("message", this.handleReceive, false); } - handleReceive = async ({ data }) => { - const { type, payload: { id, params } = {} } = data; + handleReceive = ({ data }) => { + const { type, payload: { id, params } = {} } = data, { selectedKey } = this.props; if (type === "init") { - this.postMessageToChild(); + selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); } else if (type === "turn") { if (id === "PAGEINFO") { const { pageNum: current, size: pageSize } = params; - this.setState({ current, pageSize }, () => { - const { billMonth, paymentOrganization, selectedKey } = this.props; - const { current, pageSize } = this.state; - selectedKey === "1" ? - this.getNormalList({ - billMonth, current, pageSize, paymentOrganization - }) : - this.getSupplementaryList({ - billMonth, current, pageSize, paymentOrganization - }); + this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => { + selectedKey === "1" ? this.getNormalList(true) : this.getSupplementaryList(true); }); } else if (id === "ROWSELECT") { const { selectedRowKeys } = params; @@ -107,184 +63,125 @@ export default class NormalIndex extends Component { }; componentWillUnmount() { - if (this.timer) { - clearInterval(this.timer); - } - if (this.timerDelete) { - clearInterval(this.timerDelete); - } + if (this.timer) clearInterval(this.timer); + if (this.timerDelete) clearInterval(this.timerDelete); window.removeEventListener("message", this.handleReceive, false); } componentWillReceiveProps(nextProps) { - if (nextProps.selectedKey != this.props.selectedKey) { - const { billMonth, paymentOrganization } = nextProps; + if (nextProps.selectedKey !== this.props.selectedKey) { this.setState({ - current: 1, selectedRowKeys: [] + pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], dataSource: [], sumRow: {}, + addProps: { title: "", visible: false }, returnEditPersonSlide: { title: "", editId: "", visible: false } }, () => { - const { current } = this.state; - nextProps.selectedKey === "1" - ? this.getNormalList({ billMonth, current, paymentOrganization }) - : this.getSupplementaryList({ billMonth, current, paymentOrganization }); + nextProps.selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); }); } } postMessageToChild = () => { - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); const childFrameObj = document.getElementById("atdTable"); - const { current, pageSize, tableData, selectedRowKeys, showSum, siaccountSum, searchValue: userName } = this.state; - const { list: dataSource, total, columns } = tableData; - const pageInfo = { current, pageSize, total }; - childFrameObj.contentWindow.postMessage(JSON.stringify({ - dataSource, columns, pageInfo, - selectedRowKeys, selectedKey: this.props.selectedKey, - sumpayload: { billMonth, paymentOrganization, userName }, - showOperates: !getQueryString("type") + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ + ..._.pick(this.state, ["dataSource", "columns", "pageInfo", "selectedRowKeys", "sumRow"]), + showOperates: !this.props.type }), "*"); }; - - handleSearch = () => { - const { billMonth, selectedKey, paymentOrganization } = this.props; - selectedKey === "1" - ? this.getNormalList({ - billMonth, - current: 1, - paymentOrganization, - userName: this.state.searchValue, - workcode: this.state.workcode, - departmentIds: this.state.departmentIds ? this.state.departmentIds.split(",") : [], - subCompanyIds: this.state.subCompanyIds ? this.state.subCompanyIds.split(",") : [] - }) - : this.getSupplementaryList({ - billMonth, - current: 1, - paymentOrganization, - userName: this.state.searchValue, - workcode: this.state.workcode, - departmentIds: this.state.departmentIds ? this.state.departmentIds.split(",") : [], - subCompanyIds: this.state.subCompanyIds ? this.state.subCompanyIds.split(",") : [] - }); - }; - - getNormalList = async (payload = {}) => { - const { getNormalList } = this.props.standingBookStore; - getNormalList({ ...payload, pageSize: this.state.pageSize }).then(({ list, columns = [], total }) => { - this.setState({ - tableData: { list, total, columns }, normalPayer: "" - }, () => this.postMessageToChild()); + handleSearch = () => this.props.selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); + getNormalList = (pageTurning = false) => { + const { pageInfo, formParams } = this.state; + const payload = { ..._.pick(this.props, ["billMonth", "paymentOrganization"]) }; + this.setState({ loading: true }); + API.getNormalList({ ...payload, ...pageInfo, ...formParams }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { pageInfo: { columns, list: dataSource, pageNum: current, pageSize, total } } = data; + this.setState({ pageInfo: { current, pageSize, total }, columns, dataSource }, () => this.postMessageToChild()); + } + }); + sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }).then(({ status, data }) => { + if (status && data === "1" && !pageTurning) { + API.getNormalListSum({ ...payload, ...pageInfo, ...formParams }) + .then(({ status: sumStatus, data: sumData }) => { + if (sumStatus) this.setState({ sumRow: sumData.sumRow }, () => this.postMessageToChild()); + }); + } }); }; - getSupplementaryList = async (payload = {}) => { - const { getSupplementaryList } = this.props.standingBookStore; - getSupplementaryList({ - ...payload, pageSize: this.state.pageSize - }).then(({ list, columns = [], total }) => { - this.setState({ - tableData: { list, columns, total } - }, () => this.postMessageToChild()); + getSupplementaryList = (pageTurning = false) => { + const { pageInfo, formParams } = this.state; + const payload = { ..._.pick(this.props, ["billMonth", "paymentOrganization"]) }; + this.setState({ loading: true }); + API.getSupplementaryList({ ...payload, ...pageInfo, ...formParams }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { pageInfo: { columns, list: dataSource, pageNum: current, pageSize, total } } = data; + this.setState({ pageInfo: { current, pageSize, total }, columns, dataSource }, () => this.postMessageToChild()); + } + }); + sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }).then(({ status, data }) => { + if (status && data === "1" && !pageTurning) { + API.getSupplementaryListSum({ ...payload, ...pageInfo, ...formParams }) + .then(({ status: sumStatus, data: sumData }) => { + if (sumStatus) this.setState({ sumRow: sumData.sumRow }, () => this.postMessageToChild()); + }); + } }); - }; - onSelectChange = selectedRowKeys => { - this.setState({ selectedRowKeys }); }; handleBatchDelete = () => { - const { siaccountCommonDelete } = this.props.standingBookStore; - const { list } = this.state.tableData; - const { selectedRowKeys } = this.state; + const { selectedRowKeys, dataSource, pageInfo } = this.state; const { billMonth, selectedKey, paymentOrganization } = this.props; - if (_.isEmpty(selectedRowKeys)) { - message.warning("未勾选数据!"); - } else { - const includes = _.map( - _.filter(list, it => selectedRowKeys.includes(it.id)), - item => item.employeeId - ); - const ids = _.map( - _.filter(list, it => selectedRowKeys.includes(it.id)), - item => item.id - ); - Modal.confirm({ - title: "确认信息", - content: "确认删除勾选的数据吗?", - onOk: () => { - this.setState({ - progressVisible: true - }, () => { - this.timerDelete = setInterval(() => { - if (this.state.progress !== 100) { - this.setState({ - progress: this.state.progress + 10 - }); - } else { - clearInterval(this.timerDelete); - this.setState({ - progressVisible: false, - progress: 0 - }, () => { - message.success("删除成功"); - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length) - }) - : this.getSupplementaryList({ - billMonth, - current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length), - paymentOrganization - }); - }); - } - }, 800); - }); - - siaccountCommonDelete({ - billMonth, - includes, - ids, - paymentOrganization - }).then(() => { - clearInterval(this.timerDelete); - message.success("删除成功"); - this.setState({ selectedRowKeys: [], progressVisible: false, progress: 0 }); - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length) - }) - : this.getSupplementaryList({ - billMonth, - current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length), - paymentOrganization + const includes = _.map(_.filter(dataSource, it => selectedRowKeys.includes(it.id)), item => item.employeeId); + const ids = _.map(_.filter(dataSource, it => selectedRowKeys.includes(it.id)), item => item.id); + Modal.confirm({ + title: getLabel(111, "确认信息"), + content: getLabel(111, "确认删除勾选的数据吗?"), + onOk: () => { + this.setState({ progressVisible: true }, () => { + this.timerDelete = setInterval(() => { + if (this.state.progress !== 100) { + this.setState({ progress: this.state.progress + 10 }); + } else { + clearInterval(this.timerDelete); + this.setState({ + progressVisible: false, progress: 0, pageInfo: { + ...pageInfo, current: calcPageNo(pageInfo.total, pageInfo.current, 10, includes.length) + } + }, () => { + message.success(getLabel(111, "操作成功!")); + selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); }); + } + }, 800); + }); + API.siaccountCommonDelete({ billMonth, includes, ids, paymentOrganization }) + .then(() => { + clearInterval(this.timerDelete); + this.setState({ + selectedRowKeys: [], progressVisible: false, progress: 0, pageInfo: { + ...pageInfo, current: calcPageNo(pageInfo.total, pageInfo.current, 10, includes.length) + } + }, () => { + message.success(getLabel(111, "操作成功!")); + selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); + }); }); - }, - onCancel: () => { - } - }); - } + } + }); }; - handleAdd = () => this.setState({ addProps: { ...this.state.addProps, title: "添加缴纳人员", visible: true } }); + handleAdd = () => this.setState({ + addProps: { ...this.state.addProps, title: getLabel(111, "添加缴纳人员"), visible: true } + }); handleCommonAccountClick = () => { - const { billMonth, selectedKey, paymentOrganization } = this.props; - const { commonAccount } = this.props.standingBookStore; - commonAccount({ billMonth, paymentOrganization, includes: [] }); - this.setState({ - progressVisible: true - }, () => { + const { billMonth, paymentOrganization, selectedKey } = this.props; + const promise = API.commonAccount({ ..._.pick(this.props, ["billMonth", "paymentOrganization"]), includes: [] }); + this.setState({ progressVisible: true }, () => { this.timer = setInterval(() => { getCalculateProgress(billMonth, paymentOrganization).then(({ status, data }) => { if (status) { if (!data.status) { clearInterval(this.timer); - this.setState({ - progressVisible: false, - progress: 0 - }); + this.setState({ progressVisible: false, progress: 0 }); message.error(data.message); } if (this.state.progress !== 100) { @@ -294,86 +191,68 @@ export default class NormalIndex extends Component { } else { clearInterval(this.timer); this.setState({ - progressVisible: false, - progress: 0 + progressVisible: false, progress: 0 }, () => { - message.success("核算成功"); - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current: this.state.current - }) - : this.getSupplementaryList({ - billMonth, - paymentOrganization, - current: this.state.current - }); + message.success(getLabel(111, "操作成功!")); + this.getNormalList(); }); } } else { clearInterval(this.timer); - this.setState({ - progressVisible: false, - progress: 0 - }); + this.setState({ progressVisible: false, progress: 0 }); } }).catch(() => { clearInterval(this.timer); - this.setState({ - progressVisible: false, - progress: 0 - }); + this.setState({ progressVisible: false, progress: 0 }); }); }, 600); }); }; handleAddSocialAcctEmp = () => { - const { billMonth, paymentOrganization } = this.props, { normalPayer } = this.state; - addSocialAcctEmp({ billMonth, paymentOrganization, includes: normalPayer.split(",") }) - .then(({ status, errormsg }) => { - if (status) { - message.success(getLabel(111, "操作成功")); - this.getNormalList({ - billMonth, paymentOrganization, - current: calcPageNo(this.state.tableData.total, this.state.current, 10, normalPayer.split(",").length) - }); - } else { - message.error(errormsg); - } - }); + const { normalPayer, pageInfo } = this.state, { current, pageSize, total } = pageInfo; + API.addSocialAcctEmp({ + ..._.pick(this.props, ["billMonth", "paymentOrganization"]), includes: normalPayer.split(",") + }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功")); + this.setState({ + pageInfo: { ...pageInfo, current: calcPageNo(total, current, pageSize, normalPayer.split(",").length) } + }, () => this.getNormalList()); + } else { + message.error(errormsg); + } + }); }; handleDeleteNormalPayer = () => { Modal.confirm({ title: getLabel(111, "确认信息"), content: getLabel(111, "确认删除勾选的数据吗?"), onOk: () => { - const { billMonth, paymentOrganization } = this.props, { selectedRowKeys: ids } = this.state; - deleteSocialAcctEmp({ billMonth, paymentOrganization, ids }).then(({ status, errormsg }) => { - if (status) { - message.success(getLabel(111, "操作成功!")); - this.getNormalList({ - billMonth, - paymentOrganization, - current: calcPageNo(this.state.tableData.total, this.state.current, 10, ids.length) - }); - } else { - message.error(errormsg); - } - }); - + const { selectedRowKeys: ids, pageInfo } = this.state, { current, pageSize, total } = pageInfo; + API.deleteSocialAcctEmp({ ..._.pick(this.props, ["billMonth", "paymentOrganization"]), ids }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ + selectedRowKeys: [], + pageInfo: { ...pageInfo, current: calcPageNo(total, current, pageSize, ids.length) } + }, () => this.getNormalList()); + } else { + message.error(errormsg); + } + }); } }); }; handleExport = () => { - const { billMonth, selectedKey, paymentOrganization } = this.props; + const { selectedKey } = this.props; const urlObj = { "1": "/api/bs/hrmsalary/welfare/common/export", "3": "/api/bs/hrmsalary/welfare/supplementary/export" }; const url = `${window.location - .origin}${urlObj[selectedKey]}?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; - window.open(url, "_self"); + .origin}${urlObj[selectedKey]}?${convertToUrlString(_.pick(this.props, ["billMonth", "paymentOrganization"]))}`; + window.open(url, "_blank"); }; handleEditNormalStandingBook = (record) => { const { userName, id: editId } = record; @@ -387,50 +266,36 @@ export default class NormalIndex extends Component { this.setState({ returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" } }, () => { - if (refreshList) { - const { current } = this.state; - const { billMonth, selectedKey, paymentOrganization } = this.props; - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current - }) - : this.getSupplementaryList({ - billMonth, - paymentOrganization, - current - }); - } + if (refreshList) this.props.selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); }); }; getSearchs = () => { - return + const { formParams } = this.state, { workcode, departmentIds, subCompanyIds } = formParams; + return - - this.setState({ workcode: v })} - /> + + this.setState({ formParams: { ...formParams, workcode: v } })}/> this.setState({ departmentIds: v })}/> + isSingle={false} value={departmentIds.join(",")} type={57} + onChange={v => this.setState({ formParams: { ...formParams, departmentIds: v.split(",") } })}/> this.setState({ subCompanyIds: v })}/> + isSingle={false} value={subCompanyIds.join(",")} type={164} + onChange={v => this.setState({ formParams: { ...formParams, subCompanyIds: v.split(",") } })}/> ; }; render() { - const { remarks, billMonth, selectedKey, paymentOrganization, standingBookStore } = this.props; - const { addProps, adjustSlide, importParams, returnEditPersonSlide, showSearchAd, selectedRowKeys } = this.state; - const { loading } = standingBookStore; + const { remarks, billMonth, selectedKey, paymentOrganization, type } = this.props; + const { + formParams, addProps, adjustSlide, importParams, returnEditPersonSlide, + showSearchAd, selectedRowKeys, loading + } = this.state; const btn1 = [ , @@ -441,13 +306,13 @@ export default class NormalIndex extends Component { , this.setState({ normalPayer: ids }, () => this.handleAddSocialAcctEmp())} - > + onChange={ids => this.setState({ normalPayer: ids }, () => this.handleAddSocialAcctEmp())}> , - , - + , + ]; const btn3 = [ { @@ -466,10 +331,10 @@ export default class NormalIndex extends Component { ]; let btn = []; - (this.props.type !== "detail" && this.props.selectedKey == "3") && (btn = [...btn, ...btn1]); - (selectedKey === "1" && this.props.type !== "detail") && (btn = [...btn, ...btn2]); + (type !== "detail" && selectedKey === "3") && (btn = [...btn, ...btn1]); + (selectedKey === "1" && type !== "detail") && (btn = [...btn, ...btn2]); btn = [...btn5, ...btn]; - this.props.type !== "detail" && (btn = [...btn4, ...btn]); + type !== "detail" && (btn = [...btn4, ...btn]); selectedKey === "1" && (btn = [...btn3, ...btn]); return (
@@ -478,20 +343,16 @@ export default class NormalIndex extends Component {
- 账单月份 - + {getLabel(111, "账单月份")} + - - {billMonth} - + {billMonth}
- 备注: - - {remarks} - + {getLabel(111, "备注:")} + {remarks}
} @@ -499,39 +360,26 @@ export default class NormalIndex extends Component { datas={[]} selectedKey="" advanceHeight={200} searchsAd={this.getSearchs()} searchType={["base", "advanced"]} showSearchAd={showSearchAd} setShowSearchAd={bool => this.setState({ showSearchAd: bool })} - onSearchChange={searchValue => this.setState({ searchValue })} + onSearchChange={userName => this.setState({ formParams: { ...formParams, userName } })} buttons={btn} onSearch={this.handleSearch} onAdSearch={this.handleSearch} - onAdReset={() => this.setState({ workcode: "" })} searchsBasePlaceHolder="请输入员工姓名" - /> - { - this.setState({ - addProps: { - ...addProps, - visible: false - } - }, () => { - isRefresh && this.getSupplementaryList({ - billMonth, - current: this.state.current, - paymentOrganization - }); - }); - }} - /> + onAdReset={() => this.setState({ + formParams: { userName: "", workcode: "", departmentIds: [], subCompanyIds: [] } + })}/> + {/*添加补缴弹框*/} + { + this.setState({ addProps: { ...addProps, visible: false } }, () => { + isRefresh && this.getSupplementaryList(); + }); + }}/> {/*核算进度条*/} { - this.setState({ progressVisible: false, progress: 0 }); - }} - progress={this.state.progress} - /> + onCancel={() => this.setState({ progressVisible: false, progress: 0 })} + progress={this.state.progress}/> {/*导入弹框*/} - this.setState({ importParams: { ...importParams, visible: false } }, () => isInit && this.handleSearch())}/> @@ -547,17 +395,9 @@ export default class NormalIndex extends Component { {/*编辑弹框*/} - { - this.setState({ - adjustSlide: { - ...adjustSlide, - visible: false - } - }); - }} - /> + {/*调差*/} + this.setState({ adjustSlide: { ...adjustSlide, visible: false } })}/>
); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js index f88362f5..acb72e00 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js @@ -6,107 +6,68 @@ */ import React, { Component } from "react"; import { Icon, Spin, Tooltip } from "antd"; -import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom"; +import { getOverViewList } from "../../../../apis/standingBook"; import "./index.less"; +import { convertToUrlString } from "../../../../util/url"; const getLabel = WeaLocaleProvider.getLabel; -@inject("standingBookStore") -@observer export default class OverViewIndex extends Component { constructor(props) { super(props); this.state = { - selectedRowKeys: [], - current: 1, - pageSize: 10, - tableData: { - list: [], - columns: [], - total: 0 - } + dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false }; } componentDidMount() { - const { billMonth, paymentOrganization } = this.props; - this.getOverViewList({ billMonth, paymentOrganization }); + this.getOverViewList(); } - getOverViewList = (payload = {}) => { - const { getOverViewList } = this.props.standingBookStore; - getOverViewList({ ...payload, current: 1 }).then( - ({ list, columns = [], total }) => { - columns = _.map( - _.filter(columns, (it) => it.dataIndex !== "id"), - (it) => { - // if (it.dataIndex === "employeeId") { - // it = { - // ...it, - // width: 150, - // fixed: 'left' - // } - // } - return { - ...it, - title: ( + getOverViewList = () => { + const { pageInfo } = this.state; + this.setState({ loading: true }); + getOverViewList({ ..._.pick(this.props, ["billMonth", "paymentOrganization"]), ...pageInfo }) + .then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { current, pageSize, total }, + columns: _.map(columns, (it) => ({ + ...it, title: ( ) - }; - } - ); - this.setState({ - tableData: { - list, - columns, - total - } - }); - } - ); + })) + }); + } + }); }; handleExport = () => { - const { billMonth, paymentOrganization } = this.props; - const url = `${window.location - .origin}/api/bs/hrmsalary/welfare/overView/export?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; - window.open(url, "_self"); + const url = `/api/bs/hrmsalary/welfare/overView/export?${convertToUrlString(_.pick(this.props, ["billMonth", "paymentOrganization"]))}`; + window.open(url, "_blank"); }; render() { - const { remarks, billMonth, selectedKey, paymentOrganization } = this.props; - const { selectedRowKeys } = this.state; - const { loading } = this.props.standingBookStore; - let { list, columns, total } = this.state.tableData; + const { pageInfo, loading, dataSource, columns } = this.state, { billMonth } = this.props; const pagination = { - total, - showTotal: (total) => `共 ${total} 条`, - showSizeChanger: true, + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, showQuickJumper: true, + showSizeChanger: true, pageSizeOptions: ["10", "20", "50", "100"], onShowSizeChange: (current, pageSize) => { - this.setState({ current, pageSize }); - this.getOverViewList({ - billMonth, current, - pageSize, paymentOrganization - }); + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getOverViewList()); }, - onChange: (current) => { - this.setState({ current }); - this.getOverViewList({ - billMonth, current, - pageSize: this.state.pageSize, paymentOrganization - }); - } + onChange: current => this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getOverViewList()) }; return (
- 账单月份 - + {getLabel(111, "账单月份")} + @@ -120,14 +81,8 @@ export default class OverViewIndex extends Component {
- +
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js index c311d035..793b5acc 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js @@ -8,7 +8,6 @@ import React, { Component } from "react"; import { WeaDatePicker, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; import { Button, Modal } from "antd"; import RegSelect from "./regSelect"; -import * as API from "../../../../apis/standingBook"; class RegAddEmployee extends Component { constructor(props) { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js index 979cccc9..c37db36c 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js @@ -5,10 +5,9 @@ * Date: 2022/11/23 */ import React, { Component } from "react"; -import { WeaInputNumber, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTable } from "ecCom"; -import { message } from "antd"; +import { WeaInputNumber, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTable, WeaTop } from "ecCom"; +import { Button, message } from "antd"; import * as API from "../../../../apis/standingBook"; -import SlideModalTitle from "../../../../components/slideModalTitle"; import { regColumns } from "../constant"; import { toDecimal_n } from "../../../../util"; @@ -20,37 +19,19 @@ class RegEditDetial extends Component { this.state = { loading: false, listMap: [ - { - key: "social", - label: "社保", - dataSource: [], - columns: [] - }, - { - key: "fund", - label: "公积金", - dataSource: [], - columns: [] - }, - { - key: "other", - label: "企业年金及其他福利", - dataSource: [], - columns: [] - } + { key: "social", label: getLabel(111, "社保"), dataSource: [], columns: [] }, + { key: "fund", label: getLabel(111, "公积金"), dataSource: [], columns: [] }, + { key: "other", label: getLabel(111, "企业年金及其他福利"), dataSource: [], columns: [] } ] }; } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.editId !== this.props.editId && nextProps.editId) { - this.getPaymentById(nextProps.editId); - } + if (nextProps.editId !== this.props.editId && nextProps.editId) this.getPaymentById(nextProps.editId); } handleSave = () => { - const { editId, onCancel } = this.props; - const { listMap } = this.state; + const { editId, onCancel } = this.props, { listMap } = this.state; const [socialData, foundData, otherData] = listMap; let payload = { id: editId, @@ -100,8 +81,7 @@ class RegEditDetial extends Component { }); }; handleChange = (type, dataIndex, value, record) => { - const { listMap } = this.state; - const [socialData, foundData, otherData] = listMap; + const { listMap } = this.state, [socialData, foundData, otherData] = listMap; switch (type) { case "social": const sociallist = _.map(socialData.dataSource, item => { @@ -139,7 +119,6 @@ class RegEditDetial extends Component { default: break; } - }; getPaymentById = (id) => { const payload = { id }; @@ -257,39 +236,26 @@ class RegEditDetial extends Component { const { visible, title, onCancel } = this.props; const { listMap, loading } = this.state; return ( - - } - content={ -
- { - _.map(listMap, item => { - const { key, label, dataSource, columns } = item; - return - - ; - }) - } -
- } - onClose={() => onCancel()} - showMask={true} - /> - ); + } iconBgcolor="#F14A2D" + buttons={[]}/> + } + content={ + + { + _.map(listMap, item => { + const { key, label, dataSource, columns } = item; + return + + ; + }) + } + + } + onClose={() => onCancel()}/>); } } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js index 849cb407..08f65301 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js @@ -6,36 +6,27 @@ */ import React, { Component } from "react"; import { Spin } from "antd"; -import { getQueryString } from "../../../../util/url"; +import { sysConfCodeRule } from "../../../../apis/ruleconfig"; import * as API from "../../../../apis/standingBook"; import "./index.less"; const APIFox = { "regression": API.recessionList, - "difference": API.balanceList + "regressionSum": API.recessionListSum, + "difference": API.balanceList, + "differenceSum": API.balanceListSum }; class RegList extends Component { constructor(props) { super(props); this.state = { - columns: [], - dataSource: [], - selectedRowKeys: [], - loading: { - query: false - }, - datalistPayload: {}, - pageInfo: { - current: 1, - pageSize: 10, - total: 0 - } + columns: [], dataSource: [], selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, sumRow: {} }; } componentDidMount() { - this.recessionList(); window.addEventListener("message", this.handleReceive, false); } @@ -43,11 +34,11 @@ class RegList extends Component { const { onEdit, onChangeRowkey } = this.props; const { type, payload: { id, params } = {} } = data; if (type === "init") { - this.postMessageToChild(); + this.recessionList(); } else if (type === "turn") { if (id === "PAGEINFO") { const { pageNum: current, size: pageSize } = params; - this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.recessionList()); + this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.recessionList({}, true)); } else if (id === "ROWSELECT") { const { selectedRowKeys } = params; this.setState({ selectedRowKeys }); @@ -58,24 +49,15 @@ class RegList extends Component { } }; postMessageToChild = () => { - const paymentStatus = this.props.type === "difference" ? "4" : "3"; - const creator = Number(getQueryString("creator")); - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); const childFrameObj = document.getElementById("atdTable"); - const { pageInfo, dataSource, columns, selectedRowKeys, datalistPayload } = this.state; - childFrameObj.contentWindow.postMessage(JSON.stringify({ - dataSource, columns, pageInfo, - selectedRowKeys, selectedKey: this.props.type, - sumpayload: { billMonth, paymentOrganization, creator, paymentStatus, ...datalistPayload }, - showOperates: !getQueryString("type") + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ + ..._.pick(this.state, ["dataSource", "columns", "pageInfo", "selectedRowKeys", "sumRow"]), + showOperates: !this.props.type }), "*"); }; componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.visible !== this.props.visible) { - this.recessionList(); - } + if (nextProps.visible !== this.props.visible) this.recessionList(); } componentWillUnmount() { @@ -85,41 +67,37 @@ class RegList extends Component { handleResetSelectRowKeys = (selectedRowKeys) => { this.setState({ selectedRowKeys }); }; - recessionList = (module) => { - const { type } = this.props; - const { loading, pageInfo } = this.state; - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); - const creator = Number(getQueryString("creator")); - const paymentStatus = type === "difference" ? "4" : "3"; + recessionList = (module, pageTurning = false) => { + const { regType } = this.props, { pageInfo } = this.state; + const paymentStatus = regType === "difference" ? "4" : "3"; const payload = { - billMonth, paymentStatus, - creator, paymentOrganization, - ...pageInfo, - ...module + ...pageInfo, ...module, paymentStatus, + ..._.pick(this.props, ["billMonth", "paymentOrganization", "creator"]) }; - this.setState({ loading: { ...loading, query: true } }); - APIFox[type](payload).then(({ status, data }) => { - this.setState({ loading: { ...loading, query: false } }); + this.setState({ loading: true }); + APIFox[regType](payload).then(({ status, data }) => { + this.setState({ loading: false }); if (status) { const { pageInfo: list } = data; const { columns, list: dataSource, pageNum: current, pageSize, total } = list; this.setState({ - pageInfo: { ...pageInfo, current, pageSize, total }, - dataSource, - columns, - datalistPayload: module + pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, columns }, () => this.postMessageToChild()); } - }).catch(() => { - this.setState({ loading: { ...loading, query: false } }); + }); + sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }).then(({ status, data }) => { + if (status && data === "1" && !pageTurning) { + APIFox[`${regType}Sum`](payload).then(({ status: sumStatus, data: sumData }) => { + if (sumStatus) this.setState({ sumRow: sumData.sumRow }, () => this.postMessageToChild()); + }); + } }); }; render() { const { loading } = this.state; return ( - +