diff --git a/pc4mobx/hrmSalary/components/importModal/index.js b/pc4mobx/hrmSalary/components/importModal/index.js index 2df45373..3d8e2bcf 100644 --- a/pc4mobx/hrmSalary/components/importModal/index.js +++ b/pc4mobx/hrmSalary/components/importModal/index.js @@ -90,7 +90,6 @@ export default class ImportModal extends React.Component { onPreviewDate={() => this.handlePreviewDate()} dataSource={slideDataSource} columns={this.props.columns} - onStep2Next={() => {this.nextStep()}} onStep2Pre={() => {this.preStep()}}/>) } { diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/background.png b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/background.png new file mode 100644 index 00000000..49ee940a Binary files /dev/null and b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/background.png differ diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js index 6c5281a5..9d00cb4f 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js @@ -1,19 +1,35 @@ import React from 'react' +import background from './background.png' +import { Row, Col } from 'antd' export default class ComputerTemplate extends React.Component { render() { + const { isPC } = this.props; return (
测试标题
- +
- +
+ + 员工信息 + + + + 个税扣缴义务人 + 上海泛微 + 姓名 + 张三 + 部门 + 研发部 + +
) diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.js index 25a04f85..ed6be8b5 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.js @@ -2,6 +2,8 @@ import React from 'react' import phone from './phone_new.png' import computer from './computer.png' import './index.less' +import ComputerTemplate from './computerTemplate' +import PhoneTemplate from './phoneTemplate' export default class TemplatePreview extends React.Component { constructor(props) { @@ -31,6 +33,9 @@ export default class TemplatePreview extends React.Component {
+ { + this.state.selectKey == "0" ? : + }
diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less index 3d4c23ca..f3168d8c 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less @@ -1,4 +1,5 @@ .templatePreview { + .headerWrapper { background-color: #0270c1; height: 55px; @@ -10,7 +11,7 @@ height: 55px; .iconWrapper { display: inline-block; - width: 50px; + width: 64px; height: 55px; line-height: 75px; text-align: center; @@ -24,4 +25,71 @@ } } } + + .computerTemplate { + background-color: rgb(246, 246, 246); + width: 900px; + min-height: 1200px; + padding-top: 30px; + padding-bottom: 20px; + margin: 20px auto; + box-shadow: rgba(214, 214, 214, 0.5) 0px 0px 14px 0px; + border: 3px solid #fff; + .background-wrapper { + height: 200px; + margin: 10px; + } + .background-img { + width: 100%; + height: 200px; + } + .titleWrapper { + text-align: center; + font-size: 18px; + font-weight: 700; + } + .sobItem { + margin: 10px; + background-color: #FFF; + padding: 10px; + line-height: 35px; + text-align: center; + .titleRow { + border: 1px solid #f2f2f2; + text-align: left; + .sobTitle { + padding-left: 10px; + } + } + .contentRow { + border-left: 1px solid #f2f2f2; + border-bottom: 1px solid #f2f2f2; + border-right: 1px solid #f2f2f2; + } + .contentItem { + border-right: 1px solid #f2f2f2; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .contentItem:last-child { + border-right: none; + } + } + } + + .phoneTemplate { + width: 330px; + padding-top: 0px; + border-radius: 20px; + .phoneBar { + height: 50px; + line-height: 50px; + font-size: 16px; + font-weight: 700; + background-color: #fff; + text-align: center; + } + } + } \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js new file mode 100644 index 00000000..9fdfab88 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js @@ -0,0 +1,40 @@ +import React from 'react' +import { Row, Col} from 'antd' +import background from '../computerTemplate/background.png' +import "../index.less" + +export default class PhoneTemplate extends React.Component { + render() { + return ( +
+
薪酬预览
+
+ 测试标题 +
+
+ +
+ +
+
+ + 员工信息 + + + + 个税扣缴义务人 + 上海泛微 + 姓名 + 张三 + + + + 部门 + 研发部 + +
+
+
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.js b/pc4mobx/hrmSalary/pages/salaryFile/index.js index 7bc7df34..c89d9b85 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.js @@ -42,7 +42,8 @@ export default class SalaryFile extends React.Component { step: 0, recordSlideVisible: false, selectedRowKeys: [], - showSearchBar: false + showSearchBar: false, + importResult: {} } } @@ -82,7 +83,12 @@ export default class SalaryFile extends React.Component { handleImportFile(params) { const { salaryFileStore: {importSalaryArchive}} = this.props; params.importType = this.state.importType - importSalaryArchive(params) + importSalaryArchive(params).then(data => { + data.errorData = data.errorNotice + this.setState({ + importResult: data + }) + }) } @@ -298,7 +304,7 @@ export default class SalaryFile extends React.Component { step={step} setStep={this.setStep.bind(this)} slideDataSource={previewDataSource} - importResult={{}} + importResult={this.state.importResult} onFinish={() => {this.handleImportFinish()}} previewImport={(params) => { this.handlePreviewImport(params) @@ -310,8 +316,6 @@ export default class SalaryFile extends React.Component { onCancel={() => { this.setState({modalVisiable: false})}} /> } - - { this.state.changeSalaryVisible && { - API.importSalaryArchive(params).then(res => { - if(res.status) { - message.success("导入成功") - } else { - message.error(res.errormsg || "接口异常") - } + return new Promise((resolve, reject) => { + API.importSalaryArchive(params).then(res => { + if(res.status) { + message.success("导入成功") + resolve(res.data) + } else { + message.error(res.errormsg || "接口异常") + reject() + } + }) }) + } // 导出档案