// 明细录入列表
import React from 'react';
import { Card, Row, Col, Form, Icon, Table, Button, DatePicker, Select, Input, message, Popconfirm } from 'antd';
import ColumnAuthoritysModel from 'pages/columnAuthority/ColumnAuthoritysModel';
import CommonPagination from 'components/pagination/index';
import { $http } from 'containers/config/https';
import store from 'store';
import Moment from 'moment';
import PublicModalTable from './../../../common/PublicModalTable';
import FormModalData from './../../../common/FormModalData';
import { Resizable } from 'react-resizable';

const ResizeableTitle = props => {
    const { onResize, width, ...restProps } = props;
  
    if (!width) {
      return <th {...restProps} />;
    }
  
    return (
      <Resizable
        width={width}
        height={0}
        onResize={onResize}
        draggableOpts={{ enableUserSelectHack: false }}
      >
        <th {...restProps} />
      </Resizable>
    );
};
const { Option } = Select;
const { TextArea } = Input;

const DetailEntryList = Form.create()(
    class extends React.Component {
        constructor() {
            super();
            this.state = {
                unitData: [], // 单位下拉框数据
                modalData: [], // 弹框列表数据
                ModalRowData: {}, // 弹框双击选中行数据
                data: [], // 列表数据
                detailInfo: [], // 入库制单回显至明细列表数据
                tacitlyApproveData: {}, // 初始化数据
                stockID: '', // 回显的描述id
                getDrugListData: {},//明细列表数据
                frLocDr: '',
                toLocID: '',
                columns: [],
                detailWidthTotal: '',
                show: false, //收缩图标
                frLocID: '',
                operation: false,
                total: 0, // 总条数
                page: 1, // 页数
                pageSize: 10, // 每页的条数
                rpTotal: 0, //进价金额总和
                spTotal: 0, //售价金额总和
                ChineseEnglishSize: {}, //中英翻译
                language: JSON.parse(window.sessionStorage.userData),
            };
            this.columns = [
                {
                    key: 1,
                    title: '药品',
                    dataIndex: 'stockDesc',
                    align: "center",
                    width: '200px'
                },
                {
                    key: 2,
                    title: '请求数量',
                    dataIndex: 'qty',
                    align: "center",
                    width: '100px',
                },
                {
                    key: 3,
                    title: '单位',
                    dataIndex: 'unitDesc',
                    align: "center",
                    width: '200px',
                },
                {
                    key: 5,
                    title: '进价',
                    dataIndex: 'rp',
                    align: "center",
                    width: '100px',
                },
                {
                    key: 6,
                    title: '进价金额',
                    dataIndex: 'rpAmt',
                    align: "center",
                    width: '100px',
                },
                {
                    key: 7,
                    title: '零售单价',
                    dataIndex: 'sp',
                    align: "center",
                    width: '100px',
                },
                {
                    key: 8,
                    title: '售价金额',
                    dataIndex: 'spAmt',
                    align: "center",
                    width: '100px',
                },
                {
                    key: 14,
                    title: '请求方库存',
                    dataIndex: 'toLocQtyUom',
                    align: "center",
                    width: '100px',
                },
                {
                    key: 15,
                    title: '供应方库存',
                    dataIndex: 'frLocQtyUom',
                    align: "center",
                    width: '100px',
                },
                {
                    key: 9,
                    title: '规格',
                    dataIndex: 'stockSpec',
                    align: "center",
                    width: '100px',
                },
                {
                    key: 10,
                    title: '生产厂家',
                    dataIndex: 'manfDesc',
                    align: "center",
                    width: '200px',
                },
                {
                    key: 11,
                    title: '备注',
                    dataIndex: 'remark',
                    align: "center",
                    width: '200px',
                },
                {
                    key: 16,
                    title: '处方通用名',
                    dataIndex: 'remark5',
                    align: "center",
                    width: '200px',
                },
                {
                    key: 17,
                    title: '建议请领数量',
                    dataIndex: 'remark6',
                    align: "center",
                    width: '100px',
                },
                {
                    key: 12,
                    title: '剂型',
                    dataIndex: 'preDate2',
                    align: "center",
                    width: '100px',
                },{
                    title: '操作',
                    key: 13,
                    fixed: 'right',
                    align: "center",
                    width: '100px',
                    render: (text, record) => (
                        <span>
                        <Popconfirm title="删除不可恢复，你确定要删除吗?" onCancel={this.handlePopconfirm} onConfirm={(e) => this.handleDelete(record, e)} onClick={this.handlePopconfirm} >
                            <span className='span' style={{color: 'rgba(240,65,52,1)'}}>删除</span>
                        </Popconfirm>
                      </span>
                    ),
                }
            ];
            this.modalColumns = [
                {
                    key: 1,
                    title: '库存项代码',
                    dataIndex: 'stockCode',
                    align: "center",
                    width: '22%'
                },
                {
                    key: 2,
                    title: '库存项描述',
                    dataIndex: 'stockDesc',
                    align: "center",
                    width: '24%',
                },
                {
                    key: 5,
                    title: '库存分类',
                    dataIndex: 'stkSubCatDesc',
                    align: "center",
                    width: '16%',
                },
                {
                    key: 3,
                    title: '包装规格',
                    dataIndex: 'stockSpec',
                    align: "center",
                    width: '12%',
                },
                {
                    key: 6,
                    title: '基本单位',
                    dataIndex: 'baseUnitDesc',
                    align: "center",
                    width: '12%',
                },
                {
                    key: 7,
                    title: '入库单位',
                    dataIndex: 'purUnitDesc',
                    align: "center",
                }
            ];
            this.myRef1 = React.createRef();
            this.myRef2 = React.createRef();
            this.myRef3 = React.createRef();
            this.myRef4 = React.createRef();
            this.myRef5 = React.createRef();
            this.myRef6 = React.createRef();
            this.myRef7 = React.createRef();
            this.myRef8 = React.createRef();
            this.myRef9 = React.createRef();
            this.myRef10 = React.createRef();
            this.myRef11 = React.createRef();
            this.myRef12 = React.createRef();
            this.myRef13 = React.createRef();
            this.myRef14 = React.createRef();
        }
        components = {
            header: {
              cell: ResizeableTitle,
            },
        };
        componentDidMount() {
            this.props.onRef(this);
            this.getDetailTableColumns();
            let leftList = document.querySelectorAll('.reviewHeight  .ant-table-body');
            if(leftList.length>0){
                leftList[0].style.height = store.getState().tableHeight.y - 49 + 'px';
            }
        }

        componentWillReceiveProps(props) {
            this.setState({frLocDr: props.inOpLocDr, toLocID: props.toLoc, frLocID: props.frLocID,total: props.total,page: props.page, pageSize: props.pageSize});
            if (this.state.tacitlyApproveData) {
                this.setState({tacitlyApproveData: props.handleThis.state.tacitlyApproveData});
            }
            if (props.detailInfo !== this.state.detailInfo) {
                let arr =[...props.detailInfo];
                this.setState({data: arr, detailInfo: props.detailInfo},()=>{
                    let spNum = 0;
                    let rpNum = 0;
                    for(var f=0; f<arr.length; f++){
                        spNum = +arr[f].spAmt+spNum;
                        rpNum = +arr[f].rpAmt+rpNum;
                    }
                    this.setState({rpTotal: rpNum.toFixed(2),spTotal:spNum.toFixed(2)})
                });
            }
        }
        // 获取明系列表头数据
        getDetailTableColumns = () => {
            let {language} = this.state;
            let data = {
                params: [{
                    reactCode: ['StockRequestForm'],
                    compontName: 'RequestVouchingDetailList',
                    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();}}>{language.language== 'EN' ? item.enDescripts : item.title}</div>,
                                ellipsis: true
                            }
                        }) : '';
                        let filterArr = arr.filter(function(item){ return item.display === 'Y'});
                        let obj = {
                            title: language.language== 'EN' ? 'operating':'操作',
                            key: 13,
                            fixed: 'right',
                            align: "center",
                            width: '100px',
                            render: (text, record) => (
                                <span>
                        <Popconfirm title={language.language== 'EN' ? 'Delete is not recoverable, are you sure you want to delete it?':'删除不可恢复，你确定要删除吗?'} onCancel={this.handlePopconfirm} onConfirm={(e) => this.handleDelete(record, e)} onClick={this.handlePopconfirm} >
                            <span className='span' style={{color: 'rgba(240,65,52,1)'}}>{language.language== 'EN' ? 'Delete':'删除'}</span>
                        </Popconfirm>
                      </span>
                            ),
                        };
                        filterArr.push(obj);
                        this.setState({columns: filterArr, detailWidthTotal: res.totalWidth, ChineseEnglishSize:  language.language== 'EN' ? res.result.language.EN : res.result.language.CN},()=>{
                            this.props.handleThis.getChineseEnglishSize(this.state.ChineseEnglishSize)
                        })
                    }
                }
            })
        };

        // 点击删除时阻止事件冒泡
        handlePopconfirm = (e) => {
            e.stopPropagation();
        };

        onRef = (ref) => {
            this.child = ref;
        };

        // 保存成功后清空data数据
        deleteData() {
            this.setState({data: [], detailInfo: [],  rpTotal: 0, spTotal: 0,});
        }

        // 获取单位下拉框数据
        getUnitData(id) {
            let data = {
                params: [
                    {
                        stockID: id, // 库存项Id
                    }
                ]
            };
            $http.post('urlS', this, {
                code: "02020043",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({ unitData: res.result})
                    } else {
                        this.setState({ unitData: [] })
                    }
                }
            })
        }

        // 描述回车事件
        stockDescOnPressEnter = (e) => {
            // let inOpLocDr = this.props.handleThis.getInOpLocDr();
            if (this.state.frLocDr) {
                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();
            } else {
                message.info("请先选择供给部门");
            }
        };

        // 操作弹框
        onClickRowPublic = (record) => {
            return {
                onDoubleClick: () => {
                    this.confirmSelection(record);
                }
            }
        };

        // 双击选中行数据的回调
        confirmSelection = (record) => {
            this.resetFields();
            this.setState({ModalRowData: record}, () => {
                // 关闭弹窗
                this.child.handleCancel();
                // 获取单位下拉框数据
                this.getDrugData(record.stockID);
                this.props.form.setFieldsValue({stockDesc: record.stockDesc,uomDr: undefined});
            })
        };

        // 获取焦点的方法--描述
        stockDescOnFocus = () => {
            let inOpLocDr = this.props.handleThis.getInOpLocDr();
            if (!inOpLocDr) {
                message.info("请先选择请求部门");
            }
        };

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

        // 获取描述列表数据
        getModalListData(alias) {
            let data = {
                params: [
                    {
                        stockAlias: alias, // 库存项描述别名
                        frLocID: this.state.frLocDr ? this.state.frLocDr : undefined
                    }
                ]
            };
            $http.post('urlS', this, {
                code: "02020140",
                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: [] })
                    }
                }
            })
        }

        // 双击获取药品详细信息
        getDrugData(id) {
            let data = {
                params: [
                    {
                        stockID: id, // 库存项描述别名
                        frLocID: this.state.frLocDr,
                        toLocID: this.state.toLocID
                    }
                ]
            };
            $http.post('urlS', this, {
                code: "02020117",
                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({ getDrugListData: res.result});
                        setTimeout(() => {
                            this.setState({  descriptsList: res.result.purUnitID});
                        },1000)
                    } else {
                        this.setState({ getDrugListData: [] })
                    }
                }
            })
        }

        // 新增明细录入
        addHandle = (obj) => {
            let inOpStatusDr = this.props.handleThis.state.userInfo ? this.props.handleThis.state.userInfo.stateID: '';
            if (+inOpStatusDr < 20 || inOpStatusDr === undefined) {
                // const { form: { validateFields } } = this.props;

                        let arr = [...this.state.data];
                        if (obj.key) {
                            for (let i = 0, len = arr.length; i < len; i++) {
                                if (arr[i].key === obj.key) {
                                    arr[i] = obj;
                                }
                            }
                        } else {
                            arr.push(obj);
                            for(let i = 0; i < arr.length; i++) {
                                !arr[i].key ?  arr[i].key= i + 'detail' : '';
                            }
                        }
                        this.setState({data: arr}, () => {
                            let spNum = 0;
                            let rpNum = 0;
                            for(var f=0; f<arr.length; f++){
                                spNum = +arr[f].spAmt+spNum;
                                rpNum = +arr[f].rpAmt+rpNum;
                            }
                            this.setState({rpTotal: rpNum.toFixed(2),spTotal:spNum.toFixed(2)})
                            this.childDesc.resetFields();
                            this.resetFields();
                            if (this.state.stockID && +inOpStatusDr < 20) {
                                this.props.handleThis.saveHandle()
                            }
                        });
            } else {
                message.error("当单据状态为保存时才可以进行操作");
            }
        };

        // 数量
        qtyOnChange = (e) => {
            let RPMoney = this.myRef7.current.props.value ? this.myRef7.current.props.value : 0;
            let SPMoney =  this.myRef8.current.props.value ? this.myRef8.current.props.value : 0;
            this.props.form.setFieldsValue({rpAmt: RPMoney * e.target.value, spAmt: SPMoney * e.target.value});
        };

        // 进价
        RPOnChange = (e) => {
            let num = this.myRef5.current.props.value ? this.myRef5.current.props.value : 0;
            this.props.form.setFieldsValue({rpAmt: num * e.target.value});
        };

        // 售价
        SPOnChange = (e) => {
            let num = this.myRef5.current.props.value ? this.myRef5.current.props.value : 0;
            this.props.form.setFieldsValue({spAmt: num * e.target.value});
        };

        // 验证进价
        // validatorRP = (rule, value, callback) => {
        //     let num = this.state.tacitlyApproveData ? this.state.tacitlyApproveData.rpLen : 3;
        //     if(!value) {
        //         // 当value值不存在的话
        //         callback('进价不能为空');
        //     } else {
        //         let re = new RegExp("^\\d+(\\.\\d{1," + num + "})?$");
        //         if (!re.test(value)) {
        //             callback("小数位数不能超过" + num + "位" + '，并且不能为负数');
        //         }
        //     }
        //     callback();
        // };

        // 验证售价
        // validatorSP = (rule, value, callback) => {
        //     let num = this.state.tacitlyApproveData ? this.state.tacitlyApproveData.spLen : 3;
        //     if(!value) {
        //         // 当value值不存在的话
        //         callback('售价不能为空');
        //     } else {
        //         let re = new RegExp("^\\d+(\\.\\d{1," + num + "})?$");
        //         if (!re.test(value)) {
        //             callback("小数位数不能超过" + num + "位" + '，并且不能为负数');
        //         }
        //     }
        //     callback();
        // };



        // 重置表单
        resetFields = () => {
            this.props.form.resetFields(); //清空所有
            this.setState({userInfo: {}, rowKey: '', stockID: '', descriptsList: '', getDrugListData: {},unitData: []});
            this.childDesc.resetFields();
        };

        // 删除
        handleDelete = (record, e) => {
            e.stopPropagation();
            if (record.stkReqDetailID) {
                // 当inOpDetailID存在的话则删除接口明细、不存在的话切割数组当中的一个对象
                let inOpStatusDr = this.props.handleThis.state.userInfo ? this.props.handleThis.state.userInfo.stateID: '';
                if (+inOpStatusDr < 20 || inOpStatusDr === undefined) {
                    let data = {
                        params: {
                            detail: [{
                                stkReqDetailID:record.stkReqDetailID ? record.stkReqDetailID: undefined,
                            }]

                        }
                    };
                    $http.post('urlS', this, {
                        code: "02020114",
                        data: data,
                        success: function (res) {
                            if (+res.errorCode === 0) {
                                message.success(res.errorMessage);
                                this.deleteRow(record.key);
                            }
                        }
                    })
                } else {
                    message.error("当单据状态为保存时才可以进行操作");
                }
            } else {
                this.setState({userInfo: {}, rowKey: '', stockID: ''});
                this.deleteRow(record.key);
            }
        };

        // 本地删除数据
        deleteRow(key){
            const dataSource = JSON.parse(JSON.stringify(this.state.data));
            this.setState({ data: dataSource.filter(item => item.key !== key)},()=>{
                let spNum = 0;
                let rpNum = 0;
                for(var f=0; f<this.state.data.length; f++){
                    spNum = +this.state.data[f].spAmt+spNum;
                    rpNum = +this.state.data[f].rpAmt+rpNum;
                }
                this.setState({rpTotal: rpNum.toFixed(2),spTotal:spNum.toFixed(2)})
            });
        }

        // 设置行属性
        onClickRow = (record) => {
            return {
                // 单击行选中
                onClick: (e) => {
                    e.stopPropagation();
                    this.resetFields();
                    if (this.state.rowKey === '') {
                        // 保存行数据以及ID
                        this.setState({rowKey: record.key, userInfo: record, stockID: record.stockID});
                        this.getUnitData(record.stockID);
                    } else {
                        if (this.state.rowKey !== record.key) {
                            this.setState({rowKey: record.key, userInfo: record, stockID: record.stockID});
                            this.getUnitData(record.stockID);
                        } else {
                            this.setState({rowKey: '', userInfo: {}, stockID: '', unitData: []});
                            this.childDesc.resetFields();
                        }
                    }
                }
            }
        };

        // 表格行的类名
        setRowClassName = (record) => {
            return record.key === this.state.rowKey ? 'clickRowStyle' : '';
        };

        //选择单位后改变进价和售价
        changeUnit = (e,event) => {
            if(e=='base'){
                this.props.form.setFieldsValue({rp: this.state.getDrugListData.baseRp});
                this.props.form.setFieldsValue({sp: this.state.getDrugListData.baseSp});
            }else if(e=='purch'){
                this.props.form.setFieldsValue({rp: this.state.getDrugListData.purRp});
                this.props.form.setFieldsValue({sp: this.state.getDrugListData.purSp});
            }else {
                this.props.form.setFieldsValue({rp: this.state.getDrugListData.baseRp});
                this.props.form.setFieldsValue({sp: this.state.getDrugListData.baseSp});
            }
        };

        initialDataObj=()=>{
            var initialObj = {};
            let { userInfo } = this.state;
            initialObj.qty = userInfo.qty ? userInfo.qty+'' : '';
            initialObj.remark = userInfo.remark ? userInfo.remark : '';
            initialObj.stockDesc = userInfo.stockDesc ?  userInfo.stockDesc : '';
            initialObj.unitDesc = userInfo.unitDesc ?  userInfo.unitDesc : '';
            return initialObj;
        }

        //检查表单是否有未保持数据
        checkFormData=()=>{
            let newObjData = {};
            let stockDesc =this.props.form.getFieldValue('stockDesc');
            let qty =this.props.form.getFieldValue('qty');
            let unit =this.props.form.getFieldValue('descripts');
            let remark =this.props.form.getFieldValue('remark');
            if(qty == undefined){
                newObjData.qty = '';
            }else {
                newObjData.qty = qty+'';
            }
            if(remark == undefined){
                newObjData.remark = '';
            }else {
                newObjData.remark = remark;
            }
            if(stockDesc == undefined){
                newObjData.stockDesc = '';
            }else {
                newObjData.stockDesc = stockDesc;
            }
            if(unit == undefined){
                newObjData.unitDesc = '';
            }else {
                newObjData.unitDesc = unit;
            }
            return newObjData;
        };

        //药品名称为空时清除表单数据
        clearData=(val)=>{
            if(!val.target.value){
                this.setState({userInfo: {}, getDrugListData: {}});
            }
        };

        //组件权限编辑器
        childDesc = (ref) => {
            this.childDesc = ref;
        };
        // 收起明细录入
        packUpHandle = () => {
            this.setState({show: !this.state.show})
        };
        //组件权限编辑器
        onColumnRef = (ref) => {
            this.columnRef = ref;
        };
        operationShow=()=>{
            this.props.handleThis.operationNo()
        };
        operationHide=()=>{
            this.props.handleThis.operationOFF()
        };
        handleResize = index => (e, { size }) => {
            this.setState(({ columns }) => {
              const nextColumns = [...columns];
              nextColumns[index] = {
                ...nextColumns[index],
                width: parseInt(size.width),
              };
              return { columns: nextColumns };
            });
        };
        render() {
            const formItemInput  = {
                labelCol: {
                    span: 8
                },
                wrapperCol: {
                    span: 16
                },
            };
            const formItemInputText  = {
                labelCol: {
                    span: 4
                },
                wrapperCol: {
                    span: 20
                },
            };
            const { getFieldDecorator } = this.props.form;
            let { detailWidthTotal, ChineseEnglishSize } = this.state;
            const columns = this.state.columns.map((col, index) => ({
                ...col,
                onHeaderCell: column => ({
                  width: parseInt(column.width),
                  onResize: this.handleResize(index),
                }),
            }));
            let userInfo = this.state.userInfo ? this.state.userInfo: {};
            let param = {
                width: '600px',
                top: this.state.top,
                left: this.state.left,
                columns: this.modalColumns,
                data: this.state.modalData,
                isOnRow: true,
                TableClassName: 'tab-placeholder',
            };
            //别名接口需要的参数
            let parameData = {
                toLocID: this.state.toLocID ? this.state.toLocID : JSON.parse(window.sessionStorage.userData).locID ? JSON.parse(window.sessionStorage.userData).locID : undefined,
                frLocID: this.state.frLocID ? this.state.frLocID : undefined,
                stkCatID: this.props.stkCatID ? this.props.stkCatID : undefined
            }
            return (
                <div>
                    <Row>
                        <Col span={10} style={{display: this.state.show ? 'none' : ''}} className={!this.state.show ? "animate-wrap active down-in" : "animate-wrap"}>
                            <Card
                                size="small"
                                title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.StockRequestFormrequestEntry ? ChineseEnglishSize.StockRequestFormrequestEntry.descripts:'请求录入'}</div>}
                            >
                                <div style={{height: store.getState().tableHeight.y -36 + 'px', overflow: 'auto'}} className="InPurPlan-detail-left">
                                    <FormModalData parameter='RequestVouching' APICode='02020117' parameData={parameData} stockCode='02020140'  frLocDr = {this.state.frLocDr} unitData={this.state.unitData}  rowKey={this.state.rowKey} userInfo={this.state.userInfo} handelThis={this} onRef={this.childDesc}/>
                                </div>
                            </Card>
                        </Col>
                        <Col span={this.state.show ? 24 : 14}>
                            <Card
                                size="small"
                                title={<span><Icon onClick={this.packUpHandle} type={this.state.show ? 'double-right' : 'double-left'} />{ChineseEnglishSize.StockRequestForminvenReqList ? ChineseEnglishSize.StockRequestForminvenReqList.descripts:'库存请求列表'}</span>}
                                extra={<span style={{color: '#666'}} className='span' onClick={() => {this.columnRef.onOpenModel();}}><Icon type="setting" title={ChineseEnglishSize.StockRequestFormcolumnSettings ? ChineseEnglishSize.StockRequestFormcolumnSettings.descripts:'列权限设置'} /></span>}
                            >
                                <div style={{height: store.getState().tableHeight.y -36 + 'px'}}>
                                    <Table
                                        columns={columns.length>0 ? columns : this.columns}
                                        components={this.components}
                                        dataSource={this.state.data}
                                        pagination={false}
                                        bordered
                                        scroll={{ x: detailWidthTotal ? detailWidthTotal : 2100, y: store.getState().tableHeight.y - 120 }}
                                        onRow={this.onClickRow}
                                        rowClassName={this.setRowClassName}
                                        className="reviewHeight"
                                    />
                                    <Col style={{fontSize: '15px' ,fontWeight: '700', marginLeft: '18px', marginTop: '5px'}} span={10}>
                                        <span >{ChineseEnglishSize.StockRequestFormrpTotal ? ChineseEnglishSize.StockRequestFormrpTotal.descripts:'进价金额总价'}：</span><span>{this.state.rpTotal} </span>
                                        <span style={{marginLeft: '10px'}}>  {ChineseEnglishSize.StockRequestFormspTotal ? ChineseEnglishSize.StockRequestFormspTotal.descripts:'售价金额总价'}：</span><span>{this.state.spTotal}</span>
                                    </Col>
                                    <Col span={13}>
                                        <CommonPagination size='small' current={this.state.page} total={this.state.total} search= 'search'
                                                          onShowSizeChange={ this.props.handleThis.onShowSizeChange.bind(this)} complete={true} dataSource={this.state.data}
                                                          loading={this.state.loading} onChange={ this.props.handleThis.onChange.bind(this)} />
                                    </Col>
                                </div>

                            </Card>
                        </Col>
                    </Row>
                    <PublicModalTable onClickRowPublic={this.onClickRowPublic} setRowClassNamePublic={this.setRowClassNamePublic} param={param} onRef={this.onRef} />
                    <ColumnAuthoritysModel
                        clientWidth='800px'
                        compontName='RequestVouchingDetailList'
                        configType="C"
                        onRef={this.onColumnRef}
                        reloadData={this.getDetailTableColumns}
                    />
                </div>
            )
        }
    }
);

export default DetailEntryList;