diff --git a/pc4mobx/hrmSalary/apis/welfareScheme.js b/pc4mobx/hrmSalary/apis/welfareScheme.js index 11ce1976..e742db40 100644 --- a/pc4mobx/hrmSalary/apis/welfareScheme.js +++ b/pc4mobx/hrmSalary/apis/welfareScheme.js @@ -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', diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js index 38edc86c..c0b33901 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/accumulationFundForm.js @@ -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 { 公积金方案名称: - { + this.handleFormChange({fundSchemeId: value}) + this.handleFetchPaymentForm(value); + }}> { items && items[0].items &&items[0].items[0] && items[0].items[0].options.map(item => ( @@ -111,7 +121,9 @@ export default class AccumulationFundForm extends React.Component { 公积金个人实际承担方: - { + this.handleFormChange({underTake: value}) + }}> { items && items[0].items &&items[0].items[2] && items[0].items[2].options.map(item => ( diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index e97efca2..fbc7099a 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -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}) } // 导入 diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js index 27c42c9c..02feb7de 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/otherForm.js @@ -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 { 其他福利方案名称: - { + this.handleFormChange({otherName: value}) + this.handleFetchPaymentForm(value); + }}> { items && items[0].items &&items[0].items[0] && items[0].items[0].options.map(item => ( diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js index 7438dc6b..563b90db 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js @@ -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 { 社保方案名称: - { + this.handleFormChange({socialName: value}) + this.handleFetchPaymentForm(value) + }}> { items && items[0].items &&items[0].items[0] && items[0].items[0].options.map(item => ( @@ -105,7 +115,11 @@ export default class SocialSecurityForm extends React.Component { 社保个人实际承担方: - { + this.handleFormChange({underTake: value}) + this.handleFetchPaymentForm(value) + }}> { items && items[0].items &&items[0].items[2] && items[0].items[2].options.map(item => ( diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js index 25edd31a..349ea720 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/columns.js @@ -130,8 +130,8 @@ export const insertUpdateColumns = [ }, { title: "有效小数位", - dataIndex: "paymentScopeValue", - key: "paymentScopeValue" + dataIndex: "validNum", + key: "validNum" }, { title: "进位规则", diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/copySchemaModal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/copySchemaModal.js index c13969ad..c5b785b3 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/copySchemaModal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/copySchemaModal.js @@ -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 ( this.props.onCancel()} visible={this.props.visible}> @@ -11,7 +17,9 @@ export default class CopySchemaModal extends React.Component { 方案名称 - {this.props.onChange(v)}} /> + { + this.setState({value: v}) + this.props.onChange(v)}} /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js index 382fb904..ba827ba3 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/defaultSlideForm.js @@ -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 { { - this.setState({ value: v }); - console.log("v", v, "showname:", showname); + let requestParams = {...this.props.requestParams} + requestParams.paymentType = v + this.props.onChange(requestParams) }} /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js index 17a7a977..2bd94345 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js @@ -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={( { + console.log("requestParams:", requestParams); setRequestParams(requestParams) }}/>)} onClose={() => {handleSlideClose()}} diff --git a/pc4mobx/hrmSalary/stores/archives.js b/pc4mobx/hrmSalary/stores/archives.js index 7fe65466..6bab3913 100644 --- a/pc4mobx/hrmSalary/stores/archives.js +++ b/pc4mobx/hrmSalary/stores/archives.js @@ -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; diff --git a/pc4mobx/hrmSalary/stores/programme.js b/pc4mobx/hrmSalary/stores/programme.js index 1284f807..d69d4f2a 100644 --- a/pc4mobx/hrmSalary/stores/programme.js +++ b/pc4mobx/hrmSalary/stores/programme.js @@ -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("更新成功");