From 7384d124b2fcf6238c6437abe02ed985fc87e595 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Mon, 24 Oct 2022 11:24:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95=E5=8F=91=E6=94=BE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8A=A5=E9=94=99=E7=9A=84bug=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/mobilePayroll/index.js | 15 ++++++++------- .../templatePreview/computerTemplate/index.js | 8 +++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 949412ed..5ea4e38e 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -11,9 +11,10 @@ import "../payroll/templatePreview/index.less"; export default class MobilePayroll extends React.Component { constructor(props) { super(props); - this.state= { + this.state = { mySalaryBillData: { - employeeInformation: {} + employeeInformation: {}, + salaryTemplate: [] } }; this.id = ""; @@ -31,13 +32,13 @@ export default class MobilePayroll extends React.Component { getMySalaryBill(id).then(result => { this.setState({ mySalaryBillData: result - }) - }) - } + }); + }); + }; render() { - const { mySalaryBillData }= this.state; + const { mySalaryBillData } = this.state; const type = getQueryString("type"); const employeeInformation = mySalaryBillData.employeeInformation ? mySalaryBillData.employeeInformation : {}; const salaryGroups = mySalaryBillData.salaryGroups ? mySalaryBillData.salaryGroups : []; @@ -64,7 +65,7 @@ export default class MobilePayroll extends React.Component { isPreview isMsgPreview salaryTemplateShowSet={JSON.stringify(mySalaryBillData.salaryTemplate)} - salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : []} + salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : JSON.stringify([])} /> } diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js index b6ddd000..f1616003 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js @@ -73,9 +73,11 @@ export default class ComputerTemplate extends React.Component { const { salaryTemplateShowSet, salaryItemSet } = this.state; return (
-
- {salaryTemplateShowSet.theme.replace("${companyName}", "").replace("${salaryMonth}", moment(new Date()).format("YYYY-MM"))} -
+ {salaryTemplateShowSet.theme && +
+ {salaryTemplateShowSet.theme.replace("${companyName}", "").replace("${salaryMonth}", moment(new Date()).format("YYYY-MM"))} +
+ } { salaryTemplateShowSet.background &&