//医院药品维护
import React from 'react';
import { Card, Input, Row, Col, Button, Table, Select, message, Form, Radio, Divider, Descriptions, Icon, DatePicker, Checkbox, notification } from 'antd';
import { $http } from '../../../containers/config/https';
import '../../../assets/css/App.css'
import store from '../../../store';
import './style/index.less'
import moment from 'moment'
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
import ColumnAuthoritysModel from 'pages/columnAuthority/ColumnAuthoritysModel';
// import { $loadTemplate } from '../../lodop/Common/Print.js';
import CommonPagination from 'components/pagination/index';
const FormItem = Form.Item;
import ApprovalNomaintain from './component/ApprovalNoMaintain.jsx';
import AIIUnitMaintenance from '../drugMaintenance/component/component/AIIUnitMaintenance.jsx'; // 发药单位维护
import { Util } from 'tools/index';
import Moment from 'moment';

import 'pages/common/style/publicStyle.less';

class HospDrugMainMaintenance extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            columnsVisible: false,
            retColumns: [],
            widthTotal: 0,
            cardHeight: '',
            alias: '',
            hospFlag: '1',
            stkCatData: [],
            stkSubCatData: [],
            stockData: [],
            total: 0,
            page: 1,
            pageSize: 20,
            medVisFlag: '',
            stockVisFlag: '',
            chargeVisFlag: '',
            hospVisFlag: 'none',
            btnAllStatus: 'primary',
            btnMedStatus: '',
            btnStockStatus: '',
            btnChargeStatus: '',
            btnHospStatus: '',
            doseData: [],
            medAutData: [],
            dispUnitData: [],
            listType: '平铺',
            hospBtnHidden: true,
            saveBtnStatus: true,
            //医嘱项
            medCode: '',
            medDesc: '',
            chemicDesc: '',
            generDesc: '',
            medShortDesc: '',
            medSubCatDesc: '',
            medPriorityDesc: '',
            medUnitDesc: '',
            medMaxDose: '',
            medQdMaxQty: '',
            medSexDesc: '',
            medAgeFrom: '',
            medAgeTo: '',
            medMessage: '',
            medNoAloneOrder: '',
            medNoStockFlag: '',
            medNoChangeFlag: '',
            medMergeUseFlag: '',
            medEMFlag: '',
            medToalCountO: '',
            medToalCountI: '',
            medSpec: '',
            medUsageDesc: '',
            medFreqDesc: '',
            tradeName: '',
            poisonDesc: '',
            criLevDesc: '',
            antidFlag: '',
            countryFlag: '',
            provFlag: '',
            cityFlag: '',
            monitFlag: '',
            medSkinTestFlag: '',
            formDesc: '',
            medDurQty: '',
            medDurationDesc: '',
            medAlias: '',
            medStartDate: '',
            medEndDate: '',
            billFac: '',
            //库存项
            stockCode: '',
            stockDesc: '',
            stockSpec: '',
            barCode: '',
            stkSubCatDesc: '',
            purUnitDesc: '',
            factor: '',
            baseUnitDesc: '',
            quaLevelDesc: '',
            qualityNo: '',
            priceTypeDesc: '',
            maxSprice: '',
            priceFileNo: '',
            drugUseInfo: '',
            impTypeDesc: '',
            stockAlias: '',
            packPicPath: '',
            //存储条件
            minTemp: '',
            maxTemp: '',
            minHumidity: '',
            maxHumidity: '',
            commonTemp: '',
            dry: '',
            airtight: '',
            dark: '',
            radiation: '',
            seal: '',
            gloomyCool: '',
            meltPack: '',
            coldST: '',
            freeze: '',
            dampProof: '',
            //本院信息
            approvalPrefixData: [],
            packUnitData: [],
            pubBidVendorData: [],
            refRetReasonData: [],
            pubBidLevelData: [],
            pubBidManfData: [],
            stopReasonData: [],
            pubBidListData: [],
            packUnitID: '',
            appPreFixID: '',
            PBLID: '',
            PBManfID: '',
            stockStartDate: '',
            stockEndDate: '',
            packFac: '',
            approvalNo: '',
            PBRp: '',
            PBLevID: '',
            purPlanCode: '',
            stopReaID: '',
            inMedBasis: '',
            standCode: '',
            PBVendorID: '',
            refRetReaID: '',
            isHospFlag: false,
            //收费项
            itemCode: '',
            itemDesc: '',
            itemTCDesc: '',
            itemPCDesc: '',
            itemICDesc: '',
            itemOCDesc: '',
            itemECDesc: '',
            itemACDesc: '',
            itemMCDesc: '',
            itemStartDate: '',
            itemEndDate: '',
            loading: false,
            language: JSON.parse(window.sessionStorage.userData),
            ChineseEnglishSize: {},
            columns: [],
            columnsWidth: '',
            doseColumns: [],
            doseColumnsWidth: '',
            autColumns: [],
            autColumnsWidth: '',
            dispUnitColumns: [],
            dispUnitColumnsWidth: '',
            childSelectData: {},
            inventoryItemSelectData: {},
            baseUnitID: '',
            dispUomID: '',
            exportStatus: '',
        };
        this.columns = [
            { key: '1', title: '药品代码', dataIndex: 'stockCode', width: "150px", align: 'center' },
            { key: '2', title: '药品名称', dataIndex: 'stockDesc', width: "300px", align: 'center' },
            { key: '3', title: '包装规格', dataIndex: 'stockSpec', width: "150px", align: 'center' },
            { key: '4', title: '处方通用名', dataIndex: 'genenDesc', width: "250px", align: 'center' },
            { key: '5', title: '剂型', dataIndex: 'medFormDesc', width: "150px", align: 'center' },
            { key: '6', title: '基本单位', dataIndex: 'baseUnitDesc', width: "150px", align: 'center' },
            { key: '7', title: '入库单位', dataIndex: 'purUnitDesc', width: "150px", align: 'center' },
        ];

        this.doseColumns = [
            { key: '1', title: '等效单位', dataIndex: 'doseUnitDesc', width: "34%", align: 'center' },
            { key: '2', title: '等效数量', dataIndex: 'doseQty', width: "33%", align: 'center' },
            { key: '3', title: '默认数量', dataIndex: 'defaltQty', width: "33%", align: 'center' },
        ];

        this.autColumns = [
            { key: '1', title: '关系', dataIndex: 'relationDesc', width: "15%", align: 'center' },
            { key: '2', title: '操作', dataIndex: 'operateDesc', width: "15%", align: 'center' },
            { key: '3', title: '类型', dataIndex: 'operTypeDesc', width: "15%", align: 'center' },
            { key: '4', title: '类型值', dataIndex: 'pointerDesc', width: "40%", align: 'center' },
            { key: '5', title: '管控级别', dataIndex: 'levelDesc', width: "15%", align: 'center' },
        ];

        this.dispUnitColumns = [
            { key: '1', title: '发药科室', dataIndex: 'dispLocDesc', width: "20%", align: 'center' },
            { key: '2', title: '发药单位', dataIndex: 'dispUnitDesc', width: "20%", align: 'center' },
            { key: '3', title: '转换系数', dataIndex: 'factor', width: "20%", align: 'center' },
            { key: '4', title: '生效日期', dataIndex: 'startDate', width: "20%", align: 'center' },
            { key: '5', title: '失效日期', dataIndex: 'endDate', width: "20%", align: 'center' },
        ];
    }

    componentDidMount() {
        const sessionObj = sessionStorage.userData ? JSON.parse(sessionStorage.userData) : {};
        const ipconfigObj = React.$getSessionData('ipConfig');
        this.setState({ sessionObj, ipconfigObj });
        this.initData();
        this.getDoseColumns();
        this.getAutColumns();
        this.getDispUnitColumns();
        this.handleAllQuery();
        this.getInventoryItemSelectData();
    }

    // 获取库存项下拉框数据
    getInventoryItemSelectData = () => {
        let data = {
            params: [{}],
        }
        $http.post('urlS', this, {
            code: "02020237",
            data: data,
            success: function (res) {
                if (res.errorCode === '0') {
                    this.setState({ inventoryItemSelectData: res })
                }
            }
        });
    }

    getDoseColumns = () => {
        let { language } = this.state;
        let data = {
            params: [{
                compontName: "ListOfEquivalentUnits",
                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>{language.language == 'EN' ? item.enDescripts : item.title}</div>,
                        }
                    }) : '';
                    let filterArr = arr.filter(function (item) { return item.display === 'Y' });
                    this.setState({ doseColumns: filterArr, doseColumnsWidth: res.totalWidth })
                }
            }
        })
    };

    getAutColumns = () => {
        let { language } = this.state;
        let data = {
            params: [{
                compontName: "DrugRestriction",
                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>{language.language == 'EN' ? item.enDescripts : item.title}</div>,
                        }
                    }) : '';
                    let filterArr = arr.filter(function (item) { return item.display === 'Y' });
                    this.setState({ autColumns: filterArr, autColumnsWidth: res.totalWidth })
                }
            }
        })
    };

    getDispUnitColumns = () => {
        let { language } = this.state;
        let data = {
            params: [{
                compontName: "DrugDeliveryUnit",
                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>{language.language == 'EN' ? item.enDescripts : item.title}</div>,
                        }
                    }) : '';
                    let filterArr = arr.filter(function (item) { return item.display === 'Y' });
                    this.setState({ dispUnitColumns: filterArr, dispUnitColumnsWidth: res.totalWidth })
                }
            }
        })
    }

    initData = () => {
        let height = store.getState().tableHeight.y + 111 + 'px';
        this.setState({ cardHeight: height })
        this.getTableColumns();
        this.loadData();
    }

    //获取下拉框信息
    loadData() {
        var params = [{}]
        $http.post('urlS', this, {
            code: "02020200",
            data: params,
            success: function (res) {
                if (res.errorCode === '0') {
                    for (var i = 0; i < res.result.stkSubCat.length; i++) {
                        this.state.stkSubCatData.push(<Select.Option value={res.result.stkSubCat[i].id} key={i}>{res.result.stkSubCat[i].descripts}</Select.Option>)
                    }
                    for (var i = 0; i < res.result.stkCat.length; i++) {
                        this.state.stkCatData.push(<Select.Option value={res.result.stkCat[i].id} key={i}>{res.result.stkCat[i].descripts}</Select.Option>)
                    }
                    for (var i = 0; i < res.result.approvalPrefix.length; i++) {
                        this.state.approvalPrefixData.push(<Select.Option value={res.result.approvalPrefix[i].id} key={i}>{res.result.approvalPrefix[i].descripts}</Select.Option>)
                    }
                    for (var i = 0; i < res.result.pubBidList.length; i++) {
                        this.state.pubBidListData.push(<Select.Option value={res.result.pubBidList[i].id} key={i}>{res.result.pubBidList[i].descripts}</Select.Option>)
                    }
                    for (var i = 0; i < res.result.pubBidVendor.length; i++) {
                        this.state.pubBidVendorData.push(<Select.Option value={res.result.pubBidVendor[i].id} key={i}>{res.result.pubBidVendor[i].descripts}</Select.Option>)
                    }
                    for (var i = 0; i < res.result.pubBidManf.length; i++) {
                        this.state.pubBidManfData.push(<Select.Option value={res.result.pubBidManf[i].id} key={i}>{res.result.pubBidManf[i].descripts}</Select.Option>)
                    }
                    for (var i = 0; i < res.result.pubBidLevel.length; i++) {
                        this.state.pubBidLevelData.push(<Select.Option value={res.result.pubBidLevel[i].id} key={i}>{res.result.pubBidLevel[i].descripts}</Select.Option>)
                    }
                    for (var i = 0; i < res.result.refRetReason.length; i++) {
                        this.state.refRetReasonData.push(<Select.Option value={res.result.refRetReason[i].id} key={i}>{res.result.refRetReason[i].descripts}</Select.Option>)
                    }
                    for (var i = 0; i < res.result.stopReason.length; i++) {
                        this.state.stopReasonData.push(<Select.Option value={res.result.stopReason[i].id} key={i}>{res.result.stopReason[i].descripts}</Select.Option>)
                    }
                    for (var i = 0; i < res.result.unit.length; i++) {
                        this.state.packUnitData.push(<Select.Option value={res.result.unit[i].id} key={i}>{res.result.unit[i].descripts}</Select.Option>)
                    }
                    let obj = {};
                    obj.appCertificat = res.result && res.result.appCertificat ? res.result.appCertificat : [];
                    obj.pubBidManf = res.result && res.result.pubBidManf ? res.result.pubBidManf : [];
                    this.setState({ childSelectData: obj })
                }
            }
        });
    }

    // 获取主列表columns
    getTableColumns = () => {
        let { language } = this.state;
        let data = {
            params: [{
                reactCode: ['HospitalDrugInformationMainten'],
                compontName: "HospDrugMainList",
                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.handleMainList}>{language.language == 'EN' ? item.enDescripts : item.title}</div>,
                        }
                    }) : '';
                    let filterArr = arr.filter(function (item) { return item.display === 'Y' });
                    this.setState({ columns: filterArr, columnsWidth: res.totalWidth, ChineseEnglishSize: language.language == 'EN' ? res.result.language.EN : res.result.language.CN })
                }
            }
        })
    }

    onColumnRef = (ref) => {
        this.columnRef = ref;
    }

    // 列设置
    handleMainList = () => {
        this.columnRef.onOpenModel();
    }

    //处理多个input的公共方法
    onChangeInput(name, e) {
        this.setState({
            [name]: e.target.value
        })
        if (e.target.value === "" && name === "alias") {
            this.handleAllQuery();
        }
        if (name === "hospFlag") {
            if (e.target.value === "1") {
                this.setState({
                    hospVisFlag: 'none',
                    hospBtnHidden: true,
                }, () => {
                    this.handleAllVis();
                    this.handleAllQuery();
                })
            } else {
                this.setState({
                    hospVisFlag: '',
                    hospBtnHidden: false,
                }, () => {
                    this.handleAllQuery();
                })
            }
        }
    }

    ///处理多个select下拉的公共方法
    selectOnChange = (name, value, option) => {
        if (value) {
            this.setState({
                [name]: value,
            })
        } else {
            this.setState({
                [name]: '',
            })
        }
    }

    // 时间
    dateOnChange = (name, date, dateString) => {
        this.setState({
            [name]: dateString,
        })
    }

    //处理多个checkbox的公共方法
    onChangeCheckbox(name, e) {
        this.setState({
            [name]: e.target.checked
        })
    }

    //清空
    clear = () => {
        this.props.form.resetFields(); //清空所有
        this.setState({
            saveBtnStatus: true,
            //医嘱项
            medCode: '',
            medDesc: '',
            chemicDesc: '',
            generDesc: '',
            medShortDesc: '',
            medSubCatDesc: '',
            medPriorityDesc: '',
            medUnitDesc: '',
            medMaxDose: '',
            medQdMaxQty: '',
            medSexDesc: '',
            medAgeFrom: '',
            medAgeTo: '',
            medMessage: '',
            medNoAloneOrder: '',
            medNoStockFlag: '',
            medNoChangeFlag: '',
            medMergeUseFlag: '',
            medEMFlag: '',
            medToalCountO: '',
            medToalCountI: '',
            medSpec: '',
            medUsageDesc: '',
            medFreqDesc: '',
            tradeName: '',
            poisonDesc: '',
            criLevDesc: '',
            antidFlag: '',
            countryFlag: '',
            provFlag: '',
            cityFlag: '',
            monitFlag: '',
            medSkinTestFlag: '',
            formDesc: '',
            medDurQty: '',
            medDurationDesc: '',
            medAlias: '',
            medStartDate: '',
            medEndDate: '',
            billFac: '',
            //库存项
            stockCode: '',
            stockDesc: '',
            stockSpec: '',
            barCode: '',
            stkSubCatDesc: '',
            purUnitDesc: '',
            factor: '',
            baseUnitDesc: '',
            quaLevelDesc: '',
            qualityNo: '',
            priceTypeDesc: '',
            maxSprice: '',
            priceFileNo: '',
            drugUseInfo: '',
            impTypeDesc: '',
            stockAlias: '',
            packPicPath: '',
            //存储条件
            minTemp: '',
            maxTemp: '',
            minHumidity: '',
            maxHumidity: '',
            commonTemp: '',
            dry: '',
            airtight: '',
            dark: '',
            radiation: '',
            seal: '',
            gloomyCool: '',
            meltPack: '',
            coldST: '',
            freeze: '',
            dampProof: '',
            //收费项
            itemCode: '',
            itemDesc: '',
            itemTCDesc: '',
            itemPCDesc: '',
            itemICDesc: '',
            itemOCDesc: '',
            itemECDesc: '',
            itemACDesc: '',
            itemMCDesc: '',
            itemStartDate: '',
            itemEndDate: '',
            itemYBCode: '',
            //列表
            doseData: [],
            medAutData: [],
            dispUnitData: [],
            //本院信息
            packUnitID: '',
            appPreFixID: '',
            PBLID: '',
            PBManfID: '',
            stockStartDate: '',
            stockEndDate: '',
            packFac: '',
            approvalNo: '',
            PBRp: '',
            PBLevID: '',
            purPlanCode: '',
            stopReaID: '',
            inMedBasis: '',
            standCode: '',
            PBVendorID: '',
            refRetReaID: '',
            isHospFlag: false,
            baseUnitID: '',
            dispUomID: '',
        })
    }

    //查询
    handleAllQuery = () => {
        this.setState({
            stockID: '',
            total: 0,
            page: 1,
            pageSize: 10,
        }, () => {
            this.handleQuery();
        })
    }

    //查询
    handleQuery = () => {
        this.clear();
        this.setState({ loading: true });
        let data = {}
        data = {
            params: [{
                stkCatID: this.state.stkCatID,
                stkSubCatID: this.state.stkSubCatID,
                alias: this.state.alias,
                hospFlag: this.state.hospFlag
            }],
            pagination: [{
                pageSize: this.state.pageSize,
                currentPage: this.state.page,
                sort: "ID",
                dir: "desc"
            }]
        }
        $http.post('urlS', this, {
            code: '02020201',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.result) {
                    for (var i = 0; i < res.result[0].rows.length; i++) {
                        res.result[0].rows[i].key = i
                    }
                    this.setState({
                        loading: false,
                        stockData: res.result[0].rows,
                        total: res.result[0].total,
                    })
                } else {
                    this.setState({ loading: false });
                }
            },
            error: function () {
                this.setState({ loading: false });
            }
        })
    };

    //延时执行
    sleep = (millisecond) => {
        return new Promise(resolve => {
            setTimeout(() => {
                resolve()
            }, millisecond)
        })
    };

    // 导出
    exportFun = async () => {
        this.clear();
        //导出状态
        this.setState({
            exportStatus: true,
            loading: true
        });
        let { sessionObj, ipconfigObj } = this.state;
        let StartDate = new Date();

        let data = {
            params: [{
                queryParams: {
                    params: [{
                        "stkCatID": this.state.stkCatID,
                        "stkSubCatID": this.state.stkSubCatID,
                        "alias": this.state.alias,
                        "hospFlag": this.state.hospFlag,
                        "ordStartDate": Moment(StartDate).format('YYYY-MM-DD'), //后台导出时需要
                        "ordEndDate": Moment(StartDate).format('YYYY-MM-DD'), //后台导出时需要
                    }],
                    code: '02020201',
                    pagination: [{
                        pageSize: this.state.pageSize,
                        currentPage: this.state.page,
                        sort: "ID",
                        dir: "desc"
                    }],
                    session: [{
                        userID: sessionObj.userID,
                        locID: sessionObj.locID,
                        groupID: sessionObj.groupID,
                        hospID: sessionObj.hospID,
                        sessionID: sessionObj.sessionID,
                        hospCode: sessionObj.hospCode,
                        language: sessionObj.language,
                        hostName: ipconfigObj?.hostName || '',
                        ipv4: ipconfigObj?.ipv4 || '',
                        ipv6: ipconfigObj?.ipv6 || '',
                        mac: ipconfigObj?.mac || ''
                    }]
                },
                queryCode: '02020201',
                componentCode: 'HospDrugMainList'
            }],
            pagination: [{
                pageSize: this.state.pageSize,
                currentPage: this.state.page,
                sort: "ID",
                dir: "asc",
            }],
            session: [{
                userID: sessionObj.userID,
                locID: sessionObj.locID,
                groupID: sessionObj.groupID,
                hospID: sessionObj.hospID,
                sessionID: sessionObj.sessionID,
                hospCode: sessionObj.hospCode,
                language: sessionObj.language,
                hostName: ipconfigObj?.hostName || '',
                ipv4: ipconfigObj?.ipv4 || '',
                ipv6: ipconfigObj?.ipv6 || '',
                mac: ipconfigObj?.mac || ''
            }]
        };
        await this.sleep(1000); //延时，按钮效果
        const resObj = await React.$asyncPost(this, "11020007", data);
        if (resObj) {
            let errorCode = resObj.errorCode;
            if (+errorCode === 0) {
                let downLoadUrl = resObj.result.downloadURL;
                //异步--消息提醒
                if (downLoadUrl === '') {
                    this.exportNotification(); //提示栏
                    store.dispatch({
                        type: 'downloadTask',
                        value: {
                            timeStamp: new Date().getTime(),
                            startDate: Moment(new Date()).format('YYYY-MM-DD'),
                            endDate: Moment(new Date()).format('YYYY-MM-DD'),
                        }
                    })
                } else { //同步-直接取到链接后下载
                    window.open(downLoadUrl, '_parent')
                }

                this.setState({
                    exportStatus: false,
                    loading: false
                });
            } else {
                this.setState({
                    exportStatus: false,
                    loading: false
                });
                message.error(resObj.errorMessage)
            }
        }
    };

    //右上角提示栏
    exportNotification = () => {
        const msgValue = (<p>数据正在导出，导出完成后可在右上角<span style={{ color: 'red' }}>↗</span><span style={{ fontWeight: 'bold' }}>【导出任务列表】</span>中下载</p>);
        notification.info({
            message: '导出中..',
            description: msgValue,
            placement: 'topRight',
            style: {
                top: 30,
            },
        });
    };

    //保存到本院
    handleSaveToHosp = () => {
        let { ChineseEnglishSize } = this.state;
        if (this.state.stockID === "") {
            message.warning(ChineseEnglishSize.HospitalDrugInformationMaintensaveTips1 ? ChineseEnglishSize.HospitalDrugInformationMaintensaveTips1.descripts : '请选择药品记录在保存到本院!!');
            return;
        }
        let data = {
            params: [{
                stockID: this.state.stockID,
            }],
        }
        $http.post('urlS', this, {
            code: '02020203',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    message.success(ChineseEnglishSize.HospitalDrugInformationMaintensavesaveSucc ? ChineseEnglishSize.HospitalDrugInformationMaintensavesaveSucc.descripts : '保存成功');
                    this.handleAllQuery();
                } else {
                    return;
                }
            }
        })
    }

    //查询明细
    handleQueryDetail = () => {
        if (this.state.stockID === "") { return; }
        let data = {}
        data = {
            params: [{
                stockID: this.state.stockID,
                hospFlag: this.state.hospFlag
            }],
        }
        $http.post('urlS', this, {
            code: '02020202',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0 && res.result) {
                    this.setState({
                        medCode: res.result.medCode,
                        medDesc: res.result.medDesc,
                        chemicDesc: res.result.medDesc,
                        generDesc: res.result.generDesc,
                        medShortDesc: res.result.medShortDesc,
                        medSubCatDesc: res.result.medSubCatDesc,
                        medPriorityDesc: res.result.medPriorityDesc,
                        medUnitDesc: res.result.medUnitDesc,
                        medMaxDose: res.result.medMaxDose,
                        medQdMaxQty: res.result.medQdMaxQty,
                        medSexDesc: res.result.medSexDesc,
                        medAgeFrom: res.result.medAgeFrom,
                        medAgeTo: res.result.medAgeTo,
                        medMessage: res.result.medMessage,
                        medNoAloneOrder: res.result.medNoAloneOrder === "Y" ? true : false,
                        medNoStockFlag: res.result.medNoStockFlag === "Y" ? true : false,
                        medNoChangeFlag: res.result.medNoChangeFlag === "Y" ? true : false,
                        medMergeUseFlag: res.result.medMergeUseFlag === "Y" ? true : false,
                        medEMFlag: res.result.medEMFlag === "Y" ? true : false,
                        medSkinTestFlag: res.result.medSkinTestFlag === "Y" ? true : false,
                        medToalCountO: res.result.medToalCountO === "Y" ? true : false,
                        medToalCountI: res.result.medToalCountI === "Y" ? true : false,
                        medStartDate: res.result.medStartDate,
                        medEndDate: res.result.medEndDate,
                        medAlias: res.result.medAlias,
                        medSpec: res.result.medSpec,
                        medFreqDesc: res.result.medFreqDesc,
                        medUsageDesc: res.result.medUsageDesc,
                        formDesc: res.result.formDesc,
                        medDurQty: res.result.medDurQty,
                        medDurationDesc: res.result.medDurationDesc,
                        tradeName: res.result.tradeName,
                        poisonDesc: res.result.poisonDesc,
                        criLevDesc: res.result.criLevDesc,
                        antidFlag: res.result.antidFlag === "Y" ? true : false,
                        countryFlag: res.result.countryFlag === "Y" ? true : false,
                        provFlag: res.result.provFlag === "Y" ? true : false,
                        cityFlag: res.result.cityFlag === "Y" ? true : false,
                        monitFlag: res.result.monitFlag === "Y" ? true : false,
                        doseData: res.result.doseJson,
                        medAutData: res.result.autJson,
                        stockCode: res.result.stockCode,
                        stockDesc: res.result.stockDesc,
                        stockSpec: res.result.stockSpec,
                        barCode: res.result.barCode,
                        stkSubCatDesc: res.result.stkSubCatDesc,
                        purUnitDesc: res.result.purUnitDesc,
                        factor: res.result.factor,
                        baseUnitDesc: res.result.baseUnitDesc,
                        billFac: res.result.billFac,
                        packPicPath: res.result.packPicPath,
                        priceTypeDesc: res.result.priceTypeDesc,
                        quaLevelDesc: res.result.quaLevelDesc,
                        qualityNo: res.result.qualityNo,
                        maxSprice: res.result.maxSprice,
                        priceFileNo: res.result.priceFileNo,
                        drugUseInfo: res.result.drugUseInfo,
                        impTypeDesc: res.result.impTypeDesc,
                        stockAlias: res.result.stockAlias,
                        minTemp: res.result.minTemp,
                        maxTemp: res.result.maxTemp,
                        commonTemp: res.result.commonTemp === "Y" ? true : false,
                        minHumidity: res.result.minHumidity,
                        maxHumidity: res.result.maxHumidity,
                        dry: res.result.dry === "Y" ? true : false,
                        airtight: res.result.airtight === "Y" ? true : false,
                        dark: res.result.dark === "Y" ? true : false,
                        radiation: res.result.radiation === "Y" ? true : false,
                        seal: res.result.seal === "Y" ? true : false,
                        gloomyCool: res.result.gloomyCool === "Y" ? true : false,
                        meltPack: res.result.meltPack === "Y" ? true : false,
                        coldST: res.result.coldST === "Y" ? true : false,
                        freeze: res.result.freeze === "Y" ? true : false,
                        dampProof: res.result.dampProof === "Y" ? true : false,
                        itemCode: res.result.itemCode,
                        itemDesc: res.result.itemDesc,
                        itemTCDesc: res.result.itemTCDesc,
                        itemPCDesc: res.result.itemPCDesc,
                        itemICDesc: res.result.itemICDesc,
                        itemOCDesc: res.result.itemOCDesc,
                        itemECDesc: res.result.itemECDesc,
                        itemACDesc: res.result.itemACDesc,
                        itemMCDesc: res.result.itemMCDesc,
                        itemStartDate: res.result.itemStartDate,
                        itemEndDate: res.result.itemEndDate,
                        itemYBCode: res.result.itemYBCode,
                        packUnitID: res.result.packUnitID,
                        appPreFixID: res.result.appPreFixID,
                        PBLID: res.result.PBLID,
                        PBManfID: res.result.PBManfID,
                        stockStartDate: res.result.stockStartDate,
                        stockEndDate: res.result.stockEndDate,
                        packFac: res.result.packFac,
                        approvalNo: res.result.approvalNo,
                        PBRp: res.result.PBRp,
                        PBLevID: res.result.PBLevID,
                        purPlanCode: res.result.purPlanCode,
                        stopReaID: res.result.stopReaID,
                        inMedBasis: res.result.inMedBasis,
                        standCode: res.result.standCode,
                        PBVendorID: res.result.PBVendorID,
                        refRetReaID: res.result.refRetReaID,
                        isHospFlag: res.result.isHospFlag === "Y" ? true : false,
                        baseUnitID: res.result.baseUnitID,
                        dispUomID: res.result.dispUomID,
                        dispUnitData: res.result?.dispUnitJson || []
                    }, () => {
                        this.unitMaintenanceChild && this.unitMaintenanceChild.getTableData(this.state.dispUnitData);
                    })
                } else {
                    return;
                }
            }
        })
    }

    //保存
    handleSave = () => {
        let { ChineseEnglishSize } = this.state;
        if (this.state.hospFlag === "1") {
            message.warning(ChineseEnglishSize.HospitalDrugInformationMaintensaveTips2 ? ChineseEnglishSize.HospitalDrugInformationMaintensaveTips2.descripts : '只能切换到本院目录才允许保存本院信息!!');
            return;
        }
        if (this.state.stockID === "") {
            message.warning(ChineseEnglishSize.HospitalDrugInformationMaintensaveTips3 ? ChineseEnglishSize.HospitalDrugInformationMaintensaveTips3.descripts : '请选择药品记录后再保存本院信息!!');
            return;
        }
        if (this.state.stockStartDate === "") {
            message.warning(ChineseEnglishSize.HospitalDrugInformationMainteneffectiveDateNotNull ? ChineseEnglishSize.HospitalDrugInformationMainteneffectiveDateNotNull.descripts : '生效日期不能为空!!');
            return;
        }
        let data = {
            params: [{
                stockID: this.state.stockID,
                packUnitID: this.state.packUnitID,
                appPreFixID: this.state.appPreFixID,
                PBLID: this.state.PBLID,
                PBManfID: this.state.PBManfID,
                stockStartDate: this.state.stockStartDate,
                stockEndDate: this.state.stockEndDate,
                packFac: this.state.packFac,
                approvalNo: this.state.approvalNo,
                PBRp: this.state.PBRp,
                PBLevID: this.state.PBLevID,
                purPlanCode: this.state.purPlanCode,
                stopReaID: this.state.stopReaID,
                inMedBasis: this.state.inMedBasis,
                standCode: this.state.standCode,
                PBVendorID: this.state.PBVendorID,
                refRetReaID: this.state.refRetReaID,
                isHospFlag: this.state.isHospFlag === true ? "Y" : "N",
                packPicPath: this.state.packPicPath,
            }],
        }
        $http.post('urlS', this, {
            code: '02020204',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    message.success(ChineseEnglishSize.HospitalDrugInformationMaintensavesaveSucc ? ChineseEnglishSize.HospitalDrugInformationMaintensavesaveSucc.descripts : '保存成功');
                } else {
                    return;
                }
            }
        })
    }

    setRowClassName = (record) => {
        return record.stockID === this.state.stockID ? 'clickRowStyle' : '';
    }

    onClickRow = (record) => {
        //给右边的编辑form传值
        return {
            onClick: () => {
                if (record.stockID != this.state.stockID) {
                    this.props.form.resetFields(); //清空所有
                    this.setState({
                        stockID: record.stockID,
                        saveBtnStatus: false,
                    }, () => {
                        this.handleQueryDetail();
                    })
                }
            }
        };
    }

    // 提供修改page和pageSize的回调函数
    compilePage(page, pageSize) {
        // 修改page，或者pageSize
        this.setState({ page: page, pageSize: pageSize }, () => {
            // 重新调用查询方法
            this.handleQuery()
        })
    }

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

    // 条数改变的回调
    onShowSizeChange = (current, size) => {
        this.setState({ page: current, pageSize: size }, () => {
            // 重新调用查询方法
            this.handleQuery();
        });
    }

    // 显示分页总条数
    showTotal(total) {
        return `共 ${total} 条`;
    }

    //其他条件
    loadConditionList() {
        var { conditionList } = this.state;
        var conditionListOption = []
        conditionList && conditionList.map((item, index) => {
            conditionListOption.push(
                item.conditionCode == this.state.conditionCode ?
                    <Button type={this.state.btnStatus} size='small'
                        onClick={this.handleChangeCondition.bind(this, item)} style={{ marginLeft: 10, marginTop: 5 }} key={index}
                        value={item.conditionCode}>{item.conditionDesc}
                        ({this.state.conditionData ? (this.state.conditionData[item.conditionCode] || 0) : 0})</Button>
                    : <Button size='small'
                        onClick={this.handleChangeCondition.bind(this, item)} style={{ marginLeft: 10, marginTop: 5 }} key={index}
                        value={item.conditionCode}>{item.conditionDesc}
                        ({this.state.conditionData ? (this.state.conditionData[item.conditionCode] || 0) : 0})</Button>
            )
        })
        return loadConditionList
    }

    //全部信息
    handleAllVis = () => {
        if (this.state.hospFlag === '2') {
            var hospVisFlag = '';
        } else {
            var hospVisFlag = 'none';
        }
        this.setState({
            medVisFlag: '',
            stockVisFlag: '',
            chargeVisFlag: '',
            hospVisFlag: hospVisFlag,
            btnAllStatus: 'primary',
            btnMedStatus: '',
            btnStockStatus: '',
            btnChargeStatus: '',
            btnHospStatus: '',
        })
    }

    //医嘱项信息
    handleMedVis = () => {
        this.setState({
            medVisFlag: '',
            stockVisFlag: 'none',
            chargeVisFlag: 'none',
            hospVisFlag: 'none',
            btnAllStatus: '',
            btnMedStatus: 'primary',
            btnStockStatus: '',
            btnChargeStatus: '',
            btnHospStatus: '',
        })
    }

    //库存项信息
    handleStockVis = () => {
        this.setState({
            medVisFlag: 'none',
            stockVisFlag: '',
            chargeVisFlag: 'none',
            hospVisFlag: 'none',
            btnAllStatus: '',
            btnMedStatus: '',
            btnStockStatus: 'primary',
            btnChargeStatus: '',
            btnHospStatus: '',
        })
    }

    //收费项信息
    handleChargeVis = () => {
        this.setState({
            medVisFlag: 'none',
            stockVisFlag: 'none',
            chargeVisFlag: '',
            hospVisFlag: 'none',
            btnAllStatus: '',
            btnMedStatus: '',
            btnStockStatus: '',
            btnChargeStatus: 'primary',
            btnHospStatus: '',
        })
    }

    //本院信息
    handleHospVis = () => {
        this.setState({
            medVisFlag: 'none',
            stockVisFlag: 'none',
            chargeVisFlag: 'none',
            hospVisFlag: '',
            btnAllStatus: '',
            btnMedStatus: '',
            btnStockStatus: '',
            btnChargeStatus: '',
            btnHospStatus: 'primary',
        })
    }


    //切换显示类型
    changeListType = () => {
        let { language } = this.state;
        if (language.language == 'EN') {
            this.setState({ listType: this.state.listType === 'List' ? 'Tile' : 'List', })
        } else {
            this.setState({ listType: this.state.listType === '列表' ? '平铺' : '列表', })
        }
    }

    mintenanceRef = ref => {
        this.maintenanceChild = ref;
    }

    // 批准文号设置
    handleSettingClick = () => {
        this.maintenanceChild.showModal(this.state.childSelectData, this.state.approvalPrefixData);
    }

    // 给批准文号赋值
    setApprovalNoValue = (value) => {
        this.props.form.setFieldsValue({ approvalNo: value })
    }

    // 保存
    handleUnitMaintenanceSave = () => {
        this.unitMaintenanceChild.handleValidateFields();
        setTimeout(() => {
            let { dispUnitData, stockID, baseUnitID } = this.state;
            for (var i = 0; i < dispUnitData.length; i++) {
                dispUnitData[i].dispUomID = dispUnitData[i]?.ID;
                dispUnitData[i].stockID = stockID;
                dispUnitData[i].baseUnitID = baseUnitID;
            }
            let data = {
                params: [{
                    dispUomArr: dispUnitData
                }]
            }
            $http.post('urlADS', this, {
                code: "02020393",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        // 成功提示
                        message.success(res && res.errorMessage ? res.errorMessage : '保存成功');
                        this.handleQueryDetail();
                    }
                }
            })
        }, 500)
    }

    // 接收子组件form表单中的值
    receiveSubcomponentsValue = values => {
        this.setState({ dispUnitData: values })
    }

    // 从本院目录移除
    handlereOurHospitalMove = async () => {
        try {
            let { stockID } = this.state;
            let data = {
                params: [{
                    stockID
                }]
            }
            let res = await React.$asyncPost(this, '02020401', data);
            message.success(res.errorMessage || '移除成功');
            this.handleAllQuery();
        } catch (error) {
            console.log(error)
        }
    }

    render() {
        let { cardHeight, language, ChineseEnglishSize, doseColumns, columns, dispUnitColumns, autColumns, inventoryItemSelectData } = this.state;
        const options = [
            { label: language.language == 'EN' ? 'Public directory' : '公共目录', value: '1' },
            { label: language.language == 'EN' ? 'Directory of our hospital' : '本院目录', value: '2' },
        ];
        const { getFieldDecorator } = this.props.form;
        let formItemLayout = {
            labelCol: { span: 7 },
            wrapperCol: { span: 17 }
        };
        let formItemLayout2 = { labelCol: { span: 8 }, wrapperCol: { span: 16 } }
        return (
            <div className="drugMain-body">
                <Card
                    size="small"
                    title={ChineseEnglishSize.HospitalDrugInformationMaintendrugInfoMaintenance ? ChineseEnglishSize.HospitalDrugInformationMaintendrugInfoMaintenance.descripts : '医院药品信息维护'}
                    className="catd-head-bg-img"
                >
                    <Col span={11}>
                        <div style={{ paddingRight: '12px', position: 'relative' }}>
                            <Card bodyStyle={{ padding: '8px' }}>
                                <Row>
                                    <Col span={9} style={{ paddingLeft: '10px' }}>
                                        <FormItem {...formItemLayout} label={ChineseEnglishSize.HospitalDrugInformationMaintenStkCat ? ChineseEnglishSize.HospitalDrugInformationMaintenStkCat.descripts : '库存大类'}>
                                            {getFieldDecorator('StkCat', {
                                                initialValue: this.state.stkCatID,
                                            })(
                                                <Select
                                                    style={{ width: '100%' }}
                                                    allowClear={true}
                                                    showSearch
                                                    optionFilterProp="children"
                                                    onChange={this.selectOnChange.bind(this, "stkCatID")}
                                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                                >
                                                    {this.state.stkCatData}
                                                </Select>
                                            )}
                                        </FormItem>
                                        <FormItem {...formItemLayout} label={ChineseEnglishSize.HospitalDrugInformationMaintenAlias ? ChineseEnglishSize.HospitalDrugInformationMaintenAlias.descripts : '药品别名'}>
                                            {getFieldDecorator('Alias', {
                                                initialValue: this.state.alias,
                                            })(
                                                <Input
                                                    allowClear={true}
                                                    onChange={this.onChangeInput.bind(this, "alias")}
                                                    onPressEnter={() => this.handleAllQuery()}
                                                />
                                            )}
                                        </FormItem>
                                    </Col>
                                    <Col span={9} style={{ paddingLeft: '20px' }}>
                                        <FormItem {...formItemLayout} label={ChineseEnglishSize.HospitalDrugInformationMaintenStkSubCat ? ChineseEnglishSize.HospitalDrugInformationMaintenStkSubCat.descripts : '库存子类'}>
                                            {getFieldDecorator('StkSubCat', {
                                                initialValue: this.state.stkSubCatID,
                                            })(
                                                <Select
                                                    style={{ width: '100%' }}
                                                    allowClear={true}
                                                    showSearch
                                                    optionFilterProp="children"
                                                    onChange={this.selectOnChange.bind(this, "stkSubCatID")}
                                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                                >
                                                    {this.state.stkSubCatData}
                                                </Select>
                                            )}
                                        </FormItem>
                                        <FormItem>
                                            <Radio.Group
                                                style={{ paddingLeft: '5px' }}
                                                options={options}
                                                onChange={this.onChangeInput.bind(this, "hospFlag")}
                                                value={this.state.hospFlag}
                                            />
                                        </FormItem>
                                    </Col>
                                    <Col span={6}>
                                        <FormItem>
                                            <Button style={{ marginLeft: '24px', background: '#1999db', color: '#ffffff' }} onClick={this.handleAllQuery}>{ChineseEnglishSize.HospitalDrugInformationMaintensearch ? ChineseEnglishSize.HospitalDrugInformationMaintensearch.descripts : '查询'}</Button>
                                            <Button style={{ marginLeft: '24px', background: '#1999db', color: '#ffffff', display: (+this.state.hospFlag !== 2 ? 'none' : '') }} loading={this.state.exportStatus} disabled={Util.isEmpty(this.state.stockData)} onClick={this.exportFun}>{this.state.exportStatus === true ? '导出中' : '导出'}</Button>
                                        </FormItem>
                                        <FormItem>
                                            <Button
                                                disabled={this.state.saveBtnStatus}
                                                style={{ marginLeft: '24px' }}
                                                onClick={+this.state.hospFlag !== 2 ? this.handleSaveToHosp : this.handlereOurHospitalMove}
                                            >
                                                {+this.state.hospFlag !== 2 ? (ChineseEnglishSize.HospitalDrugInformationMaintensaveToHospital ? ChineseEnglishSize.HospitalDrugInformationMaintensaveToHospital.descripts : '保存到本院') : '从本院移除'}
                                            </Button>
                                        </FormItem>
                                    </Col>
                                </Row>
                                <Row>
                                    <div>
                                        <Table
                                            dataSource={this.state.stockData}
                                            columns={columns.length > 0 ? columns : this.columns}
                                            rowClassName={this.setRowClassName}
                                            pagination={false}
                                            bordered
                                            loading={this.state.loading}
                                            onRow={this.onClickRow}
                                            scroll={{ x: this.state.widthTotal, y: store.getState().tableHeight.y - 28 }}
                                            style={{ height: (store.getState().tableHeight.y + 24 + "px") }}
                                        />
                                        {/* 分页: total--总条数  defaultCurrent--默认的当前页 hideOnSinglePage--只有一页时隐藏分页器 */}
                                        {/* <Pagination
                                            showTotal={() => this.showTotal(this.state.total)}
                                            size="small"
                                            showQuickJumper
                                            showSizeChanger
                                            defaultCurrent={1}
                                            current={this.state.page}
                                            total={this.state.total}
                                            onChange={this.pageChange}
                                            onShowSizeChange={this.onShowSizeChange}
                                            style={{textAlign: "right", marginTop: '15px'}}
                                        /> */}
                                        <CommonPagination size="small" current={this.state.page} total={this.state.total} search="search"
                                            onShowSizeChange={this.onShowSizeChange} complete={true} dataSource={this.state.stockData}
                                            loading={this.state.loading} onChange={this.pageChange} pageSize={true} />
                                    </div>
                                </Row>
                            </Card>
                            <div style={{ width: '12px', background: '#fff', position: 'absolute', top: 0, right: 0, height: '100%' }}></div>
                        </div>
                    </Col>
                    <Col span={13}>
                        <Card bodyStyle={{ padding: '8px', paddingRight: '0px' }}>
                            <Row>
                                <div style={{ display: 'flex', background: '#e4e4e4', height: 34, lineHeight: '34px' }}>
                                    <Col span={22}>
                                        <Button type={this.state.btnAllStatus} size='small' style={{ marginLeft: '10px', marginTop: '5px' }} onClick={this.handleAllVis}>{ChineseEnglishSize.HospitalDrugInformationMaintenallInfo ? ChineseEnglishSize.HospitalDrugInformationMaintenallInfo.descripts : '全部信息'}</Button>
                                        <Button type={this.state.btnMedStatus} size='small' style={{ marginLeft: '10px', marginTop: '5px' }} onClick={this.handleMedVis}>{ChineseEnglishSize.HospitalDrugInformationMaintenprescriptionItemInfo ? ChineseEnglishSize.HospitalDrugInformationMaintenprescriptionItemInfo.descripts : '医嘱项信息'}</Button>
                                        <Button type={this.state.btnStockStatus} size='small' style={{ marginLeft: '10px', marginTop: '5px' }} onClick={this.handleStockVis}>{ChineseEnglishSize.HospitalDrugInformationMainteninventoryItemInfo ? ChineseEnglishSize.HospitalDrugInformationMainteninventoryItemInfo.descripts : '库存项信息'}</Button>
                                        <Button type={this.state.btnChargeStatus} size='small' style={{ marginLeft: '10px', marginTop: '5px' }} onClick={this.handleChargeVis}>{ChineseEnglishSize.HospitalDrugInformationMaintenchargeItemInfo ? ChineseEnglishSize.HospitalDrugInformationMaintenchargeItemInfo.descripts : '收费项信息'}</Button>
                                        <Button hidden={this.state.hospBtnHidden} type={this.state.btnHospStatus} size='small' style={{ marginLeft: '10px', marginTop: '5px' }} onClick={this.handleHospVis}>{ChineseEnglishSize.HospitalDrugInformationMaintenourInformation ? ChineseEnglishSize.HospitalDrugInformationMaintenourInformation.descripts : '本院信息'}</Button>
                                    </Col>
                                    <Col span={2}>
                                        <Button size='small' icon="swap" onClick={this.changeListType}>{this.state.listType}</Button>
                                    </Col>
                                </div>
                            </Row>
                            <Divider dashed style={{ marginTop: '8px', marginBottom: '8px' }} />
                            <Row>
                                <div style={{ height: cardHeight, overflow: 'auto', padding: '0 12px' }} className="drugmain-bar">
                                    <div style={{ display: this.state.medVisFlag }}>
                                        <Descriptions title={ChineseEnglishSize.HospitalDrugInformationMaintenprescriptionItemInfo ? ChineseEnglishSize.HospitalDrugInformationMaintenprescriptionItemInfo.descripts : '医嘱项信息'} column={2} layout="horizontal" bordered={this.state.listType === '平铺' || 'Tile' ? true : false} size="small">
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenmedDesc.descripts : '医嘱项代码'} >{this.state.medCode}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenmedDesc.descripts : '医嘱项名称'} >{this.state.medDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenchemicDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenchemicDesc.descripts : '化学通用名'} >{this.state.chemicDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintengenerDesc ? ChineseEnglishSize.HospitalDrugInformationMaintengenerDesc.descripts : '处方通用名'} >{this.state.generDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedShortDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenmedShortDesc.descripts : '简称'} >{this.state.medShortDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedSubCatDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenmedSubCatDesc.descripts : '医嘱子类'} >{this.state.medSubCatDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedPriorityDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenmedPriorityDesc.descripts : '医嘱优先级'} >{this.state.medPriorityDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedUnitDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenmedUnitDesc.descripts : '计价单位'} >{this.state.medUnitDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedMaxDose ? ChineseEnglishSize.HospitalDrugInformationMaintenmedMaxDose.descripts : '单次最大剂量'} >{this.state.medMaxDose}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedQdMaxQty ? ChineseEnglishSize.HospitalDrugInformationMaintenmedQdMaxQty.descripts : '每天最大剂量'} >{this.state.medQdMaxQty}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedSexDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenmedSexDesc.descripts : '性别'} >{this.state.medSexDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedAgeFrom ? ChineseEnglishSize.HospitalDrugInformationMaintenmedAgeFrom.descripts : '年龄'} >{this.state.medAgeFrom + " - " + this.state.medAgeTo}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedMessage ? ChineseEnglishSize.HospitalDrugInformationMaintenmedMessage.descripts : '医嘱提示'} >{this.state.medMessage}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedNoAloneOrder ? ChineseEnglishSize.HospitalDrugInformationMaintenmedNoAloneOrder.descripts : '独立医嘱'} ><span> {this.state.medNoAloneOrder ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedNoStockFlag ? ChineseEnglishSize.HospitalDrugInformationMaintenmedNoStockFlag.descripts : '无库存医嘱'} ><span> {this.state.medNoStockFlag ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedNoChangeFlag ? ChineseEnglishSize.HospitalDrugInformationMaintenmedNoChangeFlag.descripts : '不收费'} ><span> {this.state.medNoChangeFlag ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedMergeUseFlag ? ChineseEnglishSize.HospitalDrugInformationMaintenmedMergeUseFlag.descripts : '合并用药'} ><span> {this.state.medMergeUseFlag ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedEMFlag ? ChineseEnglishSize.HospitalDrugInformationMaintenmedEMFlag.descripts : '加急标志'} ><span> {this.state.medEMFlag ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedSkinTestFlag ? ChineseEnglishSize.HospitalDrugInformationMaintenmedSkinTestFlag.descripts : '是否需要皮试'} ><span> {this.state.medSkinTestFlag ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedToalCountO ? ChineseEnglishSize.HospitalDrugInformationMaintenmedToalCountO.descripts : '门诊按总量'} ><span> {this.state.medToalCountO ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedToalCountI ? ChineseEnglishSize.HospitalDrugInformationMaintenmedToalCountI.descripts : '住院按总量'} ><span> {this.state.medToalCountI ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenstockAlias ? ChineseEnglishSize.HospitalDrugInformationMaintenstockAlias.descripts : '别名'} >{this.state.medAlias}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenstockStartDate ? ChineseEnglishSize.HospitalDrugInformationMaintenstockStartDate.descripts : '生效日期'} >{this.state.medStartDate}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedEndDate ? ChineseEnglishSize.HospitalDrugInformationMaintenmedEndDate.descripts : '失效日期'} >{this.state.medEndDate}</Descriptions.Item>
                                        </Descriptions>
                                        <Divider dashed style={{ marginTop: '8px', marginBottom: '8px' }} />
                                        <Descriptions column={3} layout="horizontal" bordered={this.state.listType === '平铺' || 'Tile' ? true : false} size="small">
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedSpec ? ChineseEnglishSize.HospitalDrugInformationMaintenmedSpec.descripts : '含量规格'} >{this.state.medSpec}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedUsageDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenmedUsageDesc.descripts : '用法'} >{this.state.medUsageDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedFreqDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenmedFreqDesc.descripts : '频次'} >{this.state.medFreqDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintendosageForm ? ChineseEnglishSize.HospitalDrugInformationMaintendosageForm.descripts : '剂型'} >{this.state.formDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedDurQty ? ChineseEnglishSize.HospitalDrugInformationMaintenmedDurQty.descripts : '疗程'} >{this.state.medDurQty + this.state.medDurationDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintentradeName ? ChineseEnglishSize.HospitalDrugInformationMaintentradeName.descripts : '商品名'} >{this.state.tradeName}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenpoisonDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenpoisonDesc.descripts : '管制分类'} >{this.state.poisonDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintencriLevDesc ? ChineseEnglishSize.HospitalDrugInformationMaintencriLevDesc.descripts : '危重级别'} >{this.state.criLevDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenantidFlag ? ChineseEnglishSize.HospitalDrugInformationMaintenantidFlag.descripts : '抗菌药物标志'} ><span> {this.state.antidFlag ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintencountryFlag ? ChineseEnglishSize.HospitalDrugInformationMaintencountryFlag.descripts : '国家基本药物标志'} ><span> {this.state.countryFlag ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenprovFlag ? ChineseEnglishSize.HospitalDrugInformationMaintenprovFlag.descripts : '省级基本药物标志'} ><span> {this.state.provFlag ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintencityFlag ? ChineseEnglishSize.HospitalDrugInformationMaintencityFlag.descripts : '市级基本药物标志'} ><span> {this.state.cityFlag ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmonitFlag ? ChineseEnglishSize.HospitalDrugInformationMaintenmonitFlag.descripts : '重点监控标志'} ><span> {this.state.monitFlag ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                        </Descriptions>
                                        <Divider dashed style={{ marginTop: '8px', marginBottom: '8px' }} />
                                        <Card title={ChineseEnglishSize.HospitalDrugInformationMaintenequivalentUnit ? ChineseEnglishSize.HospitalDrugInformationMaintenequivalentUnit.descripts : '等效单位'} background="#1999db" bodyStyle={{ padding: '0px' }}>
                                            <div>
                                                <Table
                                                    size="middle"
                                                    dataSource={this.state.doseData}
                                                    columns={doseColumns.length > 0 ? doseColumns : this.doseColumns}
                                                    pagination={false}
                                                    bordered
                                                    scroll={{ y: store.getState().tableHeight.y - 370 }}
                                                    style={{ height: (store.getState().tableHeight.y - 340) }}
                                                />
                                            </div>
                                        </Card>
                                        <Divider dashed style={{ marginTop: '8px', marginBottom: '8px' }} />
                                        <Card title={ChineseEnglishSize.HospitalDrugInformationMaintendrugRestriction ? ChineseEnglishSize.HospitalDrugInformationMaintendrugRestriction.descripts : '限制用药'} background="#1999db" bodyStyle={{ padding: '0px' }}>
                                            <div>
                                                <Table
                                                    size="middle"
                                                    dataSource={this.state.medAutData}
                                                    columns={autColumns.length > 0 ? autColumns : this.autColumns}
                                                    pagination={false}
                                                    bordered
                                                    scroll={{ y: store.getState().tableHeight.y - 370 }}
                                                    style={{ height: (store.getState().tableHeight.y - 340) }}
                                                />
                                            </div>
                                        </Card>
                                        <Divider dashed style={{ marginTop: '8px', marginBottom: '8px' }} />
                                    </div>
                                    <div style={{ display: this.state.stockVisFlag }}>
                                        <Descriptions title={ChineseEnglishSize.HospitalDrugInformationMainteninventoryItemInfo ? ChineseEnglishSize.HospitalDrugInformationMainteninventoryItemInfo.descripts : '库存项信息'} column={3} layout="horizontal" bordered={this.state.listType === '平铺' || 'Tile' ? true : false} size="small">
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenstockCode ? ChineseEnglishSize.HospitalDrugInformationMaintenstockCode.descripts : '库存项代码'}>{this.state.stockCode}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenstockDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenstockDesc.descripts : '库存项名称'} span={2}>{this.state.stockDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenstockSpec ? ChineseEnglishSize.HospitalDrugInformationMaintenstockSpec.descripts : '包装规格'}>{this.state.stockSpec}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenbarCode ? ChineseEnglishSize.HospitalDrugInformationMaintenbarCode.descripts : '条码'}>{this.state.barCode}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenstkType ? ChineseEnglishSize.HospitalDrugInformationMaintenstkType.descripts : '库存分类'}>{this.state.stkSubCatDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenpurUnitDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenpurUnitDesc.descripts : '入库单位'}>{this.state.purUnitDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenfactor ? ChineseEnglishSize.HospitalDrugInformationMaintenfactor.descripts : '转换系数'}>{this.state.factor}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenbaseUnitDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenbaseUnitDesc.descripts : '基本单位'}>{this.state.baseUnitDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenbillFac ? ChineseEnglishSize.HospitalDrugInformationMaintenbillFac.descripts : '转换系数(计价单位)'}>{this.state.billFac}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedUnitDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenmedUnitDesc.descripts : '计价单位'}>{this.state.medUnitDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenimpTypeDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenimpTypeDesc.descripts : '进口类型'}>{this.state.impTypeDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenpriceTypeDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenpriceTypeDesc.descripts : '定价类型'}>{this.state.priceTypeDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenquaLevelDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenquaLevelDesc.descripts : '质量层次'}>{this.state.quaLevelDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenqualityNo ? ChineseEnglishSize.HospitalDrugInformationMaintenqualityNo.descripts : '质标编号'}>{this.state.qualityNo}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmaxSprice ? ChineseEnglishSize.HospitalDrugInformationMaintenmaxSprice.descripts : '最高售价'}>{this.state.maxSprice}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenpriceFileNo ? ChineseEnglishSize.HospitalDrugInformationMaintenpriceFileNo.descripts : '物价文件号'} span={2}>{this.state.priceFileNo}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintendrugUseInfo ? ChineseEnglishSize.HospitalDrugInformationMaintendrugUseInfo.descripts : '用药说明'} span={3}>{this.state.drugUseInfo}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedAlias ? ChineseEnglishSize.HospitalDrugInformationMaintenmedAlias.descripts : '别名'} span={2}>{this.state.stockAlias}</Descriptions.Item>
                                        </Descriptions>
                                        <Divider dashed style={{ marginTop: '8px', marginBottom: '8px' }} />
                                        <Descriptions title={ChineseEnglishSize.HospitalDrugInformationMaintenstorageConditions ? ChineseEnglishSize.HospitalDrugInformationMaintenstorageConditions.descripts : '存储条件'} column={3} layout="horizontal" bordered={this.state.listType === '平铺' || 'Tile' ? true : false} size="small">
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenminTemp ? ChineseEnglishSize.HospitalDrugInformationMaintenminTemp.descripts : '最低温度(°C)'}>{this.state.minTemp}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmaxTemp ? ChineseEnglishSize.HospitalDrugInformationMaintenmaxTemp.descripts : '最高温度(°C)'}>{this.state.maxTemp}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintencommonTemp ? ChineseEnglishSize.HospitalDrugInformationMaintencommonTemp.descripts : '常温'}><span> {this.state.commonTemp ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenminHumidity ? ChineseEnglishSize.HospitalDrugInformationMaintenminHumidity.descripts : '最低湿度'}>{this.state.minHumidity}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmaxHumidity ? ChineseEnglishSize.HospitalDrugInformationMaintenmaxHumidity.descripts : '最高湿度'}>{this.state.maxHumidity}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintendry ? ChineseEnglishSize.HospitalDrugInformationMaintendry.descripts : '干燥'}><span> {this.state.dry ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenairtight ? ChineseEnglishSize.HospitalDrugInformationMaintenairtight.descripts : '密闭'}><span> {this.state.airtight ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintendark ? ChineseEnglishSize.HospitalDrugInformationMaintendark.descripts : '遮光'}><span> {this.state.dark ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenradiation ? ChineseEnglishSize.HospitalDrugInformationMaintenradiation.descripts : '防辐射'}><span> {this.state.radiation ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenseal ? ChineseEnglishSize.HospitalDrugInformationMaintenseal.descripts : '熔封'}><span> {this.state.seal ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintengloomyCool ? ChineseEnglishSize.HospitalDrugInformationMaintengloomyCool.descripts : '暗凉'}><span> {this.state.gloomyCool ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmeltPack ? ChineseEnglishSize.HospitalDrugInformationMaintenmeltPack.descripts : '密封'}><span> {this.state.meltPack ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintencoldST ? ChineseEnglishSize.HospitalDrugInformationMaintencoldST.descripts : '冷藏'}><span> {this.state.coldST ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenfreeze ? ChineseEnglishSize.HospitalDrugInformationMaintenfreeze.descripts : '冷冻'}><span> {this.state.freeze ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintendampProof ? ChineseEnglishSize.HospitalDrugInformationMaintendampProof.descripts : '防潮'}><span> {this.state.dampProof ? <Icon type="check" /> : <Icon type="close" />}</span></Descriptions.Item>
                                        </Descriptions>
                                        <Divider dashed style={{ marginTop: '8px', marginBottom: '8px' }} />
                                        <Card
                                            title={ChineseEnglishSize.HospitalDrugInformationMaintendrugDeliveryUnit ? ChineseEnglishSize.HospitalDrugInformationMaintendrugDeliveryUnit.descripts : '发药单位'}
                                            background="#1999db"
                                            bodyStyle={{ padding: '0px' }}
                                            style={{ display: this.state.hospFlag === '1' ? 'block' : 'none' }}
                                        >
                                            <div>
                                                <Table
                                                    size="middle"
                                                    dataSource={this.state.dispUnitData}
                                                    columns={dispUnitColumns.length > 0 ? dispUnitColumns : this.dispUnitColumns}
                                                    pagination={false}
                                                    bordered
                                                    scroll={{ y: store.getState().tableHeight.y - 370 }}
                                                    style={{ height: (store.getState().tableHeight.y - 340) }}
                                                />
                                            </div>
                                        </Card>
                                        <div style={{ display: this.state.hospFlag === '2' ? 'block' : 'none' }}>
                                            <AIIUnitMaintenance
                                                onRef={ref => this.unitMaintenanceChild = ref}
                                                selectData={inventoryItemSelectData}
                                                receiveSubcomponentsValue={this.receiveSubcomponentsValue}
                                                isSaveAnother=''
                                                ChineseEnglishSize={ChineseEnglishSize}
                                                handleSave={this.handleUnitMaintenanceSave}
                                            />
                                        </div>
                                        <Divider dashed style={{ marginTop: '8px', marginBottom: '8px' }} />
                                    </div>
                                    <div style={{ display: this.state.chargeVisFlag }}>
                                        <Descriptions title={ChineseEnglishSize.HospitalDrugInformationMaintenchargeItemInfo ? ChineseEnglishSize.HospitalDrugInformationMaintenchargeItemInfo.descripts : '收费项信息'} column={3} layout="horizontal" bordered={this.state.listType === '平铺' || 'Tile' ? true : false} size="small">
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenitemCode ? ChineseEnglishSize.HospitalDrugInformationMaintenitemCode.descripts : '收费项代码'}>{this.state.itemCode}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenitemDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenitemDesc.descripts : '收费项名称'} span={2}>{this.state.itemDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenitemTCDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenitemTCDesc.descripts : '收费分类'}>{this.state.itemTCDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenitemPCDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenitemPCDesc.descripts : '物价分类'}>{this.state.itemPCDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenitemICDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenitemICDesc.descripts : '住院收据分类'}>{this.state.itemICDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenitemOCDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenitemOCDesc.descripts : '门诊收据分类'}>{this.state.itemOCDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenitemECDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenitemECDesc.descripts : '核算项目分类'}>{this.state.itemECDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenitemACDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenitemACDesc.descripts : '会计分类'}>{this.state.itemACDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenitemMCDesc ? ChineseEnglishSize.HospitalDrugInformationMaintenitemMCDesc.descripts : '病案分类'}>{this.state.itemMCDesc}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenstockStartDate ? ChineseEnglishSize.HospitalDrugInformationMaintenstockStartDate.descripts : '生效日期'}>{this.state.itemStartDate}</Descriptions.Item>
                                            <Descriptions.Item label={ChineseEnglishSize.HospitalDrugInformationMaintenmedEndDate ? ChineseEnglishSize.HospitalDrugInformationMaintenmedEndDate.descripts : '失效日期'}>{this.state.itemEndDate}</Descriptions.Item>
                                            {this.state.itemYBCode ? <Descriptions.Item label="医保国家码" span={24}>{this.state.itemYBCode}</Descriptions.Item> : ''}
                                        </Descriptions>
                                        <Divider dashed style={{ marginTop: '8px', marginBottom: '8px' }} />
                                    </div>
                                    <div style={{ display: this.state.hospVisFlag }}>
                                        <div style={{ background: '#FFFFFF', height: 34, lineHeight: '34px' }}>
                                            <Col span={22}>
                                                <p style={{ color: 'rgba(31, 125, 99, 0.85)', fontSize: '17px', fontWeight: 'bold', lineHeight: '1.7' }}>
                                                    {ChineseEnglishSize.HospitalDrugInformationMaintenourInformation ? ChineseEnglishSize.HospitalDrugInformationMaintenourInformation.descripts : '本院信息'}
                                                </p>
                                            </Col>
                                            <Col span={2} style={{ paddingLeft: '10px' }}>
                                                <Button size='small' type="dashed" icon="save" onClick={this.handleSave}>{ChineseEnglishSize.HospitalDrugInformationMaintensave ? ChineseEnglishSize.HospitalDrugInformationMaintensave.descripts : '保存'}</Button>
                                            </Col>
                                        </div>
                                        <div>
                                            <Form>
                                                <Row>
                                                    <Col span={8}>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenpackUnitID ? ChineseEnglishSize.HospitalDrugInformationMaintenpackUnitID.descripts : '大包装单位'}>
                                                            {getFieldDecorator('packUnitID', {
                                                                initialValue: this.state.packUnitID,
                                                                rules: [{ required: false, message: '大包装单位是必填项,请选择！' }]
                                                            })(
                                                                <Select
                                                                    allowClear={true}
                                                                    showSearch
                                                                    optionFilterProp="children"
                                                                    onChange={this.selectOnChange.bind(this, "packUnitID")}
                                                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                                                >
                                                                    {this.state.packUnitData}
                                                                </Select>
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenappPreFixID ? ChineseEnglishSize.HospitalDrugInformationMaintenappPreFixID.descripts : '批准文号前缀'}>
                                                            {getFieldDecorator('appPreFixID', {
                                                                initialValue: this.state.appPreFixID,
                                                                rules: [{ required: false, message: '批准文号前缀是必填项,请选择！' }]
                                                            })(
                                                                <Select
                                                                    allowClear={true}
                                                                    showSearch
                                                                    optionFilterProp="children"
                                                                    onChange={this.selectOnChange.bind(this, "appPreFixID")}
                                                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                                                >
                                                                    {this.state.approvalPrefixData}
                                                                </Select>
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenPBLID ? ChineseEnglishSize.HospitalDrugInformationMaintenPBLID.descripts : '招标名称'}>
                                                            {getFieldDecorator('PBLID', {
                                                                initialValue: this.state.PBLID,
                                                                rules: [{ required: false, message: '招标名称是必填项,请选择！' }]
                                                            })(
                                                                <Select
                                                                    allowClear={true}
                                                                    showSearch
                                                                    optionFilterProp="children"
                                                                    onChange={this.selectOnChange.bind(this, "PBLID")}
                                                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                                                >
                                                                    {this.state.pubBidListData}
                                                                </Select>
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenPBManfID ? ChineseEnglishSize.HospitalDrugInformationMaintenPBManfID.descripts : '招标生产企业'}>
                                                            {getFieldDecorator('PBManfID', {
                                                                initialValue: this.state.PBManfID,
                                                                rules: [{ required: ChineseEnglishSize.HospitalDrugInformationMaintenPBManfID ? ChineseEnglishSize.HospitalDrugInformationMaintenPBManfID.required == 'Y' ? true : false : false, message: ChineseEnglishSize.HospitalDrugInformationMaintenPBManfID ? ChineseEnglishSize.HospitalDrugInformationMaintenPBManfID.message : '招标生产企业是必填项,请选择！' }]
                                                            })(
                                                                <Select
                                                                    allowClear={true}
                                                                    showSearch
                                                                    optionFilterProp="children"
                                                                    onChange={this.selectOnChange.bind(this, "PBManfID")}
                                                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                                                >
                                                                    {this.state.pubBidManfData}
                                                                </Select>
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenstockStartDate ? ChineseEnglishSize.HospitalDrugInformationMaintenstockStartDate.descripts : '生效日期'}>
                                                            {getFieldDecorator('stockStartDate', {
                                                                initialValue: this.state.stockStartDate ? moment(this.state.stockStartDate, 'YYYY-MM-DD') : moment(new Date(), 'YYYY-MM-DD'),
                                                                rules: [{ required: ChineseEnglishSize.HospitalDrugInformationMaintenstockStartDate ? ChineseEnglishSize.HospitalDrugInformationMaintenstockStartDate.required == 'Y' ? true : false : false, message: ChineseEnglishSize.HospitalDrugInformationMaintenstockStartDate ? ChineseEnglishSize.HospitalDrugInformationMaintenstockStartDate.message : '生效日期是必填项,请选择！' }]
                                                            })(
                                                                <DatePicker
                                                                    onChange={this.dateOnChange.bind(this, "stockStartDate")}
                                                                    format="YYYY-MM-DD"
                                                                    style={{ width: '100%' }}
                                                                >
                                                                </DatePicker>
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenmedEndDate ? ChineseEnglishSize.HospitalDrugInformationMaintenmedEndDate.descripts : '失效日期'}>
                                                            {getFieldDecorator('stockEndDate', {
                                                                initialValue: this.state.stockEndDate && this.state.stockEndDate !== '' ? moment(this.state.stockEndDate, 'YYYY-MM-DD') : null,
                                                                rules: []
                                                            })(
                                                                <DatePicker
                                                                    onChange={this.dateOnChange.bind(this, "stockEndDate")}
                                                                    format="YYYY-MM-DD"
                                                                    style={{ width: '100%' }}
                                                                >
                                                                </DatePicker>
                                                            )}
                                                        </FormItem>
                                                    </Col>
                                                    <Col span={8}>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenpackFac ? ChineseEnglishSize.HospitalDrugInformationMaintenpackFac.descripts : '大包装系数'}>
                                                            {getFieldDecorator('packFac', {
                                                                initialValue: this.state.packFac,
                                                                rules: [{ required: false, message: '大包装系数是必填项,请选择！' }]
                                                            })(
                                                                <Input
                                                                    onChange={this.onChangeInput.bind(this, "packFac")}
                                                                />
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenapprovalNo ? ChineseEnglishSize.HospitalDrugInformationMaintenapprovalNo.descripts : '批准文号'}>
                                                            {getFieldDecorator('approvalNo', {
                                                                initialValue: this.state.approvalNo,
                                                                rules: [{ required: false, message: '批准文号是必填项,请选择！' }]
                                                            })(
                                                                <Input
                                                                    disabled
                                                                    addonAfter={<Icon type="setting" style={{ cursor: "printer" }} onClick={this.handleSettingClick} />}
                                                                    onChange={this.onChangeInput.bind(this, "approvalNo")}
                                                                    className="addon-after"
                                                                />
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenPBRp ? ChineseEnglishSize.HospitalDrugInformationMaintenPBRp.descripts : '招标进价'}>
                                                            {getFieldDecorator('PBRp', {
                                                                initialValue: this.state.PBRp,
                                                                rules: [{ required: false, message: '招标进价是必填项,请选择！' }]
                                                            })(
                                                                <Input
                                                                    onChange={this.onChangeInput.bind(this, "PBRp")}
                                                                />
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenPBLevID ? ChineseEnglishSize.HospitalDrugInformationMaintenPBLevID.descripts : '招标级别'}>
                                                            {getFieldDecorator('PBLevID', {
                                                                initialValue: this.state.PBLevID,
                                                                rules: [{ required: false, message: '招标级别是必填项,请选择！' }]
                                                            })(
                                                                <Select
                                                                    allowClear={true}
                                                                    showSearch
                                                                    optionFilterProp="children"
                                                                    onChange={this.selectOnChange.bind(this, "PBLevID")}
                                                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                                                >
                                                                    {this.state.pubBidLevelData}
                                                                </Select>
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenpurPlanCode ? ChineseEnglishSize.HospitalDrugInformationMaintenpurPlanCode.descripts : '采购编码'}>
                                                            {getFieldDecorator('purPlanCode', {
                                                                initialValue: this.state.purPlanCode,
                                                                rules: [{ required: false, message: '采购编码是必填项,请选择！' }]
                                                            })(
                                                                <Input
                                                                    onChange={this.onChangeInput.bind(this, "purPlanCode")}
                                                                />
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenstopReaID ? ChineseEnglishSize.HospitalDrugInformationMaintenstopReaID.descripts : '失效原因'}>
                                                            {getFieldDecorator('stopReaID', {
                                                                initialValue: this.state.stopReaID,
                                                                rules: [{ required: false, message: '失效原因是必填项,请选择！' }]
                                                            })(
                                                                <Select
                                                                    allowClear={true}
                                                                    showSearch
                                                                    optionFilterProp="children"
                                                                    onChange={this.selectOnChange.bind(this, "stopReaID")}
                                                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                                                >
                                                                    {this.state.stopReasonData}
                                                                </Select>
                                                            )}
                                                        </FormItem>
                                                    </Col>
                                                    <Col span={8}>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenpackPicPath ? ChineseEnglishSize.HospitalDrugInformationMaintenpackPicPath.descripts : '包装图片路径'}>
                                                            {getFieldDecorator('packPicPath', {
                                                                initialValue: this.state.packPicPath,
                                                                rules: [{ required: false, message: '包装图片路径是必填项,请选择！' }]
                                                            })(
                                                                <Input
                                                                    onChange={this.onChangeInput.bind(this, "packPicPath")}
                                                                />
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenstandCode ? ChineseEnglishSize.HospitalDrugInformationMaintenstandCode.descripts : '本位码'}>
                                                            {getFieldDecorator('standCode', {
                                                                initialValue: this.state.standCode,
                                                                rules: [{ required: false, message: '本位码是必填项,请选择！' }]
                                                            })(
                                                                <Input
                                                                    onChange={this.onChangeInput.bind(this, "standCode")}
                                                                />
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenPBVendorID ? ChineseEnglishSize.HospitalDrugInformationMaintenPBVendorID.descripts : '招标供应商'}>
                                                            {getFieldDecorator('PBVendorID', {
                                                                initialValue: this.state.PBVendorID,
                                                                rules: [{ required: false, message: '招标供应商是必填项,请选择！' }]
                                                            })(
                                                                <Select
                                                                    allowClear={true}
                                                                    showSearch
                                                                    optionFilterProp="children"
                                                                    onChange={this.selectOnChange.bind(this, "PBVendorID")}
                                                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                                                >
                                                                    {this.state.pubBidVendorData}
                                                                </Select>
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenrefRetReaID ? ChineseEnglishSize.HospitalDrugInformationMaintenrefRetReaID.descripts : '不可退原因'}>
                                                            {getFieldDecorator('refRetReaID', {
                                                                initialValue: this.state.refRetReaID,
                                                                rules: [{ required: false, message: '不可退原因是必填项,请选择！' }]
                                                            })(
                                                                <Select
                                                                    allowClear={true}
                                                                    showSearch
                                                                    optionFilterProp="children"
                                                                    onChange={this.selectOnChange.bind(this, "refRetReaID")}
                                                                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                                                                >
                                                                    {this.state.refRetReasonData}
                                                                </Select>
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMainteninMedBasis ? ChineseEnglishSize.HospitalDrugInformationMainteninMedBasis.descripts : '进药依据'}>
                                                            {getFieldDecorator('inMedBasis', {
                                                                initialValue: this.state.inMedBasis,
                                                                rules: [{ required: false, message: '进药依据是必填项,请选择！' }]
                                                            })(
                                                                <Input
                                                                    onChange={this.onChangeInput.bind(this, "inMedBasis")}
                                                                />
                                                            )}
                                                        </FormItem>
                                                        <FormItem {...formItemLayout2} label={ChineseEnglishSize.HospitalDrugInformationMaintenisHospFlag ? ChineseEnglishSize.HospitalDrugInformationMaintenisHospFlag.descripts : '院内目录'}>
                                                            {getFieldDecorator('isHospFlag', {
                                                                initialValue: this.state.isHospFlag,
                                                                rules: []
                                                            })(
                                                                <Checkbox
                                                                    onChange={this.onChangeCheckbox.bind(this, "isHospFlag")}
                                                                    checked={this.state.isHospFlag}
                                                                />
                                                            )}
                                                        </FormItem>

                                                    </Col>
                                                </Row>
                                            </Form>
                                        </div>
                                        <Divider dashed style={{ marginTop: '8px', marginBottom: '8px' }} />
                                    </div>
                                </div>
                            </Row>
                        </Card>
                    </Col>
                </Card>
                <ColumnAuthoritysModel
                    clientWidth='800px'
                    compontName="HospDrugMainList"
                    configType="C"
                    onRef={this.onColumnRef}
                    reloadData={this.getTableColumns}
                />
                <ApprovalNomaintain onRef={this.mintenanceRef} stockID={this.state.stockID} setApprovalNoValue={this.setApprovalNoValue} />
            </div>
        )
    }
};

export default Form.create()(HospDrugMainMaintenance);