diff --git a/pc4mobx/hrmSalary/components/importModal/modalStep1.js b/pc4mobx/hrmSalary/components/importModal/modalStep1.js index 3c810b47..16bf8b7b 100644 --- a/pc4mobx/hrmSalary/components/importModal/modalStep1.js +++ b/pc4mobx/hrmSalary/components/importModal/modalStep1.js @@ -28,7 +28,7 @@ export default class ModalStep1 extends React.Component { const dragger = { name: 'file', multiple: false, - action: "handleCancel", //上传地址 + action: "/api/doc/upload/uploadFile", //上传地址 onChange: (info) => { const { status } = info.file; if (status !== 'uploading') { diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 55ccf955..091a8b90 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -24,6 +24,7 @@ import PlaceOnFileDetail from './pages/calculateDetail/placeOnFileDetail'; import CompareDetail from './pages/calculateDetail/compareDetail' import GenerateDeclarationDetail from './pages/declare/generateDeclarationDetail' import BaseForm from './components'; +import TemplatePreview from './pages/payroll/templatePreview' import stores from './stores'; @@ -93,6 +94,7 @@ const Routes = ( + diff --git a/pc4mobx/hrmSalary/pages/payroll/index.js b/pc4mobx/hrmSalary/pages/payroll/index.js index 3ffac0c0..bcc5aaa4 100644 --- a/pc4mobx/hrmSalary/pages/payroll/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/index.js @@ -32,10 +32,8 @@ export default class Payroll extends React.Component { this.state = { value: "", selectedKey: "0", - startDate: moment(new Date()).format("YYYY-MM"), - endDate: moment(new Date()).format("YYYY-MM"), - selectedKey: "0", - stepSlideVisible: false, + startDate: "", + endDate: "", currentStep: 0, stepSlideVisible: false, selectedTab: 0, @@ -49,12 +47,12 @@ export default class Payroll extends React.Component { } columns.map(item => { if(item.dataIndex == "cz") { - item.render = () => { + item.render = (text, record) => { return ( ) } @@ -83,6 +81,17 @@ export default class Payroll extends React.Component { }) } + // 更新模板 + handleUpdateTemplate(record) { + alert(JSON.stringify(record)) + this.setState({ + selectedKey: "1", + editSlideVisible: true, + templateCurrentId: record.templateId + + }) + } + // 工资单模板-新建表单变化监听 handleBaseInfoChange(request) { const { payrollStore: {setTemplateBaseData}} = this.props; @@ -167,6 +176,46 @@ export default class Payroll extends React.Component { }, }); } + + // 开始日期修改 + handleStartDateChange(value) { + this.setState({ + startDate: value + }) + + const { payrollStore } = this.props; + const { getPayrollList } = payrollStore; + let salaryYearMonth = [] + if(value != "") { + salaryYearMonth.push(value) + } + if(this.state.endDate != "") { + salaryYearMonth.push(this.state.endDate); + } + getPayrollList({salaryYearMonth}) + + } + + // 结束日期修改 + handleEndDateChange(value) { + this.setState({endDate: value}) + const { payrollStore } = this.props; + const { getPayrollList } = payrollStore; + let salaryYearMonth = [] + if(this.state.startDate != "") { + salaryYearMonth.push(this.state.startDate) + } + if(value != "") { + salaryYearMonth.push(value) + } + getPayrollList({salaryYearMonth}) + } + + + // 预览 + handlePreview() { + window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/templatePreview") + } render() { @@ -219,13 +268,13 @@ export default class Payroll extends React.Component { this.props.onStartDateChange(value)} + onChange={value => this.handleStartDateChange(value)} /> this.props.onEndDateChange(value)} + onChange={value => this.handleEndDateChange(value)} /> @@ -330,7 +379,7 @@ export default class Payroll extends React.Component { currentStep == 1 &&
- +
} diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js index 07d3eefd..345de372 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js @@ -82,7 +82,7 @@ export default class ShowSettingForm extends React.Component { - 工资单主题 + 工资单背景 {this.handleChange({background: value})}}/> {/* diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computer.png b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computer.png new file mode 100644 index 00000000..535b91b9 Binary files /dev/null and b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computer.png differ diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js new file mode 100644 index 00000000..6c5281a5 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js @@ -0,0 +1,21 @@ +import React from 'react' + +export default class ComputerTemplate extends React.Component { + + render() { + return ( +
+
+ 测试标题 +
+
+ +
+ +
+ +
+
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.js new file mode 100644 index 00000000..25a04f85 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.js @@ -0,0 +1,39 @@ +import React from 'react' +import phone from './phone_new.png' +import computer from './computer.png' +import './index.less' + +export default class TemplatePreview extends React.Component { + constructor(props) { + super(props) + this.state = { + selectKey: "0" + } + } + + handleSelectClick(selectKey) { + this.setState({selectKey}) + } + + render() { + const { selectKey } = this.state; + return ( +
+
+
+
{this.handleSelectClick("0")}} className={selectKey == "0" ? "iconWrapper activeIconWrapper" : "iconWrapper" }> + +
+
{this.handleSelectClick("1")}} className={selectKey == "1" ? "iconWrapper activeIconWrapper" : "iconWrapper"}> + +
+
+
+ +
+ +
+
+ ) + } +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less new file mode 100644 index 00000000..3d4c23ca --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less @@ -0,0 +1,27 @@ +.templatePreview { + .headerWrapper { + background-color: #0270c1; + height: 55px; + line-height: 55px; + text-align: center; + .iconsWrapper { + display: inline-block; + width: 150px; + height: 55px; + .iconWrapper { + display: inline-block; + width: 50px; + height: 55px; + line-height: 75px; + text-align: center; + img { + width: 30px; + height: 30px; + } + } + .activeIconWrapper { + background-color: #1c87d3; + } + } + } +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/phone_new.png b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phone_new.png new file mode 100644 index 00000000..4a1acf81 Binary files /dev/null and b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phone_new.png differ