import React, { PureComponent } from 'react'; import style from 'styled-components'; import { connect } from 'dva'; // import { Modal, Button ,Form, Input, Select } from 'antd'; import { enterpriseInsComInsPromptInitEnterpriseIns //是否需要保险提示 } from '../../../services/api'; import GetPlanBook from '../../Enterprise/Organization/getPlanBook'; import './InsuranceMangerment.less'; // import Insurance from "./InsuranceBasic"; import Insurance from './../../Enterprise/Company/InsuranceBasic'; import styles from './../../Enterprise/Company/Company.less'; // import styles from './Company.less'; // const FormItem = Form.Item; // const { Option } = Select; // @Form.create() @connect(state => state.insurance) export default class EnterpriseInsurance extends PureComponent { constructor(props, context) { super(props, context); this.state = { // shows: [true, false, false, false],//各个 tab 内容是否显示,这里按需加载 // policyHolder: "百川信(厦门)网络信息服务有限公司", // contacts: "", // contactsinformation: "", // enterprises: "", // premium:[], // amountmoney:[], // accessbookvisible:false, // disabled: true, isIns: '' }; } // // state = { accessbookvisible:false, } // // 获取方案书 // showaccessbookModal = () => { // this.setState({ // accessbookvisible:true, // }); // } // handlereducepeopleOk = (e) => { // console.log(e); // this.setState({ // accessbookvisible:false, // }); // } // handlereducepeopleCancel = (e) => { // console.log(e); // this.setState({ // accessbookvisible:false, // }); // } // handleSubmit = e => { // e.preventDefault(); // this.props.form.validateFieldsAndScroll((err, values) => { // if (!err) { // console.log('表单提交中.........',values); // } // }); // }; // 初始化温馨提示 getPrimotInt = () => { if (!this.props.isShowPlanBook) { enterpriseInsComInsPromptInitEnterpriseIns().then( data => { console.log('是否初始化', data); this.setState({ isIns: data.data.isIns }); // “0”标识没有买保险,“1”标识投保人数不符合要求,“2”标识保险保额不符合要求,“3”标识投保人数和保险保额不符合要求,“9”标识不需要提示 // if (data.data.isIns !== '9' && !this.props.isShowPlanBook) { // this.setState({ // insurancetipsvisible: true // }); // this.props.dispatch({ // type: 'insurance/showPlanBook', // payload: true // }); // } }, err => { console.log(err); } ); } }; componentDidMount() { this.getPrimotInt(); } render() { // console.log('aa',this.state.disabled); // console.log('bb',this.state.accessbookvisible); // const { submitting } = this.props; // const { getFieldDecorator } = this.props.form; // const formItemLayout = { // labelCol: { // xs: { span: 7 }, // sm: { span: 7 } // }, // wrapperCol: { // xs: { span: 15 }, // sm: { span: 15 }, // md: { span: 15 } // } // }; // const submitFormLayout = { // wrapperCol: { // xs: { span: 15, offset: 7 }, // sm: { span: 15, offset: 7 } // } // }; // // const { policyHolder, contacts, contactsinformation, enterprises, amountmoney,premium} = this.state; // const amountmoney = [ // {"code":0,"price":10}, // {"code":1,"price":20}, // ]; // const premium = [ // {"code":0,"price":10}, // {"code":1,"price":20}, // ]; return ( { this.setState({ insurancetipsvisible: value // accessbookvisible: true }); }} props={this.props} styles={styles} /> {/*
{getFieldDecorator("policyHolder", { // {} initialValue: this.state.policyHolder, rules: [{ message: "请填写" }] })()} {getFieldDecorator("contacts", { initialValue: this.state.contacts, rules: [{ required: true, message: "请填写" }] })()} {getFieldDecorator("contactsinformation", { initialValue: this.state.contactsinformation, rules: [{ required: true, message: "请填写" }] })()} {getFieldDecorator("enterprises", { initialValue: this.state.enterprises, rules: [{ message: "请填写" }] })()} {getFieldDecorator("amountmoney", { initialValue: this.state.amountmoney, rules: [{ required: true, message: "请选择" }] })( )} {getFieldDecorator("premium", { initialValue: this.state.premium, rules: [{ required: true, message: "请选择" }] })( )}
*/} {/* 初始化时保险弹窗 */} { this.setState({ [field]: value }); }} conGetPlanBook={value => { this.setState({ insurancetipsvisible: value }); }} isIns={this.state.isIns} accessbookvisible={this.state.accessbookvisible} insurancetipsvisible={this.state.insurancetipsvisible} />
); } } const Container = style.div` padding:10px 24px 24px; `;