/** * @author Xyz * 分公司管理 */ import React from 'react'; import { connect } from 'dva'; import { Form, Input, Button, message, Table, Popover, Modal, Tabs, Alert } from 'antd'; const store = require('store'); import { Container, SearchItem, Options } from './styles'; import PTable from '../../../components/Pro/PTable'; import PDrawer from '../../../components/Pro/PDrawer'; import { systemComVaseInfoGet, getRegionMenuButton } from '../../../services/api'; import { AddCompanyTip } from './components'; import DrawBranchCompanyDetail from './DrawBranchCompanyDetail'; //新增分公司 import DrawChildCompanyBasic from './DrawChildCompanyBasic';//分公司基础信息 import DrawChildCompanyIdentification from './DrawChildCompanyIdentification'; //分公司详情 const FormItem = Form.Item; const { TabPane } = Tabs; @Form.create() @connect(state => ({ menuInfo: state.global.menuInfo, })) export default class BranchCompanyManager extends React.Component { constructor(props, context) { super(props, context); this.state = { visible: false, isBasicOpen: false, //是否显示分公司详情 isIdentificationOpen: false, pageParm: { //数据请求 分页信息 pageSize: '10', //缴交情况 pageNumber: '1', keyWord: '' }, comBranchId: '', //分公司ID forceUpdate: false, comId: '', btnControl: [], modalVisible: false //分公司开通成功后提示 }; } /******************************生命周期******************************/ componentDidMount = () => { const currentMenu = this.props.menuInfo.find(v => v.menuName == '分公司管理'); const menuId = currentMenu? currentMenu.menuId: ''; systemComVaseInfoGet({}).then(res => { const regionId = res.data.regProvince; getRegionMenuButton({menuId, regionId}).then(respones => { this.setState({ btnControl: respones.data || [] }); }); }); }; /******************************ajax请求******************************/ /******************************相关事件******************************/ //新增分公司 addCompany = () => { this.setState({ visible: true, comBranchId: '' }); }; //修改分公司 item upDateItem = ({ comBranchId }) => { if (!comBranchId) { return; } this.setState({ visible: true, comBranchId }); }; //查看基础信息 item basicInfoOpen = (record) => { this.setState({ isBasicOpen: true, comId: record["comBranchId"] }); } closeBasicDrawer = () => { this.setState({isBasicOpen: false}); } //关闭 修改 item 抽屉 closeDrawer = () => { this.setState({ visible: false }); // Modal.confirm({ // title: '当前信息未提交,返回后无法保证。是否确认返回?', // okText: '确定', // cancelText: '取消', // onOk: () => { // this.setState({ visible: false }); // }, // onCancel: () => { // console.log('Cancel'); // }, // }); }; confirDrawer = () => { this.setState({ visible: false }); }; handleOk = () => { this.setState({ modalVisible: false }); } //删除提示框 deleteConfirm = () => { Modal.confirm({ title: '删除后将无法查看分公司信息,并影响年报统计。是否确认删除?', okText: '确定', cancelText: '取消' }); }; //搜索 search = () => { this.setState({ forceUpdate: true }, () => { this.setState({ forceUpdate: false }); }); }; //重置搜索条件 resetSearch = () => { const pageParm = { pageSize: '10', pageNumber: '1', keyWord: '' }; this.setState({ pageParm }); }; //关键字更改 inputChange = e => { const pageParm = this.state.pageParm; pageParm.keyWord = e.target.value; this.setState({ pageParm }); }; //查看认证信息 indetificationOpen = record => { this.setState({ isIdentificationOpen: true, comId: record['comBranchId'] }); }; closeIdentDrawer = () => { this.setState({ isIdentificationOpen: false }); }; /******************************render******************************/ renderTable = () => { const columns1 = [ { title: '分公司名称', dataIndex: 'comName', key: 'comName', // render: text => {text}, render: (text, record) => (