This commit is contained in:
parent
32d0578be2
commit
b678ec91e6
|
|
@ -20,6 +20,7 @@ export class EditableCell extends React.Component {
|
|||
<div className="editable-cell-input-wrapper">
|
||||
{
|
||||
editable ? <Input
|
||||
type={this.props.type ? this.props.type : "text"}
|
||||
value={value}
|
||||
onChange={this.handleChange}
|
||||
/> : value
|
||||
|
|
@ -40,6 +41,7 @@ export default class EditableTable extends React.Component {
|
|||
if (item.editable) {
|
||||
item.render = (text, record) => (
|
||||
<EditableCell
|
||||
type={this.props.type ? this.props.type : "text"}
|
||||
value={text}
|
||||
record={record}
|
||||
onChange={this.onCellChange(record.indexNum, item.dataIndex)}
|
||||
|
|
@ -66,6 +68,7 @@ export default class EditableTable extends React.Component {
|
|||
if (child.editable) {
|
||||
child.render = (text, record) => (
|
||||
<EditableCell
|
||||
type={this.props.type ? this.props.type : "text"}
|
||||
value={text}
|
||||
onChange={this.onCellChange(record.indexNum, child.dataIndex)}
|
||||
editable={this.props.editable}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import React from 'react'
|
||||
import { Checkbox, Radio, Row, Col } from "antd"
|
||||
import { WeaInput } from "ecCom"
|
||||
import RequiredLabelTip from '../requiredLabelTip';
|
||||
const CheckboxGroup = Checkbox.Group;
|
||||
|
||||
export default class CustomForm extends React.Component {
|
||||
|
||||
|
||||
handleChange(params) {
|
||||
let request = {...this.props.request, ...params}
|
||||
this.props.onChange(request);
|
||||
|
|
@ -21,7 +20,9 @@ export default class CustomForm extends React.Component {
|
|||
return (
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={6}>
|
||||
{item.label} :
|
||||
{item.label} {
|
||||
item.rules == "required" && <RequiredLabelTip />
|
||||
} :
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
import React from 'react'
|
||||
import "./index.less"
|
||||
|
||||
export default class RequiredLabelTip extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<span className="requireLabel" style={{
|
||||
display: "inline-block",
|
||||
marginRight: "4px",
|
||||
color: "#ff4d4f",
|
||||
fontSize: "14px",
|
||||
fontFamily: "SimSun,sans-serif",
|
||||
lineHeight: 1
|
||||
}}>*</span>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
.requireLabel:after {
|
||||
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ import React from 'react'
|
|||
import { Modal, Button, Row, Col, Radio } from 'antd'
|
||||
import { WeaSelect, WeaBrowser } from "ecCom"
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import RequiredLabelTip from '../../components/requiredLabelTip';
|
||||
|
||||
const objectOptions = [
|
||||
{
|
||||
|
|
@ -38,6 +39,7 @@ export default class AddUserModal extends React.Component {
|
|||
this.setState({radioValue: e.target.value})
|
||||
}
|
||||
|
||||
// 保存
|
||||
handleSave() {
|
||||
const { ledgerStore: {saveLedgerPersonRange, salarySobId, includeType} } = this.props;
|
||||
saveLedgerPersonRange({
|
||||
|
|
@ -48,6 +50,15 @@ export default class AddUserModal extends React.Component {
|
|||
})
|
||||
}
|
||||
|
||||
// 重置
|
||||
handleReset() {
|
||||
this.setState({
|
||||
selectedKey: "EMPLOYEE",
|
||||
radioValue: "ALL",
|
||||
ids: ""
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Modal visible={this.props.visible} onCancel={() => {this.props.onCancel()}} width={600}
|
||||
|
|
@ -55,13 +66,13 @@ export default class AddUserModal extends React.Component {
|
|||
footer={
|
||||
<div style={{display:"inlne-block"}}>
|
||||
<Button type="primary" onClick={() => {this.handleSave()}}>保存</Button>
|
||||
<Button type="default" >重置</Button>
|
||||
<Button type="default" onClick={() => {this.handleReset()}}>重置</Button>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div style={{padding: "20px"}}>
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={8}>对象类型</Col>
|
||||
<Col span={8}>对象类型<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
<div style={{display: "inline-block", verticalAlign: "top"}}>
|
||||
<WeaSelect style={{height: "30px", marginRight: "10px"}} options={objectOptions} value={this.state.selectedKey} onChange={(value) => {
|
||||
|
|
@ -103,7 +114,7 @@ export default class AddUserModal extends React.Component {
|
|||
</Col>
|
||||
</Row>
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={8}>选择员工状态</Col>
|
||||
<Col span={8}>选择员工状态<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
<Radio.Group onChange={(e) => this.onRadioChange(e)} value={this.state.radioValue}>
|
||||
<Radio value={"ALL"}>全部</Radio>
|
||||
|
|
|
|||
|
|
@ -325,7 +325,19 @@ export default class Ledger extends React.Component {
|
|||
content={
|
||||
<div>
|
||||
{
|
||||
currentStep == 0 && <BaseForm />
|
||||
currentStep == 0 && <SlideBaseForm />
|
||||
}
|
||||
{
|
||||
currentStep == 1 && <SlideRefereUser />
|
||||
}
|
||||
{
|
||||
currentStep == 2 && <SalaryItemForm />
|
||||
}
|
||||
{
|
||||
currentStep == 3 && <CalRulesForm />
|
||||
}
|
||||
{
|
||||
currentStep == 4 && <ValidRulesForm />
|
||||
}
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import "./index.less"
|
|||
import TipLabel from '../../components/TipLabel'
|
||||
import { daysOptions, cycleTypeOption } from './options'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import RequiredLabelTip from "../../components/requiredLabelTip"
|
||||
|
||||
@inject('ledgerStore')
|
||||
@observer
|
||||
|
|
@ -48,13 +49,13 @@ export default class SlideBaseForm extends React.Component {
|
|||
<Col span={18}>
|
||||
<div className="leftContentWrapper">
|
||||
<Row className="formItem">
|
||||
<Col span={6}>账套名称</Col>
|
||||
<Col span={6}>账套名称<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaInput style={{width: "190px"}} value={name} onChange={(value) => {this.handleChange({name: value})}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>薪资类型</Col>
|
||||
<Col span={6}>薪资类型<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect options={[{
|
||||
key: "1",
|
||||
|
|
@ -64,7 +65,7 @@ export default class SlideBaseForm extends React.Component {
|
|||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>薪资周期</Col>
|
||||
<Col span={6}>薪资周期<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={salaryCycleType} onChange={(value) => {this.handleChange({salaryCycleType: value})}}/>
|
||||
<WeaSelect options={daysOptions} style={{width: "90px", marginLeft: '10px'}} value={salaryCycleFromDay} onChange={(value) => {this.handleChange({salaryCycleFromDay: value})}}/>
|
||||
|
|
@ -72,13 +73,13 @@ export default class SlideBaseForm extends React.Component {
|
|||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>税款所属期</Col>
|
||||
<Col span={6}>税款所属期<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={taxCycleType} onChange={(value) => {this.handleChange({taxCycleType: value})}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>考勤周期</Col>
|
||||
<Col span={6}>考勤周期<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={attendCycleType} onChange={(value) => {this.handleChange({attendCycleType: value})}}/>
|
||||
<WeaSelect options={daysOptions} style={{width: "90px", marginLeft: "10px"}} value={attendCycleFromDay} onChange={(value) => {this.handleChange({attendCycleFromDay: value})}}/>
|
||||
|
|
@ -86,14 +87,14 @@ export default class SlideBaseForm extends React.Component {
|
|||
</Col>
|
||||
</Row>
|
||||
<Row className="formItem">
|
||||
<Col span={6}>福利台账月份</Col>
|
||||
<Col span={6}>福利台账月份<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect options={cycleTypeOption} style={{width: "90px"}} value={socialSecurityCycleType} onChange={(value) => {this.handleChange({socialSecurityCycleType: value})}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row className="formItem">
|
||||
<Col span={6}>核算人员范围</Col>
|
||||
<Col span={6}>核算人员范围<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaCheckbox value={true} viewAttr={1} content="【入职日期≤薪资周期止】且【离职日期≥薪资周期起】" />
|
||||
</Col>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import React from 'react'
|
||||
import { Row, Col, Modal, Button } from 'antd'
|
||||
import { WeaInput } from 'ecCom'
|
||||
import RequiredLabelTip from '../../../components/requiredLabelTip'
|
||||
|
||||
|
||||
export default class AddCategoryModal extends React.Component {
|
||||
|
|
@ -17,7 +18,7 @@ export default class AddCategoryModal extends React.Component {
|
|||
>
|
||||
<div style={{padding: "20px"}}>
|
||||
<Row>
|
||||
<Col span={6}>分类名称</Col>
|
||||
<Col span={6}>分类名称<RequiredLabelTip /></Col>
|
||||
<Col span={18}>
|
||||
<WeaInput value={this.state.name} onChange={(value) => {this.setState({name: value})}}/>
|
||||
</Col>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import React from 'react'
|
||||
import { Row, Col, Radio, Button, Modal } from 'antd'
|
||||
import { Row, Col, Radio, Button, Modal, message } from 'antd'
|
||||
import { WeaSelect, WeaHelpfulTip} from 'ecCom'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import {daysOptions} from "../options"
|
||||
import RequiredLabelTip from '../../../components/requiredLabelTip';
|
||||
import { notNull } from '../../../util/validate';
|
||||
|
||||
|
||||
@inject('ledgerStore')
|
||||
|
|
@ -35,8 +37,36 @@ export default class RuleEditModal extends React.Component {
|
|||
afterAdjustmentTypeChange(e) {
|
||||
this.setState({afterAdjustmentType: e.target.value})
|
||||
}
|
||||
|
||||
validateForm() {
|
||||
const {itemValue, effectiveDate, beforeAdjustmentType, afterAdjustmentType} = this.state;
|
||||
if(!notNull(itemValue)) {
|
||||
message.warning("薪资项目不能为空")
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!notNull(effectiveDate)) {
|
||||
message.warning("计薪规则不能为空")
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!notNull(beforeAdjustmentType)) {
|
||||
message.warning("计薪规则不能为空")
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!notNull(afterAdjustmentType)) {
|
||||
message.warning("计薪规则不能为空")
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
handleSave() {
|
||||
if(!this.validateForm()) {
|
||||
return;
|
||||
}
|
||||
const { ledgerStore } = this.props;
|
||||
const { ruleOptionList } = ledgerStore;
|
||||
let salaryItemName = ""
|
||||
|
|
@ -45,6 +75,7 @@ export default class RuleEditModal extends React.Component {
|
|||
salaryItemName = item.showname
|
||||
}
|
||||
})
|
||||
|
||||
this.props.onSave({
|
||||
salaryItemId:this.state.itemValue,
|
||||
dayOfMonth:this.state.effectiveDate,
|
||||
|
|
@ -66,7 +97,7 @@ export default class RuleEditModal extends React.Component {
|
|||
>
|
||||
<div style={{padding: '20px'}}>
|
||||
<Row style={{lineHeight: '40px'}}>
|
||||
<Col span={8}>薪资项目</Col>
|
||||
<Col span={8}>薪资项目<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
{
|
||||
initedSelect &&
|
||||
|
|
@ -75,7 +106,7 @@ export default class RuleEditModal extends React.Component {
|
|||
</Col>
|
||||
</Row>
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={8}>计薪规则</Col>
|
||||
<Col span={8}>计薪规则<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
<div>
|
||||
<WeaHelpfulTip
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
import React from 'react'
|
||||
import { Modal, Row, Col, Button } from 'antd'
|
||||
import { Modal, Row, Col, Button, message } from 'antd'
|
||||
import { WeaInput } from 'ecCom'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import RequiredLabelTip from '../../../components/requiredLabelTip';
|
||||
import { notNull } from '../../../util/validate';
|
||||
|
||||
@inject('ledgerStore')
|
||||
@observer
|
||||
|
|
@ -14,8 +16,26 @@ export default class ValidRuleEditModal extends React.Component {
|
|||
description: ""
|
||||
}
|
||||
}
|
||||
validateForm() {
|
||||
const { name, formulaId} = this.state;
|
||||
if(!notNull(name)) {
|
||||
message.warning("规则名称不能为空")
|
||||
return false;
|
||||
}
|
||||
|
||||
// if(!notNull(formulaId)) {
|
||||
// message.warning("校验规则不能为空")
|
||||
// return false;
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
handleSave() {
|
||||
if(!this.validateForm()) {
|
||||
return;
|
||||
}
|
||||
const { ledgerStore: {saveLedgerRule}} = this.props;
|
||||
saveLedgerRule({
|
||||
name: this.state.name,
|
||||
|
|
@ -40,13 +60,13 @@ export default class ValidRuleEditModal extends React.Component {
|
|||
>
|
||||
<div style={{padding: "20px"}}>
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={8}>规则名称</Col>
|
||||
<Col span={8}>规则名称<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
<WeaInput value={this.state.name} onChange={(value) => {this.setState({name: value})}}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={8}>校验规则</Col>
|
||||
<Col span={8}>校验规则<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
<WeaInput value={this.state.formulaId} onChange={(value)=> {this.setState({formulaId: value})}}/>
|
||||
</Col>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import React from 'react'
|
||||
import { Modal, Row, Col, Button } from "antd"
|
||||
import { WeaDatePicker, WeaSelect } from "ecCom"
|
||||
import { adjustResion } from './adjustReason'
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import moment from 'moment'
|
||||
|
||||
@inject('taxAgentStore', "salaryFileStore")
|
||||
@inject("salaryFileStore")
|
||||
@observer
|
||||
export default class EditAgentModal extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -22,25 +21,41 @@ export default class EditAgentModal extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { taxAgentStore: {fetchTaxAgentOption}} = this.props;
|
||||
fetchTaxAgentOption().then(() => {
|
||||
this.setState({initSelected: true})
|
||||
getAdjustReasonList() {
|
||||
const { salaryFileStore:{salaryArchiveTaxAgentForm}} = this.props;
|
||||
let adjustReasonList = salaryArchiveTaxAgentForm.adjustReasonList.map(item => {
|
||||
item = {...item}
|
||||
item.showname = item.content;
|
||||
item.key = item.id + "";
|
||||
item.selected = false
|
||||
return item;
|
||||
})
|
||||
return adjustReasonList
|
||||
}
|
||||
|
||||
getResionOptions() {
|
||||
return Object.keys(adjustResion).map(key => {
|
||||
let item = {}
|
||||
item.showname = adjustResion[key]
|
||||
item.key = key
|
||||
|
||||
getTaxAgentList() {
|
||||
const { salaryFileStore:{salaryArchiveTaxAgentForm}} = this.props;
|
||||
return salaryArchiveTaxAgentForm.taxAgentList.map(item => {
|
||||
item = {...item}
|
||||
item.showname = item.name;
|
||||
item.key = item.id + "";
|
||||
item.selected = false
|
||||
return item
|
||||
})
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { salaryFileStore: {salaryArchiveTaxAgentForm, getTaxAgentForm}} = this.props;
|
||||
getTaxAgentForm(this.props.currentId).then(() => {
|
||||
|
||||
this.setState({initSelected: true})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
handleSave() {
|
||||
const { salaryFileStore: {saveTaxAgent}} = this.props;
|
||||
|
||||
saveTaxAgent(this.state.request)
|
||||
}
|
||||
|
||||
|
|
@ -53,8 +68,8 @@ export default class EditAgentModal extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { taxAgentStore } = this.props;
|
||||
const { taxAgentOption } = taxAgentStore
|
||||
const { salaryFileStore } = this.props;
|
||||
const { salaryArchiveTaxAgentForm } = salaryFileStore
|
||||
const { request } = this.state;
|
||||
const {
|
||||
salaryArchiveId,
|
||||
|
|
@ -62,6 +77,7 @@ export default class EditAgentModal extends React.Component {
|
|||
adjustReason,
|
||||
taxAgentId
|
||||
} = request;
|
||||
|
||||
return (
|
||||
<Modal title="个税扣缴义务人调整" width={800} visible={this.props.visible} onClose={this.props.onCancel}
|
||||
footer={
|
||||
|
|
@ -78,21 +94,25 @@ export default class EditAgentModal extends React.Component {
|
|||
<Row style={{lineHeight: '47px'}}>
|
||||
<Col span={8}>调整原因</Col>
|
||||
<Col span={16}>
|
||||
<WeaSelect style={{width:"200px"}} options={this.getResionOptions()} value={adjustReason} onChange={(value) => {
|
||||
this.handleChange({adjustReason: value})
|
||||
}}/>
|
||||
{
|
||||
this.state.initSelected &&
|
||||
<WeaSelect style={{width:"200px"}} options={this.getAdjustReasonList()} value={adjustReason} onChange={(value) => {
|
||||
this.handleChange({adjustReason: value})
|
||||
}}/>
|
||||
}
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{lineHeight: '47px'}}>
|
||||
<Col span={8}>调整前</Col>
|
||||
<Col span={16}>
|
||||
{salaryArchiveTaxAgentForm.adjustBefore}
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{lineHeight: '47px'}}>
|
||||
<Col span={8}>调整后</Col>
|
||||
<Col span={16}>
|
||||
{
|
||||
this.state.initSelected && <WeaSelect style={{width: '200px'}} options={taxAgentOption} value={taxAgentId} onChange={(value) => {
|
||||
this.state.initSelected && <WeaSelect style={{width: '200px'}} options={this.getTaxAgentList()} value={taxAgentId} onChange={(value) => {
|
||||
this.handleChange({taxAgentId: value})
|
||||
}} />
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,11 +3,14 @@ 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'
|
||||
|
||||
export default class CustomSalaryItemSlide extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
showForm: false
|
||||
}
|
||||
}
|
||||
handleChange(params) {
|
||||
let request = {...this.props.request, ...params}
|
||||
|
|
@ -24,7 +27,7 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
<div className="customSalaryItemSlide">
|
||||
<div>
|
||||
<Row className="formItem">
|
||||
<Col span={4}>名称</Col>
|
||||
<Col span={4}>名称 <RequiredLabelTip /></Col>
|
||||
<Col span={20}>
|
||||
<WeaInput viewAttr={editable ? 2 : 1} value={name} onChange={(value) => {this.handleChange({name: value})}}/>
|
||||
</Col>
|
||||
|
|
@ -59,7 +62,7 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
<Row className="formItem">
|
||||
<Col span={12}>
|
||||
<Row>
|
||||
<Col span={8}>字段类型</Col>
|
||||
<Col span={8}>字段类型<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
<WeaSelect value={dataType} options={dataTypeOptions} onChange={(value) => {this.handleChange({dataType: value})}} style={{width: "200px"}}/>
|
||||
</Col>
|
||||
|
|
@ -69,7 +72,7 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
<Row className="formItem">
|
||||
<Col span={12}>
|
||||
<Row>
|
||||
<Col span={8}>舍入规则</Col>
|
||||
<Col span={8}>舍入规则<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
|
||||
<WeaSelect options={roundingModeOptions} style={{width: "200px"}} value={roundingMode} onChange={(value) => {this.handleChange({roundingMode: value})}}/>
|
||||
|
|
@ -78,7 +81,7 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
</Col>
|
||||
<Col span={12}>
|
||||
<Row>
|
||||
<Col span={8}>保留小数位</Col>
|
||||
<Col span={8}>保留小数位<RequiredLabelTip /></Col>
|
||||
<Col span={16}>
|
||||
<WeaSelect options={patternOptions} onChange={(value) => {this.handleChange({pattern: value})}} value={pattern} style={{width: "200px"}}/>
|
||||
</Col>
|
||||
|
|
@ -88,21 +91,30 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
|
||||
|
||||
<Row className="formItem">
|
||||
<Col span={4}>取值方式</Col>
|
||||
<Col span={4}>取值方式<RequiredLabelTip /></Col>
|
||||
<Col span={20}>
|
||||
<Radio.Group disabled={editable? false: true} value={valueType} onChange={(e) => {this.handleChange({valueType: e.target.value})}}>
|
||||
<Radio.Group disabled={editable? false: true} value={valueType} onChange={(e) => {
|
||||
this.setState({
|
||||
showForm: e.target.value == 2 ? true: false
|
||||
})
|
||||
this.handleChange({valueType: e.target.value})
|
||||
}}>
|
||||
<Radio value={1}>输入</Radio>
|
||||
<Radio value={2}>公式</Radio>
|
||||
</Radio.Group>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row className="formItem">
|
||||
<Col span={4}>公式</Col>
|
||||
<Col span={20}>
|
||||
<WeaTextarea viewAttr={editable ? 2 : 1}/>
|
||||
</Col>
|
||||
</Row>
|
||||
{
|
||||
this.state.showForm &&
|
||||
<Row className="formItem">
|
||||
<Col span={4}>公式</Col>
|
||||
<Col span={20}>
|
||||
<WeaTextarea viewAttr={editable ? 2 : 1}/>
|
||||
</Col>
|
||||
</Row>
|
||||
}
|
||||
|
||||
|
||||
<Row className="formItem">
|
||||
<Col span={4}>备注</Col>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
export const roundingModeOptions = [
|
||||
{
|
||||
key: 1,
|
||||
key: "1",
|
||||
selected: false,
|
||||
showname: "原始数据"
|
||||
},
|
||||
{
|
||||
key: 2,
|
||||
key: "2",
|
||||
selected: false,
|
||||
showname: "四舍五入"
|
||||
},
|
||||
{
|
||||
key: 3,
|
||||
key: "3",
|
||||
selected: false,
|
||||
showname: "向上舍入"
|
||||
},
|
||||
{
|
||||
key: 4,
|
||||
key: "4",
|
||||
selected: false,
|
||||
showname: "向下舍入"
|
||||
}
|
||||
|
|
@ -23,32 +23,32 @@ export const roundingModeOptions = [
|
|||
|
||||
export const patternOptions = [
|
||||
{
|
||||
key: 0,
|
||||
key: "0",
|
||||
showname: "0",
|
||||
selected: false
|
||||
},
|
||||
{
|
||||
key: 1,
|
||||
key: "1",
|
||||
showname: "1",
|
||||
selected: false
|
||||
},
|
||||
{
|
||||
key: 2,
|
||||
key: "2",
|
||||
showname: "2",
|
||||
selected: false
|
||||
},
|
||||
{
|
||||
key: 3,
|
||||
key: "3",
|
||||
showname: "3",
|
||||
selected: false
|
||||
},
|
||||
{
|
||||
key: 4,
|
||||
key: "4",
|
||||
showname: "4",
|
||||
selected: false
|
||||
},
|
||||
{
|
||||
key: 5,
|
||||
key: "5",
|
||||
showname: "5",
|
||||
selected: false
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { insertUpdateColumns } from './columns'
|
|||
import { inject, observer } from 'mobx-react';
|
||||
import SmallTab from '../../../components/smallTab'
|
||||
import "./index.less"
|
||||
import RequiredLabelTip from '../../../components/requiredLabelTip';
|
||||
|
||||
@inject('programmeStore')
|
||||
@observer
|
||||
|
|
@ -170,7 +171,7 @@ export default class DefaultSlideForm extends React.Component {
|
|||
<div>
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={6}>
|
||||
缴纳类型
|
||||
缴纳类型<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaSelect
|
||||
|
|
@ -188,7 +189,7 @@ export default class DefaultSlideForm extends React.Component {
|
|||
|
||||
<Row style={{lineHeight: "40px"}}>
|
||||
<Col span={6}>
|
||||
方案名称
|
||||
方案名称<RequiredLabelTip />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaInput value={this.props.requestParams.schemeName} onChange={(value) => {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import React from 'react'
|
|||
import { Button, Modal, Row, Col, message } from 'antd';
|
||||
import { WeaTextarea, WeaInput } from "ecCom";
|
||||
import { logColumns, dataSource } from "../../common/columns"
|
||||
import RequiredLabelTip from "../../components/requiredLabelTip"
|
||||
|
||||
export default class EditModal extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -28,7 +29,7 @@ export default class EditModal extends React.Component {
|
|||
}
|
||||
|
||||
submitAdd() {
|
||||
if(this.validate) {
|
||||
if(this.validate()) {
|
||||
this.props.onSubmitAdd({name: this.state.name, description: this.state.remark})
|
||||
}
|
||||
}
|
||||
|
|
@ -48,7 +49,7 @@ export default class EditModal extends React.Component {
|
|||
>
|
||||
<Row gutter={16}>
|
||||
<Col span={6}>
|
||||
<div className="formLabel">名称:</div>
|
||||
<div className="formLabel">名称:<RequiredLabelTip /></div>
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaInput
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { inject, observer } from 'mobx-react';
|
|||
import { WeaInput, WeaTextarea, WeaSearchGroup } from "ecCom";
|
||||
import { slideColumns} from './columns';
|
||||
import EditableTable from '../../components/EditTable'
|
||||
import RequiredLabelTip from '../../components/requiredLabelTip'
|
||||
|
||||
let emptyItem = {
|
||||
incomeLowerLimit: "0.00",
|
||||
|
|
@ -45,7 +46,7 @@ export default class EditSlideContent extends React.Component {
|
|||
<WeaSearchGroup showGroup={true} title={"基本信息"}>
|
||||
<Row gutter={16}>
|
||||
<Col span={6}>
|
||||
<div className="formLabel">名称:</div>
|
||||
<div className="formLabel">名称:<RequiredLabelTip /></div>
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<WeaInput
|
||||
|
|
@ -80,6 +81,7 @@ export default class EditSlideContent extends React.Component {
|
|||
columns={slideColumns}
|
||||
dataSource={dataSource}
|
||||
bordered
|
||||
type="number"
|
||||
addItem={() => {this.addItem()}}
|
||||
onDataSourceChange={setDataSource}
|
||||
editable={this.state.editable}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { WeaForm, WeaTableNew } from 'comsMobx';
|
|||
|
||||
import * as API from '../apis/ledger'; // 引入API接口文件
|
||||
import { tempateColumns } from '../pages/payroll/columns';
|
||||
import { notNull } from '../util/validate';
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -103,6 +104,10 @@ export class LedgerStore {
|
|||
|
||||
@action
|
||||
addItemGroup = name => {
|
||||
if(!name || name == "" || name.trim() == "") {
|
||||
message.warning("分类名称不能为空")
|
||||
return
|
||||
}
|
||||
let itemGroups = [...this.itemGroups]
|
||||
let flag = false;
|
||||
itemGroups.map(item => {
|
||||
|
|
@ -253,9 +258,57 @@ export class LedgerStore {
|
|||
})
|
||||
}
|
||||
|
||||
validateBaseFrom(params) {
|
||||
if(!notNull(params.name)) {
|
||||
message.warning("名称不能为空");
|
||||
return false
|
||||
}
|
||||
|
||||
if(!notNull(params.taxableItems)) {
|
||||
message.warning("薪资类型不能为空");
|
||||
return false
|
||||
}
|
||||
|
||||
if(!notNull(params.salaryCycleType)) {
|
||||
message.warning("薪资周期不能为空");
|
||||
return false
|
||||
}
|
||||
|
||||
if(!notNull(params.salaryCycleFromDay)) {
|
||||
message.warning("薪资周期不能为空");
|
||||
return false
|
||||
}
|
||||
|
||||
if(!notNull(params.taxCycleType)) {
|
||||
message.warning("税款所属期不能为空");
|
||||
return false
|
||||
}
|
||||
|
||||
if(!notNull(params.attendCycleType)) {
|
||||
message.warning("考勤周期不能为空");
|
||||
return false
|
||||
}
|
||||
|
||||
if(!notNull(params.attendCycleFromDay)) {
|
||||
message.warning("考勤周期不能为空");
|
||||
return false
|
||||
}
|
||||
|
||||
if(!notNull(params.socialSecurityCycleType)) {
|
||||
message.warning("福利台账月份不能为空");
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
//保存薪资帐套基本信息
|
||||
@action
|
||||
saveLedgerBasic = (params) => {
|
||||
if(!this.validateBaseFrom(params)) {
|
||||
return
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
API.saveLedgerBasic(params).then(res => {
|
||||
if(res.status) {
|
||||
|
|
@ -285,9 +338,30 @@ export class LedgerStore {
|
|||
})
|
||||
}
|
||||
|
||||
validateLedgerPersonRange(params) {
|
||||
if(!notNull(params.includeType)) {
|
||||
message.warning("对象类型不能为空")
|
||||
return false
|
||||
}
|
||||
|
||||
if(!notNull(params.targetParams)) {
|
||||
message.warning("对象类型不能为空")
|
||||
return false
|
||||
}
|
||||
|
||||
if(!notNull(params.employeeStatus)) {
|
||||
message.warning("选择员工状态不能为空")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
//保存薪资帐套人员范围
|
||||
@action
|
||||
saveLedgerPersonRange = (params) => {
|
||||
if(!this.validateLedgerPersonRange(params)) {
|
||||
return
|
||||
}
|
||||
API.saveLedgerPersonRange(params).then(res => {
|
||||
if(res.status) {
|
||||
if(this.includeType == 1) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { WeaForm, WeaTableNew } from 'comsMobx';
|
|||
|
||||
import * as API from '../apis/welfareScheme'; // 引入API接口文件
|
||||
import * as CumAPI from '../apis/cumDeduct'
|
||||
import { notNull } from '../util/validate';
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -141,7 +142,23 @@ export class ProgrammeStore {
|
|||
})
|
||||
}
|
||||
|
||||
valideForm(params) {
|
||||
if(!notNull(params.insuranceScheme.paymentArea)) {
|
||||
message.warning("缴纳类型不能为空")
|
||||
return false
|
||||
}
|
||||
|
||||
if(!notNull(params.insuranceScheme.schemeName)) {
|
||||
message.warning("方案名称不能为空")
|
||||
return false
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@action createScheme = (params) => {
|
||||
if(!this.valideForm(params)) {
|
||||
return
|
||||
}
|
||||
API.createScheme(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("新建成功");
|
||||
|
|
@ -153,6 +170,9 @@ export class ProgrammeStore {
|
|||
}
|
||||
|
||||
@action updateScheme = (params) => {
|
||||
if(!this.valideForm()) {
|
||||
return
|
||||
}
|
||||
API.updateScheme(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("更新成功");
|
||||
|
|
@ -189,8 +209,24 @@ export class ProgrammeStore {
|
|||
})
|
||||
}
|
||||
|
||||
validateCustomRequest() {
|
||||
let flag = true;
|
||||
this.formCondition.forEach(item => {
|
||||
if(item.rules == "required") {
|
||||
if(!notNull(this.customRequest[item.domkey[0]])) {
|
||||
message.warning(item.label + "不能为空")
|
||||
flag = false
|
||||
}
|
||||
}
|
||||
})
|
||||
return flag;
|
||||
}
|
||||
|
||||
// 新增自定义福利
|
||||
@action createSICategory = (params) => {
|
||||
if(!this.validateCustomRequest()) {
|
||||
return
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
API.createSICategory(params).then(res => {
|
||||
if(res.status) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ export class salaryFileStore {
|
|||
@observable previewDataSource = [];
|
||||
@observable dataSource = [];
|
||||
@observable detailForm= {}
|
||||
@observable salaryArchiveTaxAgentForm = {}
|
||||
|
||||
|
||||
// 初始化操作
|
||||
|
|
@ -154,4 +155,21 @@ export class salaryFileStore {
|
|||
})
|
||||
}
|
||||
|
||||
// 调整-义务扣缴人-调整表单
|
||||
@action
|
||||
getTaxAgentForm = (salaryArchiveId) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.getTaxAgentForm({salaryArchiveId}).then(res => {
|
||||
if(res.status) {
|
||||
this.salaryArchiveTaxAgentForm = res.data.salaryArchiveTaxAgentForm
|
||||
resolve()
|
||||
} else {
|
||||
message.error(res.errormsg || "获取失败")
|
||||
reject()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ import { message } from 'antd';
|
|||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
|
||||
import * as API from '../apis/item'; // 引入API接口文件
|
||||
import {notNull} from '../util/validate'
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -135,7 +136,7 @@ export class SalaryItemStore {
|
|||
getItemForm = (id) => {
|
||||
API.getItemForm(id).then(res => {
|
||||
if(res.status) {
|
||||
this.request = res.data
|
||||
this.request = res.data.map(item => item.toString())
|
||||
} else {
|
||||
message.error(res.errormsg || '获取失败')
|
||||
}
|
||||
|
|
@ -188,9 +189,40 @@ export class SalaryItemStore {
|
|||
})
|
||||
}
|
||||
|
||||
validateForm(params) {
|
||||
if(!notNull(params.name)) {
|
||||
message.warning("名称不能为空")
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!notNull(params.dataType)) {
|
||||
message.warning("字段类型不能为空")
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!notNull(params.roundingMode)) {
|
||||
message.warning("舍入规则不能为空")
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!notNull(params.pattern)) {
|
||||
message.warning("保留小数位不能为空")
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!notNull(params.valueType)) {
|
||||
message.warning("取值方式不能为空")
|
||||
return false;
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
//薪资项目-新增薪资项目
|
||||
@action
|
||||
saveItem = (params, continueFlag) => {
|
||||
if(!this.validateForm(params)) {
|
||||
return
|
||||
}
|
||||
API.saveItem(params).then(res => {
|
||||
if(res.status) {
|
||||
if(!continueFlag) {
|
||||
|
|
@ -204,7 +236,4 @@ export class SalaryItemStore {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -89,6 +89,10 @@ export class taxRateStore {
|
|||
},
|
||||
taxRateRecords: this.dataSource
|
||||
}
|
||||
if(!params.name || params.name == "" ) {
|
||||
message.warning("名称不能为空")
|
||||
return
|
||||
}
|
||||
API.saveTaxRate(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("保存成功");
|
||||
|
|
@ -131,6 +135,11 @@ export class taxRateStore {
|
|||
},
|
||||
taxRateRecords: this.dataSource
|
||||
}
|
||||
|
||||
if(!params.name || params.name == "") {
|
||||
message.warning("名称不能为空")
|
||||
return
|
||||
}
|
||||
API.updateTaxRate(params).then(res => {
|
||||
if(res.status) {
|
||||
message.success("保存成功");
|
||||
|
|
|
|||
|
|
@ -28,3 +28,4 @@
|
|||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
export const notNull = (name) => {
|
||||
if(typeof(name) == "string") {
|
||||
name = name.trim()
|
||||
}
|
||||
if(name !== undefined) {
|
||||
name = name.toString()
|
||||
}
|
||||
if(!name || name == "") {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
Loading…
Reference in New Issue