diff --git a/pc4mobx/hrmSalary/pages/declare/index.js b/pc4mobx/hrmSalary/pages/declare/index.js index 9475d502..fcd8648f 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.js +++ b/pc4mobx/hrmSalary/pages/declare/index.js @@ -35,11 +35,10 @@ export default class Declare extends React.Component { selectedKey: "0", declarationModalVisible: false, startDate: moment(new Date()) - .subtract(3, "months") + .subtract(5, "months") .startOf("month") .format("YYYY-MM"), endDate: moment(new Date()) - .subtract(-3, "months") .startOf("month") .format("YYYY-MM"), }; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 745ee7fb..58ecc2eb 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -1,161 +1,264 @@ -import React from 'react' -import { Row, Col, Switch, Radio } from 'antd' -import { WeaHelpfulTip, WeaSelect, WeaTextarea, WeaInput } from 'ecCom' -import "./index.less" -import { roundingModeOptions, patternOptions, dataTypeOptions } from "./options" -import RequiredLabelTip from '../../components/requiredLabelTip' -import FormalFormModal from './formalFormModal' +import React from "react"; +import { Row, Col, Switch, Radio } from "antd"; +import { WeaHelpfulTip, WeaSelect, WeaTextarea, WeaInput } from "ecCom"; +import "./index.less"; +import { + roundingModeOptions, + patternOptions, + dataTypeOptions +} from "./options"; +import RequiredLabelTip from "../../components/requiredLabelTip"; +import FormalFormModal from "./formalFormModal"; export default class CustomSalaryItemSlide extends React.Component { - constructor(props) { - super(props) - this.state = { - showForm: false, - formalModalVisible: false - } - } + constructor(props) { + super(props); + this.state = { + showForm: false, + formalModalVisible: false + }; + } - handleChange(params) { - let request = {...this.props.request, ...params} - this.props.onChange(request) - } + handleChange(params) { + let request = { ...this.props.request, ...params }; + this.props.onChange(request); + } - handleShowFormal() { - this.setState({ - formalModalVisible: true - }) - } - - // 保存公式成功回调 - handleSaveFormal(data) { - this.handleChange({formulaId: data.id, formulaContent: data.formula}) - } + handleShowFormal() { + this.setState({ + formalModalVisible: true + }); + } - render() { - const { editable, request, isAdd } = this.props; - const { name, useDefault, useInEmployeeSalary, roundingMode, pattern, valueType, description, dataType, formulaContent, formulaId } = request; - const { formalModalVisible } = this.state; + // 保存公式成功回调 + handleSaveFormal(data) { + this.handleChange({ formulaId: data.id, formulaContent: data.formula }); + } - return ( -
-
- - 名称 - - {this.handleChange({name: value})}}/> - - - - 默认使用 - - {this.handleChange({useDefault: value ? 1 : 0})}}/> - - - + render() { + const { editable, request, isAdd } = this.props; + const { + name, + useDefault, + useInEmployeeSalary, + roundingMode, + pattern, + valueType, + description, + dataType, + formulaContent, + formulaId + } = request; + const { formalModalVisible } = this.state; - - - 薪资档案引用 - - {this.handleChange({useInEmployeeSalary: value? 1: 0})}}/> - - - - - - - - 字段类型 - - {this.handleChange({dataType: value})}} style={{width: "200px"}}/> - - - - - - - - 舍入规则 - - {this.handleChange({roundingMode: value})}}/> - - - - - - 保留小数位 - - {this.handleChange({pattern: value})}} value={pattern} style={{width: "200px"}}/> - - - - - - - - 取值方式 - - { - this.handleChange({valueType: e.target.value, formulaId: null, formulaContent: ""}) - - }}> - 输入 - 公式 - SQL - - - - { - ( valueType == 2 || valueType == 3 ) && - {valueType == 2 ? "公式" : "SQL"} - -
- { - if(this.props.record.canEdit || isAdd) { - this.handleShowFormal() - } - }} - > - {formulaContent} -
- -
- } - - - 备注 - - {this.handleChange({description: value})}}/> - - - -
- { - formalModalVisible && - { - this.handleSaveFormal(data) - }} - onCancel={() => this.setState({ - formalModalVisible: false - })} - /> + return ( +
+
+ + + 名称 + + + - ) - } -} \ No newline at end of file + value={name} + onChange={value => { + this.handleChange({ name: value }); + }} + /> + + + + 默认使用 + + { + this.handleChange({ useDefault: value ? 1 : 0 }); + }} + /> + + + + + + 薪资档案引用 + + { + this.handleChange({ useInEmployeeSalary: value ? 1 : 0 }); + }} + /> + + + + + + + + + 字段类型 + + + { + this.handleChange({ dataType: value }); + }} + style={{ width: "200px" }} + /> + + + + + + + + + 舍入规则 + + + { + this.handleChange({ roundingMode: value }); + }} + /> + + + + + + + 保留小数位 + + + { + this.handleChange({ pattern: value }); + }} + value={pattern} + style={{ width: "200px" }} + /> + + + + + + + + 取值方式 + + + { + this.handleChange({ + valueType: e.target.value, + formulaId: null, + formulaContent: "" + }); + }}> + + 输入 + + + 公式 + + + SQL + + + + + {(valueType == 2 || valueType == 3) && + + + {valueType == 2 ? "公式" : "SQL"} + + + +
{ + if (this.props.record.canEdit || isAdd) { + this.handleShowFormal(); + } + }}> + {formulaContent} +
+ +
} + + + 备注 + + { + this.handleChange({ description: value }); + }} + /> + + +
+ {formalModalVisible && + { + this.handleSaveFormal(data); + }} + onCancel={() => + this.setState({ + formalModalVisible: false + })} + />} +
+ ); + } +} diff --git a/pc4mobx/hrmSalary/stores/programme.js b/pc4mobx/hrmSalary/stores/programme.js index eac6325e..9720c1cb 100644 --- a/pc4mobx/hrmSalary/stores/programme.js +++ b/pc4mobx/hrmSalary/stores/programme.js @@ -141,7 +141,7 @@ export class ProgrammeStore { resultList= _.map(resultList, it => ({ ...it, rententionRule: it.rententionRule ? it.rententionRule : "2", - validNum: it.validNum ? it.validNum : "2" + validNum: !_.isNil(it.validNum) ? it.validNum : "2" })) this.defaultPersonDataSource = resultList.filter(item => item.paymentScope == "个人") this.defaultCompanyDataSource = resultList.filter(item => item.paymentScope == "公司") diff --git a/pc4mobx/hrmSalary/stores/salaryItem.js b/pc4mobx/hrmSalary/stores/salaryItem.js index 7370f582..07e67a5f 100644 --- a/pc4mobx/hrmSalary/stores/salaryItem.js +++ b/pc4mobx/hrmSalary/stores/salaryItem.js @@ -24,7 +24,7 @@ export class SalaryItemStore { useDefault: 0, useInEmployeeSalary: 0, systemType:0, - roundingMode: 0, + roundingMode: "1", pattern: 0, valueType: 1, dataType: "number", @@ -62,7 +62,7 @@ export class SalaryItemStore { useDefault: 0, useInEmployeeSalary: 0, systemType:0, - roundingMode: 0, + roundingMode: "1", pattern: 0, valueType: "1", dataType: "number",