// 物资入库审核
import React from 'react';
import { Card, Row, Col, Form, DatePicker, Select, Button, Icon, Table, Switch, message, Pagination } from 'antd';
import ColumnAuthoritysModel from 'pages/columnAuthority/ColumnAuthoritysModel';
import CommonPagination from 'components/pagination/index';
import { $http } from 'containers/config/https';
import Moment from 'moment';
import store from 'store';
import './style/index.less';
import { printInOp } from '../commonPrint/stkPrint';

const { Option } = Select;
const FormItem = Form.Item;
const formItemLayout = {    // label 和input宽度
    labelCol: { span: 7 },
    wrapperCol: { span: 17 },
};

const MaterialWarehouseCheck = Form.create()(
    class extends React.Component {
        constructor() {
            super();
            this.state = {
                userInfo: JSON.parse(window.sessionStorage.userData),
                data: [],
                queryCondition: {},
                SelectData: {},
                inOpLocDr: '',
                vendor: '',
                detailsId: '',//入库单ID
                detailsListData: [], //入库单明细数据
                WaListData: [], //入库单数据
                pageSize: 10,
                page: 1,
                pageSize2: 10,
                page2: 1,
                total: 0,
                detailTotal: 0,
                detailWidthTotal: '',
                columns: [],
                modalColumns: [],
                modificationList: false,  //默认隐藏修改表头弹窗
                showDetailPopup: false,  //默认隐藏修改表头弹窗
                listLength: '',  //列表长度
                parameterCode: '',
                ChineseEnglishSize: {},
                checkData: [],
                selectedRowKeys: [],
                inOperID: ''
            }
            // 入库单的数据表头
            this.columns = [
                {
                    key: 1,
                    title: '单号',
                    dataIndex: 'No',
                    align: "center",
                    width: '11%'
                },
                {
                    key: 2,
                    title: '入库科室',
                    dataIndex: 'inOperLocDesc',
                    align: "center",
                    width: '9%'
                },
                {
                    key: 3,
                    title: '供应商',
                    dataIndex: 'vendorDesc',
                    align: "center",
                    width: '15%'
                },
                {
                    key: 4,
                    title: '入库日期',
                    dataIndex: 'createDate',
                    align: "center",
                    width: '6%'
                },
                {
                    key: 5,
                    title: '制单人',
                    dataIndex: 'createUserName',
                    align: "center",
                    width: '6.5%'
                },
                {
                    key: 6,
                    title: '入库类型',
                    dataIndex: 'operTypeDesc',
                    align: "center",
                    width: '6%'
                },
                {
                    key: 7,
                    title: '审核人',
                    dataIndex: 'auditUserName',
                    align: "center",
                    width: '6.5%'
                },
                {
                    key: 8,
                    title: '审核日期',
                    dataIndex: 'auditDate',
                    align: "center",
                    width: '6%'
                },
                {
                    key: 9,
                    title: '订单号',
                    dataIndex: 'orderNo',
                    align: "center",
                    width: '15.5%'
                },
                {
                    key: 10,
                    title: '进价金额',
                    dataIndex: 'rpAmt',
                    align: "center",
                    width: '5%'
                },
                {
                    key: 11,
                    title: '售价金额',
                    dataIndex: 'spAmt',
                    align: "center",
                    width: '5%'
                },
                {
                    key: 12,
                    title: '进销差价',
                    dataIndex: 'difAmt',
                    align: "center",
                    width: '5%'
                }
            ];
            // 入库单详细表头
            this.modalColumns = [
                {
                    key: 1,
                    title: '代码',
                    dataIndex: 'stockCode',
                    align: "center",
                    width: '8.25%'
                },
                {
                    key: 2,
                    title: '描述',
                    dataIndex: 'stockDesc',
                    align: "center",
                    width: '9.5%'
                },
                {
                    key: 3,
                    title: '包装规格',
                    dataIndex: 'stockSpec',
                    align: "center",
                    width: '6.25%'
                },
                {
                    key: 4,
                    title: '生产厂家',
                    dataIndex: 'manfDesc',
                    align: "center",
                    width: '10.5%'
                },
                {
                    key: 5,
                    title: '批号',
                    dataIndex: 'batNo',
                    align: "center",
                    width: '7.25%'
                },
                {
                    key: 6,
                    title: '有效期',
                    dataIndex: 'expDate',
                    align: "center",
                    width: '6.25%'
                },
                {
                    key: 7,
                    title: '生产日期',
                    dataIndex: 'produceDate',
                    align: "center",
                    width: '6.25%'
                },
                {
                    key: 8,
                    title: '数量',
                    dataIndex: 'qty',
                    align: "center",
                    width: '4%'
                },
                {
                    key: 9,
                    title: '单位',
                    dataIndex: 'unitDesc',
                    align: "center",
                    width: '4%'
                },
                {
                    key: 10,
                    title: '进价',
                    dataIndex: 'rp',
                    align: "center",
                    width: '4%'
                },
                {
                    key: 11,
                    title: '售价',
                    dataIndex: 'sp',
                    align: "center",
                    width: '4%'
                },
                {
                    key: 12,
                    title: '发票号',
                    dataIndex: 'invNo',
                    align: "center",
                    width: '6.25%'
                },
                {
                    key: 13,
                    title: '发票日期',
                    dataIndex: 'invDate',
                    align: "center",
                    width: '6%'
                },
                {
                    key: 14,
                    title: '进价金额',
                    dataIndex: 'rpAmt',
                    align: "center",
                    width: '6%'
                },
                {
                    key: 15,
                    title: '售价金额',
                    dataIndex: 'spAmt',
                    align: "center",
                    width: '6%'
                },
                {
                    key: 16,
                    title: '进销差额',
                    dataIndex: 'difAmt',
                    align: "center",
                    width: '6%'
                }
            ]
        }

        componentDidMount() {
            // 初始化数据
            this.getTacitlyApproveData();
            this.getDetailTableColumns();
            this.getDetailListTableColumns();
            let leftList = document.querySelectorAll('.tableListHeight  .ant-table-body');
            if (leftList.length > 0) {
                leftList[0].style.height = store.getState().tableHeight.y - 371 + 'px';
            }
            let listData = document.querySelectorAll('.tableDetailHeight  .ant-table-body');
            if (listData.length > 0) {
                listData[0].style.height = store.getState().tableHeight.y - 294 + 'px';
            }
        }

        // 获取明系列表头数据
        getDetailTableColumns = () => {
            let { userInfo } = this.state;
            let data = {
                params: [{
                    reactCode: ['materialWarehouseCheck'],
                    compontName: 'materialWarehouseCheck',
                    type: 'C',
                }]
            }
            $http.post('urlS', this, {
                code: '01040073',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        let arr = res.result.C && res.result.C.length > 0 ? JSON.parse(JSON.stringify(res.result.C)).map((item, index) => {
                            return {
                                ...item,
                                key: index + 1,
                                title: <div onDoubleClick={() => {
                                    this.setState({ parameterCode: 'materialWarehouseCheck' }, () => {
                                        this.columnRef.onOpenModel();
                                    })
                                }}>{userInfo.language == 'EN' ? item.enDescripts : item.title}</div>
                            }
                        }) : '';
                        let filterArr = arr.filter(function (item) { return item.display === 'Y' });
                        this.setState({ columns: filterArr, detailWidthTotal: res.totalWidth, ChineseEnglishSize: userInfo.language == 'EN' ? res.result.language.EN : res.result.language.CN })
                    }
                }
            })
        };

        // 获取明系列表头数据
        getDetailListTableColumns = () => {
            let { userInfo } = this.state;
            let data = {
                params: [{
                    compontName: 'materialWarehouseCheckDetail',
                    type: 'C',
                }]
            }
            $http.post('urlS', this, {
                code: '01040073',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        let arr = res.result.C && res.result.C.length > 0 ? JSON.parse(JSON.stringify(res.result.C)).map((item, index) => {
                            return {
                                ...item,
                                key: index + 1,
                                title: <div onDoubleClick={() => {
                                    this.setState({ parameterCode: 'materialWarehouseCheckDetail' }, () => {
                                        this.columnRef.onOpenModel();
                                    })
                                }}>{userInfo.language == 'EN' ? item.enDescripts : item.title}</div>
                            }
                        }) : '';
                        let filterArr = arr.filter(function (item) { return item.display === 'Y' });
                        this.setState({ modalColumns: filterArr, listLength: res.totalWidth })
                    }
                }
            })
        };

        //清空表格内容
        handleReset = () => {
            this.setState({ WaListData: [], detailsListData: [], total: 0, detailsId: '', selectedRowKeys: [], checkData: [] });
            this.props.form.resetFields();
        };

        // 获取界面默认值
        getTacitlyApproveData() {
            let data = {
                params: []
            };
            // 获取下拉数据
            $http.post('urlS', this, {
                code: "02060005",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({ SelectData: res.result[0] }, () => {
                            this.handleQuery('N');
                        })
                    }
                }
            })
        }

        handleQuery = (isTip) => {
            this.setState({ page: 1, selectedRowKeys: [], checkData: [], detailsListData: [] }, () => {
                this.getWarehouseList(isTip)
            })
        };

        // 获取入库单列表数据
        getWarehouseList = (isTip) => {
            let { ChineseEnglishSize } = this.state;
            this.setState({ detailsId: '', loading: true });
            let inOpLocDr = this.props.form.getFieldValue('inOpLocDr');
            let provider = this.props.form.getFieldValue('provider');
            let StartDate = this.props.form.getFieldValue('StartDate');
            let EndData = this.props.form.getFieldValue('EndData');
            let approve = this.props.form.getFieldValue('approve');
            let data = {
                params: [{
                    inOperLocID: inOpLocDr,
                    vendorID: provider,
                    startDate: Moment(StartDate).format('YYYY-MM-DD'),
                    endDate: Moment(EndData).format('YYYY-MM-DD'),
                    stateID: approve ? "30" : "20",
                }],
                pagination: [
                    {
                        pageSize: this.state.pageSize,
                        currentPage: this.state.page,
                        sort: "ID",
                        dir: "asc",
                    }
                ],
            };
            $http.post('urlS', this, {
                code: "02060010",
                data: data,
                success: function (res) {
                    if (res.rows.length > 0) {
                        for (let i = 0; i < res.rows.length; i++) {
                            res.rows[i].key = i;
                        }
                        this.setState({ WaListData: res.rows, total: res.total, page2: 1, loading: false });
                    } else {
                        this.setState({ detailsListData: [], WaListData: [], selectedRowKeys: [], loading: false });
                        if (isTip !== 'N') {
                            message.error(ChineseEnglishSize.materialWarehouseChecknoData ? ChineseEnglishSize.materialWarehouseChecknoData.descripts : '没数据');
                        }
                    }
                }
            });
        };
        // 获取入库单明细
        getWarehouseEntryDetails(id) {
            this.setState({ detailsLoading: true })
            let { inOperID } = this.state
            let data = {
                params: [{
                    inOperID: id ? id : inOperID
                }],
                pagination: [
                    {
                        pageSize: this.state.pageSize2,
                        currentPage: id ? 1 : this.state.page2,
                        sort: "ID",
                        dir: "asc",
                    }
                ]
            };
            $http.post('urlS', this, {
                code: "02060011",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        for (let i = 0; i < res.rows.length; i++) {
                            res.rows[i].key = i;
                        }
                        this.setState({ detailsListData: res.rows, detailTotal: res.total, detailsLoading: false });
                    } else {
                        this.setState({ detailsListData: [], detailTotal: 0, detailsLoading: false });
                    }
                }
            })
        }
        // forDerailsIs=()=>{
        //     let{checkData,userInfo} =this.state;
        //     let arr = checkData&&checkData.map(item => {
        //         return item.inOperID
        //     });
        //     if(arr.length>0){
        //         for(var i=0; i<arr.length; i++){
        //             this.approveDetermine(arr[i])
        //         }
        //     }else {
        //         if(userInfo.language == 'EN'){
        //             message.error('Please select an audit object')
        //         }else{
        //             message.error('请选择审核对象')
        //         }
        //     }
        // }
        // 提交审核确定
        approveDetermine = () => {
            let { checkData, userInfo } = this.state;
            let arr = [];
            checkData && checkData.map(item => {
                return arr.push({ inOperID: item.inOperID })
            });
            if (!arr.length > 0) {
                if (userInfo.language == 'EN') {
                    message.error('Please select an audit object')
                } else {
                    message.error('请选择审核对象')
                }
                return
            }
            let data = {
                params: arr.length > 0 ? arr : ''
            };
            $http.post('urlS', this, {
                code: "02060015",
                data: data,
                success: function (res) {
                    if (+res.errorCode == '0') {
                        // if(res.ID){
                        //     printInOp.call(this,res.ID)
                        // }
                        // this.props.form.setFieldsValue({ approve: true });  // 审核标志
                        this.setState({ selectedRowKeys: [], checkData: [] }, () => {
                            this.getWarehouseList('N');
                        });
                        message.success(res.errorMessage);
                    }
                }
            });
        };

        //点击行，渲染当前行样式
        setRowClassName = (record) => {
            if (record) {
                if (this.state.detailsId == record.inOperID) return 'clickRowStyle';
                else return '';
                // return this.state.detailsId == record.inOperID ? 'clickRowStyle ': '';
            } else {
                return '';
            }
        };

        // 页码改变的回调，参数是改变后的页码及每页条数 入库单
        onChange = (page, pageSize) => {
            this.setState({ page: page, pageSize: this.state.pageSize }, () => {
                // 重新调用查询方法
                this.getWarehouseList();
            });
        };

        onShowSizeChange = (current, size) => {
            this.setState({ page: current, pageSize: size }, () => {
                // 重新调用查询方法
                this.onChange(current, size);
            })
        };

        // 页码改变的回调，参数是改变后的页码及每页条数 入库单详情
        onChange2 = (page, pageSize) => {
            this.setState({ page2: page, pageSize2: pageSize }, () => {
                // 重新调用查询方法
                this.getWarehouseEntryDetails();
            });
        };

        onShowSizeChange2 = (current, size) => {
            this.setState({ page2: current, pageSize2: size }, () => {
                // 重新调用查询方法
                this.onChange2(current, size);
            })
        };
        // 显示分页总条数
        showTotal(total) {
            return `共 ${total} 条`;
        }
        //组件权限编辑器
        onColumnRef = (ref) => {
            this.columnRef = ref;
        };
        //打印
        printData = () => {
            let { checkData, userInfo } = this.state;
            let arr = checkData && checkData.map(item => {
                return item.inOperID
            });
            if (arr.length > 0) {
                for (var i = 0; i < arr.length; i++) {
                    printInOp.call(this, arr[i])
                }
            } else {
                if (userInfo.language == 'EN') {
                    message.error('Please select the print object')
                } else {
                    message.error('请选择打印对象')
                }
            }
        };
        render() {
            const { getFieldDecorator } = this.props.form;
            const { modalColumns, columns, listLength, detailWidthTotal, ChineseEnglishSize, userInfo } = this.state;
            //入库科室列表
            let inOpLocDrSelect = [];
            this.state.SelectData.inOpLoc && this.state.SelectData.inOpLoc.map((item, i) => {
                inOpLocDrSelect.push(<Option value={item.id} key={i} seatchprop={item.descripts + '^' + item.descriptsSPCode}>{item.descripts}</Option>)
            });
            const rowSelection = {
                selectedRowKeys: this.state.selectedRowKeys,
                selectedRows: this.state.checkData,
                onChange: (selectedRowKeys, selectedRows) => {
                    this.setState({ selectedRowKeys: selectedRowKeys, checkData: selectedRows })
                    if (selectedRows.length > 0) {
                        let data = selectedRows[selectedRowKeys.length - 1];
                        this.setState({
                            inOperID: data.inOperID
                        }, () => {
                            this.getWarehouseEntryDetails(data.inOperID)
                        })

                    } else {
                        this.setState({ detailsListData: [] })
                    }
                }
            };
            return (
                <div className="WarehouseEntryCheck">
                    <Row>
                        <Card
                            size="small"
                            title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.materialWarehouseCheckSearchTitle ? ChineseEnglishSize.materialWarehouseCheckSearchTitle.descripts : '查询条件'}</div>}
                        >
                            <Col span={18}>
                                <Form>
                                    <Row >
                                        <Col span={8}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.materialWarehouseCheckRecLoc ? ChineseEnglishSize.materialWarehouseCheckRecLoc.descripts : '入库科室'}>
                                                {getFieldDecorator('inOpLocDr', {
                                                    initialValue: this.state.userInfo.locID ? this.state.userInfo.locID : undefined,
                                                    rules: [{ required: ChineseEnglishSize.materialWarehouseCheckRecLoc ? ChineseEnglishSize.materialWarehouseCheckRecLoc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.materialWarehouseCheckRecLoc ? ChineseEnglishSize.materialWarehouseCheckRecLoc.message : '科室不能为空' }]
                                                })(
                                                    <Select allowClear showSearch optionFilterProp="seatchprop">
                                                        {inOpLocDrSelect}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={8}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.materialWarehouseCheckVendor ? ChineseEnglishSize.materialWarehouseCheckVendor.descripts : '供应商'}>
                                                {getFieldDecorator('provider', {
                                                    initialValue: undefined,
                                                    rules: [{ required: ChineseEnglishSize.materialWarehouseCheckVendor ? ChineseEnglishSize.materialWarehouseCheckVendor.required == 'Y' ? true : false : false, message: ChineseEnglishSize.materialWarehouseCheckVendor ? ChineseEnglishSize.materialWarehouseCheckVendor.message : '供应商不能为空' }]
                                                })(
                                                    <Select allowClear showSearch optionFilterProp="seatchprop">
                                                        {this.state.SelectData.vendor && this.state.SelectData.vendor.map((item, i) => {
                                                            return <Option value={item.id} key={i} seatchprop={item.descripts + '^' + item.descriptsSPCode}>{item.descripts}</Option>
                                                        })}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row>
                                        <Col span={8}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.materialWarehouseCheckStartDate ? ChineseEnglishSize.materialWarehouseCheckStartDate.descripts : '起始日期'}>
                                                {getFieldDecorator('StartDate', {
                                                    initialValue: this.state.queryCondition.startDate ? Moment(this.state.queryCondition.startDate, 'YYYY-MM-DD') : Moment(Moment().format('L'), 'YYYY-MM-DD'),
                                                    rules: [{ required: true }]
                                                })(
                                                    <DatePicker />
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={8}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.materialWarehouseCheckEndDate ? ChineseEnglishSize.materialWarehouseCheckEndDate.descripts : '截止日期'}>
                                                {getFieldDecorator('EndData', {
                                                    initialValue: this.state.queryCondition.endDate ? Moment(this.state.queryCondition.endDate, 'YYYY-MM-DD') : Moment(Moment().format('L'), 'YYYY-MM-DD'),
                                                    rules: [{ required: true }]
                                                })(
                                                    <DatePicker />
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={7}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.materialWarehouseCheckCheck ? ChineseEnglishSize.materialWarehouseCheckCheck.descripts : '审核'}>
                                                {getFieldDecorator('approve', {
                                                    valuePropName: 'checked',
                                                    initialValue: false,
                                                    rules: [{ required: false }]
                                                })(
                                                    <Switch checkedChildren={userInfo.language == 'EN' ? "Yes" : "是"} unCheckedChildren={userInfo.language == 'EN' ? "No" : "否"} onChange={this.handleQuery} />
                                                )}
                                            </FormItem>
                                        </Col>
                                    </Row>
                                </Form>
                            </Col>
                            <Col span={6}>
                                <Row style={{ marginBottom: '18px' }} className="button">
                                    <Button onClick={this.handleQuery}>{ChineseEnglishSize.materialWarehouseChecksearch ? ChineseEnglishSize.materialWarehouseChecksearch.descripts : '查询'}</Button>
                                    <Button style={{ margin: '0 30px' }} type="primary" ghost onClick={this.printData}>{ChineseEnglishSize.MaterialStorageOrderMakingprint ? ChineseEnglishSize.MaterialStorageOrderMakingprint.descripts : '打印'}</Button>
                                    <Button type="danger" ghost onClick={this.handleReset}>{ChineseEnglishSize.materialWarehouseCheckReset ? ChineseEnglishSize.materialWarehouseCheckReset.descripts : '清屏'}</Button>
                                </Row>
                                <Row style={{ marginBottom: '18px' }}>
                                    <Button type="primary" style={{ marginRight: '30px' }} onClick={this.approveDetermine}>{ChineseEnglishSize.materialWarehouseCheckAudit ? ChineseEnglishSize.materialWarehouseCheckAudit.descripts : '审核确定'}</Button>
                                </Row>
                            </Col>

                        </Card>
                    </Row>
                    <Row>
                        <Col>
                            <Card
                                size="small"
                                title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.materialWarehouseCheckRecNoTitle ? ChineseEnglishSize.materialWarehouseCheckRecNoTitle.descripts : '入库单'}</div>}
                                extra={<span style={{ color: '#666' }} className='span' onClick={() => {
                                    this.setState({ parameterCode: 'materialWarehouseCheck' }, () => {
                                        this.columnRef.onOpenModel();
                                    })
                                }}><Icon type="setting" title={ChineseEnglishSize.materialWarehouseCheckcolumnSettings ? ChineseEnglishSize.materialWarehouseCheckcolumnSettings.descripts : '列权限设置'} /></span>}
                            >
                                <div>
                                    <Table
                                        rowSelection={rowSelection}
                                        columns={columns.length > 0 ? columns : this.columns}
                                        dataSource={this.state.WaListData}
                                        pagination={false}
                                        bordered
                                        scroll={{ x: detailWidthTotal ? detailWidthTotal : 1500, y: 210 }}
                                        style={{ height: '250px' }}
                                        rowKey={record => record.key}
                                        // rowClassName={this.setRowClassName}
                                        className="tableListHeight"
                                    // onRow={(record) => {
                                    //     return {
                                    //         onClick: () => {
                                    //             serialNumber = 9999;
                                    //             this.setState({detailsId: record.inOperID,page2: 1});
                                    //             this.getWarehouseEntryDetails(record.inOperID)
                                    //         },
                                    //
                                    //     };
                                    // }}
                                    />
                                    <CommonPagination size='small' current={this.state.page} total={this.state.total} search='search'
                                        onShowSizeChange={this.onShowSizeChange.bind(this)} complete={true} dataSource={this.state.WaListData}
                                        loading={this.state.loading} onChange={this.onChange.bind(this)} />
                                </div>
                            </Card>
                        </Col>
                    </Row>
                    <Row>
                        <Col>
                            <Card
                                size="small"
                                title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.materialWarehouseCheckRecDetailTitle ? ChineseEnglishSize.materialWarehouseCheckRecDetailTitle.descripts : '入库单明细'}</div>}
                                extra={<span style={{ color: '#666' }} className='span' onClick={() => {
                                    this.setState({ parameterCode: 'materialWarehouseCheckDetail' }, () => {
                                        this.columnRef.onOpenModel();
                                    })
                                }}><Icon type="setting" title={ChineseEnglishSize.materialWarehouseCheckcolumnSettings ? ChineseEnglishSize.materialWarehouseCheckcolumnSettings.descripts : '列权限设置'} /></span>}
                            >
                                <div>
                                    <Table
                                        columns={modalColumns.length > 0 ? modalColumns : this.modalColumns}
                                        dataSource={this.state.detailsListData}
                                        pagination={false}
                                        bordered
                                        scroll={{ x: listLength ? listLength : 1500, y: store.getState().tableHeight.y - 366 }}
                                        style={{ height: (store.getState().tableHeight.y - 330) }}
                                        rowKey={record => record.key}
                                        className="tableDetailHeight"
                                    />
                                    <CommonPagination size='small' current={this.state.page2} total={this.state.detailTotal} search='search'
                                        onShowSizeChange={this.onShowSizeChange2.bind(this)} complete={true} dataSource={this.state.detailsListData}
                                        loading={this.state.detailsLoading} onChange={this.onChange2.bind(this)} />
                                </div>
                            </Card>
                        </Col>
                    </Row>
                    <ColumnAuthoritysModel
                        clientWidth='800px'
                        compontName={this.state.parameterCode}
                        configType="C"
                        onRef={this.onColumnRef}
                        reloadData={() => {
                            if (this.state.parameterCode == 'materialWarehouseCheck') {
                                this.getDetailTableColumns()
                            } else if (this.state.parameterCode == 'materialWarehouseCheckDetail') {
                                this.getDetailListTableColumns()
                            }
                        }
                        }
                    />
                </div>
            )
        }
    }
);
export default MaterialWarehouseCheck;