43 lines
1.4 KiB
JavaScript
43 lines
1.4 KiB
JavaScript
import React from 'react'
|
|
import { getCustomSearchs, getSearchs } from '../../../util';
|
|
import { Modal } from 'antd'
|
|
import { observable, action, toJS } from 'mobx';
|
|
import { inject, observer } from 'mobx-react';
|
|
import CustomForm from '../../../components/customForm'
|
|
|
|
@inject('programmeStore')
|
|
@observer
|
|
export default class CustomNewModal extends React.Component {
|
|
constructor(props) {
|
|
super(props)
|
|
}
|
|
|
|
handleOK() {
|
|
const { programmeStore: {createSICategory, setCustomRequest, customRequest, updateCustomCategory}} = this.props;
|
|
if(!this.props.edit) { // 新增
|
|
createSICategory(customRequest).then(() => {
|
|
this.props.onCancel()
|
|
})
|
|
} else {
|
|
updateCustomCategory(customRequest).then(() => {
|
|
this.props.onCancel()
|
|
})
|
|
}
|
|
}
|
|
|
|
render() {
|
|
const { programmeStore: {customRequest, setCustomRequest}} = this.props;
|
|
return (
|
|
<Modal visible={this.props.visible} onCancel={() => {
|
|
this.props.onCancel()
|
|
}} title="新建自定义福利" onOk={() => {
|
|
this.handleOK()
|
|
}}>
|
|
{/* {getCustomSearchs(this.props.form, toJS(this.props.condition), 1)} */}
|
|
<CustomForm condition={this.props.condition} disable={this.props.edit ? ['paymentScope', 'welfareType'] : null} request={customRequest} onChange={(value) => {
|
|
setCustomRequest(value)
|
|
}}/>
|
|
</Modal>
|
|
)
|
|
}
|
|
} |