diff --git a/pc4mobx/hrmSalary/pages/payroll/index.js b/pc4mobx/hrmSalary/pages/payroll/index.js index 5dba2203..229c33d8 100644 --- a/pc4mobx/hrmSalary/pages/payroll/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/index.js @@ -6,8 +6,6 @@ import moment from "moment"; import { WeaHelpfulTip, WeaInputSearch, WeaSelect, WeaSlideModal, WeaTop } from "ecCom"; import { renderLoading } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import CustomTab from "../../components/customTab"; - -import { columns, tempateColumns } from "./columns"; import StepSlide from "../../components/stepSlide"; import BaseInformForm from "./stepForm/baseInformForm"; import ShowSettingForm from "./stepForm/showSettingForm"; @@ -92,8 +90,8 @@ export default class Payroll extends React.Component { const { payrollStore } = this.props; const { fetchSavePayroll } = payrollStore; fetchSavePayroll().then(() => { - window.localStorage.removeItem("templateBaseData"); - window.localStorage.removeItem("salaryTemplateShowSet"); + window.localStorage.removeItem("template-basedata"); + window.localStorage.removeItem("salary-template-showset"); this.setState({ currentStep: 0, stepSlideVisible: false }); }); }; @@ -220,6 +218,9 @@ export default class Payroll extends React.Component { this.setState({ editSlideVisible: false, selectedTab: 0 + }, () => { + window.localStorage.removeItem("template-basedata"); + window.localStorage.removeItem("salary-template-showset"); }); }); }; @@ -245,14 +246,14 @@ export default class Payroll extends React.Component { if (_.every(validList, it => !!templateBaseData[it])) { window.localStorage.setItem("template-basedata", JSON.stringify(templateBaseData)); } else { - window.localStorage.removeItem("templateBaseData"); + window.localStorage.removeItem("template-basedata"); } return _.every(validList, it => !!templateBaseData[it]); }; render() { const { payrollStore, taxAgentStore: { showOperateBtn } } = this.props; - const { loading, hasRight, templateStore, deletePayroll } = payrollStore; + const { loading, hasRight, templateStore, deletePayroll, templateBaseData } = payrollStore; const { currentStep, selectedTab, templateSearchValue, templateSelect, startDate, endDate } = this.state; if (!hasRight && !loading) { // 无权限处理 return renderLoading(); @@ -353,6 +354,10 @@ export default class Payroll extends React.Component { }); return; } + if(templateBaseData.replenishName === templateBaseData.name){ + message.error("工资单模板名称和补发工资单模板名称不可相同") + return; + } this.setState({ currentStep: this.state.currentStep + 1 }); @@ -372,10 +377,12 @@ export default class Payroll extends React.Component { iconBgcolor="#F14A2D" // 左侧图标背景色 showDropIcon={false} // 是否显示下拉按钮 > - { - this.setState({ selectedKey: v, stepSlideVisible: false, editSlideVisible: false }); - }} + { + this.setState({ selectedKey: v, stepSlideVisible: false, editSlideVisible: false }); + }} /> { this.state.selectedKey === "0" && @@ -413,8 +420,8 @@ export default class Payroll extends React.Component { currentStep={currentStep} steps={steps} onCancel={() => { - window.localStorage.removeItem("templateBaseData"); - window.localStorage.removeItem("salaryTemplateShowSet"); + window.localStorage.removeItem("template-basedata"); + window.localStorage.removeItem("salary-template-showset"); this.setState({ stepSlideVisible: false }); }} customOperate={ @@ -513,8 +520,8 @@ export default class Payroll extends React.Component { } } onClose={() => this.setState({ editSlideVisible: false }, () => { - window.localStorage.removeItem("templateBaseData"); - window.localStorage.removeItem("salaryTemplateShowSet"); + window.localStorage.removeItem("template-basedata"); + window.localStorage.removeItem("salary-template-showset"); this.setState({ selectedTab: 0 }); })} /> diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js index fe997ed8..70629c32 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js @@ -45,7 +45,6 @@ export default class PhoneTemplate extends React.Component { const { salaryTemplateShowSet, salaryItemSet }= this.state; return (
-
薪酬预览
{salaryTemplateShowSet.theme.replace("${companyName}", "上海泛微").replace("${salaryMonth}", moment(new Date()).format("YYYY-MM"))}
diff --git a/pc4mobx/hrmSalary/single.js b/pc4mobx/hrmSalary/single.js index 6de29eb9..988ea681 100644 --- a/pc4mobx/hrmSalary/single.js +++ b/pc4mobx/hrmSalary/single.js @@ -31,8 +31,8 @@ class Root extends React.Component { componentWillMount() { top.$(".ant-message").remove(); allStore.taxAgentStore.getPermission(); - window.localStorage.removeItem("templateBaseData"); - window.localStorage.removeItem("salaryTemplateShowSet"); + window.localStorage.removeItem("template-basedata"); + window.localStorage.removeItem("salary-template-showset"); } render() { diff --git a/pc4mobx/hrmSalary/stores/payroll.js b/pc4mobx/hrmSalary/stores/payroll.js index 2e31a3bc..69c36548 100644 --- a/pc4mobx/hrmSalary/stores/payroll.js +++ b/pc4mobx/hrmSalary/stores/payroll.js @@ -192,6 +192,7 @@ export class payrollStore { if (res.status) { if (id !== "") { this.salaryItemSet = res.data.salaryTemplateSalaryItemSet; + this.replenishSalaryTemplateSalaryItemSet = res.data.salaryTemplateSalaryItemSet; } this.salaryTemplateShowSet = { ...res.data.salaryTemplateShowSet.data, ...JSON.parse(salaryTemplateShowSetStorage) }; } else {