import React from 'react' import background from './background.png' import { Row, Col } from 'antd' import moment from 'moment' import { inject, observer } from 'mobx-react'; @inject('payrollStore') @observer export default class ComputerTemplate extends React.Component { constructor(props) { super(props); this.templateBaseData = {} this.salaryItemSetStr = {} this.salaryTemplateShowSet = [] } componentWillMount() { let templateBaseDataStr = window.localStorage.getItem("templateBaseData"); this.templateBaseData = JSON.parse(templateBaseDataStr) let salaryTemplateShowSetStr = window.localStorage.getItem("salaryTemplateShowSet"); let salaryItemSetStr = window.localStorage.getItem("salaryItemSet"); this.salaryItemSet = JSON.parse(salaryItemSetStr) this.salaryTemplateShowSet = JSON.parse(salaryTemplateShowSetStr) } render() { const { isPC } = this.props; return (
{this.salaryTemplateShowSet.theme.replace("${companyName}", "上海泛微").replace("${salaryMonth}", moment(new Date()).format("YYYY-MM"))}
{ this.salaryTemplateShowSet.background &&
}
{ this.salaryTemplateShowSet.textContentPosition == 1 && this.salaryTemplateShowSet.textContent }
{ this.salaryItemSet.length > 0 && this.salaryItemSet.map((group,index) => (
{group.groupName} { group.items && group.items.map(item => ( {item.name} {index == 0 ? item.salaryItemValue : 10000} )) }
)) }
{ this.salaryTemplateShowSet.textContentPosition == 2 && this.salaryTemplateShowSet.textContent }
) } }