diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js index 69ebf94e..157467d7 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js @@ -1,7 +1,8 @@ import React from "react"; -import { WeaCheckbox, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom"; +import { WeaCheckbox, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaSelect, WeaTimePicker } from "ecCom"; import { inject, observer } from "mobx-react"; import { getReplenishRuleSetOptions } from "../../../apis/payroll"; +import moment from "moment"; import { toJS } from "mobx"; import "./index.less"; @@ -35,7 +36,8 @@ export default class BaseInformForm extends React.Component { ...data.templateBaseData, msgStatus: !this.props.id ? "1" : data.templateBaseData.msgStatus, reissueRule: data.templateBaseData.replenishRule ? "1" : "0", - ...JSON.parse(templateBaseData) + ...JSON.parse(templateBaseData), + sendEmail: "" } }, () => { this.props.onChange && this.props.onChange(this.state.request); @@ -73,7 +75,19 @@ export default class BaseInformForm extends React.Component { render() { const { request, options, replenishRuleOptions } = this.state; - const { salarySob, name, description, replenishName, replenishRule, reissueRule, msgStatus, emailStatus } = request; + const { + salarySob, + name, + description, + replenishName, + replenishRule, + reissueRule, + msgStatus, + emailStatus, + autoSendStatus, + autoSendDayOfMonth, + autoSendTimeOfDay + } = request; return ( @@ -164,8 +178,61 @@ export default class BaseInformForm extends React.Component { this.hanldeChange({ emailStatus: value === "1" })}/> + + this.hanldeChange({ autoSendStatus: value === "1" })}/> + + { + autoSendStatus && + + + + } ); } } + +const SendTimeComp = (props) => { + const { value, onChange } = props; + const { autoSendDayOfMonth, autoSendTimeOfDay } = value; + + const handleChangeSendtime = (key, val) => { + onChange({ autoSendDayOfMonth, autoSendTimeOfDay, [key]: val }); + }; + return
+
+ {getLabel(111, "每月")} + ({ key: item, showname: item }))} + onChange={v => handleChangeSendtime("autoSendDayOfMonth", v)} + /> + {getLabel(16992, "号")} +
+ handleChangeSendtime("autoSendTimeOfDay", v)}/> +
; +}; + +const getDay = () => { + let days = []; + let day = getDaysInMonth(moment().year(), moment().month() + 1); + for (let i = 1; i <= day; i++) { + days.push(i); + } + return days; +}; + +const getDaysInMonth = (year, month) => { + month = parseInt(month, 10); + let d = new Date(year, month, 0); + return d.getDate(); +}; diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/index.less b/pc4mobx/hrmSalary/pages/payroll/stepForm/index.less index 4bfbe9d0..f30d0063 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/index.less +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/index.less @@ -234,4 +234,20 @@ border-bottom: 1px solid #e5e5e5; } } + + .customTimeCompWrapper { + display: flex; + justify-content: flex-start; + + & > div { + margin-right: 10px; + display: flex; + align-items: center; + + .wea-select { + width: 80px; + margin: 0 10px; + } + } + } }