//入库明细查询
import React from 'react';
import { Card, Row, Col, Form, DatePicker, Select, Button, Icon, Table, Checkbox, message, Input } from 'antd';
import { $http } from 'containers/config/https';
import Moment from 'moment';
import store from 'store';
import './style/index.less';
import ColumnAuthoritysModel from 'pages/columnAuthority/ColumnAuthoritysModel';
import PublicModalTable from './../common/PublicModalTable';
import CommonPagination from 'components/pagination/index';
const { Option } = Select;
const FormItem = Form.Item;
const formItemLayout = {    // label 和input宽度
    labelCol: { span: 7 },
    wrapperCol: { span: 17 },
};
const formItemSwitch = {    // label 和input宽度
    labelCol: { span: 11 },
    wrapperCol: { span: 13 },
};

const warehouseDetail = Form.create()(
    class extends React.Component {
        constructor() {
            super();
            this.state = {
                userInfo: JSON.parse(window.sessionStorage.userData),
                data: [],
                queryCondition: {},
                SelectData: {},
                inOpLocDr: '',
                vendor: '',
                WaListData: [], //库存单数据
                pageSize: 20,
                page: 1,
                total: 0,
                modalData: [],
                stockID: '',
                ModalRowData: {}, // 弹框双击选中行数据
                columns: [],
                ChineseEnglishSize: [],
                detailWidthTotal: '',
                auditDate: '', // 审核日期
                batchSP: '', //批次售价
                rpTotal: 0, //进价金额总和
                spTotal: 0, //售价金额总和
                qtyTotal: 0, //数量合计
            }
            this.modalColumns = [
                {
                    key: 1,
                    title: this.state.userInfo.language == 'EN' ? 'Inventory item code' : '药品代码',
                    dataIndex: 'stockCode',
                    align: "center",
                    width: '22%'
                },
                {
                    key: 2,
                    title: this.state.userInfo.language == 'EN' ? 'Inventory item description' : '药品描述',
                    dataIndex: 'stockDesc',
                    align: "center",
                    width: '24%',
                },
                {
                    key: 5,
                    title: this.state.userInfo.language == 'EN' ? 'Inventory classification' : '库存分类',
                    dataIndex: 'stkSubCatDesc',
                    align: "center",
                    width: '16%',
                },
                {
                    key: 3,
                    title: this.state.userInfo.language == 'EN' ? 'Packing specification' : '包装规格',
                    dataIndex: 'stockSpec',
                    align: "center",
                    width: '12%',
                },
                {
                    key: 6,
                    title: this.state.userInfo.language == 'EN' ? 'Basic unit' : '基本单位',
                    dataIndex: 'baseUnitDesc',
                    align: "center",
                    width: '12%',
                },
                {
                    key: 7,
                    title: this.state.userInfo.language == 'EN' ? 'Storage unit' : '入库单位',
                    dataIndex: 'purUnitDesc',
                    align: "center",
                }
            ]
        }

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

        componentWillUnmount() {
            // 组件销毁前将静止让setState修改state的状态，防止内存泄漏
            this.setState = (state, callback) => { return; }
        }

        // 获取明系列表头数据
        getDetailTableColumns = () => {
            let { userInfo } = this.state;
            let data = {
                params: [{
                    reactCode: ['StorageDetailsQuery'],
                    compontName: 'StorageDetailsQuery',
                    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.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 })
                    }
                }
            });
        };

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

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

        searchInformation = () => {
            this.setState({ page: 1 }, () => {
                this.getConsumptionList()
            })
        };

        // 获取入库明细列表数据
        getConsumptionList = () => {
            let { ChineseEnglishSize } = this.state;
            this.setState({ loading: true })
            this.props.form.validateFields((error, value) => {
                let obj = JSON.parse(JSON.stringify(value));
                if (error == null) {
                    let data = {
                        params: [{
                            locID: obj.locDesc ? obj.locDesc : undefined,
                            startDate: obj.StartDate ? Moment(obj.StartDate).format('YYYY-MM-DD') : undefined,
                            endDate: obj.EndData ? Moment(obj.EndData).format('YYYY-MM-DD') : undefined,
                            stkCat: obj.stkCat ? obj.stkCat : "",
                            stkSubCat: obj.stkSubCat ? obj.stkSubCat : "",
                            vendor: obj.vendor ? obj.vendor : "",
                            stockID: this.state.stockID ? this.state.stockID : "",
                            impotType: obj.impotType ? obj.impotType : '',
                            priceType: obj.priceType ? obj.priceType : '',
                            manf: obj.manf ? obj.manf : "",
                            inOpType: obj.inOpType ? obj.inOpType : "",
                            invNO: obj.invNO ? obj.invNO : "",
                            form: obj.form ? obj.form : "",
                            minSP: obj.minSP ? obj.minSP : "",
                            maxSp: obj.maxSp ? obj.maxSp : "",
                            poison: obj.poison ? obj.poison : "",
                            // auditDate: this.state.auditDate ? this.state.auditDate : '',
                            batchSP: this.state.batchSP ? this.state.batchSP : ''
                        }],
                        pagination: [
                            {
                                pageSize: this.state.pageSize,
                                currentPage: this.state.page,
                                sort: "ID",
                                dir: "asc",
                            }
                        ],
                    };
                    $http.post('urlS', this, {
                        code: "02020318",
                        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, loading: false }, () => {
                                    this.handlecount();
                                });
                            } else {
                                this.setState({ WaListData: [], total: 0 });
                                message.error(ChineseEnglishSize.StorageDetailsQuerynoData ? ChineseEnglishSize.StorageDetailsQuerynoData.descripts : "没数据");
                            }
                        },
                        error: function (err) {
                            message.error(err.errorMessage)
                        }
                    });
                }
            })

        };

        ///统计 进价 售价金额合计
        handlecount = () => {
            let spNum = 0;
            let rpNum = 0;
            let qtyNum = 0;
            if (this.state.WaListData) {
                let arr = this.state.WaListData;
                for (var f = 0; f < arr.length; f++) {
                    spNum = +arr[f].spAmt + spNum;
                    rpNum = +arr[f].rpAmt + rpNum;
                    qtyNum = +arr[f].qty + qtyNum;
                }
            }
            this.setState({ rpTotal: rpNum.toFixed(2), spTotal: spNum.toFixed(2), qtyTotal: qtyNum.toFixed(2) })
        }


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

        onShowSizeChange = (current, size) => {
            this.setState({ page: current, pageSize: size }, () => {
                // 重新调用查询方法
                this.onChange(current, size);
            })
        };
        // 显示分页总条数
        showTotal(total) {
            return `共 ${total} 条`;
        }
        //组件权限编辑器
        onColumnRef = (ref) => {
            this.columnRef = ref;
        };

        // 获取描述列表数据
        getModalListData(alias) {
            let data = {
                params: [
                    {
                        stockAlias: alias, // 库存项描述别名
                        frLocID: this.state.frLocDr ? this.state.frLocDr : undefined
                    }
                ]
            };
            $http.post('urlS', this, {
                code: "02020042",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        for (var i = 0; i < res.result.length; i++) {
                            res.result[i].key = i
                        }
                        this.setState({ modalData: res.result })
                    } else {
                        this.setState({ modalData: [] })
                    }
                }
            })
        }
        // 描述回车事件
        stockDescOnPressEnter = (e) => {
            let top = document.getElementById('stock-desc').getBoundingClientRect().top + 40 + 'px';
            let left = document.getElementById('stock-desc').getBoundingClientRect().left + 100 + 'px';
            this.setState({
                top: top,
                left: left
            });
            this.getModalListData(e.target.value);
            this.child.showModal();
        };

        // 当描述失去焦点的时候
        stastockDescOnBlure = (e) => {
            if (this.state.ModalRowData && (e.target.value !== this.state.ModalRowData.stockDesc)) {
                this.props.form.setFieldsValue({ stockDesc: undefined });
            }
        };

        // 操作弹框
        onClickRowPublic = (record) => {
            return {
                onDoubleClick: () => {
                    this.confirmSelection(record);
                }
            }
        };
        // 双击选中行数据的回调
        confirmSelection = (record) => {
            // this.resetFields();
            this.setState({ ModalRowData: record }, () => {
                this.setState({ stockID: record.stockID });
                this.props.form.setFieldsValue({ stockDesc: record.stockDesc });
                // 关闭弹窗
                this.child.handleCancel();
            })
        };

        onchangeStock = (val) => {
            if (!val.target.value) {
                this.setState({ stockID: '' });
            }
        };
        onRef = (ref) => {
            this.child = ref;
        };

        onChangeSP = (e) => {
            this.setState({ batchSP: e.target.checked })
        }
        onChangeDate = (v) => {
            this.setState({ auditDate: v })
        }
        render() {
            const { getFieldDecorator } = this.props.form;
            let { ChineseEnglishSize, userInfo } = this.state;
            //科室列表
            let inOpLocDrSelect = [];
            this.state.SelectData.loc && this.state.SelectData.loc.map((item, i) => {
                inOpLocDrSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });
            //类组列表
            let stkCatSelect = [];
            this.state.SelectData.stkCat && this.state.SelectData.stkCat.map((item, i) => {
                stkCatSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });
            //库存分类列表
            let stkSubCatSelect = [];
            this.state.SelectData.stkSubCat && this.state.SelectData.stkSubCat.map((item, i) => {
                stkSubCatSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });
            //入库类型列表
            let inOpTypeSelect = [];
            this.state.SelectData.inOpType && this.state.SelectData.inOpType.map((item, i) => {
                inOpTypeSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });
            //招标列表
            let pubBidListSelect = [];
            this.state.SelectData.pubBidList && this.state.SelectData.pubBidList.map((item, i) => {
                pubBidListSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });
            //招标级别列表
            let pubBidLevelSelect = [];
            this.state.SelectData.pubBidLevel && this.state.SelectData.pubBidLevel.map((item, i) => {
                pubBidLevelSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });
            //供应商列表
            let vendorSelect = [];
            this.state.SelectData.vendor && this.state.SelectData.vendor.map((item, i) => {
                vendorSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });
            //生产厂商列表
            let manfSelect = [];
            this.state.SelectData.manf && this.state.SelectData.manf.map((item, i) => {
                manfSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });
            //剂型列表
            let formSelect = [];
            this.state.SelectData.form && this.state.SelectData.form.map((item, i) => {
                formSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });
            //管制分类列表
            let poisonSelect = [];
            this.state.SelectData.poison && this.state.SelectData.poison.map((item, i) => {
                poisonSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });
            //定价类型列表
            let priceTypeSelect = [];
            this.state.SelectData.priceType && this.state.SelectData.priceType.map((item, i) => {
                priceTypeSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });
            //进口标志列表
            let impotTypeSelect = [];
            this.state.SelectData.impotType && this.state.SelectData.impotType.map((item, i) => {
                impotTypeSelect.push(<Option value={item.id} key={i}>{item.descripts}</Option>)
            });

            let param = {
                width: '600px',
                top: this.state.top,
                left: this.state.left,
                columns: this.modalColumns,
                data: this.state.modalData,
                isOnRow: true,
                TableClassName: 'tab-placeholder',
            };
            return (
                <div className="warehouseDetail">
                    <Row>
                        <Card
                            size="small"
                            title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.StorageDetailsQueryaccToConsumption ? ChineseEnglishSize.StorageDetailsQueryaccToConsumption.descripts : '查询条件'}</div>}
                        >
                            <Col span={20}>
                                <Form>
                                    <Row >
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '科室'}>
                                                {getFieldDecorator('locDesc', {
                                                    initialValue: this.state.userInfo.locID ? this.state.userInfo.locID : undefined,
                                                    rules: [{ required: true, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '科室不能为空' }]
                                                })(
                                                    <Select allowClear>
                                                        {inOpLocDrSelect}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryStartDate ? ChineseEnglishSize.StorageDetailsQueryStartDate.descripts : '起初日期'}>
                                                {getFieldDecorator('StartDate', {
                                                    initialValue: this.state.SelectData.params && this.state.SelectData.params.startDate ? Moment(this.state.SelectData.params.startDate, 'YYYY-MM-DD') : Moment(),
                                                    rules: [{ required: true, message: '起初日期不能为空', }],
                                                })(
                                                    <DatePicker format="YYYY-MM-DD" style={{ width: '100%' }} />
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQuerydeadline ? ChineseEnglishSize.StorageDetailsQuerydeadline.descripts : '截止日期'}>
                                                {getFieldDecorator('EndData', {
                                                    initialValue: this.state.SelectData.params && this.state.SelectData.params.endDate ? Moment(this.state.SelectData.params.endDate, 'YYYY-MM-DD') : Moment(),
                                                    rules: [{ required: true, message: '截止日期不能为空', }],
                                                })(
                                                    <DatePicker format="YYYY-MM-DD" style={{ width: '100%' }} />
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '类组'}>
                                                {getFieldDecorator('stkCat', {
                                                    initialValue: "",
                                                    rules: [{ required: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '类组不能为空' }]
                                                })(
                                                    <Select allowClear>
                                                        {stkCatSelect}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row >
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '库存分类'}>
                                                {getFieldDecorator('stkSubCat', {
                                                    initialValue: "",
                                                    rules: [{ required: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '库存分类不能为空' }]
                                                })(
                                                    <Select allowClear>
                                                        {stkSubCatSelect}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6} id='stock-desc'>
                                            <FormItem label="药品名称" {...formItemLayout}>
                                                {getFieldDecorator('stockDesc', {
                                                    rules: [{ required: false, message: 'Please input your groupClass', }],
                                                })(
                                                    <Input placeholder='回车检索药品相关信息' allowClear onPressEnter={this.stockDescOnPressEnter} onBlur={this.stastockDescOnBlure} onChange={this.onchangeStock} />
                                                )}
                                            </FormItem>
                                        </Col>
                                        {/*<Col span={6}>*/}
                                        {/*<FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts:'入库单号'}>*/}
                                        {/*{getFieldDecorator('NO',{*/}
                                        {/*initialValue: "",*/}
                                        {/*rules:[{ required : ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required =='Y'? true:false: false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message:'入库单号不能为空'}]*/}
                                        {/*})(*/}
                                        {/*<Input style={{ width: '100%' }} />*/}
                                        {/*) }*/}
                                        {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '入库类型'}>
                                                {getFieldDecorator('inOpType', {
                                                    initialValue: "",
                                                    rules: [{ required: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '入库类型不能为空' }]
                                                })(
                                                    <Select allowClear>
                                                        {inOpTypeSelect}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '定价类型'}>
                                                {getFieldDecorator('priceType', {
                                                    initialValue: "",
                                                    rules: [{ required: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '定价类型不能为空' }]
                                                })(
                                                    <Select allowClear>
                                                        {priceTypeSelect}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row >
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '进口标志'}>
                                                {getFieldDecorator('impotType', {
                                                    initialValue: "",
                                                    rules: [{ required: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '进口标志不能为空' }]
                                                })(
                                                    <Select allowClear>
                                                        {impotTypeSelect}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '最低售价'}>
                                                {getFieldDecorator('minSp', {
                                                    initialValue: "",
                                                    rules: [{ required: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '最低售价不能为空' }]
                                                })(
                                                    <Input style={{ width: '100%' }} />
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '最高售价'}>
                                                {getFieldDecorator('maxSp', {
                                                    initialValue: "",
                                                    rules: [{ required: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '最高售价不能为空' }]
                                                })(
                                                    <Input style={{ width: '100%' }} />
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '管制分类'}>
                                                {getFieldDecorator('poison', {
                                                    initialValue: "",
                                                    rules: [{ required: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '管制分类不能为空' }]
                                                })(
                                                    <Select allowClear>
                                                        {poisonSelect}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>

                                    </Row>
                                    <Row >
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '供应商'}>
                                                {getFieldDecorator('vendor', {
                                                    initialValue: "",
                                                    rules: [{ required: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '供应商不能为空' }]
                                                })(
                                                    <Select allowClear>
                                                        {vendorSelect}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '生产厂商'}>
                                                {getFieldDecorator('manf', {
                                                    initialValue: "",
                                                    rules: [{ required: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '生产厂商不能为空' }]
                                                })(
                                                    <Select allowClear>
                                                        {manfSelect}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts : '剂型'}>
                                                {getFieldDecorator('form', {
                                                    initialValue: "",
                                                    rules: [{ required: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required == 'Y' ? true : false : false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message : '剂型不能为空' }]
                                                })(
                                                    <Select allowClear>
                                                        {formSelect}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6}>
                                            <Col span={20} style={{ paddingLeft: '45px', marginTop: '10px' }}>
                                                <Checkbox onChange={this.onChangeSP}>批次售价不等于售价</Checkbox>
                                            </Col>
                                            {/*<Col span={11}>*/}
                                            {/*<Checkbox onChange={this.onChangeDate}>按审核日期统计</Checkbox>*/}
                                            {/*</Col>*/}
                                        </Col>
                                    </Row>
                                    <Row >

                                        {/*<Col span={6}>*/}
                                        {/*<FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts:'医保类别'}>*/}
                                        {/*{getFieldDecorator('sdd',{*/}
                                        {/*initialValue: "",*/}
                                        {/*rules:[{ required : ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required =='Y'? true:false: false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message:'医保类别不能为空'}]*/}
                                        {/*})(*/}
                                        {/*<Select allowClear>*/}
                                        {/*{formSelect}*/}
                                        {/*</Select>*/}
                                        {/*) }*/}
                                        {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={6}>*/}
                                        {/*<FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts:'招标'}>*/}
                                        {/*{getFieldDecorator('pubBidList',{*/}
                                        {/*initialValue: "",*/}
                                        {/*rules:[{ required : ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required =='Y'? true:false: false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message:'招标不能为空'}]*/}
                                        {/*})(*/}
                                        {/*<Select allowClear>*/}
                                        {/*{pubBidListSelect}*/}
                                        {/*</Select>*/}
                                        {/*) }*/}
                                        {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={6}>*/}
                                        {/*<FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts:'招标级别'}>*/}
                                        {/*{getFieldDecorator('pubBidLevel',{*/}
                                        {/*initialValue: "",*/}
                                        {/*rules:[{ required : ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required =='Y'? true:false: false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message:'招标级别不能为空'}]*/}
                                        {/*})(*/}
                                        {/*<Select allowClear>*/}
                                        {/*{pubBidLevelSelect}*/}
                                        {/*</Select>*/}
                                        {/*) }*/}
                                        {/*</FormItem>*/}
                                        {/*</Col>*/}
                                        {/*<Col span={6}>*/}
                                        {/*<FormItem {...formItemLayout} label={ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.descripts:'发票号'}>*/}
                                        {/*{getFieldDecorator('invNO',{*/}
                                        {/*initialValue: "",*/}
                                        {/*rules:[{ required : ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.required =='Y'? true:false: false, message: ChineseEnglishSize.StorageDetailsQueryloc ? ChineseEnglishSize.StorageDetailsQueryloc.message:'发票号不能为空'}]*/}
                                        {/*})(*/}
                                        {/*<Input style={{ width: '100%' }} />*/}
                                        {/*) }*/}
                                        {/*</FormItem>*/}
                                        {/*</Col>*/}
                                    </Row>
                                </Form>
                            </Col>
                            <Col span={4} style={{ textAlign: 'center' }}>
                                <Row style={{ marginBottom: '18px' }} className="button">
                                    <Button onClick={this.searchInformation}>{ChineseEnglishSize.StorageDetailsQuerysearch ? ChineseEnglishSize.StorageDetailsQuerysearch.descripts : '查询'}</Button>
                                </Row>
                                <Row style={{ marginBottom: '18px' }} className="button">
                                    <Button type="primary" onClick={this.handleReset}>{ChineseEnglishSize.StorageDetailsQueryclean ? ChineseEnglishSize.StorageDetailsQueryclean.descripts : '清屏'}</Button>
                                </Row>
                            </Col>

                        </Card>
                    </Row>
                    <Row>
                        <Col>
                            <Card
                                size="small"
                                title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.StorageDetailsQueryinventoryAlarmForm ? ChineseEnglishSize.StorageDetailsQueryinventoryAlarmForm.descripts : '入库明细'}</div>}
                                extra={<span style={{ color: '#666' }} className='span' onClick={() => { this.columnRef.onOpenModel(); }}><Icon type="setting" title={ChineseEnglishSize.StorageDetailsQuerycolumnSettings ? ChineseEnglishSize.StorageDetailsQuerycolumnSettings.descripts : '列权限设置'} /></span>}
                            >
                                <div>
                                    <Table
                                        columns={this.state.columns.length > 0 ? this.state.columns : this.state.columns}
                                        dataSource={this.state.WaListData}
                                        pagination={false}
                                        bordered
                                        scroll={{ x: this.state.detailWidthTotal ? this.state.detailWidthTotal : 1600, y: (store.getState().tableHeight.y) / 2 + 160 }}
                                        rowKey={record => record.key}
                                        className="AccordingHeight"
                                    />
                                    <Col style={{ fontSize: '15px', fontWeight: '700', marginLeft: '18px' }}>
                                        <span>{ChineseEnglishSize.WarehousingOrderMakingqtyTotal ? ChineseEnglishSize.WarehousingOrderMakingqtyTotal.descripts : '数量合计'} : </span><span>{this.state.qtyTotal}</span>
                                        <span style={{ marginLeft: '50px' }}>{ChineseEnglishSize.WarehousingOrderMakingrpTotal ? ChineseEnglishSize.WarehousingOrderMakingrpTotal.descripts : '进价金额总价'}：</span><span>{this.state.rpTotal} </span>
                                        <span style={{ marginLeft: '50px' }}> {ChineseEnglishSize.WarehousingOrderMakingspTotal ? ChineseEnglishSize.WarehousingOrderMakingspTotal.descripts : '售价金额总价'} ：</span><span>{this.state.spTotal}</span>
                                    </Col>
                                    <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)} pageSize={true} />
                                </div>
                            </Card>
                        </Col>
                    </Row>
                    <ColumnAuthoritysModel
                        clientWidth='800px'
                        compontName='StorageDetailsQuery'
                        configType="C"
                        onRef={this.onColumnRef}
                        reloadData={this.getDetailTableColumns}
                    />
                    <PublicModalTable onClickRowPublic={this.onClickRowPublic} param={param} onRef={this.onRef} />
                </div>
            )
        }
    }
);
export default warehouseDetail;