福利方案bug处理

This commit is contained in:
MustangDeng 2022-05-18 17:10:12 +08:00
parent 6b178ebaea
commit 4701ada4dc
11 changed files with 89 additions and 33 deletions

View File

@ -25,6 +25,7 @@ export const createScheme = params => {
}).then(res => res.json())
};
export const updateScheme = params => {
return fetch('/api/bs/hrmsalary/scheme/update', {
method: 'POST',
mode: 'cors',

View File

@ -17,12 +17,19 @@ export default class AccumulationFundForm extends React.Component {
// 表单变化
handleFormChange(params) {
const { archivesStore: { socialSecurityForm, setSocialSecurityForm }} = this.props;
const { data } = socialSecurityForm
const { archivesStore: { accumulationFundForm, setAccumulationFundForm, getPaymentForm }} = this.props;
const { data } = accumulationFundForm
let request = {...data, ...params}
let form = {...socialSecurityForm}
request.fundName = request.fundSchemeId
let form = {...accumulationFundForm}
form.data = request
setSocialSecurityForm(form)
setAccumulationFundForm(form)
}
// 获取基数表单
handleFetchPaymentForm(fundName) {
const { archivesStore: { getPaymentForm }} = this.props;
getPaymentForm(this.props.employeeId, "ACCUMULATION_FUND", fundName)
}
@ -77,7 +84,10 @@ export default class AccumulationFundForm extends React.Component {
<Row>
<Col span={6} className="formItem">公积金方案名称</Col>
<Col span={6} className="formItem">
<Select defaultValue={data && data.fundSchemeId} value={data && data.fundSchemeId} style={{ width: 150 }} onChange={(value) => this.handleFormChange({fundName: value})}>
<Select defaultValue={data && data.fundSchemeId} value={data && data.fundSchemeId} style={{ width: 150 }} onChange={(value) => {
this.handleFormChange({fundSchemeId: value})
this.handleFetchPaymentForm(value);
}}>
{
items && items[0].items &&items[0].items[0] && items[0].items[0].options.map(item => (
<Option value={item.key}>{item.showname}</Option>
@ -111,7 +121,9 @@ export default class AccumulationFundForm extends React.Component {
</Col>
<Col span={6} className="formItem">公积金个人实际承担方</Col>
<Col span={6} className="formItem">
<Select defaultValue={data && data.underTake} value={data && data.underTake} style={{ width: 150 }} onChange={(value) => this.handleFormChange({underTake: value})}>
<Select defaultValue={data && data.underTake} value={data && data.underTake} style={{ width: 150 }} onChange={(value) => {
this.handleFormChange({underTake: value})
}}>
{
items && items[0].items &&items[0].items[2] && items[0].items[2].options.map(item => (
<Option value={item.key}>{item.showname}</Option>

View File

@ -90,8 +90,7 @@ export default class Archives extends React.Component {
handlePageChnage(value) {
const { archivesStore: {form, getTableDatas}} = this.props;
form.updateFields({ current: value })
getTableDatas()
getTableDatas({current: value})
}
// 导入

View File

@ -22,6 +22,12 @@ export default class OtherForm extends React.Component {
getPaymentForm(this.props.employeeId, "OTHER", this.props.record.otherSchemeId)
}
// 获取基数表单
handleFetchPaymentForm(value) {
const { archivesStore: { getPaymentForm }} = this.props;
getPaymentForm(this.props.employeeId, "OTHER", value)
}
// 表单变化
handleFormChange(params) {
const { archivesStore: { otherForm, setOtherForm }} = this.props;
@ -29,7 +35,7 @@ export default class OtherForm extends React.Component {
let request = {...data, ...params}
let form = {...otherForm}
form.data = request
setSocialSecurityForm(form)
setOtherForm(form)
}
//基数变化
@ -83,7 +89,10 @@ export default class OtherForm extends React.Component {
<Row>
<Col span={6} className="formItem">其他福利方案名称</Col>
<Col span={6} className="formItem">
<Select defaultValue={data && data.otherName} value={data && data.otherName} style={{ width: 150 }} onChange={(value) => this.handleFormChange({otherName: value})}>
<Select defaultValue={data && data.otherName} value={data && data.otherName} style={{ width: 150 }} onChange={(value) => {
this.handleFormChange({otherName: value})
this.handleFetchPaymentForm(value);
}}>
{
items && items[0].items &&items[0].items[0] && items[0].items[0].options.map(item => (
<Option value={item.key}>{item.showname}</Option>

View File

@ -28,6 +28,13 @@ export default class SocialSecurityForm extends React.Component {
setSocialSecurityForm(form)
}
// 获取基数表单
handleFetchPaymentForm(value) {
console.log("SOCIAL_SECURITY:", value);
const { archivesStore: { getPaymentForm }} = this.props;
getPaymentForm(this.props.employeeId, "SOCIAL_SECURITY", value)
}
//基数变化
handlePaymentChange(params) {
const { archivesStore: { socialSecurityPaymentForm, setSocialSecurityPaymentForm }} = this.props;
@ -78,7 +85,10 @@ export default class SocialSecurityForm extends React.Component {
<Row>
<Col span={6} className="formItem">社保方案名称</Col>
<Col span={6} className="formItem">
<Select defaultValue={data && data.socialName} value={data && data.socialName} style={{ width: 150 }} onChange={(value) => { this.handleFormChange({socialName: value})} }>
<Select defaultValue={data && data.socialName} value={data && data.socialName} style={{ width: 150 }} onChange={(value) => {
this.handleFormChange({socialName: value})
this.handleFetchPaymentForm(value)
}}>
{
items && items[0].items &&items[0].items[0] && items[0].items[0].options.map(item => (
<Option value={item.key}>{item.showname}</Option>
@ -105,7 +115,11 @@ export default class SocialSecurityForm extends React.Component {
</Col>
<Col span={6} className="formItem">社保个人实际承担方</Col>
<Col span={6} className="formItem">
<Select defaultValue={data && data.underTake} value={data && data.underTake} style={{ width: 150 }} onChange={(value) => this.handleFormChange({underTake: value})}>
<Select defaultValue={data && data.underTake} value={data && data.underTake} style={{ width: 150 }} onChange={
(value) => {
this.handleFormChange({underTake: value})
this.handleFetchPaymentForm(value)
}}>
{
items && items[0].items &&items[0].items[2] && items[0].items[2].options.map(item => (
<Option value={item.key}>{item.showname}</Option>

View File

@ -130,8 +130,8 @@ export const insertUpdateColumns = [
},
{
title: "有效小数位",
dataIndex: "paymentScopeValue",
key: "paymentScopeValue"
dataIndex: "validNum",
key: "validNum"
},
{
title: "进位规则",

View File

@ -3,6 +3,12 @@ import { Modal, Row, Col } from "antd"
import { WeaInput } from 'ecCom'
export default class CopySchemaModal extends React.Component {
constructor(props){
super(props)
this.state = {
value : ""
}
}
render() {
return (
<Modal title="复制社保方案" footer={this.props.footer} onCancel={() => this.props.onCancel()} visible={this.props.visible}>
@ -11,7 +17,9 @@ export default class CopySchemaModal extends React.Component {
方案名称
</Col>
<Col span={18}>
<WeaInput value={this.props.value} onChange={(v) =>{this.props.onChange(v)}} />
<WeaInput value={this.state.value} onChange={(v) =>{
this.setState({value: v})
this.props.onChange(v)}} />
</Col>
</Row>
</Modal>

View File

@ -24,7 +24,7 @@ export default class DefaultSlideForm extends React.Component {
this.updateDataSource(record, e, "isPayment")
}}/>)
}
} else if(item.dataIndex == "paymentScopeValue") {
} else if(item.dataIndex == "validNum") {
let options = [
{
key: "0",
@ -48,7 +48,7 @@ export default class DefaultSlideForm extends React.Component {
options={options}
value={text}
onChange={v => {
this.updateDataSource(record, v, "paymentScopeValue")
this.updateDataSource(record, v, "validNum")
}}
/>
)
@ -136,7 +136,6 @@ export default class DefaultSlideForm extends React.Component {
componentWillMount() {
const { programmeStore } = this.props;
const { getForm, selectedKey, defaultPersonDataSource } = programmeStore
getForm({welfareTypeEnum: selectedKey})
}
render() {
@ -157,13 +156,13 @@ export default class DefaultSlideForm extends React.Component {
]
const handleSmallTabChange = (item) => {
let paymentArea = item == "paymentArea" ? "1": "2"
let requestParams = {...this.props.requestParams}
requestParams.paymentArea = paymentArea
// let paymentArea = item == "paymentArea" ? "1": "2"
// let requestParams = {...this.props.requestParams}
// requestParams.paymentArea = paymentArea
this.setState({
selectItem: item.value,
})
this.props.onChange(requestParams)
// this.props.onChange(requestParams)
}
return (
@ -177,10 +176,11 @@ export default class DefaultSlideForm extends React.Component {
<WeaSelect
style={{width: "200px"}}
options={options}
value={this.state.value}
value={this.props.requestParams.paymentType}
onChange={(v, showname) => {
this.setState({ value: v });
console.log("v", v, "showname:", showname);
let requestParams = {...this.props.requestParams}
requestParams.paymentType = v
this.props.onChange(requestParams)
}}
/>
</Col>

View File

@ -182,6 +182,12 @@ export default class Programme extends React.Component {
})
}
// 页面跳转
handlePageChange(value) {
const { programmeStore: {form, getTableDatas, selectedKey} } = this.props;
getTableDatas(selectedKey, {current: value})
}
render() {
const { programmeStore } = this.props;
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = programmeStore;
@ -252,9 +258,10 @@ export default class Programme extends React.Component {
]
const handleNewClick = () => {
const { programmeStore: {initSlideParms}} = this.props;
const { programmeStore: {initSlideParms, getForm, selectedKey}} = this.props;
initSlideParms();
this.setState({ slideVisiable: true, currentOperate: "add" })
getForm({welfareTypeEnum: selectedKey})
}
const handleCustomNewClick = () => {
@ -295,10 +302,10 @@ export default class Programme extends React.Component {
const { programmeStore } = this.props
const { currentOperate } = this.state
const { selectedKey, defaultPersonDataSource, defaultCompanyDataSource, createScheme, requestParams, updateScheme } = programmeStore
let { schemeName, remarks, paymentArea } = requestParams
let { schemeName, remarks, paymentArea, paymentType } = requestParams
let request = {
insuranceScheme: {
paymentType: paymentArea == "1" ? "SCHEME_TOWN": "SCHEME_VILLAGE",
paymentType,
welfareType: selectedKey,
schemeName,
remarks,
@ -386,7 +393,7 @@ export default class Programme extends React.Component {
columns={this.getColumns(tableColumns)}
dataSource={tableDataSource}
pagination={{
onChange: (value) => {this.hangePageChange(value)},
onChange: (value) => {this.handlePageChange(value)},
total: tablePageInfo.total,
current: tablePageInfo.pageNum
}}
@ -412,6 +419,7 @@ export default class Programme extends React.Component {
/>
}
content={(<DefaultSlideForm requestParams={requestParams} onChange={(requestParams) => {
console.log("requestParams:", requestParams);
setRequestParams(requestParams)
}}/>)}
onClose={() => {handleSlideClose()}}

View File

@ -104,7 +104,7 @@ export class ArchivesStore {
getTableDatas = (params) => {
this.loading = true;
const formParams = this.form.getFormParams() || {};
params = params || formParams;
params = {...formParams, ...params};
API.getTable(params).then(action(res => {
if (res.status) { // 接口请求成功/失败处理
this.dataSource = res.data.datas;

View File

@ -53,7 +53,7 @@ export class ProgrammeStore {
this.requestParams = {
schemeName: "",
remarks: "",
paymentArea: "1"
paymentType: "SCHEME_TOWN"
}
this.defaultPersonDataSource = [];
this.defaultCompanyDataSource = [];
@ -147,7 +147,7 @@ export class ProgrammeStore {
}
valideForm(params) {
if(!notNull(params.insuranceScheme.paymentArea)) {
if(!notNull(params.insuranceScheme.paymentType)) {
message.warning("缴纳类型不能为空")
return false
}
@ -160,9 +160,11 @@ export class ProgrammeStore {
}
@action createScheme = (params) => {
params.insuranceScheme.paymentArea = params.insuranceScheme.paymentType;
if(!this.valideForm(params)) {
return
}
console.log("params:", params);
API.createScheme(params).then(res => {
if(res.status) {
message.success("新建成功");
@ -174,9 +176,12 @@ export class ProgrammeStore {
}
@action updateScheme = (params) => {
if(!this.valideForm()) {
params.insuranceScheme.paymentArea = params.insuranceScheme.paymentType;
if(!this.valideForm(params)) {
return
}
console.log("params:", params);
API.updateScheme(params).then(res => {
if(res.status) {
message.success("更新成功");