import React, { Component } from 'react'; import { connect } from 'dva'; import store from 'store'; import { withRouter } from 'dva/router'; import { Form, Input, Button, Icon, Modal, Alert, Card, List, Avatar, Select, message } from 'antd'; import './less/depart.less'; // import * as ajax from "../../../services/api"; import { enterpriseInsComInsSaveBookScheme, enterpriseInsComInsGetBlbProList, //获取产品列表 systemComVaseInfoGet //获取公司的省份信息 } from '../../../services/api'; // const { MenuItemGroup } = Menu; const FormItem = Form.Item; const { Option } = Select; @connect(state => ({ profile: state.profile, companyInfo: state.global.companyInfo })) @Form.create() @withRouter /** * 部门管理组件 */ export default class GetPlanBook extends Component { constructor(props, context) { super(props, context); this.state = { insurancetipsvisible: this.props.insurancetipsvisible, //提示模板 policyHolder: this.props.companyInfo.comName, //投保人 regProvinceId: '', //企业所在省份 regProvinceName: '', //所在省份对应的落地项目 regProvinceAllName: '', //所在省份对应的落地项目(全称) contactper: '', //联系人 contactPhone: '', //联系方式 comPerNum: '', //企业人数 guaranteeAmountLow: '', //保障金额下限 insAmountUp: '', //保费上限 accessbookvisible: false, //获取方案书 disabled: true, productvisible: false, //选择产品 productlistdata: [], isIns: this.props.isIns || '' // comName:"",//企业名称 }; } componentDidMount() { //450000-->广西壮族自治区,610000-->陕西省,640000-->宁夏回族自治区 systemComVaseInfoGet({}).then( response => { const regProvince = response.data.regProvince; const regProvinceName = regProvince === 450000 ? '广西' : regProvince === 610000 ? '陕西省' : regProvince === 640000 ? '宁夏' : regProvince === 110000 ? '北京' : ''; const regProvinceAllName = regProvince === 450000 ? '广西壮族自治区' : regProvince === 610000 ? '陕西省' : regProvince === 640000 ? '宁夏回族自治区' : regProvince === 110000 ? '北京市' : ''; this.setState({ regProvinceName, regProvinceId: regProvince, regProvinceAllName }); }, err => { console.log(err); } ); } componentWillReceiveProps(nextprops) { if ( nextprops.insurancetipsvisible && nextprops.insurancetipsvisible !== this.state.insurancetipsvisible ) { this.setState({ insurancetipsvisible: nextprops.insurancetipsvisible }); } if ( nextprops.accessbookvisible && nextprops.accessbookvisible !== this.state.accessbookvisible ) { this.setState({ accessbookvisible: nextprops.accessbookvisible }); } if (nextprops.isIns !== this.state.isIns) { this.setState({ isIns: nextprops.isIns }); } } handlenextpeopleOk = e => { //获取方案书表单提交 e.preventDefault(); this.props.form.validateFields((err, values) => { if (!err) { this.getProductList(); const { contactper = '', contactPhone = '', comPerNum = '', guaranteeAmountLow = '', insAmountUp = '', proCode = '' } = values; const obj = { contactper, contactPhone, comPerNum, guaranteeAmountLow, insAmountUp, proCode }; this.setState(obj); this.props.okorcancel('accessbookvisible', false); this.setState({ accessbookvisible: false, productvisible: true }); } }); }; // 选择产品 chooseProductClick = (item, index) => { const productlistdata = [...this.state.productlistdata].map((val, key) => { if (key !== index) { val.isCheck = false; } if (key === index) { val.isCheck = true; } return val; }); this.setState({ productlistdata }); }; handlereducepeopleCancel = () => { this.props.okorcancel('accessbookvisible', false); this.props.conGetPlanBook(false); this.setState({ accessbookvisible: false, insurancetipsvisible: false }); }; handleproductxCancel = e => { this.props.okorcancel('productvisible', false); this.setState({ productvisible: false }); }; handleproductCancel = () => { this.props.okorcancel('productvisible', false); this.setState({ productvisible: false, accessbookvisible: true }); }; handlesurancetipxCancel = e => { this.props.okorcancel('insurancetipsvisible', false); this.setState({ insurancetipsvisible: false // insurancetipvisible:true, }); }; handlesurancetipCancel = e => { this.props.okorcancel('insurancetipsvisible', false); this.setState({ // insurancetipvisible: false, insurancetipsvisible: false }); this.props.history.push( // 跳转到1-4-4 '/enterprise/company' ); }; handlesuranceOk = e => { this.props.okorcancel('insurancetipsvisible', false); this.setState({ insurancetipsvisible: false, accessbookvisible: true }); }; // 获取产品列表 getProductList = () => { enterpriseInsComInsGetBlbProList({}).then(data => { const productlistdata = data.data.map(val => { return { ...val, ...{ isCheck: false } }; }); this.setState({ productlistdata }); console.log('获取产品列表', data); }); }; handleproductOk = () => { const item = this.state.productlistdata.find(val => val.isCheck === true); if (!item) { message.error('请选择产品'); return; } const { contactper, contactPhone, comPerNum, guaranteeAmountLow, insAmountUp } = this.state; enterpriseInsComInsSaveBookScheme({ contactper, contactPhone, comPerNum, guaranteeAmountLow, insAmountUp, proCode: item.proCode, insBootName: `${item.nsBootName}方案书` }).then( res => { console.log('成功信息-方案书values', res); this.setState({ productvisible: false }); this.props.history.replace('/insurancemanagement/insurancePlan'); }, err1 => { console.log('错误信息-err', err1); } ); }; // 温馨提示马上查看 rightCheckClick = () => { this.props.history.push(`/insurancemanagement/enterpriseinsurance`); }; render() { //获取方案书 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 identification = this.state.regProvinceId === 610000 ? '陕公治〔2017〕182 号' : this.state.regProvinceId === 450000 ? '桂公网传〔2017〕110 号' : ''; const reparations = this.state.regProvinceId === 450000 ? '37' : this.state.regProvinceId === 610000 ? '38' : this.state.regProvinceId === 640000 ? '30' : this.state.regProvinceId === 110000 ? '60' : ''; return (
恭喜贵司,已符合**地区保安从业单位应为保安员投保的相关政策要求,您还可继续投保为员工提高保障额度
)} {this.state.isIns !== '9' && this.state.regProvinceId !== 110000 && (根据《关于启用{this.state.regProvinceId === 610000 ? '' : '新版'} {this.state.regProvinceName} {this.state.regProvinceId === 610000 ? '新版' : ''} 保安服务监管信息系统有关工作的通知》{identification} 及《保安服务管理条例》第四章第二十条规定,推进落实保安从业单位根据保安服务岗位的风险程度为保安员投保意外伤害保险,保险保障额度应当不低于 {this.state.regProvinceAllName}人身损害赔偿标准(约{reparations} 万),并通过本系统及时将投保情况实时向公安机关报备。
)} {this.state.isIns !== '9' && this.state.regProvinceId === 110000 && (《关于启用新版北京市保安服务监管信息系统有关工作的通知》明确规定:
(1)根据《保安服务管理条例》第四章第二十条规定,推进落实保安从业单位根据保安服务岗位的风险程度为保安员投保意外伤害保险,按照系统要求填报录入投保信息(北京人身损害赔偿标准约为60万)。