From 262976cc5e62c6ad306cc77fc1b13eeeae080538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 4 Aug 2023 13:55:20 +0800 Subject: [PATCH 01/77] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/payroll/index.js | 29 +++------------- .../payroll/stepForm/salaryItemSettings.js | 33 ++----------------- pc4mobx/hrmSalary/stores/payroll.js | 22 ------------- 3 files changed, 7 insertions(+), 77 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payroll/index.js b/pc4mobx/hrmSalary/pages/payroll/index.js index 38a5eba4..c974b699 100644 --- a/pc4mobx/hrmSalary/pages/payroll/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/index.js @@ -64,12 +64,7 @@ export default class Payroll extends React.Component { getReplenishForm = (isEdit = false, params = {}) => { const { payrollStore } = this.props; - const { - templateBaseData, - salaryTemplateShowSet, - setReplenishSalaryTemplateSalaryItemSet, - setSalaryBillItemNameSet - } = payrollStore; + const { templateBaseData, salaryTemplateShowSet, setReplenishSalaryTemplateSalaryItemSet } = payrollStore; if (!salaryTemplateShowSet.theme && !isEdit) { Modal.warning({ title: "信息确认", @@ -82,12 +77,10 @@ export default class Payroll extends React.Component { if (!isEdit) { this.setState({ currentStep: this.state.currentStep + 1 }, () => { setReplenishSalaryTemplateSalaryItemSet(data.replenishSalaryTemplateSalaryItemSet); - setSalaryBillItemNameSet(data.salaryBillItemNameSet); window.localStorage.setItem("salary-showset", JSON.stringify(salaryTemplateShowSet)); }); } else { setReplenishSalaryTemplateSalaryItemSet(data.replenishSalaryTemplateSalaryItemSet); - setSalaryBillItemNameSet(data.salaryBillItemNameSet); window.localStorage.setItem("salary-showset", JSON.stringify(salaryTemplateShowSet)); } } @@ -268,9 +261,7 @@ export default class Payroll extends React.Component { setTemplateTableSelectedRowKeys, deletePayroll, templateBaseData, - setTemplateTablePageInfo, - setSalaryBillItemNameSetting, - salaryBillItemNameSetting + setTemplateTablePageInfo } = payrollStore; const { currentStep, selectedTab, templateSearchValue, templateSelect, startDate, endDate } = this.state; if (!hasRight && !loading) { // 无权限处理 @@ -325,7 +316,7 @@ export default class Payroll extends React.Component { { showOperateBtn && } { @@ -474,16 +465,10 @@ export default class Payroll extends React.Component { customOperate={ currentStep === 0 ? [ ] : currentStep === 1 ? [ , , @@ -492,9 +477,6 @@ export default class Payroll extends React.Component { }}>预览 ] : currentStep === 2 ? [ , @@ -524,7 +506,7 @@ export default class Payroll extends React.Component { className="slideOuterWrapper" visible={this.state.editSlideVisible} top={0} - width={65} + width={50} height={100} direction="right" measure="%" @@ -557,9 +539,6 @@ export default class Payroll extends React.Component { } subItemChange={(selectedTab) => { this.setState({ selectedTab: Number(selectedTab) }, () => { - setSalaryBillItemNameSetting(_.map(salaryBillItemNameSetting, it => { - return { ...it, salaryTemplateId: "", itemShowNameSetting: [] }; - })); if (this.state.selectedTab === 2) this.getReplenishForm(true, { id: this.state.templateCurrentId }); }); }} diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js index d316745a..7281fafe 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js @@ -218,7 +218,7 @@ class SalaryItemSettings extends Component { }; handleEditSalaryItemName = (item, field, viewAttr) => { //暂时关闭 - return + return; const { groupId } = item, { salaryItemId } = field, { dataList } = this.state; if (groupId === "111111111111111111") return; this.setState({ @@ -307,36 +307,9 @@ class SalaryItemSettings extends Component { }) )} renderNodeItem={(filed) => { - const salaryBillItemNameObj = salaryBillItemNameSet[filed.id] || {}; return
-
- { - filed.viewAttr === 2 ? - this.handleEditSalaryItemName(item, filed, 1)} - onChange={(val) => this.handleChangeSalaryItemShowName(item, filed, val)} - /> : -
this.handleEditSalaryItemName(item, filed, 2)}> - { - (item.groupId !== "111111111111111111" && (!_.isEmpty(salaryBillItemNameObj) || (filed.salaryItemShowName !== filed.originName))) ? - `${filed.salaryItemShowName}(${filed.originName})` : - filed.name - } -
- } +
+
{filed.name}
this.handleDeleteSalaryItem(item, filed)}/>
; diff --git a/pc4mobx/hrmSalary/stores/payroll.js b/pc4mobx/hrmSalary/stores/payroll.js index 6c2e7d34..e42cdba0 100644 --- a/pc4mobx/hrmSalary/stores/payroll.js +++ b/pc4mobx/hrmSalary/stores/payroll.js @@ -26,19 +26,6 @@ export class payrollStore { @observable salaryTemplateShowSet = {}; // 显示设置基础表单 @observable replenishSalaryTemplateSalaryItemSet = []; // 补发工资单模版基础表单 @observable salaryItemSet = []; // 显示设置薪资项 - @observable salaryBillItemNameSetting = [ - { - salaryTemplateId: "", - salaryBillType: 0, - itemShowNameSetting: [] - }, - { - salaryTemplateId: "", - salaryBillType: 1, - itemShowNameSetting: [] - } - ]; // 工资单模板薪资项目名称修改列表 - @observable salaryBillItemNameSet = {}; // 工资单模板薪资项目名称修改列表 // **** 工资单页面 **** @observable salarySendTableStore = new TableStore(); // 工资单列表 @@ -100,10 +87,6 @@ export class payrollStore { @action setSalaryItemSet = salaryItemSet => (this.salaryItemSet = salaryItemSet); - @action - setSalaryBillItemNameSet = salaryBillItemNameSet => (this.salaryBillItemNameSet = salaryBillItemNameSet); - @action - setSalaryBillItemNameSetting = salaryBillItemNameSetting => (this.salaryBillItemNameSetting = salaryBillItemNameSetting); @action("工资单模板分页信息修改") setTemplateTablePageInfo = (pageInfo, callback) => { @@ -231,7 +214,6 @@ export class payrollStore { if (res.status) { if (id !== "") { this.salaryItemSet = res.data.salaryTemplateSalaryItemSet; - this.salaryBillItemNameSet = res.data.salaryBillItemNameSet; this.replenishSalaryTemplateSalaryItemSet = res.data.salaryTemplateSalaryItemSet; } this.salaryTemplateShowSet = { ...res.data.salaryTemplateShowSet.data, ...JSON.parse(salaryTemplateShowSetStorage) }; @@ -280,7 +262,6 @@ export class payrollStore { : false; params.salaryItemSetting = toJS(this.salaryItemSet); params.replenishSalaryItemSetting = toJS(this.replenishSalaryTemplateSalaryItemSet); - params.salaryBillItemNameSetting = toJS(this.salaryBillItemNameSetting); return params; }; @@ -293,9 +274,6 @@ export class payrollStore { if (res.status) { message.success("保存成功"); this.getPayrollTemplateList(); - this.setSalaryBillItemNameSetting(_.map(this.salaryBillItemNameSetting, it => { - return { ...it, salaryTemplateId: "", itemShowNameSetting: [] }; - })); resolve(); } else { message.error(res.errormsg || "保存失败"); From 5adfa47b5b301769e854d9adafc81b23921cb453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 11 Aug 2023 17:34:42 +0800 Subject: [PATCH 02/77] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9-=E6=96=AD=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js | 1 + .../pages/payroll/templatePreview/computerTemplate/index.js | 1 + 2 files changed, 2 insertions(+) diff --git a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js index 67374438..dd6a6d7e 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js +++ b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js @@ -87,6 +87,7 @@ class MySalaryView extends Component { const employeeInformation = !_.isEmpty(mySalaryStore) && mySalaryStore.employeeInformation; const salaryGroups = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryGroups; const salaryTemplateShowSet = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryTemplate; + console.log(90, salaryTemplateShowSet, salaryGroups); return ( Date: Wed, 16 Aug 2023 10:30:37 +0800 Subject: [PATCH 03/77] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js | 1 + pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js | 1 - .../pages/payroll/templatePreview/computerTemplate/index.js | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js index 77e8d62f..9e10b3a6 100644 --- a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js +++ b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js @@ -35,6 +35,7 @@ class FieldSlide extends Component { name: "", useInEmployeeSalary: "1", useDefault: "0", + hideDefault: "0", sharedType: "0", shareTypeList: [], taxAgentIds: "", diff --git a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js index dd6a6d7e..67374438 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js +++ b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js @@ -87,7 +87,6 @@ class MySalaryView extends Component { const employeeInformation = !_.isEmpty(mySalaryStore) && mySalaryStore.employeeInformation; const salaryGroups = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryGroups; const salaryTemplateShowSet = !_.isEmpty(mySalaryStore) && mySalaryStore.salaryTemplate; - console.log(90, salaryTemplateShowSet, salaryGroups); return ( Date: Thu, 17 Aug 2023 13:45:21 +0800 Subject: [PATCH 04/77] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/payroll/index.js | 29 ++++++++++++++++--- .../archives/baseForm.js | 2 +- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payroll/index.js b/pc4mobx/hrmSalary/pages/payroll/index.js index c974b699..38a5eba4 100644 --- a/pc4mobx/hrmSalary/pages/payroll/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/index.js @@ -64,7 +64,12 @@ export default class Payroll extends React.Component { getReplenishForm = (isEdit = false, params = {}) => { const { payrollStore } = this.props; - const { templateBaseData, salaryTemplateShowSet, setReplenishSalaryTemplateSalaryItemSet } = payrollStore; + const { + templateBaseData, + salaryTemplateShowSet, + setReplenishSalaryTemplateSalaryItemSet, + setSalaryBillItemNameSet + } = payrollStore; if (!salaryTemplateShowSet.theme && !isEdit) { Modal.warning({ title: "信息确认", @@ -77,10 +82,12 @@ export default class Payroll extends React.Component { if (!isEdit) { this.setState({ currentStep: this.state.currentStep + 1 }, () => { setReplenishSalaryTemplateSalaryItemSet(data.replenishSalaryTemplateSalaryItemSet); + setSalaryBillItemNameSet(data.salaryBillItemNameSet); window.localStorage.setItem("salary-showset", JSON.stringify(salaryTemplateShowSet)); }); } else { setReplenishSalaryTemplateSalaryItemSet(data.replenishSalaryTemplateSalaryItemSet); + setSalaryBillItemNameSet(data.salaryBillItemNameSet); window.localStorage.setItem("salary-showset", JSON.stringify(salaryTemplateShowSet)); } } @@ -261,7 +268,9 @@ export default class Payroll extends React.Component { setTemplateTableSelectedRowKeys, deletePayroll, templateBaseData, - setTemplateTablePageInfo + setTemplateTablePageInfo, + setSalaryBillItemNameSetting, + salaryBillItemNameSetting } = payrollStore; const { currentStep, selectedTab, templateSearchValue, templateSelect, startDate, endDate } = this.state; if (!hasRight && !loading) { // 无权限处理 @@ -316,7 +325,7 @@ export default class Payroll extends React.Component { { showOperateBtn && } { @@ -465,10 +474,16 @@ export default class Payroll extends React.Component { customOperate={ currentStep === 0 ? [ ] : currentStep === 1 ? [ , , @@ -477,6 +492,9 @@ export default class Payroll extends React.Component { }}>预览 ] : currentStep === 2 ? [ , @@ -506,7 +524,7 @@ export default class Payroll extends React.Component { className="slideOuterWrapper" visible={this.state.editSlideVisible} top={0} - width={50} + width={65} height={100} direction="right" measure="%" @@ -539,6 +557,9 @@ export default class Payroll extends React.Component { } subItemChange={(selectedTab) => { this.setState({ selectedTab: Number(selectedTab) }, () => { + setSalaryBillItemNameSetting(_.map(salaryBillItemNameSetting, it => { + return { ...it, salaryTemplateId: "", itemShowNameSetting: [] }; + })); if (this.state.selectedTab === 2) this.getReplenishForm(true, { id: this.state.templateCurrentId }); }); }} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js index 5c658b41..daaf7f03 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/baseForm.js @@ -21,7 +21,7 @@ export default class BaseForm extends React.Component { { com: Input("岗位", position) }, { com: Input("手机号", telephone) }, { com: Input("入职日期", hiredate) }, - { com: Input("合同到期日期", dimissionDate) } + // { com: Input("合同到期日期", dimissionDate) } ]; const taxagentItems = [ { com: Input("个税扣缴义务人", paymentOrganizationName) } From 8871b8ed2cac675063ae7f90f71f1aa6df2adcc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 18 Aug 2023 10:18:53 +0800 Subject: [PATCH 05/77] hotfix/2.9.42308.02 --- pc4mobx/hrmSalary/pages/ruleConfig/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index 4cdcafa0..3ac96bf9 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -76,8 +76,8 @@ export default class Index extends Component { showEncryptOperationButton, saveParams: { ...saveParams, - ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue, withDrawTaxDeclaration, - extEmpsWitch + ascOrDesc, orderRule, rule, enctry, matchRule, confValue, withDrawTaxDeclaration, + extEmpsWitch, operateTaxDeclaration: (operateTaxDeclaration && operateTaxDeclaration !== "0") ? "1" : "0" } }); } From 25ce139a0c7abc4c26ade0d0746616d85c08f9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 21 Aug 2023 10:53:19 +0800 Subject: [PATCH 06/77] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E5=B7=A5=E8=B5=84?= =?UTF-8?q?=E5=8D=95=E4=BA=A7=E7=9C=8B=E9=A1=B5=E9=9D=A2dom=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E9=A1=BA=E5=BA=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/mobilePayroll/index.js | 4 ++-- pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 7ad8bb01..8116c06a 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -189,7 +189,7 @@ export default class MobilePayroll extends React.Component { salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : []} > { - (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0") && + (!_.isEmpty(salaryGroups) && (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0")) && { - (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0") && + (!_.isEmpty(salaryGroups) && (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0")) && { - (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0") && + (!_.isEmpty(salaryGroups) && (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0")) && Date: Fri, 25 Aug 2023 16:12:05 +0800 Subject: [PATCH 07/77] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E4=BF=9D=E7=95=99=E5=B0=8F=E6=95=B0?= =?UTF-8?q?=E4=BD=8D=E6=95=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 12 ++----- .../hrmSalary/pages/calculateDetail/index.js | 24 +++++-------- .../pages/calculateDetail/index.less | 36 ++++++++++++++++--- .../calculateDetail/issuedAndReissueTable.js | 4 +-- .../calculateDetail/payrollItemsTable.js | 4 +-- .../calculateDetail/placeOnFileDetail.js | 3 +- .../components/ledgerSalaryItemNormal.js | 4 +-- .../components/ledgerSalaryItemTable.js | 4 +-- .../pages/salaryFile/saralyFileViewSlide.js | 2 +- 9 files changed, 52 insertions(+), 41 deletions(-) diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index d004267c..bd2d3c12 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -129,16 +129,8 @@ const Routes = ( - - + + diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index d43cfb66..5b882dee 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -353,18 +353,10 @@ export default class CalculateDetail extends React.Component { onClick={() => this.downloadTxtfile(accountExceptInfo)}/>); return buttons; }; - const topTab = [ - { - title: "人员确认", - viewcondition: "0" - }, - { - title: "薪资核算", - viewcondition: "1" - } + { title: "人员确认", viewcondition: "0" }, + { title: "薪资核算", viewcondition: "1" } ]; - const adBtn = [ // 高级搜索内部按钮 }
; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js index 57522e83..55892da2 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js @@ -255,9 +255,9 @@ class LedgerSalaryItemTable extends Component { dataIndex: "valueType", key: "valueType", render: (e, record) => { - const { valueType } = record; + const { valueType, formulaContent } = record; const key = !_.isNil(valueType) ? valueType : ""; - return {key.toString() === "1" ? "输入" : key.toString() === "2" ? "自定义公式" : key.toString() === "3" ? "SQL" : ""} ; + return {key.toString() === "1" ? "输入" : key.toString() === "2" ? formulaContent : key.toString() === "3" ? formulaContent : ""} ; } }, { diff --git a/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js b/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js index 32a53167..59428135 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/saralyFileViewSlide.js @@ -152,7 +152,7 @@ export default class SalaryFileViewSlide extends React.Component { item.dataType === "number" ? { item.value = value; From ecc20219169d42c58c2da9520b6b0688fc319884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 29 Aug 2023 14:24:43 +0800 Subject: [PATCH 08/77] =?UTF-8?q?2.9.42308.02bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/socialSecurityBenefits/programme/defaultSlideForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js index 3e7ebcfa..fabf6a86 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js @@ -203,7 +203,7 @@ export default class DefaultSlideForm extends React.Component { return ( { this.updateDataSource(record, v, "paymentProportion"); From f65b7979d76c18aa260ca8948a7f95eeda6c2bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 31 Aug 2023 09:40:09 +0800 Subject: [PATCH 09/77] =?UTF-8?q?hotfix-=E8=96=AA=E8=B5=84=E6=A0=B8?= =?UTF-8?q?=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=88=86=E9=A1=B5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js index bbcdaad6..327d9b72 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js @@ -151,6 +151,7 @@ export default class SalaryDetail extends React.Component { progressVisible: false, progress: 0 }, () => { + const { current, pageSize } = this.pageInfo; const childFrameObj = document.getElementById("atdTable"); const payload = { type: "PR", @@ -158,7 +159,8 @@ export default class SalaryDetail extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctresult/list", queryParams: { salaryAcctRecordId, - ...this.props.employeeName + ...this.props.employeeName, + current, pageSize } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -186,13 +188,15 @@ export default class SalaryDetail extends React.Component { this.setState({ loading: false }); const childFrameObj = document.getElementById("atdTable"); const salaryAcctRecordId = getQueryString("id"); + const { current, pageSize } = this.pageInfo; const payload = { type: "PR", listType: "", url: "/api/bs/hrmsalary/salaryacct/acctresult/list", queryParams: { salaryAcctRecordId, - ...this.props.employeeName + ...this.props.employeeName, + current, pageSize } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); From b6ac297242f4af24d003f554972633c083522c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 31 Aug 2023 11:15:32 +0800 Subject: [PATCH 10/77] =?UTF-8?q?hotfix-=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A1=A3=E6=A1=88=E4=BB=A5=E5=8F=8A=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E7=9A=84=E5=AF=BC=E5=85=A5=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/calculateDetail/index.less | 6 ++ .../pages/calculateDetail/salaryDetail.js | 17 ++---- .../pages/calculateDetail/userSure.js | 59 +++++++++++++++---- .../payrollFiles/components/importMenu.js | 6 +- pc4mobx/hrmSalary/pages/payrollFiles/index.js | 3 + .../socialSecurityBenefits/archives/index.js | 4 +- .../standingBookDetail/components/index.less | 26 +++++++- .../standingBookDetail/index.js | 58 +++++++++--------- 8 files changed, 120 insertions(+), 59 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.less b/pc4mobx/hrmSalary/pages/calculateDetail/index.less index 64b163fa..37d09d86 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.less +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.less @@ -270,3 +270,9 @@ } } } + +.salaryMonthTip-layout{ + display: flex; + flex-direction: column; + +} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js index 327d9b72..84e7dbf5 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js @@ -6,9 +6,10 @@ import EditSalaryDetail from "./editSalaryDetail"; import SlideModalTitle from "../../components/slideModalTitle"; import { getQueryString } from "../../util/url"; import { inject, observer } from "mobx-react"; +import ProgressModal from "../../components/progressModal"; +import { SalaryMonthTip } from "./userSure"; import { toJS } from "mobx"; import "./index.less"; -import ProgressModal from "../../components/progressModal"; @inject("calculateStore", "taxAgentStore") @observer @@ -215,17 +216,9 @@ export default class SalaryDetail extends React.Component {
薪资所属月:{baseSalarySobCycle.salaryMonth} : ""} placement="topLeft" /> {/*暂时隐藏*/} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js index 89f77d11..b7c3ac5f 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js @@ -1,10 +1,20 @@ import React from "react"; import { Button, Col, Icon, message, Modal, Row } from "antd"; -import { WeaBrowser, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom"; +import { + WeaBrowser, + WeaFormItem, + WeaHelpfulTip, + WeaInput, + WeaLocaleProvider, + WeaSearchGroup, + WeaSelect, + WeaTab +} from "ecCom"; import { inject, observer } from "mobx-react"; -import "./index.less"; import { getQueryString } from "../../util/url"; +import "./index.less"; +const { getLabel } = WeaLocaleProvider; @inject("calculateStore", "salaryFileStore") @observer export default class UserSure extends React.Component { @@ -120,7 +130,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctemployee/list", queryParams: { salaryAcctRecordId, - ...this.state.searchItemsValue, + ...this.state.searchItemsValue } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); //window.postMessage @@ -375,12 +385,8 @@ export default class UserSure extends React.Component { 薪资所属月: : ""} placement="topLeft" /> @@ -430,7 +436,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctemployee/list", queryParams: { salaryAcctRecordId, - ...this.state.searchItemsValue, + ...this.state.searchItemsValue } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); //window.postMessage @@ -460,7 +466,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/reducedemployee/list", queryParams: { salaryAcctRecordId, - ...this.state.searchItemsValue, + ...this.state.searchItemsValue } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -490,7 +496,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/addedemployee/list", queryParams: { salaryAcctRecordId, - ...this.state.searchItemsValue, + ...this.state.searchItemsValue } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -587,3 +593,32 @@ export default class UserSure extends React.Component { ); } } + +export const SalaryMonthTip = (props) => { + const { baseSalarySobCycle } = props; + const { salaryCycle, taxCycle, attendCycle, socialSecurityCycle } = baseSalarySobCycle; + const { fromDate: salaryCycleFromDate, endDate: salaryCycleEndDate } = salaryCycle; + const { fromDate: attendCycleFromDate, endDate: attendCycleEndDate } = attendCycle; + return ( +
+
+
{getLabel(543375, "薪资周期")}
+
{`${salaryCycleFromDate}${getLabel(15322, "至")}${salaryCycleEndDate}`}
+
+
+
{getLabel(542240, "税款所属期")}
+
{taxCycle}
+
+
+
{getLabel(543475, "考勤取值周期")}
+
{`${attendCycleFromDate}${getLabel(15322, "至")}${attendCycleEndDate}`}
+
+
+
{getLabel(543466, "福利台账月份")}
+
+ {`${getLabel(19422, "引用")}${socialSecurityCycle}${getLabel(543476, "的福利台账数据")}`} +
+
+
+ ); +}; diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js index 42f95e62..2e0b01d6 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js @@ -3,6 +3,7 @@ import ImportModal from "../../../components/importModal"; import * as API from "../../../apis/payrollFiles"; import { Menu, Modal } from "antd"; import "../index.less"; +import { convertToUrlString } from "../../../util/url"; class ImportMenu extends Component { constructor(props) { @@ -114,7 +115,7 @@ class ImportMenu extends Component { }; render() { - const { importType, refreshList, isExtEmp } = this.props; + const { importType, refreshList, isExtEmp, searchItemsValue = {} } = this.props; const { importParams, previewColumns, previewDataSource } = this.state; let params = ""; if (importParams.importType === "init" || importParams.importType === "salaryItemAdjust") { @@ -153,8 +154,7 @@ class ImportMenu extends Component { }} previewImport={(params) => this.salaryArchivePreview(params)} importFile={(params) => this.handleImportFile(params)} - templateLink={ - "/api/bs/hrmsalary/salaryArchive/downloadTemplate?importType=" + params + templateLink={`/api/bs/hrmsalary/salaryArchive/downloadTemplate?importType=${params}&${convertToUrlString(searchItemsValue)}` } visiable={importParams.visible} onCancel={() => { diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index 1cf37553..74326a8f 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -433,6 +433,7 @@ class Index extends Component { { this.query(); this.setState({ selectedRowKeys: [] }); @@ -523,6 +524,7 @@ class Index extends Component { { this.query(); this.setState({ selectedRowKeys: [] }); @@ -834,6 +836,7 @@ class Index extends Component {
this.importRef = dom} + searchItemsValue={this.state.searchItemsValue} refreshList={() => { this.query(); this.setState({ selectedRowKeys: [] }); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 8b078187..cab89a87 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -293,8 +293,10 @@ export default class Archives extends React.Component { // 模板点击 handleTemplateLinkClick = (exportData) => { + const { archivesStore: { form } } = this.props; + const formParams = form.getFormParams() || {}; const { selectedKey } = this.state; - let url = `/api/bs/hrmsalary/scheme/template/export?exportData=${exportData}&runStatuses=${selectedKey === "pending" ? "1" : "2,3"}`; + let url = `/api/bs/hrmsalary/scheme/template/export?exportData=${exportData}&runStatuses=${selectedKey === "pending" ? "1" : "2,3"}&${convertToUrlString(formParams)}`; window.open(`${window.location.origin}${url}`); }; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 9ed9d668..7bb28208 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -2,12 +2,26 @@ display: flex; flex-direction: column; height: 100%; + background: #f6f6f6; + + .wea-new-top-req-wapper .wea-new-top-req-main { + background: #f6f6f6 !important; + } + + .wea-new-top-req-wapper .wea-new-top-req { + z-index: 0 !important; + } + + .wea-search-tab, .wea-input-focus { + background: #f6f6f6; + } .normalWapper { - flex: 1; + height: 100%; display: flex; flex-direction: column; overflow: hidden; + padding: 0 16px; .tableWrapper { flex: 1; @@ -16,12 +30,18 @@ .ant-spin-nested-loading, .ant-spin-container { height: 100%; } + + .wea-new-table { + background: #fff; + } } .topContent { padding: 8px 20px; display: flex; align-items: center; + background: #fff; + margin-top: 16px; .month { margin-right: 26px; @@ -69,14 +89,16 @@ //退差;补差 .regressionWrapper, .differenceWrapper { - flex: 1; + height: 100%; overflow: hidden; display: flex; flex-direction: column; + padding: 16px; .tableWrapper { flex: 1; overflow: hidden; + .ant-spin-nested-loading, .ant-spin-container { height: 100%; } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js index a5ae1a93..f58a9740 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js @@ -6,13 +6,15 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaTab } from "ecCom"; +import { WeaLocaleProvider, WeaReqTop } from "ecCom"; import NormalIndex from "./components/normal"; import OverViewIndex from "./components/overView"; import AbnormalListIndex from "./components/abnormalList"; import Regression from "./components/regression"; import MakeupDifference from "./components/makeupDifference"; +const { getLabel } = WeaLocaleProvider; + @inject("standingBookStore") @observer class StandingBookDetail extends Component { @@ -43,7 +45,7 @@ class StandingBookDetail extends Component { newTabList.push(newTabList.splice(_.findIndex(newTabList, it => it.id === "4"), 1)[0]); this.setState({ selectedKey: newTabList[0].id, - tabList: _.map(newTabList, it => ({ title: it.content, viewcondition: it.id })), + tabList: _.map(newTabList, it => ({ title: it.content, key: it.id })), remarks, billMonth }); }); @@ -53,33 +55,31 @@ class StandingBookDetail extends Component { const { selectedKey, tabList, remarks, billMonth } = this.state; return (
- { - this.setState({ selectedKey }); - }} - /> - { - (selectedKey === "1" || selectedKey === "3") && - - } - { - selectedKey === "2" && - - } - { - selectedKey === "4" && - - } - { - selectedKey === "5" && - } - { - selectedKey === "6" && - } + } + iconBgcolor="#F14A2D" showDropIcon={false} tabDatas={tabList} selectedKey={selectedKey} + onChange={selectedKey => this.setState({ selectedKey })} + > + { + (selectedKey === "1" || selectedKey === "3") && + + } + { + selectedKey === "2" && + + } + { + selectedKey === "4" && + + } + { + selectedKey === "5" && + } + { + selectedKey === "6" && + } +
); } From a058242d35f382a4fd8b64dc2cc1761c6d5a0188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 31 Aug 2023 14:23:51 +0800 Subject: [PATCH 11/77] =?UTF-8?q?feature/2.9.42308.02-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8C=E6=AD=A5=E5=88=B0=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E8=B4=A6=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/item.js | 256 +++++++++--------- pc4mobx/hrmSalary/pages/salaryItem/columns.js | 21 ++ pc4mobx/hrmSalary/pages/salaryItem/index.js | 27 +- pc4mobx/hrmSalary/pages/salaryItem/index.less | 8 + .../syncToSalaryAccountSetDialog.js | 85 ++++++ pc4mobx/hrmSalary/stores/salaryItem.js | 2 + 6 files changed, 276 insertions(+), 123 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js diff --git a/pc4mobx/hrmSalary/apis/item.js b/pc4mobx/hrmSalary/apis/item.js index 3c3bb052..2d23377a 100644 --- a/pc4mobx/hrmSalary/apis/item.js +++ b/pc4mobx/hrmSalary/apis/item.js @@ -1,4 +1,4 @@ -import { WeaTools } from 'ecCom'; +import { WeaTools } from "ecCom"; /** * 薪资项目api @@ -7,171 +7,171 @@ import { WeaTools } from 'ecCom'; // 薪资项目-获取列表 export const getItemList = params => { - return fetch('/api/bs/hrmsalary/salaryitem/list', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/salaryitem/list", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; //薪资项目的高级搜索 export const getSaCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/getSearchCondition', 'GET', params); + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSearchCondition", "GET", params); }; //数据源列表字典项 export const formulaDatasourceList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/formula/datasource/list', 'GET', params); + return WeaTools.callApi("/api/bs/hrmsalary/formula/datasource/list", "GET", params); }; //薪资项目-系统薪资项目列表 export const getSysItemList = params => { - return fetch('/api/bs/hrmsalary/salaryitem/sysList', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return fetch("/api/bs/hrmsalary/salaryitem/sysList", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; //系统薪资项目的高级搜索 export const getSysSaCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/getSysSearchCondition', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSysSearchCondition", "GET", params); +}; //薪资项目-批量删除薪资项目 export const deleteItem = params => { - return fetch('/api/bs/hrmsalary/salaryitem/delete', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryitem/delete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资项目-批量删除列表 export const deleteItemList = params => { - return fetch('/api/bs/hrmsalary/salaryitem/listCanDelete', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryitem/listCanDelete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资项目-新增薪资项目 export const saveItem = params => { - delete params.formulaContent - return fetch('/api/bs/hrmsalary/salaryitem/save', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + delete params.formulaContent; + return fetch("/api/bs/hrmsalary/salaryitem/save", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资项目-更新薪资项目 export const updateItem = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/update', 'POST', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/update", "POST", params); +}; //薪资项目-薪资项目详情 export const getItemForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/getSalaryForm', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSalaryForm", "GET", params); +}; //薪资项目-添加系统薪资项目 export const saveSysItem = params => { - return fetch('/api/bs/hrmsalary/salaryitem/saveSys', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/salaryitem/saveSys", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //获取薪资项目可选的类型(与属性有联动) export const getItemTypeOption = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/listSalaryItemTypeOption', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/listSalaryItemTypeOption", "GET", params); +}; //获取公式描述 export const getFormulaDes = params => { - return WeaTools.callApi('/api/bs/hrmsalary/formula/des', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/formula/des", "GET", params); +}; // *** 公式 start *** // 获取公式变量类型 export const formualSearchGroup = params => { - return fetch('/api/bs/hrmsalary/formula/search/group', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/formula/search/group", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //获取公式变量字段 export const formualSearchField = params => { - return fetch('/api/bs/hrmsalary/formula/search/field', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/formula/search/field", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // /api/bs/hrmsalary/formula/save // 保存公式 export const saveFormual = params => { - return fetch('/api/bs/hrmsalary/formula/save', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/formula/save", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 公式测试 export const testFormual = params => { - return fetch('/api/bs/hrmsalary/formula/mock', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/formula/mock", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 根据id获取formual export const detailFormual = params => { - return fetch('/api/bs/hrmsalary/formula/detail', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return fetch("/api/bs/hrmsalary/formula/detail", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // *** 公式 end *** @@ -179,14 +179,28 @@ export const detailFormual = params => { // 列出可以删除的薪资项目 export const listCanDelete = params => { - return fetch('/api/bs/hrmsalary/salaryitem/listCanDelete', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} - + return fetch("/api/bs/hrmsalary/salaryitem/listCanDelete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +//获取哪些账套中使用了该薪资项目 +export const getSalarySobBySalaryItem = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSalarySobBySalaryItem", "GET", params); +}; +// 同步到薪资账套 +export const syncSalaryItemToSalarySobItem = params => { + return fetch("/api/bs/hrmsalary/salaryitem/syncSalaryItemToSalarySobItem ", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js index 04580369..47abe5b1 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js @@ -155,6 +155,27 @@ export const valTakeOptions = [ { key: "2", showname: "公式" }, { key: "3", showname: "SQL" } ]; +export const salarySetConditions = [ + { + items: [{ + colSpan: 1, + checkbox: false, + checkboxValue: false, + conditionType: "SELECT", + domkey: ["salarySobIds"], + fieldcol: 18, + label: "薪资账套", + lanId: 538010, + labelcol: 6, + options: [], + rules: "required|string", + multiple: true, + viewAttr: 3 + }], + title: "", + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 556b0d7e..c2c63718 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -9,6 +9,7 @@ import { columns } from "./columns"; import SlideModalTitle from "../../components/slideModalTitle"; import CustomSalaryItemSlide from "./customSalaryItemSlide"; import CustomPaginationTable from "../../components/customPaginationTable"; +import SyncToSalaryAccountSetDialog from "./syncToSalaryAccountSetDialog"; import "../socialSecurityBenefits/programme/index.less"; const { getLabel } = WeaLocaleProvider; @@ -25,7 +26,8 @@ export default class SalaryItem extends React.Component { searchValue: "", formalModalVisible: false, searchParams: { current: 1, pageSize: 10, total: 0 }, - selectedRowKeys: [] + selectedRowKeys: [], + syncSalarySetDialog: { visible: false, title: "", id: "" } }; columns.map(item => { if (item.dataIndex == "refere") { @@ -69,7 +71,10 @@ export default class SalaryItem extends React.Component { onEditItem = (record, isedit) => { this.record = record; const { salaryItemStore: { getItemForm, setEditSlideVisible } } = this.props; - this.setState({ editable: isedit, isAdd: false }); + this.setState({ + editable: isedit, isAdd: false, + syncSalarySetDialog: { ...this.state.syncSalarySetDialog, id: record.id } + }); getItemForm(record.id).then(() => { setEditSlideVisible(true); }).catch(({ errormsg }) => { @@ -308,6 +313,15 @@ export default class SalaryItem extends React.Component { ]; } else if (this.state.editable) { arrList = [ + , @@ -365,6 +379,15 @@ export default class SalaryItem extends React.Component {
+ this.setState({ + syncSalarySetDialog: { + ...this.state.syncSalarySetDialog, + visible: false, id: "", title: "" + } + })} + /> { systemItemVisible && diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index 97c79576..f02dac13 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -102,3 +102,11 @@ } } } + +.salarySetDialog { + .salarySetDialogContent { + .wea-select, .ant-select-selection, .ant-select { + width: 100%; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js new file mode 100644 index 00000000..bcaa8852 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js @@ -0,0 +1,85 @@ +/* + * Author: 黎永顺 + * name: 同步到薪资账套 + * Description: + * Date: 2023/8/31 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; +import { getSearchs } from "../../util"; +import { getSalarySobBySalaryItem } from "../../apis/item"; +import { salarySetConditions } from "./columns"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("salaryItemStore") +@observer +class SyncToSalaryAccountSetDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + conditions: [] + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + const { salaryItemStore: { salarySetform } } = nextProps; + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getSalarySobBySalaryItem(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) salarySetform.resetForm(); + } + + getSalarySobBySalaryItem = (props) => { + const { id, salaryItemStore: { salarySetform } } = props; + getSalarySobBySalaryItem({ id }).then(({ status, data }) => { + if (status) { + this.setState({ + conditions: _.map(salarySetConditions, item => { + return { + ...item, + items: _.map(item.items, o => ({ + ...o, + options: _.map(data, it => ({ key: it.id, showname: it.content })) + })) + }; + }) + }, () => { + salarySetform.initFormFields(this.state.conditions); + }); + } + }); + }; + + save = () => { + const { salaryItemStore: { salarySetform } } = this.props; + salarySetform.validateForm().then(f => { + console.log(salarySetform.getFormParams()); + if (f.isValid) { + this.setState({ loading: true }); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { salaryItemStore: { salarySetform } } = this.props; + const { conditions } = this.state; + return ( + {getLabel(537558, "确定")}]} + > +
+ {getSearchs(salarySetform, conditions, 1)} +
+
+ ); + } +} + +export default SyncToSalaryAccountSetDialog; diff --git a/pc4mobx/hrmSalary/stores/salaryItem.js b/pc4mobx/hrmSalary/stores/salaryItem.js index 3e97782f..7e7925bc 100644 --- a/pc4mobx/hrmSalary/stores/salaryItem.js +++ b/pc4mobx/hrmSalary/stores/salaryItem.js @@ -8,6 +8,8 @@ import { notNull } from "../util/validate"; const { TableStore } = WeaTableNew; export class SalaryItemStore { + @observable salarySetform = new WeaForm(); //同步薪资账套form + @observable tableStore = new TableStore(); // new table @observable sysListTableStore = new TableStore(); @observable form = new WeaForm(); // nrew 一个form From 036e59b91a78f7c8bdd309f97b1ae3ea62ad9b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 31 Aug 2023 14:43:57 +0800 Subject: [PATCH 12/77] =?UTF-8?q?feature/2.9.42308.02-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8C=E6=AD=A5=E5=88=B0=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E8=B4=A6=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/index.less | 34 ++++++++++++++++++- .../syncToSalaryAccountSetDialog.js | 18 +++++++--- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index f02dac13..b0063821 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -105,8 +105,40 @@ .salarySetDialog { .salarySetDialogContent { - .wea-select, .ant-select-selection, .ant-select { + .wea-select, .ant-select, .ant-select-selection { width: 100%; } + + .wea-select .wea-select-input .arrow { + position: absolute; + right: 4px; + top: 8px; + color: #666; + } + + .wea-select .wdb { + word-break: break-all !important; + word-wrap: break-word !important; + } + + .wea-select .wea-select-input { + height: 30px; + white-space: nowrap; + min-width: 100px; + max-width: 345px; + width: 100%; + display: inline-block; + padding: 4px 17px 4px 4px; + position: relative; + min-height: 30px; + border: 1px solid #d9d9d9; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + overflow: hidden; + } } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js index bcaa8852..e8ca847b 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js @@ -7,9 +7,9 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider } from "ecCom"; -import { Button } from "antd"; +import { Button, message } from "antd"; import { getSearchs } from "../../util"; -import { getSalarySobBySalaryItem } from "../../apis/item"; +import { getSalarySobBySalaryItem, syncSalaryItemToSalarySobItem } from "../../apis/item"; import { salarySetConditions } from "./columns"; const getLabel = WeaLocaleProvider.getLabel; @@ -53,11 +53,21 @@ class SyncToSalaryAccountSetDialog extends Component { }; save = () => { - const { salaryItemStore: { salarySetform } } = this.props; + const { salaryItemStore: { salarySetform }, id: salaryItemId } = this.props; salarySetform.validateForm().then(f => { - console.log(salarySetform.getFormParams()); if (f.isValid) { + const { salarySobIds } = salarySetform.getFormParams(); this.setState({ loading: true }); + syncSalaryItemToSalarySobItem({ salaryItemId, salarySobIds: salarySobIds.split(",") }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(38462, "同步成功!")); + this.props.onCancel(); + } else { + message.error(errormsg || getLabel(81556, "同步失败!")); + } + }).catch(() => this.setState({ loading: false })); } else { f.showErrors(); } From a5e0ca30845e79993c6423751f8698d0bd245a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 31 Aug 2023 15:02:56 +0800 Subject: [PATCH 13/77] =?UTF-8?q?=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=85=AC=E5=BC=8F=E4=BF=9D=E5=AD=98=E5=8F=82=E6=95=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ledgerSalaryItemEditSlide.js | 2 +- .../ledgerPage/components/ledgerSalaryItemTable.js | 9 +++++---- .../pages/salaryItem/customSalaryItemSlide.js | 14 +++++++++----- .../hrmSalary/pages/salaryItem/formalFormModal.js | 2 +- .../hrmSalary/pages/salaryItem/salaryItemForm.js | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemEditSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemEditSlide.js index de0c2871..d476edbd 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemEditSlide.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemEditSlide.js @@ -23,7 +23,7 @@ class LedgerSalaryItemEditSlide extends Component { const key = Object.keys(params)[0]; this.props.onUpdateRequest(request, key); }; - handleShowFormal = () => this.props.onEditFormnul(); + handleShowFormal = (salaryItemName) => this.props.onEditFormnul(salaryItemName); render() { return ( diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js index 55892da2..123b74ab 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js @@ -28,7 +28,8 @@ class LedgerSalaryItemTable extends Component { visible: false, formulaId: "", valueType: "", - dataType: "" + dataType: "", + name: "" } }; } @@ -163,13 +164,13 @@ class LedgerSalaryItemTable extends Component { originSqlContent: ((valueType.toString() === "2" && (!originFormulaContent || originFormulaContent === " ")) || (valueType.toString() === "1") || (valueType.toString() === "2" && originFormulaContent)) ? " " : originSqlContent }, salaryItemId); }; - handleEditFormnul = () => { + handleEditFormnul = (salaryItemName) => { const { salaryItemPayload, editFormulModal } = this.state; const { record } = salaryItemPayload; const { valueType, formulaId, dataType, originFormulaContent, originSqlContent } = record; this.setState({ editFormulModal: { - ...editFormulModal, visible: true, valueType, dataType, + ...editFormulModal, visible: true, valueType, dataType, name: salaryItemName, formulaId: ((valueType.toString() === "2" && (originFormulaContent || originFormulaContent !== " ")) || valueType.toString() === "3" && (originSqlContent || originSqlContent === " ")) ? formulaId : "" } }); @@ -180,7 +181,7 @@ class LedgerSalaryItemTable extends Component { editFormulModal: { ...editFormulModal, visible: false, - formulaId: "", + formulaId: "", name: "", valueType: "", dataType: "" } }); diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index fe601cc5..9e407f56 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -8,7 +8,8 @@ export default class CustomSalaryItemSlide extends React.Component { super(props); this.state = { showForm: false, - formalModalVisible: false + formalModalVisible: false, + salaryItemName: "" }; } @@ -16,9 +17,10 @@ export default class CustomSalaryItemSlide extends React.Component { this.props.onChange({ ...this.props.request, ...params }); }; - handleShowFormal = () => { + handleShowFormal = (salaryItemName) => { this.setState({ - formalModalVisible: true + formalModalVisible: true, + salaryItemName }); }; @@ -34,12 +36,13 @@ export default class CustomSalaryItemSlide extends React.Component { render() { const { request } = this.props; const { valueType, dataType, formulaId } = request; - const { formalModalVisible } = this.state; + const { formalModalVisible, salaryItemName } = this.state; return (
{formalModalVisible && this.setState({ - formalModalVisible: false + formalModalVisible: false, + salaryItemName: "" })} />}
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js index 58808c61..98c706fc 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js @@ -208,7 +208,7 @@ export default class FormalFormModal extends React.Component { }); this.parameters = result; let params = { - name: "公式1", + name: this.props.name || "公式1", description: "备注", module: "salary", useFor: "salaryitem", diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js index 73418bad..16a8a099 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js @@ -133,7 +133,7 @@ class SalaryItemForm extends Component { (type === "INPUT" && display) ? (key === "originSqlContent" || key === "originFormulaContent") && onShowFormal()} + onClick={() => (key === "originSqlContent" || key === "originFormulaContent") && onShowFormal(request["name"])} onChange={v => this.handleChangeSalaryFiledItems(key, v)}/> : (type === "SWITCH" && display) ? From cae8d86cd616dd6eb969090cbe11269f93e0a815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 1 Sep 2023 09:29:49 +0800 Subject: [PATCH 14/77] =?UTF-8?q?=E8=A7=84=E5=88=99=E8=AE=BE=E7=BD=AE-?= =?UTF-8?q?=E5=8A=A0=E8=A7=A3=E5=AF=86=E4=BF=AE=E6=94=B9=E4=B8=BA=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=BC=80=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/ruleConfig/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index 3ac96bf9..2fccbadf 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -23,7 +23,7 @@ export default class Index extends Component { orderRule: "", ascOrDesc: "", rule: "", - enctry: "", + enctry: "1", operateTaxDeclaration: "1", matchRule: "", confValue: "0", @@ -56,7 +56,7 @@ export default class Index extends Component { ascOrDesc = "", orderRule = "", showEncryptOperationButton, matchEmployeeMode: rule = "", taxDeclarationFunction: operateTaxDeclaration = "1", salaryArchiveDelete: confValue, salaryAcctEmployeeRule: matchRule, WITHDRAW_TAX_DECLARATION: withDrawTaxDeclaration = "0", - OPEN_APPLICATION_ENCRYPT: enctry = "0", extEmpsWitch = "0" + OPEN_APPLICATION_ENCRYPT: enctry = "1", extEmpsWitch = "0" } } = sysInfo; // const { data: { ascOrDesc, orderRule } } = orderRules; From 5b6480f07660e571aa9b04d31356fca0524d330a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 1 Sep 2023 11:08:35 +0800 Subject: [PATCH 15/77] =?UTF-8?q?hotfix/2.9.42308.02-=E5=B7=A5=E8=B5=84?= =?UTF-8?q?=E5=8D=95=E6=A8=A1=E6=9D=BF=E8=AE=BE=E7=BD=AE=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=A4=B1=E8=B4=A5bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/payroll/stepForm/salaryItemSettings.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js index 0113ecd5..53802244 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js @@ -86,9 +86,11 @@ class SalaryItemSettings extends Component { } }); this.setState({ - dataList: resultSalaryItemSet + dataList: resultSalaryItemSet, + itemShowNamesetting: _.filter(this.state.itemShowNamesetting, it => it.salaryItemId !== item.id) }, () => { this.props.onChangeSalaryItem(resultSalaryItemSet); + this.props.onChangeSalaryItemShowNamesetting(this.state.itemShowNamesetting); }); }; handleCloseModal = () => { From 242b96321a643d2e847635496f938a58a96633cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 1 Sep 2023 14:06:32 +0800 Subject: [PATCH 16/77] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/payroll/payrollDetail/index.js | 2 +- .../pages/payroll/payrollDetail/index.less | 10 ++++++++-- .../pages/payroll/payrollGrant/index.js | 1 + .../pages/payroll/payrollGrant/index.less | 16 +++++++++++++--- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js index 03ff17c6..6e6479c0 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js @@ -133,7 +133,7 @@ export default class PayrollDetail extends React.Component { ]; return ( -
+
导出全部]} diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.less b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.less index 9bb70233..01a180a0 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.less +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.less @@ -1,12 +1,17 @@ -.payrollGrant { +.payrollDetail { display: flex; flex-direction: column; height: 100%; + background: #f6f6f6; + + .wea-tab .wea-tab-right, .wea-input-focus { + background: #f6f6f6; + } .titleBar { height: 47px; line-height: 47px; - padding: 0 10px; + padding: 0 16px; .titleBarLeft { float: left; @@ -19,6 +24,7 @@ .tableWrapper { flex: 1; + padding: 0 16px; .ant-spin-nested-loading, .ant-spin-container { height: 100%; diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js index 9582c550..d52797f0 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js @@ -595,6 +595,7 @@ export default class PayrollGrant extends React.Component { this.pageInfo = { current, pageSize }; this.handleShowSizeChange(this.pageInfo); }} + scroll={{ y: `calc(100vh - 236px)` }} /> : renderLoading() }
diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.less b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.less index 9699454a..cd2ce262 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.less +++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.less @@ -1,8 +1,15 @@ .payrollGrant_new { + background: #f6f6f6; + height: 100%; + + .wea-tab .wea-tab-right, .wea-input-focus { + background: #f6f6f6; + } + .titleBar { height: 47px; line-height: 47px; - padding: 0 10px; + padding: 0 16px; .titleBarLeft { float: left; @@ -14,8 +21,11 @@ } .tableWrapper { - height: calc(100vh - 180.22px); - overflow: auto; + padding: 0 16px; + + .wea-new-table { + background: #FFF; + } } } From 60431599766be3587ad7a8f75b41aa3fff9da0da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 4 Sep 2023 16:48:36 +0800 Subject: [PATCH 17/77] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E5=8F=91=E8=96=AA=E5=91=98=E5=B7=A5=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E8=B0=83=E8=96=AA=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/payrollFiles/index.js | 32 +- pc4mobx/hrmSalary/pages/salaryFile/columns.js | 354 ++++++++++-------- pc4mobx/hrmSalary/pages/salaryFile/index.less | 54 ++- .../salaryArchiveEditAdjLogRecord.js | 220 +++++++++++ .../pages/salaryFile/salaryItemChangeList.js | 97 ++--- pc4mobx/hrmSalary/stores/salaryFile.js | 5 + pc4mobx/hrmSalary/util/index.js | 3 + 7 files changed, 542 insertions(+), 223 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index 74326a8f..db623a70 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -30,8 +30,8 @@ import AllWithoutPay from "./components/allWithoutPay"; import BatchSuspendsPay from "./components/batchSuspendsPay"; import SlideModalTitle from "../../components/slideModalTitle"; import SalaryFileViewSlide from "../salaryFile/saralyFileViewSlide"; -import ChangeSalaryModal from "../salaryFile/changeSalaryModal"; import { sysinfo } from "../../apis/ruleconfig"; +import SalaryArchiveEditAdjLogRecord from "../salaryFile/salaryArchiveEditAdjLogRecord"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -77,7 +77,9 @@ class Index extends Component { subcompanyIds: "" }, salaryAdjustmentInfo: {}, - changeSalaryVisible: false, + adjLogRecordDialog: { + visible: false, title: "", id: "", salaryArchiveId: "" + }, noPayDate: "", slideParams: { visible: false, @@ -624,7 +626,12 @@ class Index extends Component { } if (showOperateBtn && (selectedKey === "fixed" || selectedKey === "ext")) { arrList.push(); } selectedKey !== "stop" && arrList.push(); @@ -719,7 +726,7 @@ class Index extends Component { pageInfo, showSearchAd, slideParams, - changeSalaryVisible, + adjLogRecordDialog, paysetParams, extEmpsWitch } = this.state; @@ -884,15 +891,14 @@ class Index extends Component { }} /> )} - {changeSalaryVisible && ( - { - this.setState({ changeSalaryVisible: false }); - }} - /> - )} + this.setState({ + adjLogRecordDialog: { + adjLogRecordDialog, visible: false, title: "", id: "", salaryArchiveId: "" + } + })} + />
); } diff --git a/pc4mobx/hrmSalary/pages/salaryFile/columns.js b/pc4mobx/hrmSalary/pages/salaryFile/columns.js index 7cfdb4d9..a34d95bf 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/columns.js @@ -1,175 +1,203 @@ export const columns = [ - { - title: "姓名", - dataIndex: 'title', - key: 'title', - }, - { - title: "个税扣缴义务人", - dataIndex: 'title', - key: 'title', - }, - { - title: "部门", - dataIndex: 'title', - key: 'title', - }, - { - title: "手机号", - dataIndex: 'title', - key: 'title', - }, - { - title: "员工状态", - dataIndex: 'title', - key: 'title', - }, - { - title: "基本工资", - dataIndex: 'title', - key: 'title', - }, - { - title: "操作", - dataIndex: 'cz', - key: 'cz', - } -] + { + title: "姓名", + dataIndex: "title", + key: "title" + }, + { + title: "个税扣缴义务人", + dataIndex: "title", + key: "title" + }, + { + title: "部门", + dataIndex: "title", + key: "title" + }, + { + title: "手机号", + dataIndex: "title", + key: "title" + }, + { + title: "员工状态", + dataIndex: "title", + key: "title" + }, + { + title: "基本工资", + dataIndex: "title", + key: "title" + }, + { + title: "操作", + dataIndex: "cz", + key: "cz" + } +]; -export const changeSalaryModalColumns = [ - { - title: '薪资项目', - dataIndex: 'title', - key: 'title' - }, - { - title: '调整前', - dataIndex: 'title', - key: 'title' - }, - { - title: '调整后', - dataIndex: 'title', - key: 'title' - } -] +export const adjCondition = [ + { + items: [ + { + colSpan: 1, + conditionType: "DATEPICKER", + domkey: ["effectiveTime"], + fieldcol: 18, + label: "生效日期", + lanId: 19548, + labelcol: 6, + rules: "required", + value: "", + viewAttr: 3 + }, + { + colSpan: 1, + checkbox: false, + checkboxValue: false, + conditionType: "SELECT", + domkey: ["adjustReason"], + fieldcol: 18, + label: "调整原因", + lanId: 1897, + labelcol: 6, + options: [], + rules: "required", + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["description"], + fieldcol: 18, + label: "说明", + lanId: 25734, + labelcol: 6, + value: "", + viewAttr: 2 + } + ], + title: "调薪信息", + defaultshow: true + } +]; export const slideSalaryItemColumns = [ - { - title: "姓名", - dataIndex: 'title', - key: 'title' - }, - { - title: "员工状态", - dataIndex: 'title', - key: 'title' - }, - { - title: "部门", - dataIndex: 'title', - key: 'title' - }, - { - title: "薪资项目", - dataIndex: 'title', - key: 'title' - }, - { - title: "调整前", - dataIndex: 'title', - key: 'title' - }, - { - title: "调整后", - dataIndex: 'title', - key: 'title' - }, - { - title: "调整原因", - dataIndex: 'title', - key: 'title' - }, - { - title: "生效日期", - dataIndex: 'title', - key: 'title' - }, - { - title: "操作人", - dataIndex: 'title', - key: 'title' - }, - { - title: "操作日期", - dataIndex: 'title', - key: 'title' - }, - { - title: "说明", - dataIndex: 'title', - key: 'title' - } -] + { + title: "姓名", + dataIndex: "title", + key: "title" + }, + { + title: "员工状态", + dataIndex: "title", + key: "title" + }, + { + title: "部门", + dataIndex: "title", + key: "title" + }, + { + title: "薪资项目", + dataIndex: "title", + key: "title" + }, + { + title: "调整前", + dataIndex: "title", + key: "title" + }, + { + title: "调整后", + dataIndex: "title", + key: "title" + }, + { + title: "调整原因", + dataIndex: "title", + key: "title" + }, + { + title: "生效日期", + dataIndex: "title", + key: "title" + }, + { + title: "操作人", + dataIndex: "title", + key: "title" + }, + { + title: "操作日期", + dataIndex: "title", + key: "title" + }, + { + title: "说明", + dataIndex: "title", + key: "title" + } +]; export const slieAgentColumns = [ - { - title: "姓名", - dataIndex: 'title', - key: 'title' - }, - { - title: "员工状态", - dataIndex: 'title', - key: 'title' - }, - { - title: "部门", - dataIndex: 'title', - key: 'title' - }, - { - title: "调整前", - dataIndex: 'title', - key: 'title' - }, - { - title: "调整后", - dataIndex: 'title', - key: 'title' - }, - { - title: "调整原因", - dataIndex: 'title', - key: 'title' - }, - { - title: "生效日期", - dataIndex: 'title', - key: 'title' - }, - { - title: "操作人", - dataIndex: 'title', - key: 'title' - }, - { - title: "操作日期", - dataIndex: 'title', - key: 'title' - }, - { - title: "说明", - dataIndex: 'title', - key: 'title' - } -] + { + title: "姓名", + dataIndex: "title", + key: "title" + }, + { + title: "员工状态", + dataIndex: "title", + key: "title" + }, + { + title: "部门", + dataIndex: "title", + key: "title" + }, + { + title: "调整前", + dataIndex: "title", + key: "title" + }, + { + title: "调整后", + dataIndex: "title", + key: "title" + }, + { + title: "调整原因", + dataIndex: "title", + key: "title" + }, + { + title: "生效日期", + dataIndex: "title", + key: "title" + }, + { + title: "操作人", + dataIndex: "title", + key: "title" + }, + { + title: "操作日期", + dataIndex: "title", + key: "title" + }, + { + title: "说明", + dataIndex: "title", + key: "title" + } +]; export const dataSource = [ - { - title: "测试" - } + { + title: "测试" + } ]; diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.less b/pc4mobx/hrmSalary/pages/salaryFile/index.less index 506beb63..ebc4a8a4 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.less +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.less @@ -73,7 +73,6 @@ } } - .salaryFileSlide { padding: 10px 20px; @@ -125,7 +124,6 @@ } } - .salaryFileTabWrapper { .searchPanel { position: absolute; @@ -169,3 +167,55 @@ } } } + +.adjustItem-layout { + .ant-table-fixed td { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +} + +.adjLogRecordDialogContent { + background: #f6f6f6; + padding: 16px; + height: 100%; + overflow-y: auto; + + .empty { + text-align: center; + background: transparent; + margin-bottom: 20px; + padding: 30px 50px; + } + + .wea-search-group:first-child { + margin-bottom: 16px; + } + + .wea-search-group { + background: #FFF; + padding: 0; + border: 1px solid #e5e5e5; + border-bottom: none; + } + + .wea-content, .wea-form-cell { + padding: 0; + } + + .wea-form-item { + padding: 5px 16px; + border-bottom: 1px solid #e5e5e5; + } + + .wea-select, .ant-select { + width: 100%; + } + + .ant-select-selection { + width: 100%; + height: 30px; + border-radius: 0; + } +} diff --git a/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js b/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js new file mode 100644 index 00000000..cceb5f89 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js @@ -0,0 +1,220 @@ +/* + * Author: 黎永顺 + * name: 薪资档案-调薪 + * Description: + * Date: 2023/9/4 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider, WeaSearchGroup, WeaTableEdit, WeaTools } from "ecCom"; +import { Button, message, Spin } from "antd"; +import { + editSingleSalaryItem, + getSalaryItemAdjustBeforeValue, + getSalaryItemForm, + getSingleSalaryItemInfo, + saveSalaryItem +} from "../../apis/archive"; +import { inject, observer } from "mobx-react"; +import { adjCondition } from "./columns"; +import { getDomkes, getSearchs } from "../../util"; +import moment from "moment"; + +const { getLabel } = WeaLocaleProvider; +const getKey = WeaTools.getKey; +const APIFox = { + save: saveSalaryItem, + edit: editSingleSalaryItem, + saveForm: getSalaryItemForm, + editForm: getSingleSalaryItemInfo +}; + +@inject("salaryFileStore") +@observer +class SalaryArchiveEditAdjLogRecordDialog extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false, saveLoading: false, + salaryArchiveItemDetail: {}, canOperator: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + const { id, visible, salaryFileStore: { adjForm, initAdjForm } } = nextProps; + if (nextProps.visible !== this.props.visible && visible) { + this.getSingleSalaryItemInfo(nextProps); + } else { + adjForm.resetForm(); + initAdjForm(); + } + } + + getSingleSalaryItemInfo = (props) => { + const { salaryFileStore: { adjForm }, id, salaryArchiveId: salaryArchiveItemId } = props; + this.setState({ loading: true }); + APIFox[id ? "editForm" : "saveForm"](id ? { id } : { salaryArchiveItemId }) + .then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { salaryArchiveItemForm, salaryArchiveItemDetail, canOperator } = data; + const { adjustReasonList } = salaryArchiveItemForm; + this.setState({ + canOperator, salaryArchiveItemDetail, + conditions: _.map(adjCondition, item => { + return { + ...item, + title: getLabel(111, "调薪信息"), + items: _.map(item.items, o => { + if (getKey(o) === "adjustReason") { + return { + ...o, + options: _.map(adjustReasonList, it => ({ key: it.id, showname: it.content })) + }; + } + return { ...o }; + }) + }; + }) + }, () => { + adjForm.initFormFields(this.state.conditions); + _.map(getDomkes(this.state.conditions), domkey => { + adjForm.updateFields({ + [domkey]: salaryArchiveItemForm[domkey] || "" + }); + }); + }); + } + }).catch(() => this.setState({ loading: false })); + }; + getSalaryItemAdjustBeforeValue = (salaryItemId) => { + const payload = { + salaryArchiveId: this.props.salaryArchiveId, + salaryItemId + }; + getSalaryItemAdjustBeforeValue(payload).then(({ status, data }) => { + if (status) { + const { salaryArchiveItemDetail } = this.state; + const { list } = salaryArchiveItemDetail; + this.setState({ + salaryArchiveItemDetail: { + ...salaryArchiveItemDetail, + list: _.map(list, o => { + if (o.salaryItem === salaryItemId) { + return { ...o, salaryBefore: data }; + } + return { ...o }; + }) + } + }); + } + }); + }; + save = () => { + const { salaryFileStore: { adjForm, fetchSingleSalaryItemList, getArchiveForm } } = this.props; + const { pass } = this.tableEdit.refs.edit.doRequiredCheck(); + adjForm.validateForm().then(f => { + if (f.isValid) { + if (!pass) return; + const { salaryArchiveId, id: salaryArchiveItemId } = this.props; + const { salaryArchiveItemDetail, canOperator } = this.state; + const { list } = salaryArchiveItemDetail; + let payload = { + ...adjForm.getFormParams(), salaryArchiveId, + effectiveTime: moment(adjForm.getFormParams().effectiveTime).format("YYYY-MM-DD"), + salaryArchiveItems: _.map(list, o => ({ salaryItemId: o.salaryItem, adjustValue: o.adjustAfter })) + }; + if (salaryArchiveItemId) { + payload = { ...payload, canOperator, salaryArchiveItemId }; + } + this.setState({ saveLoading: true }); + APIFox[salaryArchiveItemId ? "edit" : "save"](payload).then(({ status, errormsg }) => { + this.setState({ saveLoading: false }); + if (status) { + message.success(getLabel(22619, "保存成功!")); + this.props.onCancel(); + fetchSingleSalaryItemList({ salaryArchiveId }); + getArchiveForm(salaryArchiveId); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ saveLoading: false })); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { salaryFileStore: { adjForm }, id } = this.props; + const { loading, saveLoading, salaryArchiveItemDetail, conditions } = this.state; + const { salaryItemList, list } = salaryArchiveItemDetail; + const adjColumns = [ + { + title: "薪资项目", + dataIndex: "salaryItem", + key: "salaryItem", + com: [{ + options: _.map(salaryItemList, o => ({ key: o.id, showname: o.content })), + type: "SELECT", viewAttr: id ? 1 : 3, key: "salaryItem", + onChange: (v) => this.getSalaryItemAdjustBeforeValue(v) + }], + colSpan: 1, + width: "40%" + }, + { + title: getLabel(111, "调整前"), + dataIndex: "salaryBefore", + key: "salaryBefore", + com: [{ label: "", type: "INPUT", viewAttr: 1, key: "salaryBefore" }], + colSpan: 1, + width: "30%" + }, + { + title: getLabel(111, "调整后"), + dataIndex: "adjustAfter", + key: "adjustAfter", + com: [{ label: "", type: "INPUTNUMBER", precision: 3, viewAttr: 3, key: "adjustAfter" }], + colSpan: 1, + width: "30%" + } + ]; + return ( + {getLabel(537558, "保存")}]} + > +
+ { + !loading ? + {getSearchs(adjForm, conditions, 1)} + + this.tableEdit = dom} deleteConfirm + columns={adjColumns} datas={list} showCopy={false} + onChange={o => this.setState({ + salaryArchiveItemDetail: { + ...salaryArchiveItemDetail, list: o + } + })} + /> + + :
+ } +
+
+ ); + } +} + +export default SalaryArchiveEditAdjLogRecordDialog; diff --git a/pc4mobx/hrmSalary/pages/salaryFile/salaryItemChangeList.js b/pc4mobx/hrmSalary/pages/salaryFile/salaryItemChangeList.js index 49d82cd8..410e4a6d 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/salaryItemChangeList.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/salaryItemChangeList.js @@ -1,10 +1,11 @@ import React from "react"; import { Menu, message, Modal, Popover } from "antd"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; import { inject, observer } from "mobx-react"; -import ChangeSalaryModal from "./changeSalaryModal"; import { deleteSalaryItem } from "../../apis/archive"; -import UnifiedTable from "../../components/UnifiedTable"; +import SalaryArchiveEditAdjLogRecord from "./salaryArchiveEditAdjLogRecord"; +const { getLabel } = WeaLocaleProvider; @inject("salaryFileStore") @observer export default class SalaryItemChangeList extends React.Component { @@ -12,6 +13,9 @@ export default class SalaryItemChangeList extends React.Component { super(props); this.state = { changeSalaryVisible: false, + adjLogRecordDialog: { + visible: false, title: "", id: "", salaryArchiveId: "" + }, recordId: "" }; this.searchParams = {}; @@ -25,11 +29,11 @@ export default class SalaryItemChangeList extends React.Component { handleEdit = (record) => { this.setState({ - recordId: record.id - }, () => { - this.setState({ - changeSalaryVisible: true - }); + adjLogRecordDialog: { + ...this.state.adjLogRecordDialog, + visible: true, title: getLabel(542686, "调薪"), id: record.id, + salaryArchiveId: this.props.id + } }); }; deleteSalaryItem = (salaryArchiveItemId) => { @@ -58,11 +62,30 @@ export default class SalaryItemChangeList extends React.Component { const { salaryFileStore: { singleSalaryItemList }, selectedKey } = this.props; let columns = []; if (singleSalaryItemList.columns) { - columns = [...singleSalaryItemList.columns]; + columns = _.map([...singleSalaryItemList.columns], o => { + const { dataIndex } = o; + if (dataIndex === "adjustItem") { + return { ...o, width: 100, fixed: "left", render: text => ({text}) }; + } + let width = ""; + switch (o) { + case "adjustBefore": + case "adjustAfter": + case "operateTime": + width = "20%"; + break; + case "effectiveTime": + width = "15%"; + break; + default: + width = "10%"; + break; + } + return { ...o, width, render: text => ({text}) }; + }); if (selectedKey === "fixed") { columns = [...columns, { - dataIndex: "operate", - title: "操作", + dataIndex: "operate", fixed: "right", width: 120, title: "操作", render: (text, record) => { return
this.handleEdit(record)}>编辑 @@ -90,45 +113,29 @@ export default class SalaryItemChangeList extends React.Component { } render() { - const { salaryFileStore } = this.props; + const { salaryFileStore } = this.props, { adjLogRecordDialog } = this.state; const { singleSalaryItemList } = salaryFileStore; + const pageInfo = { current: singleSalaryItemList.pageNum, pageSize: 10, total: singleSalaryItemList.total }; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + onChange: current => this.handlePageChange(current) + }; return (
- { - if (item.dataIndex !== "operate") { - return { - ...item, - render: (text) => { - return {text}; - } - }; - } - return { ...item }; - }) - } - dataSource={singleSalaryItemList.list ? singleSalaryItemList.list : []} - pagination={{ - onChange: (value) => { - this.handlePageChange(value); - }, - total: singleSalaryItemList.total, - showTotal: (total) => `共 ${total} 条`, - current: singleSalaryItemList.pageNum - }} - xWidth={this.getColumns().length * 100} + + this.setState({ + adjLogRecordDialog: { + adjLogRecordDialog, visible: false, title: "", id: "", salaryArchiveId: "" + } + })} /> - { - this.state.changeSalaryVisible && { - this.setState({ changeSalaryVisible: false }); - }} - /> - }
); } diff --git a/pc4mobx/hrmSalary/stores/salaryFile.js b/pc4mobx/hrmSalary/stores/salaryFile.js index a0e213c7..de262e8f 100644 --- a/pc4mobx/hrmSalary/stores/salaryFile.js +++ b/pc4mobx/hrmSalary/stores/salaryFile.js @@ -9,6 +9,9 @@ import { notNull } from "../util/validate"; const { TableStore } = WeaTableNew; export class salaryFileStore { + @observable adjForm = new WeaForm(); // 调薪form + + @observable tableStore = new TableStore(); // new table @observable form = new WeaForm(); // nrew 一个form @observable condition = []; // 存储后台得到的form数据 @@ -41,6 +44,8 @@ export class salaryFileStore { setSalaryIncreaseUrl = data => (this.salaryIncreaseUrl = data); @action("设置薪资档案项") setAdjustSalaryItems = data => (this.adjustSalaryItems = data); + @action("调薪初始化form") + initAdjForm = () => (this.adjForm = new WeaForm()); // ** 设置导入参数 start ** @action setPreviewDataSource = (previewDataSource) => { diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index 702a281b..6e864a59 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -106,3 +106,6 @@ export const format_with_regex = (number) => { }); }; +export const getDomkes = (conditions) => { + return _.map(conditions[0].items, it => it.domkey[0]); +}; From bc3632e0542967c4450d42a9dab8a51488fff39b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 4 Sep 2023 18:13:19 +0800 Subject: [PATCH 18/77] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E5=8F=91=E8=96=AA=E5=91=98=E5=B7=A5=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E8=B0=83=E8=96=AA=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryFile/salaryArchiveEditAdjLogRecord.js | 7 ++++--- .../pages/salaryFile/salaryItemChangeList.js | 12 +++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js b/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js index cceb5f89..a1656d53 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js @@ -120,7 +120,7 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component { const { list } = salaryArchiveItemDetail; let payload = { ...adjForm.getFormParams(), salaryArchiveId, - effectiveTime: moment(adjForm.getFormParams().effectiveTime).format("YYYY-MM-DD"), + effectiveTime: moment(new Date(adjForm.getFormParams().effectiveTime)).format("YYYY-MM-DD"), salaryArchiveItems: _.map(list, o => ({ salaryItemId: o.salaryItem, adjustValue: o.adjustAfter })) }; if (salaryArchiveItemId) { @@ -173,7 +173,7 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component { title: getLabel(111, "调整后"), dataIndex: "adjustAfter", key: "adjustAfter", - com: [{ label: "", type: "INPUTNUMBER", precision: 3, viewAttr: 3, key: "adjustAfter" }], + com: [{ label: "", type: "INPUTNUMBER", otherParams: { precision: 3 }, viewAttr: 3, key: "adjustAfter" }], colSpan: 1, width: "30%" } @@ -184,7 +184,7 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component { scalable hasScroll className="declareResultDialog" initLoadCss style={{ width: 800, - height: 606.6, + height: 406.6, minHeight: 200, minWidth: 380, maxHeight: "80%", @@ -202,6 +202,7 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component { this.tableEdit = dom} deleteConfirm columns={adjColumns} datas={list} showCopy={false} + showAdd={!id} showDelete={!id} onChange={o => this.setState({ salaryArchiveItemDetail: { ...salaryArchiveItemDetail, list: o diff --git a/pc4mobx/hrmSalary/pages/salaryFile/salaryItemChangeList.js b/pc4mobx/hrmSalary/pages/salaryFile/salaryItemChangeList.js index 410e4a6d..21b8042a 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/salaryItemChangeList.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/salaryItemChangeList.js @@ -1,5 +1,5 @@ import React from "react"; -import { Menu, message, Modal, Popover } from "antd"; +import { message, Modal } from "antd"; import { WeaLocaleProvider, WeaTable } from "ecCom"; import { inject, observer } from "mobx-react"; import { deleteSalaryItem } from "../../apis/archive"; @@ -89,14 +89,8 @@ export default class SalaryItemChangeList extends React.Component { render: (text, record) => { return
this.handleEdit(record)}>编辑 - this.deleteSalaryItem(record.id)}> - 删除 - } title=""> - - + this.deleteSalaryItem(record.id)}>{getLabel(535052, "删除")}
; } }]; From 2a40afb7b4e6739d707405cde01d1123133d92c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 5 Sep 2023 15:14:05 +0800 Subject: [PATCH 19/77] =?UTF-8?q?feature=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A1=A3=E6=A1=88=E6=B7=BB=E5=8A=A0=E9=9D=9E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/welfareArchive.js | 4 + .../importDialog/components/impStep1.js | 86 +++++++++++ .../importDialog/components/impStep3.js | 51 ++++++ .../components/importDialog/index.js | 135 ++++++++++++++++ .../components/importDialog/index.less | 145 ++++++++++++++++++ .../archives/config/index.js | 9 +- .../socialSecurityBenefits/archives/index.js | 21 ++- 7 files changed, 444 insertions(+), 7 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/importDialog/components/impStep1.js create mode 100644 pc4mobx/hrmSalary/components/importDialog/components/impStep3.js create mode 100644 pc4mobx/hrmSalary/components/importDialog/index.js create mode 100644 pc4mobx/hrmSalary/components/importDialog/index.less diff --git a/pc4mobx/hrmSalary/apis/welfareArchive.js b/pc4mobx/hrmSalary/apis/welfareArchive.js index a38f22ce..e86e909e 100644 --- a/pc4mobx/hrmSalary/apis/welfareArchive.js +++ b/pc4mobx/hrmSalary/apis/welfareArchive.js @@ -13,6 +13,10 @@ export const getCondition = params => { export const queryList = (params) => { return postFetch("/api/bs/hrmsalary/archives/getTable", params); }; +//社保福利档案_非系统人员列表 +export const getExtTable = (params) => { + return postFetch("/api/bs/hrmsalary/archives/getExtTable", params); +}; //社保福利档案列表 export const queryInsuranceTabTotal = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/archives/queryInsuranceTabTotal", params); diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js new file mode 100644 index 00000000..9e24dbf5 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -0,0 +1,86 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤一 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Icon, Upload, message } from "antd"; + +const Dragger = Upload.Dragger; +const { getLabel } = WeaLocaleProvider; + +class ImpStep1 extends Component { + constructor(props) { + super(props); + this.state = { + fileList: [] + }; + } + + handleChange = (data) => { + const { fileList, file } = data; + if (file.response && typeof (file.response) != "undefined") message.success(getLabel(111, "上传成功")); + this.setState({ fileList }); + }; + + render() { + const { fileList } = this.state; + const dragger = { + accept: ".xlsx", + name: "file", + multiple: false, + action: "/api/doc/upload/uploadFile", + fileList, + onChange: this.handleChange + }; + return ( +
+ {/* 导入选项 */} + { + this.props.importParams && +
+
{getLabel(543201, "导入选项")}
+ {this.props.importParams} +
+ } +
{getLabel(543202, "导入Excel")}
+

+ +

+

+

{getLabel(543203, "点击或将文件拖拽到此区域上传")}

+

{getLabel(543204, "支持单个或批量上传,严禁上传公司内部资料及其他违禁文件")}

+
+ +

+ +
+
{getLabel(27577, "操作步骤")}
+

+ {`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}   + {getLabel(543207, "点击这里下载模板")} +

+

{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}

+

{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}

+

+ {`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`} +

+
+ +
+
{getLabel(543223, "Excel文件说明")}
+

{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}

+

{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}

+

{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}

+
+ +
+ ); + } +} + +export default ImpStep1; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js new file mode 100644 index 00000000..481813b4 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js @@ -0,0 +1,51 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤3 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import successImg from "../../importModal/success.svg"; + +const getLabel = WeaLocaleProvider.getLabel; + +class ImpStep3 extends Component { + render() { + const { importResult } = this.props; + return ( +
+ { + !_.isEmpty(importResult) ? +
+

+

+ {getLabel(389249, "已导入")} + {importResult.successCount}   + {`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`} + {importResult.errorCount}  {getLabel(30690, "条数据")} +

+
: +
+

{getLabel(111, "导入失败")}

+
+ } + { + !_.isEmpty(importResult.errorData) && + + } +
+ ); + } +} + +export default ImpStep3; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js new file mode 100644 index 00000000..49956e37 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -0,0 +1,135 @@ +/* + * Author: 黎永顺 + * name: 导入弹框-步骤条 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { Button, message, Modal } from "antd"; +import { WeaDialog, WeaLocaleProvider, WeaSteps } from "ecCom"; +import ImpStep1 from "./components/impStep1"; +import ImpStep3 from "./components/impStep3"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; +const Step = WeaSteps.Step; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + current: 0 + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (JSON.stringify(nextProps.importResult) !== JSON.stringify(this.props.importResult)) { + this.setState({ + current: this.state.current + 1 + }); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ current: 0 }); + } + + renderChildren = () => { + const { current } = this.state; + const { importParams, link, excludeKey, importResult } = this.props; + let CurrentDom = null; + switch (current) { + case 0: + CurrentDom = this.step1Ref = dom}/>; + break; + case 1: + CurrentDom = null; + if (excludeKey) { + CurrentDom = ; + } + break; + case 2: + CurrentDom = null; + break; + default: + CurrentDom = null; + break; + } + return CurrentDom; + }; + + /* + * Author: 黎永顺 + * Description: 下一步 + * Params: + * Date: 2023/8/11 + */ + handleNext = () => { + const { params } = this.props; + const { fileList } = this.step1Ref.state; + if (!_.isEmpty(params)) { + if (!Object.values(params).every(o => !!o)) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } + } + if (_.isEmpty(fileList)) { + message.error(getLabel(111, "请先上传EXCEL文件")); + return; + } + const [file] = fileList; + const { response } = file; + this.props.nextCallback(response.data.fileid); + }; + + render() { + const { current } = this.state; + const stepData = [ + { key: 0, label: getLabel(543202, "上传EXCEL") }, + { key: 1, label: getLabel(543200, "数据预览") }, + { key: 2, label: getLabel(502835, "导入数据") } + ]; + const btns = [ + , + , + + ]; + return ( + +
+
+ + {/*this.props.key: 不需要展示的步骤*/} + { + _.map(_.filter(stepData, item => item.key !== this.props.excludeKey), it => ( + )) + } + +
+
+ { + this.renderChildren() + } +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.less b/pc4mobx/hrmSalary/components/importDialog/index.less new file mode 100644 index 00000000..8e4dbb53 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/index.less @@ -0,0 +1,145 @@ +.importBox { + .importCont { + padding: 16px 8px; + + .weapp-batch-impsteps-picker-content-imp-steps { + width: 80%; + margin: 0 auto; + } + + .weapp-batch-impsteps-picker { + margin: 16px auto; + + .weapp-batch-impsteps-picker-content-imp-step1 { + width: 98%; + background-color: #fff; + margin: 8px auto; + border-radius: 3px; + padding: 1px 12px; + + .weapp-batch-impsteps-picker-content-imp-step1 div { + color: #111; + line-height: 22px; + } + + .weapp-salary-tb-border-bottom .weapp-salary-tb-filter.weapp-salary-import-param { + box-sizing: border-box; + padding: 16px; + height: auto; + flex-wrap: wrap; + width: 100%; + } + + .weapp-salary-import-param { + border: 1px solid #ebedf0; + padding: 8px; + margin: 4px 0 14px; + } + + .weapp-salary-tb-filter { + display: flex; + flex-wrap: wrap; + align-items: center; + height: 46px; + } + + .weapp-salary-tb-border-bottom .weapp-salary-tb-filter.weapp-salary-import-param .tbf-item { + display: flex; + justify-content: flex-start !important; + } + + .weapp-salary-tb-filter .tbf-item { + padding: 0 20px 0 0; + display: flex; + align-items: center; + font-size: 12px; + color: #111; + height: 40px; + } + + .weapp-salary-tb-filter .tbf-item > .tbfi-label { + flex-basis: 100px; + flex-shrink: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-right: 10px; + color: #666; + } + + .draggerUploadWrapper { + margin: 16px 0 0; + + .ant-upload-drag-container { + padding: 24px 0 16px; + + .iconUpload { + i { + color: #5d9cec; + font-size: 43px; + } + } + + .uplaod-title { + font-size: 14px; + color: #333; + height: 24px; + line-height: 24px; + margin-top: 8px; + } + + .uplaod-subTitle { + height: 22px; + font-size: 12px; + color: #666; + text-align: center; + line-height: 22px; + } + } + } + + .bottom-border, .description { + margin-top: 12px; + + p { + font-size: 12px; + color: #666; + line-height: 15px; + margin: 12px 0; + } + } + + .bottom-border { + border-bottom: 1px solid #e5e5e5; + + .weapp-salary-link { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: #5d9cec; + } + } + + } + } + + .weapp-batch-impsteps-picker-content-imp-step3 { + .weapp-batch-impsteps-picker-spinText { + position: relative; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + padding-top: 80px; + padding-bottom: 80px; + text-align: center; + + p { + margin: 14px 0; + } + } + } + + } +} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js index de89e096..84bcb6ff 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js @@ -26,5 +26,12 @@ export const tabCondition = [ showcount: true, title: "停缴员工", viewcondition: "stop" - } + }, + { + color: "#000000", + groupid: "ext", + showcount: true, + title: "非系统人员", + viewcondition: "ext" + }, ]; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index cab89a87..329dc99e 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -19,6 +19,10 @@ import { salaryArchiveDelete } from "../../../apis/payrollFiles"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; +const APILIST = { + runStatuses: API["queryList"], + extWelArchiveList: API["getExtTable"] +}; @inject("archivesStore", "taxAgentStore") @observer export default class Archives extends React.Component { @@ -78,7 +82,7 @@ export default class Archives extends React.Component { const formParams = form.getFormParams() || {}; const payload = { ...pageInfo }; this.setState({ loading: { ...loading, query: true } }); - API.queryList({ ...formParams, ...payload, ...params }).then(({ data, status }) => { + APILIST[_.keys(params)[0]]({ ...formParams, ...payload, ...params }).then(({ data, status }) => { this.setState({ loading: { ...loading, query: false } }); if (status) { const { pageInfo: paganition, columns, datas: dataSource } = data; @@ -375,9 +379,12 @@ export default class Archives extends React.Component { case "suspend": this.queryList({ runStatuses: ["3"] }); break; - default: + case "stop": this.queryList({ runStatuses: ["4", "5"] }); break; + default: + this.queryList({ extWelArchiveList: true }); + break; } }; handleMenuBtnClick = () => { @@ -564,13 +571,15 @@ export default class Archives extends React.Component { {/*
4、数据进入【待减员】规则的第四种情况下,若还需要在当前个税扣缴义务人下进行缴纳的话,当前该员工的【待减员】数据进行【删除待办】操作即可;若不在该个税扣缴义务人下继续缴纳,维护好最后缴纳月后进行【减员】操作,员工进入【停缴员工】;
*/}
; break; - default: + case "stop": dom =
1、不需要缴纳社保福利的员工,保存在【停缴员工】;
{/*
2、【停缴员工】点击取消停缴,数据会回退到上次的位置(从【待减员】减员到停缴员工的,点击停缴返回到【在缴员工】,不返回到【待减员】);
*/} {/*
3、若员工的社保福利从一个个税扣缴义务人下转到另一个个税扣缴义务人下去缴纳,则在转后的个税扣缴义务人的【待增员】中进行增员操作成功后,员工进入待【在缴员工】,而在原个税扣缴义务人下的【停缴员工】中,该员工数据将会被删除;是否开启分权员工的档案数据都只保存一份;
*/}
; break; + default: + break; } return dom; }; @@ -719,7 +728,7 @@ export default class Archives extends React.Component { } type="ghost"> 导出全部 - ] : [ + ] : selectedKey === "stop" ? [ } @@ -733,7 +742,7 @@ export default class Archives extends React.Component { } type="ghost"> 导出全部 - ]; + ] : []; const pagination = { current: pageInfo.current, @@ -807,7 +816,7 @@ export default class Archives extends React.Component { xWidth={this.getColumns().length * 120} /> { - !_.isEmpty(this.getColumns()) && + !_.isEmpty(this.getColumns()) && selectedKey !== "ext" && {this.getTipChildren()} } From bb1e328c9209e8cd19c786bd9cbe8d70b44a137a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 5 Sep 2023 16:49:26 +0800 Subject: [PATCH 20/77] =?UTF-8?q?feature=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A1=A3=E6=A1=88=E6=B7=BB=E5=8A=A0=E9=9D=9E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../importDialog/components/impStep1.js | 3 +- .../components/importDialog/index.js | 7 +-- .../socialSecurityBenefits/archives/index.js | 52 ++++++++++++++++--- pc4mobx/hrmSalary/util/url.js | 15 +++--- 4 files changed, 59 insertions(+), 18 deletions(-) diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js index 9e24dbf5..e8a3f662 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -62,7 +62,8 @@ class ImpStep1 extends Component {

{`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}   {getLabel(543207, "点击这里下载模板")} + target="_blank">{getLabel(543207, "点击这里下载模板")}   + {this.props.exportDataDom}

{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}

{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}

diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js index 49956e37..bfaf70cf 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.js +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -33,11 +33,12 @@ class Index extends Component { renderChildren = () => { const { current } = this.state; - const { importParams, link, excludeKey, importResult } = this.props; + const { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props; let CurrentDom = null; switch (current) { case 0: - CurrentDom = this.step1Ref = dom}/>; + CurrentDom = this.step1Ref = dom}/>; break; case 1: CurrentDom = null; @@ -74,7 +75,7 @@ class Index extends Component { } } if (_.isEmpty(fileList)) { - message.error(getLabel(111, "请先上传EXCEL文件")); + message.warning(getLabel(111, "请先上传EXCEL文件")); return; } const [file] = fileList; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 329dc99e..864a555b 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -2,7 +2,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; import { Button, Dropdown, Menu, message, Modal, Popover } from "antd"; -import { WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom"; +import { WeaCheckbox, WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom"; import { getSearchs, renderLoading } from "../../../util"; import BaseForm from "./baseForm"; import SlideModalTitle from "../../../components/slideModalTitle"; @@ -14,8 +14,9 @@ import * as API from "../../../apis/welfareArchive"; import ImportModal from "../../../components/importModal"; import TipLabel from "../../../components/TipLabel"; import UnifiedTable from "../../../components/UnifiedTable"; -import { convertToUrlString } from "../../../util/url"; +import { convertToUrlString, getURLParameters } from "../../../util/url"; import { salaryArchiveDelete } from "../../../apis/payrollFiles"; +import ImportDialog from "../../../components/importDialog"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -50,14 +51,19 @@ export default class Archives extends React.Component { stayAdd: 0, paying: 0, stayDel: 0, - stopPay: 0 + stopPay: 0, + ext: 0 }, pageInfo: { current: 1, pageSize: 10, total: 0 }, - salaryArchiveDelete: "" //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是 + salaryArchiveDelete: "", //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是 + importDialog: { + visible: false, title: "", nextloading: false, + link: "" + } }; this.record = {}; } @@ -593,7 +599,8 @@ export default class Archives extends React.Component { dataSource: dataSourceActive, pageInfo, tabCount, - loading + loading, + importDialog } = this.state; const { form, condition, showSearchAd, setShowSearchAd, @@ -742,7 +749,15 @@ export default class Archives extends React.Component { } type="ghost"> 导出全部 - ] : []; + ] : [ + ]; const pagination = { current: pageInfo.current, @@ -887,6 +902,31 @@ export default class Archives extends React.Component { this.setState({ selectedTab: "0" }); })}/> } + this.setState(({ + importDialog: { + visible: false, title: "", nextloading: false, + link: "" + } + }))} + exportDataDom={ + { + const payload = { exportData: val === "1" }; + this.setState(({ + importDialog: { + ...importDialog, + link: `/api/bs/hrmsalary/scheme/template/export?extWelArchiveList=true&${convertToUrlString(payload)}` + } + })); + }} + /> + } + nextCallback={()=>{}} + /> { this.state.importVisible && { diff --git a/pc4mobx/hrmSalary/util/url.js b/pc4mobx/hrmSalary/util/url.js index a69b4f81..d2802383 100644 --- a/pc4mobx/hrmSalary/util/url.js +++ b/pc4mobx/hrmSalary/util/url.js @@ -1,11 +1,10 @@ -// export const getQueryString = (name) => { -// let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); -// let r = window.location.hash.split("?")[1].match(reg); -// if (r != null) { -// return decodeURIComponent(r[2]); -// }; -// return null; -// } +export const getURLParameters = (url) => + (url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce( + (a, v) => ( + (a[v.slice(0, v.indexOf("="))] = v.slice(v.indexOf("=") + 1)), a + ), + {} + ); export const getQueryString = (variable) => { let split = window.location.hash.split("?"); From f593e9720756b087521eb86640b1ba8348d78335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 6 Sep 2023 10:19:35 +0800 Subject: [PATCH 21/77] =?UTF-8?q?feature=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A1=A3=E6=A1=88=E6=B7=BB=E5=8A=A0=E9=9D=9E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../importDialog/components/impStep1.js | 6 +- .../importDialog/components/impStep2.js | 49 ++++++++++++++++ .../components/importDialog/index.js | 57 ++++++++++++------- .../components/importDialog/index.less | 2 - .../socialSecurityBenefits/archives/index.js | 32 ++++++++--- .../standingBookDetail/components/index.less | 4 -- pc4mobx/hrmSalary/stores/archives.js | 2 +- 7 files changed, 115 insertions(+), 37 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/importDialog/components/impStep2.js diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js index e8a3f662..6ab09b3e 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; -import { Icon, Upload, message } from "antd"; +import { Icon, message, Upload } from "antd"; const Dragger = Upload.Dragger; const { getLabel } = WeaLocaleProvider; @@ -21,8 +21,8 @@ class ImpStep1 extends Component { handleChange = (data) => { const { fileList, file } = data; - if (file.response && typeof (file.response) != "undefined") message.success(getLabel(111, "上传成功")); - this.setState({ fileList }); + if (file.response && typeof (file.response) != "undefined" && file.status !== "removed") message.success(getLabel(111, "上传成功")); + this.setState({ fileList: fileList.slice(-1) }); }; render() { diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js new file mode 100644 index 00000000..8a7373d4 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js @@ -0,0 +1,49 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤二 + * Description: + * Date: 2023/9/5 + */ +import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import { postFetch } from "../../../util/request"; + +class ImpStep2 extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, columns: [], dataSource: [] + }; + } + + componentDidMount() { + this.init(); + } + + init = () => { + const { previewUrl, imageId } = this.props; + const payload = { imageId }; + this.setState({ loading: true }); + postFetch(previewUrl, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { headers, list } = data; + this.setState({ + columns: _.map(headers, (item, index) => ({ title: item, dataIndex: index + "", width: 120 })), + dataSource: _.map(list, item => { + return _.reduce(item, (pre, cur, key) => (_.assign(pre, { [key]: cur })), {}); + }) + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { dataSource, columns, loading } = this.state; + return ( + + ); + } +} + +export default ImpStep2; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js index bfaf70cf..b7eafd97 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.js +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -8,6 +8,7 @@ import React, { Component } from "react"; import { Button, message, Modal } from "antd"; import { WeaDialog, WeaLocaleProvider, WeaSteps } from "ecCom"; import ImpStep1 from "./components/impStep1"; +import ImpStep2 from "./components/impStep2"; import ImpStep3 from "./components/impStep3"; import "./index.less"; @@ -23,7 +24,7 @@ class Index extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (JSON.stringify(nextProps.importResult) !== JSON.stringify(this.props.importResult)) { + if (JSON.stringify(nextProps.importResult) !== JSON.stringify(this.props.importResult) && !_.isEmpty(nextProps.importResult)) { this.setState({ current: this.state.current + 1 }); @@ -41,13 +42,13 @@ class Index extends Component { ref={dom => this.step1Ref = dom}/>; break; case 1: - CurrentDom = null; + CurrentDom = ; if (excludeKey) { CurrentDom = ; } break; case 2: - CurrentDom = null; + CurrentDom = ; break; default: CurrentDom = null; @@ -55,7 +56,19 @@ class Index extends Component { } return CurrentDom; }; - + /* + * Author: 黎永顺 + * Description: 上一步 + * Params: + * Date: 2023/9/5 + */ + handlePreviousStep = () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "是否放弃已上传的文件?"), + onOk: () => this.setState({ current: this.state.current - 1 }, () => this.props.onResetImportResult()) + }); + }; /* * Author: 黎永顺 * Description: 下一步 @@ -63,24 +76,28 @@ class Index extends Component { * Date: 2023/8/11 */ handleNext = () => { - const { params } = this.props; - const { fileList } = this.step1Ref.state; - if (!_.isEmpty(params)) { - if (!Object.values(params).every(o => !!o)) { - Modal.warning({ - title: getLabel(131329, "信息确认"), - content: getLabel(518702, "必要信息不完整,红色*为必填项!") - }); + const { params, importResult } = this.props; + if (_.isEmpty(importResult)) { + const { fileList } = this.step1Ref.state; + if (!_.isEmpty(params)) { + if (!Object.values(params).every(o => !!o)) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } + } + if (_.isEmpty(fileList)) { + message.warning(getLabel(111, "请先上传EXCEL文件")); return; } + const [file] = fileList; + const { response } = file; + this.props.nextCallback(response.data.fileid); + } else { + this.setState({ current: this.state.current + 1 }); } - if (_.isEmpty(fileList)) { - message.warning(getLabel(111, "请先上传EXCEL文件")); - return; - } - const [file] = fileList; - const { response } = file; - this.props.nextCallback(response.data.fileid); }; render() { @@ -91,7 +108,7 @@ class Index extends Component { { key: 2, label: getLabel(502835, "导入数据") } ]; const btns = [ - , + , , diff --git a/pc4mobx/hrmSalary/components/importDialog/index.less b/pc4mobx/hrmSalary/components/importDialog/index.less index 8e4dbb53..95cee40b 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.less +++ b/pc4mobx/hrmSalary/components/importDialog/index.less @@ -131,8 +131,6 @@ justify-content: center; align-items: center; flex-direction: column; - padding-top: 80px; - padding-bottom: 80px; text-align: center; p { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 864a555b..62bd167d 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -62,7 +62,8 @@ export default class Archives extends React.Component { salaryArchiveDelete: "", //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是 importDialog: { visible: false, title: "", nextloading: false, - link: "" + link: "", importResult: {}, imageId: "", + previewUrl: "/api/bs/hrmsalary/scheme/preview" } }; this.record = {}; @@ -319,8 +320,19 @@ export default class Archives extends React.Component { // 导入 handleImport = (params) => { const { archivesStore: { importBatch } } = this.props; - const { runStatus } = this.state; - importBatch({ ...params, runStatus }); + const { runStatus, importDialog } = this.state; + this.setState(({ + importDialog: { + ...importDialog, nextloading: true, ...params + } + })); + importBatch({ ...params, runStatus }).then(({ status, data }) => { + this.setState(({ + importDialog: { + ...importDialog, nextloading: false, importResult: data, ...params + } + })); + }); }; // 导入完成 @@ -751,6 +763,7 @@ export default class Archives extends React.Component { ] : [
diff --git a/pc4mobx/hrmSalary/stores/mySalary.js b/pc4mobx/hrmSalary/stores/mySalary.js index 916c3be9..8a38f31e 100644 --- a/pc4mobx/hrmSalary/stores/mySalary.js +++ b/pc4mobx/hrmSalary/stores/mySalary.js @@ -218,6 +218,34 @@ export class MySalaryStore { }); }; + @action initRecordData = async (payload) => { + this.clear(); + //1.check is need second verify + if (window.doCheckSecondaryVerify4ec) { + window.doCheckSecondaryVerify4ec({ mouldCode: "HRM", itemCode: "SALARY" }, (data) => this.getRecordData({ + ...data, payload + })); + } else { + //4.loaddata + this.getRecordData({ status: "1", token: "", payload }); + } + }; + + @action + getRecordData = async (params = {}) => { + if (_.isEmpty(params)) return; + const { status, payload, token } = params; + if (status == "1") { + // Object.assign(this._reqParams, { token }); + // this.getFormData({ viewAttr: 1 }); + this.hasRight = true; + this.getRecordList(payload); + } else { + this.hasRight = false; + } + this.loading = false; + }; + @action getRecordList = (params = {}) => { API.recordList(params).then(res => { From 8a90d58196cfdfcd335653d09510adba687ce4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 14 Sep 2023 10:25:22 +0800 Subject: [PATCH 27/77] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?= =?UTF-8?q?=E8=BE=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../importDialog/components/impStep1.js | 87 +++++++++ .../importDialog/components/impStep2.js | 49 +++++ .../importDialog/components/impStep3.js | 51 +++++ .../components/importDialog/index.js | 153 +++++++++++++++ .../components/importDialog/index.less | 143 ++++++++++++++ pc4mobx/hrmSalary/index.js | 3 + .../components/advanceInputBtn/index.js | 19 ++ .../components/advanceInputBtn/index.less | 28 +++ .../salaryCalcPersonConfirm/baseInfo.js | 75 ++++++++ .../salaryCalcPersonConfirm/condition.js | 104 ++++++++++ .../salaryCalcPersonConfirm/index.js | 177 ++++++++++++++++++ .../salaryCalcPersonConfirm/index.less | 42 +++++ .../doCalc/components/salaryMonthTip/index.js | 42 +++++ .../components/salaryMonthTip/index.less | 11 ++ .../hrmSalary/pages/calculate/doCalc/index.js | 105 +++++++++++ .../pages/calculate/doCalc/index.less | 15 ++ .../pages/calculate/doCalc/layout.js | 46 +++++ pc4mobx/hrmSalary/stores/calculate.js | 3 + pc4mobx/hrmSalary/stores/taxAgent.js | 5 +- 19 files changed, 1155 insertions(+), 3 deletions(-) create mode 100644 pc4mobx/hrmSalary/components/importDialog/components/impStep1.js create mode 100644 pc4mobx/hrmSalary/components/importDialog/components/impStep2.js create mode 100644 pc4mobx/hrmSalary/components/importDialog/components/impStep3.js create mode 100644 pc4mobx/hrmSalary/components/importDialog/index.js create mode 100644 pc4mobx/hrmSalary/components/importDialog/index.less create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.less create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/baseInfo.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/condition.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryMonthTip/index.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryMonthTip/index.less create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/index.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/index.less create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/layout.js diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js new file mode 100644 index 00000000..6ab09b3e --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -0,0 +1,87 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤一 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Icon, message, Upload } from "antd"; + +const Dragger = Upload.Dragger; +const { getLabel } = WeaLocaleProvider; + +class ImpStep1 extends Component { + constructor(props) { + super(props); + this.state = { + fileList: [] + }; + } + + handleChange = (data) => { + const { fileList, file } = data; + if (file.response && typeof (file.response) != "undefined" && file.status !== "removed") message.success(getLabel(111, "上传成功")); + this.setState({ fileList: fileList.slice(-1) }); + }; + + render() { + const { fileList } = this.state; + const dragger = { + accept: ".xlsx", + name: "file", + multiple: false, + action: "/api/doc/upload/uploadFile", + fileList, + onChange: this.handleChange + }; + return ( +
+ {/* 导入选项 */} + { + this.props.importParams && +
+
{getLabel(543201, "导入选项")}
+ {this.props.importParams} +
+ } +
{getLabel(543202, "导入Excel")}
+

+ +

+

+

{getLabel(543203, "点击或将文件拖拽到此区域上传")}

+

{getLabel(543204, "支持单个或批量上传,严禁上传公司内部资料及其他违禁文件")}

+
+ +

+ +
+
{getLabel(27577, "操作步骤")}
+

+ {`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}   + {getLabel(543207, "点击这里下载模板")}   + {this.props.exportDataDom} +

+

{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}

+

{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}

+

+ {`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`} +

+
+ +
+
{getLabel(543223, "Excel文件说明")}
+

{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}

+

{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}

+

{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}

+
+ +
+ ); + } +} + +export default ImpStep1; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js new file mode 100644 index 00000000..8a7373d4 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js @@ -0,0 +1,49 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤二 + * Description: + * Date: 2023/9/5 + */ +import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import { postFetch } from "../../../util/request"; + +class ImpStep2 extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, columns: [], dataSource: [] + }; + } + + componentDidMount() { + this.init(); + } + + init = () => { + const { previewUrl, imageId } = this.props; + const payload = { imageId }; + this.setState({ loading: true }); + postFetch(previewUrl, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { headers, list } = data; + this.setState({ + columns: _.map(headers, (item, index) => ({ title: item, dataIndex: index + "", width: 120 })), + dataSource: _.map(list, item => { + return _.reduce(item, (pre, cur, key) => (_.assign(pre, { [key]: cur })), {}); + }) + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { dataSource, columns, loading } = this.state; + return ( + + ); + } +} + +export default ImpStep2; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js new file mode 100644 index 00000000..481813b4 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js @@ -0,0 +1,51 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤3 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import successImg from "../../importModal/success.svg"; + +const getLabel = WeaLocaleProvider.getLabel; + +class ImpStep3 extends Component { + render() { + const { importResult } = this.props; + return ( +
+ { + !_.isEmpty(importResult) ? +
+

+

+ {getLabel(389249, "已导入")} + {importResult.successCount}   + {`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`} + {importResult.errorCount}  {getLabel(30690, "条数据")} +

+
: +
+

{getLabel(111, "导入失败")}

+
+ } + { + !_.isEmpty(importResult.errorData) && + + } +
+ ); + } +} + +export default ImpStep3; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js new file mode 100644 index 00000000..b7eafd97 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -0,0 +1,153 @@ +/* + * Author: 黎永顺 + * name: 导入弹框-步骤条 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { Button, message, Modal } from "antd"; +import { WeaDialog, WeaLocaleProvider, WeaSteps } from "ecCom"; +import ImpStep1 from "./components/impStep1"; +import ImpStep2 from "./components/impStep2"; +import ImpStep3 from "./components/impStep3"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; +const Step = WeaSteps.Step; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + current: 0 + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (JSON.stringify(nextProps.importResult) !== JSON.stringify(this.props.importResult) && !_.isEmpty(nextProps.importResult)) { + this.setState({ + current: this.state.current + 1 + }); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ current: 0 }); + } + + renderChildren = () => { + const { current } = this.state; + const { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props; + let CurrentDom = null; + switch (current) { + case 0: + CurrentDom = this.step1Ref = dom}/>; + break; + case 1: + CurrentDom = ; + if (excludeKey) { + CurrentDom = ; + } + break; + case 2: + CurrentDom = ; + break; + default: + CurrentDom = null; + break; + } + return CurrentDom; + }; + /* + * Author: 黎永顺 + * Description: 上一步 + * Params: + * Date: 2023/9/5 + */ + handlePreviousStep = () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "是否放弃已上传的文件?"), + onOk: () => this.setState({ current: this.state.current - 1 }, () => this.props.onResetImportResult()) + }); + }; + /* + * Author: 黎永顺 + * Description: 下一步 + * Params: + * Date: 2023/8/11 + */ + handleNext = () => { + const { params, importResult } = this.props; + if (_.isEmpty(importResult)) { + const { fileList } = this.step1Ref.state; + if (!_.isEmpty(params)) { + if (!Object.values(params).every(o => !!o)) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } + } + if (_.isEmpty(fileList)) { + message.warning(getLabel(111, "请先上传EXCEL文件")); + return; + } + const [file] = fileList; + const { response } = file; + this.props.nextCallback(response.data.fileid); + } else { + this.setState({ current: this.state.current + 1 }); + } + }; + + render() { + const { current } = this.state; + const stepData = [ + { key: 0, label: getLabel(543202, "上传EXCEL") }, + { key: 1, label: getLabel(543200, "数据预览") }, + { key: 2, label: getLabel(502835, "导入数据") } + ]; + const btns = [ + , + , + + ]; + return ( + +
+
+ + {/*this.props.key: 不需要展示的步骤*/} + { + _.map(_.filter(stepData, item => item.key !== this.props.excludeKey), it => ( + )) + } + +
+
+ { + this.renderChildren() + } +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.less b/pc4mobx/hrmSalary/components/importDialog/index.less new file mode 100644 index 00000000..95cee40b --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/index.less @@ -0,0 +1,143 @@ +.importBox { + .importCont { + padding: 16px 8px; + + .weapp-batch-impsteps-picker-content-imp-steps { + width: 80%; + margin: 0 auto; + } + + .weapp-batch-impsteps-picker { + margin: 16px auto; + + .weapp-batch-impsteps-picker-content-imp-step1 { + width: 98%; + background-color: #fff; + margin: 8px auto; + border-radius: 3px; + padding: 1px 12px; + + .weapp-batch-impsteps-picker-content-imp-step1 div { + color: #111; + line-height: 22px; + } + + .weapp-salary-tb-border-bottom .weapp-salary-tb-filter.weapp-salary-import-param { + box-sizing: border-box; + padding: 16px; + height: auto; + flex-wrap: wrap; + width: 100%; + } + + .weapp-salary-import-param { + border: 1px solid #ebedf0; + padding: 8px; + margin: 4px 0 14px; + } + + .weapp-salary-tb-filter { + display: flex; + flex-wrap: wrap; + align-items: center; + height: 46px; + } + + .weapp-salary-tb-border-bottom .weapp-salary-tb-filter.weapp-salary-import-param .tbf-item { + display: flex; + justify-content: flex-start !important; + } + + .weapp-salary-tb-filter .tbf-item { + padding: 0 20px 0 0; + display: flex; + align-items: center; + font-size: 12px; + color: #111; + height: 40px; + } + + .weapp-salary-tb-filter .tbf-item > .tbfi-label { + flex-basis: 100px; + flex-shrink: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-right: 10px; + color: #666; + } + + .draggerUploadWrapper { + margin: 16px 0 0; + + .ant-upload-drag-container { + padding: 24px 0 16px; + + .iconUpload { + i { + color: #5d9cec; + font-size: 43px; + } + } + + .uplaod-title { + font-size: 14px; + color: #333; + height: 24px; + line-height: 24px; + margin-top: 8px; + } + + .uplaod-subTitle { + height: 22px; + font-size: 12px; + color: #666; + text-align: center; + line-height: 22px; + } + } + } + + .bottom-border, .description { + margin-top: 12px; + + p { + font-size: 12px; + color: #666; + line-height: 15px; + margin: 12px 0; + } + } + + .bottom-border { + border-bottom: 1px solid #e5e5e5; + + .weapp-salary-link { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: #5d9cec; + } + } + + } + } + + .weapp-batch-impsteps-picker-content-imp-step3 { + .weapp-batch-impsteps-picker-spinText { + position: relative; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + text-align: center; + + p { + margin: 14px 0; + } + } + } + + } +} diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index bd2d3c12..7f0f110d 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -25,6 +25,7 @@ import TaxAgent from "./pages/taxAgent"; import CalculateDetail from "./pages/calculateDetail"; import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail"; import CompareDetail from "./pages/calculateDetail/compareDetail"; +import DoCalcDetail from "./pages/calculate/doCalc"; import GenerateDeclarationDetail from "./pages/declare/generateDeclarationDetail"; import TemplatePreview from "./pages/payroll/templatePreview"; import MobilePayroll from "./pages/mobilePayroll"; @@ -73,6 +74,7 @@ const DataAcquisition = (props) => props.children; // ledger 薪资账套 // calculate 薪资核算 // calculateDetail 核算详情 +// DoCalcDetail 新核算详情页面 // placeOnFileDetail 核算归档详情 // compareDetail 线下线上对比 // payroll 工资单发放 @@ -130,6 +132,7 @@ const Routes = ( + diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js new file mode 100644 index 00000000..654756d7 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js @@ -0,0 +1,19 @@ +import React, { Component } from "react"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import { Button } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + render() { + return ( +
+ + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.less new file mode 100644 index 00000000..1a3d7283 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.less @@ -0,0 +1,28 @@ +.advance-search { + display: flex; + align-items: center; + position: relative; + top: -2.5px; + + .wea-advanced-search { + top: 2px; + left: -1px; + height: 28px; + line-height: 1; + border-radius: 0; + position: relative; + color: #474747; + padding: 4px 15px; + } + + .wea-advanced-search:hover { + border: 1px solid #dadada; + color: #474747; + } + + .text-elli { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/baseInfo.js new file mode 100644 index 00000000..c12b35e7 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/baseInfo.js @@ -0,0 +1,75 @@ +/* + * Author: 黎永顺 + * name: 人员信息确认-基础信息 + * Description: + * Date: 2023/9/13 + */ +import React, { Component } from "react"; +import { WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import SalaryMonthTip from "../salaryMonthTip"; +import { getSalarySobCycle, salaryacctGetForm } from "../../../../../apis/calculate"; +import { Col, Row } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class BaseInfo extends Component { + constructor(props) { + super(props); + this.state = { + salaryInfo: {}, salarySobCycle: {} + }; + } + + componentDidMount() { + const promise = this.init(); + } + + init = async () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + const [salaryInfo, salarySobCycle] = await Promise.all([salaryacctGetForm({ id: salaryAcctRecordId }), getSalarySobCycle({ salaryAcctRecordId })]); + if (salaryInfo.status && salarySobCycle.status) { + this.setState({ + salaryInfo: salaryInfo.data, salarySobCycle: salarySobCycle.data + }); + } + }; + + render() { + const { salaryInfo, salarySobCycle } = this.state; + const { formDTO } = salaryInfo || {}; + return ( + + + + + + {getLabel(542604, "薪资所属月")} + } + style={{ marginLeft: 10 }} + /> + + {formDTO && formDTO.salaryMonth} + + + + + {getLabel(519146, "核算账套")} + {formDTO && formDTO.salarySobName} + + + + + {getLabel(536726, "备注")} + {formDTO && formDTO.description} + + + + + ); + } +} + +export default BaseInfo; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/condition.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/condition.js new file mode 100644 index 00000000..a92c43df --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/condition.js @@ -0,0 +1,104 @@ +export const personConfirmSearchConditions = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["employeeName"], + fieldcol: 12, + label: "姓名", + lanId: 25034, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["workcode"], + fieldcol: 12, + label: "工号", + lanId: 1933, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "57", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["departmentIds"], + fieldcol: 12, + label: "部门", + lanId: 27511, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "24", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["positionIds"], + fieldcol: 12, + label: "岗位", + lanId: 6086, + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "SELECT", + domkey: ["statuses"], + fieldcol: 12, + multiple: true, + label: "状态", + lanId: 535101, + labelcol: 6, + options: [], + viewAttr: 2 + } + ], + defaultshow: true, + title: "常用条件" + } +]; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js new file mode 100644 index 00000000..944304a1 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js @@ -0,0 +1,177 @@ +/* + * Author: 黎永顺 + * name: 人员确认 + * Description: + * Date: 2023/9/13 + */ +import React, { Component } from "react"; +import { WeaButtonIcon, WeaHelpfulTip, WeaLocaleProvider, WeaTab, WeaTools } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import BaseInfo from "./baseInfo"; +import { acctemployeeList } from "../../../../../apis/calculate"; +import { personConfirmSearchConditions } from "./condition"; +import { getSearchs } from "../../../../../util"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "range", showSearchAd: false, + searchConditions: [], loading: false, + pageInfo: { current: 1, pageSize: 10, total: 0 }, + selectedRowKeys: [] + }; + } + + componentDidMount() { + if ($) { + const domTabInnerList = $(".salary-calculate-do-calc-content .ant-tabs-tab-inner"); + domTabInnerList[0].setAttribute("title", ""); + domTabInnerList[1].setAttribute("title", ""); + domTabInnerList[2].setAttribute("title", ""); + } + this.setState({ + searchConditions: _.map(personConfirmSearchConditions, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "statuses") { + return { + ...o, + options: [ + { key: "0", showname: getLabel(18883, "试用") }, { key: "1", showname: getLabel(15711, "正式") }, + { key: "2", showname: getLabel(480, "临时") }, { key: "3", showname: getLabel(15844, "试用延期") }, + { key: "4", showname: getLabel(542707, "解雇") }, { key: "5", showname: getLabel(6091, "离职") }, + { key: "6", showname: getLabel(6092, "退休") } + ] + }; + } + return { ...o }; + }), + title: getLabel(32905, "常用条件") + }; + }) + }, () => { + const { calculateStore: { PCSearchForm } } = this.props; + PCSearchForm.initFormFields(this.state.searchConditions); + this.acctemployeeList(); + }); + } + + renderTabBtns = () => { + const { selectedKey } = this.state; + let tabBtns = []; + switch (selectedKey) { + case "range": + tabBtns = [ + , + , + + ]; + break; + case "add": + case "sub": + tabBtns = [ + + ]; + break; + default: + break; + } + return tabBtns; + }; + acctemployeeList = () => { + const { pageInfo } = this.state; + const { calculateStore: { PCSearchForm }, routeParams: { salaryAcctRecordId } } = this.props; + const { departmentIds, positionIds, statuses, ...extra } = PCSearchForm.getFormParams(); + const payload = { + salaryAcctRecordId, ...pageInfo, ...extra, + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + positionIds: !_.isEmpty(positionIds) ? positionIds.split(",") : [], + statuses: !_.isEmpty(statuses) ? statuses.split(",") : [] + }; + acctemployeeList(payload).then(({ status, data }) => { + if (status) { + console.log(data); + } + }); + }; + + render() { + const { calculateStore: { PCSearchForm } } = this.props; + const { selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys } = this.state; + const tabDatas = [ + { + title: + {getLabel(542307, "核算人员范围")} + + , viewcondition: "range" + }, + { + title: + {getLabel(542308, "环比上月减少人员")} + + , viewcondition: "sub" + }, + { + title: + {getLabel(542308, "环比上月增加人员")} + + , viewcondition: "add" + } + ]; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.queryList()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.queryList()); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + return ( +
+ + this.setState({ selectedKey: v })} advanceHeight={220} + buttons={this.renderTabBtns()} searchType={["base", "advanced"]} + showSearchAd={showSearchAd} setShowSearchAd={bool => this.setState({ showSearchAd: bool })} + searchsAd={getSearchs(PCSearchForm, searchConditions, 2, false)} + onSearchChange={(v) => PCSearchForm.updateFields({ employeeName: v })} + searchsBaseValue={PCSearchForm.getFormParams().employeeName} + onSearch={this.acctemployeeList} onAdSearch={this.acctemployeeList} + onAdReset={() => PCSearchForm.resetForm()} + /> +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less new file mode 100644 index 00000000..18bcbc29 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less @@ -0,0 +1,42 @@ +.person-confirm-layout { + .wea-tab .wea-tab-right, .wea-input-focus { + background: transparent; + } +} + +.docalc-baseinfo-layout { + padding: 0; + + .wea-title { + border-bottom: none; + } + + .wea-content.pt15 { + padding-top: 0; + } + + .docalc-baseinfo { + background: #fff; + border: 1px solid #e5e5e5; + border-right: none; + + .ant-col-24 { + border-top: 1px solid #e5e5e5; + } + + .label { + color: #666; + } + + .value { + color: #111; + } + + & > div { + border-right: 1px solid #e5e5e5; + line-height: 30px; + padding: 5px 16px; + + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryMonthTip/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryMonthTip/index.js new file mode 100644 index 00000000..a230b83e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryMonthTip/index.js @@ -0,0 +1,42 @@ +/* + * Author: 黎永顺 + * name: 薪资所属月提示语 + * Description: + * Date: 2023/9/13 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + render() { + const { attendCycle, salaryCycle, salaryMonth, socialSecurityCycle } = this.props; + const { fromDate: attendFromDate, endDate: attendEndDate } = attendCycle, + { fromDate: salaryFromDate, endDate: salaryEndDate } = salaryCycle; + return ( +
+
+
{getLabel(543375, "薪资周期")}
+
{`${salaryFromDate}${getLabel(15322, "至")}${salaryEndDate}`}
+
+
+
{getLabel(542240, "税款所属期")}
+
{salaryMonth}
+
+
+
{getLabel(543475, "考勤取值周期")}
+
{`${attendFromDate}${getLabel(15322, "至")}${attendEndDate}`}
+
+
+
{getLabel(543466, "福利台账月份")}
+
{`${getLabel(19422, "引用")}${socialSecurityCycle}${getLabel(543476, "的福利台账数据")}`}
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryMonthTip/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryMonthTip/index.less new file mode 100644 index 00000000..436f6a0d --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryMonthTip/index.less @@ -0,0 +1,11 @@ +.salary-month-tip { + .line { + .label { + color: #666; + } + + .value { + color: #111; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js new file mode 100644 index 00000000..2508d0dc --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -0,0 +1,105 @@ +/* + * Author: 黎永顺 + * name: 薪资核算详情 + * Description: + * Date: 2023/9/13 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaReqTop } from "ecCom"; +import { Button, Dropdown, Menu } from "antd"; +import Layout from "./layout"; +import AdvanceInputBtn from "./components/advanceInputBtn"; +import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "person" + }; + } + + componentDidMount() { + console.log(this.props); + } + + handleButtonClick = () => { + console.log("核算所有人"); + }; + handleMenuClick = ({ key }) => { + console.log(key); + }; + handleMoreMenuClick = ({ key }) => { + console.log(key); + }; + renderReqBtns = () => { + const { selectedKey } = this.state; + let reqBtns = []; + switch (selectedKey) { + case "calc": + const menu = ( + + {getLabel(543546, "核算所选人员")} + + ); + const moreMenu = ( + + {getLabel(32935, "导入")} + {getLabel(81272, "导出全部")} + {getLabel(544270, "自定义导出")} + {getLabel(543249, "线下对比")} + + ); + reqBtns = [ + + {getLabel(543545, "核算所有人")} + , + , + + ]; + break; + default: + break; + } + return reqBtns; + }; + renderContent = () => { + const { selectedKey } = this.state; + let dom = null; + switch (selectedKey) { + case "person": + dom = ; + break; + default: + break; + } + return dom; + }; + + render() { + const tabs = [ + { key: "person", title: getLabel(543547, "人员确认") }, + { key: "calc", title: getLabel(538011, "薪资核算") } + ]; + const { selectedKey } = this.state; + return ( + +
+ } iconBgcolor="#F14A2D" + onChange={key => this.setState({ selectedKey: key })} + buttons={this.renderReqBtns()} + > +
{this.renderContent()}
+
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.less new file mode 100644 index 00000000..d15f409a --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.less @@ -0,0 +1,15 @@ +.salary-calculate-do-calc { + min-width: 1000px; + overflow: auto; + width: 100%; + height: 100%; + background: #f6f6f6; + + .wea-new-top-req-wapper .wea-new-top-req-title > div:last-child { + right: 16px; + } + + .salary-calculate-do-calc-content { + padding: 8px 16px; + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/layout.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/layout.js new file mode 100644 index 00000000..9a802bfb --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/layout.js @@ -0,0 +1,46 @@ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import Authority from "../../mySalary/authority"; +import { salaryacctAcctresultCheckAuth } from "../../../apis/calculate"; + +@inject("taxAgentStore") +@observer +class Layout extends Component { + constructor(props) { + super(props); + this.state = { + store: { loading: false, hasRight: false } + }; + } + + componentDidMount() { + this.salaryacctAcctresultCheckAuth(); + } + + salaryacctAcctresultCheckAuth = () => { + const { taxAgentStore: { getPermission } } = this.props; + this.setState({ store: { ...this.state.store, loading: true } }); + getPermission().then(({ data }) => { + const { isOpenDevolution } = data; + if (isOpenDevolution) { + const { routeParams: { salaryAcctRecordId } } = this.props; + salaryacctAcctresultCheckAuth({ salaryAcctRecordId }).then(({ status, data }) => { + this.setState({ store: { ...this.state.store, loading: false, hasRight: status && data } }); + }); + } else { + this.setState({ store: { ...this.state.store, loading: false, hasRight: true } }); + } + }).catch(() => this.setState({ store: { ...this.state.store, loading: false } })); + }; + + render() { + return ( + + {this.props.children} + + ); + } +} + +export default Layout; diff --git a/pc4mobx/hrmSalary/stores/calculate.js b/pc4mobx/hrmSalary/stores/calculate.js index 5b270ddf..97102665 100644 --- a/pc4mobx/hrmSalary/stores/calculate.js +++ b/pc4mobx/hrmSalary/stores/calculate.js @@ -8,6 +8,9 @@ import { toDecimal_n } from "../util"; const { TableStore } = WeaTableNew; export class calculateStore { + @observable PCSearchForm = new WeaForm(); //人员确认-form + + @observable tableStore = new TableStore(); // new table @observable form = new WeaForm(); // nrew 一个form @observable condition = []; // 存储后台得到的form数据 diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index 2f555120..ef5cfe2d 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -4,7 +4,6 @@ import { WeaForm, WeaTableNew } from "comsMobx"; import * as API from "../apis/taxAgent"; // 引入API接口文件 import { decentralizationConditions, editConditions } from "../pages/taxAgent/editConditions"; -import { taxAgentRangeExtDelete } from "../apis/taxAgent"; const { TableStore } = WeaTableNew; @@ -149,12 +148,12 @@ export class TaxAgentStore { //薪酬统计报表权限 this.setStatisticsReportBtn(!isOpenDevolution ? true : !!(isAdminEnable || isChief)); //薪资核算详情页面查看权限 - this.setPayrollPermission(isAdminEnable && isOpenDevolution || !isOpenDevolution); + this.setPayrollPermission((isOpenDevolution && isAdminEnable) || !isOpenDevolution); resolve({ status, data }); } else { reject(); } - }); + }).catch(() => reject()); }); }; // 人员范围列表 From 2b282b42113ae39f957d943eef48091ddde75cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 14 Sep 2023 10:37:39 +0800 Subject: [PATCH 28/77] hotfix/2.9.42309.01 --- .../pages/ledgerPage/components/ledgerAssociatedPersonnel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js index 8b7af5a4..c8bb5f25 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js @@ -330,7 +330,7 @@ class LedgerAssociatedPersonnel extends Component { this.personalScopeTableRef.getPersonalScopeList()} onCancel={() => From ef16acd6387d3c6c2e54950ed01dea0c0a85ae27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 14 Sep 2023 11:41:29 +0800 Subject: [PATCH 29/77] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?= =?UTF-8?q?=E8=BE=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/calculate.js | 195 +----------------- .../salaryCalcPersonConfirm/index.js | 67 ++++-- .../salaryCalcPersonConfirm/index.less | 4 + 3 files changed, 68 insertions(+), 198 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index b14015a7..28067063 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -1,141 +1,5 @@ import { WeaTools } from "ecCom"; -//薪资核算-薪资核算列表 -export const getCalcList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/list", "POST", params); -}; - - -//薪资核算-删除薪资核算记录 -export const deleteCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/delete", "POST", params); -}; - -//薪资核算-归档薪资核算记录 -export const fileCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/file", "POST", params); -}; - -//薪资核算-薪资核算详情 -export const getCalcForm = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/getForm", "get", params); -}; - -//薪资核算-保存薪资核算的基本信息 -export const saveCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/basic/save", "POST", params); -}; - -//薪资核算-获取薪资核算提示信息 -export const getCalcInfo = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/getSalarySobCycle", "get", params); -}; - -//薪资核算-薪资核算人员确认列表 -export const getCalcPersonList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/list", "POST", params); -}; - -//薪资核算-薪资核算人员高级搜索 -export const getCalcPersonSa = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/getSearchCondition", "get", params); -}; - -//薪资核算-删除薪资核算人员 -export const deleteCalcPerson = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/delete", "POST", params); -}; - -//薪资核算-添加薪资核算人员 -export const saveCalcPerson = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/save", "POST", params); -}; - -//薪资核算-导出人员范围 -export const exportCalcPerson = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/export", "POST", params); -}; - -//薪资核算-薪资核算环比上期减少人员列表 -export const getCalcPersonSubList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/reducedEmployee/list", "POST", params); -}; - -//薪资核算-导出环比减少人员 -export const exportCalcPersonSub = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/reducedEmployee/export", "POST", params); -}; - - -//薪资核算-执行薪资核算 -export const doScCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/accounting", "POST", params); -}; - - -//薪资核算-获取薪资核算结果高级搜索 -export const getScSa = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/getSearchCondition", "get", params); -}; - -//薪资核算-薪资核算结果列表 -export const getScList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/list", "post", params); -}; - - -//薪资核算-导出薪资核算 -export const exportSc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/export", "post", params); -}; - -//薪资核算-导出线下对比结果 -export const exportOc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/comparisonResult/export", "post", params); -}; - - -//薪资核算-薪资核算结果详情 -export const getScDetail = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/detail", "get", params); -}; - -//薪资核算-薪资核算合并计税详情 -export const getScMergeTaxDetail = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/getConsolidatedTaxDetail", "get", params); -}; - -//薪资核算-编辑薪资核算结果 -export const editScResult = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/save", "post", params); -}; - -//薪资核算-薪资核算结果校验 -export const checkScResult = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/check", "post", params); -}; - - -//薪资核算-获取校验结果(异常)总数 -export const getScResultExceptionCount = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResult/getCount", "get", params); -}; - -//薪资核算-校验结果列表 -export const getCheckResultList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResult/list", "POST", params); -}; - -//薪资核算-校验结果明细列表 -export const getCheckResultDetailList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResultRecord/list", "POST", params); -}; - -//薪资核算-获取导入组件前置参数 -export const getImportParams = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResultRecord/list", "POST", params); -}; - // 薪资记录--薪资核算列表 export const getSalaryAcctList = params => { return fetch("/api/bs/hrmsalary/salaryacct/list", { @@ -176,6 +40,17 @@ export const reducedemployeeList = params => { body: JSON.stringify(params) }).then(res => res.json()); }; +// 核算人员--薪资核算环比上月增加人员 +export const addedemployeeList = params => { + return fetch("/api/bs/hrmsalary/salaryacct/addedemployee/list", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 核算人员--薪资核算人员确认列表 export const acctemployeeList = params => { @@ -206,7 +81,6 @@ export const getSalarySobCycle = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/getSalarySobCycle", "GET", params); }; - // 核算人员--添加薪资核算人员 export const saveAcctemployee = params => { return fetch("/api/bs/hrmsalary/salaryacct/acctemployee/save", { @@ -232,7 +106,6 @@ export const exportReducedEmployee = (id) => { })); }; - // 核算人员--导出人员范围 export const exportAcctEmployee = (id) => { fetch("/api/bs/hrmsalary/salaryacct/acctemployee/export?salaryAcctRecordId=" + id).then(res => res.blob().then(blob => { @@ -374,7 +247,6 @@ export const getImportField = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/importField", "GET", params); }; - // 核算结果-导入模板 export const getImportTemplate = (salaryItemIds, salaryAcctRecordId) => { fetch("/api/bs/hrmsalary/salaryacct/acctresult/importtemplate/export?salaryItemIds=" + salaryItemIds + "&salaryAcctRecordId=" + salaryAcctRecordId).then(res => res.blob().then(blob => { @@ -412,7 +284,6 @@ export const importAcctResult = (params) => { }).then(res => res.json()); }; - // 核算结果-导出全部 export const exportAcctResult = (salaryAcctRecordId, ids) => { fetch("/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=" + salaryAcctRecordId + "&ids=" + ids).then(res => res.blob().then(blob => { @@ -509,50 +380,6 @@ 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", { diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js index 944304a1..3cf9643b 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js @@ -5,16 +5,21 @@ * Date: 2023/9/13 */ import React, { Component } from "react"; -import { WeaButtonIcon, WeaHelpfulTip, WeaLocaleProvider, WeaTab, WeaTools } from "ecCom"; +import { WeaButtonIcon, WeaHelpfulTip, WeaLocaleProvider, WeaTab, WeaTable, WeaTools } from "ecCom"; import { inject, observer } from "mobx-react"; import { Button } from "antd"; import BaseInfo from "./baseInfo"; -import { acctemployeeList } from "../../../../../apis/calculate"; +import { acctemployeeList, addedemployeeList, reducedemployeeList } from "../../../../../apis/calculate"; import { personConfirmSearchConditions } from "./condition"; import { getSearchs } from "../../../../../util"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; +const api = { + range: acctemployeeList, + sub: reducedemployeeList, + add: addedemployeeList +}; @inject("calculateStore") @observer @@ -25,7 +30,7 @@ class Index extends Component { selectedKey: "range", showSearchAd: false, searchConditions: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, - selectedRowKeys: [] + selectedRowKeys: [], dataSource: [], columns: [] }; } @@ -60,7 +65,7 @@ class Index extends Component { }, () => { const { calculateStore: { PCSearchForm } } = this.props; PCSearchForm.initFormFields(this.state.searchConditions); - this.acctemployeeList(); + this.queryPCList(); }); } @@ -86,8 +91,8 @@ class Index extends Component { } return tabBtns; }; - acctemployeeList = () => { - const { pageInfo } = this.state; + queryPCList = () => { + const { pageInfo, selectedKey } = this.state; const { calculateStore: { PCSearchForm }, routeParams: { salaryAcctRecordId } } = this.props; const { departmentIds, positionIds, statuses, ...extra } = PCSearchForm.getFormParams(); const payload = { @@ -96,16 +101,22 @@ class Index extends Component { positionIds: !_.isEmpty(positionIds) ? positionIds.split(",") : [], statuses: !_.isEmpty(statuses) ? statuses.split(",") : [] }; - acctemployeeList(payload).then(({ status, data }) => { + api[selectedKey](payload).then(({ status, data }) => { if (status) { - console.log(data); + const { columns, list: dataSource = [], pageNum: current, pageSize, total } = data; + this.setState({ + columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } + }); } }); }; render() { const { calculateStore: { PCSearchForm } } = this.props; - const { selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys } = this.state; + const { + selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys, + columns, dataSource + } = this.state; const tabDatas = [ { title: @@ -145,13 +156,14 @@ class Index extends Component { showSizeChanger: true, pageSizeOptions: ["10", "20", "50", "100"], onShowSizeChange: (current, pageSize) => { - this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.queryList()); + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.queryPCList()); }, onChange: current => { - this.setState({ pageInfo: { ...pageInfo, current } }, () => this.queryList()); + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.queryPCList()); } }; const rowSelection = { + columnWidth: 80, selectedRowKeys, onChange: selectedRowKeys => this.setState({ selectedRowKeys }) }; @@ -160,15 +172,42 @@ class Index extends Component { this.setState({ selectedKey: v })} advanceHeight={220} - buttons={this.renderTabBtns()} searchType={["base", "advanced"]} + onChange={v => this.setState({ selectedKey: v }, () => this.queryPCList())} + buttons={this.renderTabBtns()} searchType={["base", "advanced"]} advanceHeight={220} showSearchAd={showSearchAd} setShowSearchAd={bool => this.setState({ showSearchAd: bool })} searchsAd={getSearchs(PCSearchForm, searchConditions, 2, false)} onSearchChange={(v) => PCSearchForm.updateFields({ employeeName: v })} searchsBaseValue={PCSearchForm.getFormParams().employeeName} - onSearch={this.acctemployeeList} onAdSearch={this.acctemployeeList} + onSearch={this.queryPCList} onAdSearch={this.queryPCList} onAdReset={() => PCSearchForm.resetForm()} /> + { + let width = ""; + const { dataIndex } = item; + switch (dataIndex) { + case "taxAgentName": + case "departmentName": + width = "15%"; + break; + default: + width = "10%"; + break; + } + return { ...item, width }; + }), + { + dataIndex: "operate", + title: getLabel(30585, "操作"), + width: 120, + render: (_, record) => ( + {getLabel(535052, "删除")} + ) + } + ]} + /> ); } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less index 18bcbc29..3dfa69f0 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less @@ -2,6 +2,10 @@ .wea-tab .wea-tab-right, .wea-input-focus { background: transparent; } + + .wea-new-table { + background: #fff; + } } .docalc-baseinfo-layout { From f18bda74f4e6f75ff4fa7ffe7cd4c431de0f371f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 14 Sep 2023 11:50:22 +0800 Subject: [PATCH 30/77] hotfix/2.9.42309.01 --- .../components/PersonalScopeModal/index.js | 103 ++++++++++++------ .../components/ledgerAssociatedPersonnel.js | 2 +- 2 files changed, 71 insertions(+), 34 deletions(-) diff --git a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js index 1668de36..079190f8 100644 --- a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js +++ b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js @@ -8,6 +8,7 @@ import React, { Component } from "react"; import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; import { Button, message, Modal } from "antd"; import { getTaxAgentRangeForm } from "../../apis/taxAgent"; +import { commonEnumList } from "../../apis/ruleconfig"; import { SelectWithAll } from "../../pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee"; import "./index.less"; @@ -31,41 +32,77 @@ class PersonalScopeModal extends Component { if (isTaxgent) { this.getTaxAgentRangeForm(); } else { - const employeeStatus = [ - { key: "TRIAL", showname: "试用" }, - { key: "FORMAL", showname: "正式" }, - { key: "TEMPORARY", showname: "临时" }, - { key: "DELAY", showname: "试用延期" }, - { key: "FIRE", showname: "解雇" }, - { key: "DEPARTURE", showname: "离职" }, - { key: "RETIRED", showname: "退休" } - ]; - const targetTypeList = [ - { - key: "EMPLOYEE", - showname: "人员", - selected: false - }, - { - key: "SUBCOMPANY", - showname: "分部", - selected: false - }, - { - key: "DEPT", - showname: "部门", - selected: false - }, - { - key: "POSITION", - showname: "岗位", - selected: false - } - ]; - this.setState({ targetTypeList, employeeStatus }); + this.commonEnumList(); + // const employeeStatus = [ + // { key: "TRIAL", showname: "试用" }, + // { key: "FORMAL", showname: "正式" }, + // { key: "TEMPORARY", showname: "临时" }, + // { key: "DELAY", showname: "试用延期" }, + // { key: "FIRE", showname: "解雇" }, + // { key: "DEPARTURE", showname: "离职" }, + // { key: "RETIRED", showname: "退休" } + // ]; + // const targetTypeList = [ + // { + // key: "EMPLOYEE", + // showname: "人员", + // selected: false + // }, + // { + // key: "SUBCOMPANY", + // showname: "分部", + // selected: false + // }, + // { + // key: "DEPT", + // showname: "部门", + // selected: false + // }, + // { + // key: "POSITION", + // showname: "岗位", + // selected: false + // } + // ]; + // this.setState({ targetTypeList, employeeStatus }); } } + commonEnumList = () => { + commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }).then(({ status, data }) => { + if (status) { + const targetTypeList = [ + { + key: "EMPLOYEE", + showname: "人员", + selected: false + }, + { + key: "SUBCOMPANY", + showname: "分部", + selected: false + }, + { + key: "DEPT", + showname: "部门", + selected: false + }, + { + key: "POSITION", + showname: "岗位", + selected: false + } + ]; + this.setState({ + targetTypeList, + employeeStatus: _.map(_.filter(data, o => o.value !== 7), it => ({ + key: it.value.toString(), + showname: it.defaultLabel + })) + }); + } + }); + }; getTaxAgentRangeForm = () => { getTaxAgentRangeForm().then(({ status, data }) => { if (status) { @@ -91,7 +128,7 @@ class PersonalScopeModal extends Component { employeeStatus: status.split(","), includeType, targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), - [saveKeyVal["key"]]: saveKeyVal["value"], + [saveKeyVal["key"]]: saveKeyVal["value"] }; this.setState({ loading: true }); APISaveFox["save"](payload).then(({ status, errormsg }) => { diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js index c8bb5f25..8b7af5a4 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js @@ -330,7 +330,7 @@ class LedgerAssociatedPersonnel extends Component { this.personalScopeTableRef.getPersonalScopeList()} onCancel={() => From 4769df4cfd72c2c4c55f8c11c9eac79bdea13fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 14 Sep 2023 14:05:40 +0800 Subject: [PATCH 31/77] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?= =?UTF-8?q?=E8=BE=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryCalcPersonConfirm/index.js | 91 +++++++++++++++++-- 1 file changed, 81 insertions(+), 10 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js index 3cf9643b..31fbfe42 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js @@ -5,13 +5,20 @@ * Date: 2023/9/13 */ import React, { Component } from "react"; -import { WeaButtonIcon, WeaHelpfulTip, WeaLocaleProvider, WeaTab, WeaTable, WeaTools } from "ecCom"; +import { WeaBrowser, WeaButtonIcon, WeaHelpfulTip, WeaLocaleProvider, WeaTab, WeaTable, WeaTools } from "ecCom"; import { inject, observer } from "mobx-react"; -import { Button } from "antd"; +import { Button, message, Modal } from "antd"; import BaseInfo from "./baseInfo"; -import { acctemployeeList, addedemployeeList, reducedemployeeList } from "../../../../../apis/calculate"; +import { + acctemployeeList, + addedemployeeList, + deleteAcctemployee, + reducedemployeeList, + saveAcctemployee +} from "../../../../../apis/calculate"; import { personConfirmSearchConditions } from "./condition"; import { getSearchs } from "../../../../../util"; +import { convertToUrlString } from "../../../../../util/url"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -70,20 +77,26 @@ class Index extends Component { } renderTabBtns = () => { - const { selectedKey } = this.state; + const { selectedKey, selectedRowKeys } = this.state; let tabBtns = []; switch (selectedKey) { case "range": tabBtns = [ - , - , - + this.handleDeletePCitem()}/>, + ids && this.handleUserBrowserChange(ids.split(","))} + > + + , + ]; break; case "add": case "sub": tabBtns = [ - + ]; break; default: @@ -101,13 +114,70 @@ class Index extends Component { positionIds: !_.isEmpty(positionIds) ? positionIds.split(",") : [], statuses: !_.isEmpty(statuses) ? statuses.split(",") : [] }; + this.setState({ loading: true }); api[selectedKey](payload).then(({ status, data }) => { + this.setState({ loading: false }); if (status) { const { columns, list: dataSource = [], pageNum: current, pageSize, total } = data; this.setState({ columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } }); } + }).catch(() => this.setState({ loading: false })); + }; + handleDeletePCitem = (ids) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(388758, "确认要删除吗?"), + onOk: () => { + const { selectedRowKeys } = this.state; + const { routeParams: { salaryAcctRecordId } } = this.props; + deleteAcctemployee({ salaryAcctRecordId, ids: !_.isEmpty(ids) ? ids : selectedRowKeys }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功!")); + this.queryPCList(); + _.isNil(ids) && this.setState({ selectedRowKeys: [] }); + } else { + message.error(errormsg || getLabel(20462, "删除失败!")); + } + }); + } + }); + }; + /* + * Author: 黎永顺 + * Description: 人员确认导出 + * Params: + * Date: 2023/9/14 + */ + handleExport = () => { + let url = ""; + const { routeParams: { salaryAcctRecordId }, calculateStore: { PCSearchForm } } = this.props; + if (this.state.selectedKey === "range") { + url = `${window.location.origin}/api/bs/hrmsalary/salaryacct/acctemployee/export?salaryAcctRecordId=${salaryAcctRecordId}&${convertToUrlString(PCSearchForm.getFormParams())}`; + } else if (this.state.selectedKey === "sub") { + url = `${window.location.origin}/api/bs/hrmsalary/salaryacct/reducedemployee/export?salaryAcctRecordId=${salaryAcctRecordId}&${convertToUrlString(PCSearchForm.getFormParams())}`; + } else { + url = `${window.location.origin}/api/bs/hrmsalary/salaryacct/addedemployee/export?salaryAcctRecordId=${salaryAcctRecordId}&${convertToUrlString(PCSearchForm.getFormParams())}`; + } + window.open(url, "_blank"); + }; + /* + * Author: 黎永顺 + * Description: 添加人员确认 + * Params: + * Date: 2023/9/14 + */ + handleUserBrowserChange = (employeeIds) => { + const { routeParams: { salaryAcctRecordId } } = this.props; + saveAcctemployee({ salaryAcctRecordId, employeeIds }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(541531, "添加成功!")); + this.queryPCList(); + } else { + message.error(errormsg || getLabel(111, "添加失败!")); + } }); }; @@ -183,7 +253,7 @@ class Index extends Component { /> { let width = ""; const { dataIndex } = item; @@ -203,7 +273,8 @@ class Index extends Component { title: getLabel(30585, "操作"), width: 120, render: (_, record) => ( - {getLabel(535052, "删除")} + this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")} ) } ]} From 85867da080721affc4e194e744e71c7380125fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 14 Sep 2023 14:19:08 +0800 Subject: [PATCH 32/77] hotfix/2.9.42309.01 --- pc4mobx/hrmSalary/components/PersonalScopeModal/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js index 079190f8..b6fd6ffb 100644 --- a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js +++ b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js @@ -95,10 +95,7 @@ class PersonalScopeModal extends Component { ]; this.setState({ targetTypeList, - employeeStatus: _.map(_.filter(data, o => o.value !== 7), it => ({ - key: it.value.toString(), - showname: it.defaultLabel - })) + employeeStatus: _.map(_.filter(data, o => o.value !== 7), it => ({ key: it.enum, showname: it.defaultLabel })) }); } }); From d008654bf82bee25d1ca5ded73f6f302a8456840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 14 Sep 2023 15:50:24 +0800 Subject: [PATCH 33/77] hotfix/2.9.42309.01 --- .../doCalc/components/salaryEditCalc/index.js | 19 +++++++++++++++++++ .../components/salaryEditCalc/index.less | 0 .../hrmSalary/pages/calculate/doCalc/index.js | 3 +++ 3 files changed, 22 insertions(+) create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js new file mode 100644 index 00000000..926fb06f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js @@ -0,0 +1,19 @@ +/* + * Author: 黎永顺 + * name: 薪资核算 + * Description: + * Date: 2023/9/14 + */ +import React, { Component } from "react"; + +class Index extends Component { + render() { + return ( +
+ +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less new file mode 100644 index 00000000..e69de29b diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index 2508d0dc..dc25caf4 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -73,6 +73,9 @@ class Index extends Component { case "person": dom = ; break; + case "calc": + dom = ; + break; default: break; } From 707ca40f054a5c1175d8588a141c42935066dfc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 15 Sep 2023 11:14:39 +0800 Subject: [PATCH 34/77] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?= =?UTF-8?q?=E8=BE=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/advanceInputBtn/index.js | 3 +- .../salaryCalcPersonConfirm/index.less | 1 + .../components/salaryEditCalc/condition.js | 145 ++++++++++++++++++ .../editCalcAdvanceSearchPannel.js | 76 +++++++++ .../salaryEditCalc/editCalcTable.js | 120 +++++++++++++++ .../doCalc/components/salaryEditCalc/index.js | 62 +++++++- .../components/salaryEditCalc/index.less | 56 +++++++ .../hrmSalary/pages/calculate/doCalc/index.js | 8 +- .../pages/calculate/doCalc/index.less | 1 + pc4mobx/hrmSalary/stores/calculate.js | 1 + 10 files changed, 466 insertions(+), 7 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcAdvanceSearchPannel.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js index 654756d7..f9a10027 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js @@ -10,7 +10,8 @@ class Index extends Component { return (
- +
); } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less index 3dfa69f0..eb4fb73b 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less @@ -13,6 +13,7 @@ .wea-title { border-bottom: none; + padding-left: 0; } .wea-content.pt15 { diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js new file mode 100644 index 00000000..59fcb015 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js @@ -0,0 +1,145 @@ +export const editCalcSearchConditions = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["employeeName"], + fieldcol: 12, + label: "姓名", + lanId: 25034, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["workcode"], + fieldcol: 12, + label: "工号", + lanId: 1933, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "164", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["subcompanyIds"], + fieldcol: 12, + label: "分部", + lanId: 33553, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "57", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["departmentIds"], + fieldcol: 12, + label: "部门", + lanId: 27511, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "24", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["positionIds"], + fieldcol: 12, + label: "岗位", + lanId: 6086, + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "SELECT", + domkey: ["statuses"], + fieldcol: 12, + multiple: true, + label: "状态", + lanId: 535101, + labelcol: 6, + options: [], + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "CHECKBOX", + domkey: ["consolidatedTaxation"], + fieldcol: 12, + isQuickSearch: false, + label: "合并计税", + labelcol: 6, + viewAttr: 2 + } + ], + defaultshow: true, + title: "常用条件" + } +]; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcAdvanceSearchPannel.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcAdvanceSearchPannel.js new file mode 100644 index 00000000..392a42d1 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcAdvanceSearchPannel.js @@ -0,0 +1,76 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-高级搜索面板 + * Description: + * Date: 2023/9/14 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button } from "antd"; +import { inject, observer } from "mobx-react"; +import { editCalcSearchConditions } from "./condition"; +import { getSearchs } from "../../../../../util"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class EditCalcAdvanceSearchPannel extends Component { + constructor(props) { + super(props); + this.state = { + searchConditions: [] + + }; + } + + componentDidMount() { + this.setState({ + searchConditions: _.map(editCalcSearchConditions, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "statuses") { + return { + ...o, + options: [ + { key: "0", showname: getLabel(18883, "试用") }, { key: "1", showname: getLabel(15711, "正式") }, + { key: "2", showname: getLabel(480, "临时") }, { key: "3", showname: getLabel(15844, "试用延期") }, + { key: "4", showname: getLabel(542707, "解雇") }, { key: "5", showname: getLabel(6091, "离职") }, + { key: "6", showname: getLabel(6092, "退休") } + ] + }; + } + return { ...o }; + }), + title: getLabel(32905, "常用条件") + }; + }) + }, () => { + const { calculateStore: { ECSearchForm } } = this.props; + ECSearchForm.initFormFields(this.state.searchConditions); + }); + } + + render() { + const { searchConditions } = this.state; + const { calculateStore: { ECSearchForm } } = this.props; + return ( + + {getSearchs(ECSearchForm, searchConditions, 2, false)} +
+
+ + + +
+
+
+ ); + } +} + +export default EditCalcAdvanceSearchPannel; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js new file mode 100644 index 00000000..00d33cd1 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -0,0 +1,120 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-列表数据 + * Description: + * Date: 2023/9/14 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { Spin } from "antd"; +import { acctResultList } from "../../../../../apis/calculate"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class EditCalcTable extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, + selectedRowKeys: [] + }; + } + + componentDidMount() { + window.addEventListener("message", this.handleReceive, false); + } + + handleReceive = async ({ data }) => { + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.queryCalcResultList(); + } else if (type === "turn") { + switch (id) { + case "PAGEINFO": + const { size: pageSize, pageNum: current } = params; + this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.queryCalcResultList()); + break; + case "CHECKBOX": + const { selectedRowKeys } = params; + this.setState({ selectedRowKeys }); + break; + default: + break; + } + } + }; + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + + postMessageToChild = (payload = {}) => { + const childFrameObj = document.getElementById("atdTable"); + childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); + }; + queryCalcResultList = () => { + const { pageInfo } = this.state; + const { calculateStore: { ECSearchForm }, routeParams: { salaryAcctRecordId } } = this.props; + const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams(); + const payload = { + salaryAcctRecordId, ...pageInfo, ...extra, + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + positionIds: !_.isEmpty(positionIds) ? positionIds.split(",") : [], + subcompanyIds: !_.isEmpty(subcompanyIds) ? subcompanyIds.split(",") : [], + statuses: !_.isEmpty(statuses) ? statuses.split(",") : [] + }; + this.setState({ loading: true }); + acctResultList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, pageInfo: list } = data; + const { list: dataSource, pageNum: current, pageSize, total } = list; + this.setState({ pageInfo: { ...pageInfo, current, pageSize, total } }, () => { + const { pageInfo, selectedRowKeys } = this.state; + console.log(selectedRowKeys); + this.postMessageToChild({ + dataSource, pageInfo, selectedRowKeys, + columns: _.map(traverse(columns), (it, idx) => ({ ...it, fixed: idx < 2 ? "left" : false })) + }); + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { loading } = this.state; + return ( +
+ +