工资单模板预览页面空白
This commit is contained in:
parent
0a3e2f8b02
commit
5c6db20caa
|
|
@ -66,11 +66,11 @@ export default class Payroll extends React.Component {
|
|||
if (!isEdit) {
|
||||
this.setState({ currentStep: this.state.currentStep + 1 }, () => {
|
||||
setReplenishSalaryTemplateSalaryItemSet(data.replenishSalaryTemplateSalaryItemSet);
|
||||
window.localStorage.setItem("salary-template-showset", JSON.stringify(salaryTemplateShowSet));
|
||||
window.localStorage.setItem("salary-showset", JSON.stringify(salaryTemplateShowSet));
|
||||
});
|
||||
} else {
|
||||
setReplenishSalaryTemplateSalaryItemSet(data.replenishSalaryTemplateSalaryItemSet);
|
||||
window.localStorage.setItem("salary-template-showset", JSON.stringify(salaryTemplateShowSet));
|
||||
window.localStorage.setItem("salary-showset", JSON.stringify(salaryTemplateShowSet));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -81,7 +81,7 @@ export default class Payroll extends React.Component {
|
|||
const { fetchSavePayroll } = payrollStore;
|
||||
fetchSavePayroll().then(() => {
|
||||
window.localStorage.removeItem("template-basedata");
|
||||
window.localStorage.removeItem("salary-template-showset");
|
||||
window.localStorage.removeItem("salary-showset");
|
||||
this.setState({ currentStep: 0, stepSlideVisible: false });
|
||||
});
|
||||
};
|
||||
|
|
@ -174,7 +174,7 @@ export default class Payroll extends React.Component {
|
|||
handlePreview = () => {
|
||||
const { payrollStore: { templateBaseData, salaryTemplateShowSet, salaryItemSet } } = this.props;
|
||||
window.localStorage.setItem("template-basedata", JSON.stringify(templateBaseData));
|
||||
window.localStorage.setItem("salary-template-showset", JSON.stringify(salaryTemplateShowSet));
|
||||
window.localStorage.setItem("salary-showset", JSON.stringify(salaryTemplateShowSet));
|
||||
window.localStorage.setItem("salaryItemSet", JSON.stringify(salaryItemSet));
|
||||
window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/templatePreview");
|
||||
};
|
||||
|
|
@ -210,7 +210,7 @@ export default class Payroll extends React.Component {
|
|||
selectedTab: 0
|
||||
}, () => {
|
||||
window.localStorage.removeItem("template-basedata");
|
||||
window.localStorage.removeItem("salary-template-showset");
|
||||
window.localStorage.removeItem("salary-showset");
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -411,7 +411,7 @@ export default class Payroll extends React.Component {
|
|||
steps={steps}
|
||||
onCancel={() => {
|
||||
window.localStorage.removeItem("template-basedata");
|
||||
window.localStorage.removeItem("salary-template-showset");
|
||||
window.localStorage.removeItem("salary-showset");
|
||||
this.setState({ stepSlideVisible: false });
|
||||
}}
|
||||
customOperate={
|
||||
|
|
@ -511,7 +511,7 @@ export default class Payroll extends React.Component {
|
|||
</div>}
|
||||
onClose={() => this.setState({ editSlideVisible: false }, () => {
|
||||
window.localStorage.removeItem("template-basedata");
|
||||
window.localStorage.removeItem("salary-template-showset");
|
||||
window.localStorage.removeItem("salary-showset");
|
||||
this.setState({ selectedTab: 0 });
|
||||
})}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ export default class ShowSettingForm extends React.Component {
|
|||
|
||||
render() {
|
||||
const { payrollStore, id } = this.props;
|
||||
const salaryTemplateShowSetStorage = id ? "{}" : window.localStorage.getItem("salary-template-showset") || "{}";
|
||||
const salaryTemplateShowSetStorage = id ? "{}" : window.localStorage.getItem("salary-showset") || "{}";
|
||||
const { salaryTemplateShowSet } = payrollStore;
|
||||
const { salaryItemSet } = payrollStore;
|
||||
const {
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ export default class ComputerTemplate extends React.Component {
|
|||
|
||||
componentWillMount() {
|
||||
if (this.props.isPreview) return;
|
||||
let salaryTemplateShowSetStr = window.localStorage.getItem("salary-template-showset");
|
||||
let salaryItemSetStr = window.localStorage.getItem("salaryItemSet");
|
||||
let salaryTemplateShowSetStr = window.localStorage.getItem("salary-showset") || "{}";
|
||||
let salaryItemSetStr = window.localStorage.getItem("salaryItemSet") || "{}";
|
||||
this.setState({
|
||||
salaryItemSet: JSON.parse(salaryItemSetStr),
|
||||
salaryTemplateShowSet: JSON.parse(salaryTemplateShowSetStr)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export default class PhoneTemplate extends React.Component {
|
|||
|
||||
componentWillMount() {
|
||||
if(this.props.isPreview) return;
|
||||
let salaryTemplateShowSetStr = window.localStorage.getItem("salary-template-showset");
|
||||
let salaryTemplateShowSetStr = window.localStorage.getItem("salary-showset");
|
||||
let salaryItemSetStr = window.localStorage.getItem("salaryItemSet");
|
||||
this.setState({
|
||||
salaryItemSet: JSON.parse(salaryItemSetStr),
|
||||
|
|
|
|||
|
|
@ -31,8 +31,10 @@ class Root extends React.Component {
|
|||
componentWillMount() {
|
||||
top.$(".ant-message").remove();
|
||||
allStore.taxAgentStore.getPermission();
|
||||
window.localStorage.removeItem("template-basedata");
|
||||
window.localStorage.removeItem("salary-template-showset");
|
||||
if(window.location.hash.indexOf("payroll")!== -1){
|
||||
window.localStorage.removeItem("template-basedata");
|
||||
window.localStorage.removeItem("salary-showset");
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ export class payrollStore {
|
|||
@action
|
||||
getPayrollShowForm = (id = "") => {
|
||||
const params = { id };
|
||||
const salaryTemplateShowSetStorage = window.localStorage.getItem("salary-template-showset") || "{}";
|
||||
const salaryTemplateShowSetStorage = window.localStorage.getItem("salary-showset") || "{}";
|
||||
API.getPayrollShowForm(params).then(res => {
|
||||
if (res.status) {
|
||||
if (id !== "") {
|
||||
|
|
|
|||
Loading…
Reference in New Issue