<template>
    <view>
        <view class="diagnostic-wrapper">
            <view style="background: #fff">
                <van-cell title="历史病历/病历模板" is-link @tap.native="historyTreatment" />
                <mp-cell class="fontS30">
                    <view class="already">{{ entryedText }}</view>
                </mp-cell>
                <view>
                    <van-cell title-width="100px" title="选择病历模块:" is-link :value="diagType[diagTypeIndex].name || '请选择'" @tap.native="selectData3" />
                    <van-action-sheet :show="selectShow" :actions="diagType" @close="onClose" @select="onSelect" />
                </view>
                <view class="row">
                    <mp-cell class="fontS30">
                        <view class="BaseInfo">基本信息</view>
                        <view class="row boxcontentBox">
                            <view class="baseinfo1">{{ baseInfo.patAge }}</view>
                            <view class="baseinfo1 borderright">{{ baseInfo.patSexDesc }}</view>
                            <view class="baseinfo1 borderright">{{ baseInfo.patName }}</view>
                        </view>
                    </mp-cell>
                </view>
            </view>
            <view class="fixedTop" :style="'height:calc(100% - 330rpx - 100rpx - ' + height + 'rpx - 10rpx)'">
                <mp-cells ext-class="my-cells">
                    <view class="row" v-for="(item, index) in admList" :key="index">
                        <van-cell
                            value-class="leftFont"
                            title-width="120rpx"
                            class="fontS30"
                            v-if="item.IEMRTempElementCode == 'DE05.01.025.00' && item.elementTypeCode == 'Labelarea'"
                            is-link
                            center
                            clickable
                            use-label-slot
                            :url="item.IEMRTempElementLinkAddress"
                        >
                            <view slot="title">
                                <view :class="'van-cell-text ' + (item.IEMRTempElementRequired == 'Y' ? 'required' : '') + ' '">{{ item.IEMRTempElementDesc }}</view>
                            </view>
                            <block v-for="(item, index1) in diagnoseObj" :key="index1">
                                <view :id="'goods-' + item.gid">{{ index + 1 }}、{{ item.ICDDesc }}</view>
                            </block>
                        </van-cell>

                        <van-cell
                            value-class="leftFont"
                            class="fontS30"
                            title-width="120rpx"
                            :title="item.IEMRTempElementDesc"
                            v-if="item.IEMRTempElementCode == 'DE06.00.289.00' && item.elementTypeCode == 'Labelarea'"
                            is-link
                            center
                            clickable
                            use-label-slot
                            :url="item.IEMRTempElementLinkAddress"
                        >
                            <view class="chufang-box">
                                <block v-for="(itemName, index1) in orderPresc" :key="index1">
                                    <view class="chufang2">
                                        <!-- <view class="item-aside"></view> -->
                                        <view class="item-main">
                                            <view class="onebox">
                                                <view class="one">
                                                    <view class="left">
                                                        <!-- 中药 -->
                                                        <view class="name" v-if="itemName.prescTypeCode == 'CM'" style="display: flex">
                                                            <view style="flex: 0 0 auto">{{ index + 1 }}、</view>
                                                            <view style="flex: 1 1 auto">
                                                                <block v-for="(itemName, index2) in itemName.comPresc" :key="index2">
                                                                    <view class="herbstemp">
                                                                        <view
                                                                            class="herbs-item-comPrincipletemp"
                                                                            :style="
                                                                                'background-color:' +
                                                                                (itemName.comPrinciple == '君'
                                                                                    ? '#FFA23E'
                                                                                    : itemName.comPrinciple == '臣'
                                                                                    ? '#39D1D1'
                                                                                    : itemName.comPrinciple == '佐'
                                                                                    ? '#FA5AB2'
                                                                                    : itemName.comPrinciple == '使'
                                                                                    ? '#AA71F9'
                                                                                    : '')
                                                                            "
                                                                        >
                                                                            {{ itemName.comPrinciple + '药' }}
                                                                        </view>
                                                                        <view class="herbs-item-medItemMed">{{ itemName.ordDesc }} {{ itemName.spec }}</view>
                                                                        <view class="herbs-item-decoctMethodMed">{{ itemName.comMark }}</view>
                                                                    </view>
                                                                </block>
                                                                <view class="child2">
                                                                    <text>
                                                                        用法：{{ itemName.comPresc[0].durStr }}，{{ itemName.comPresc[0].frequenceDesc }}，
                                                                        {{ itemName.prescDoseQty }}，{{ itemName.prescUsageExplainDesc }} ， {{ itemName.prescUsageDesc }}
                                                                    </text>
                                                                </view>
                                                            </view>
                                                        </view>
                                                    </view>
                                                </view>
                                            </view>
                                        </view>
                                    </view>

                                    <!-- 西药 -->

                                    <block v-if="itemName.prescTypeCode == 'PT'">
                                        <view v-if="itemName.childOrd.length > 0">
                                            <view>{{ index + 1 }}、 {{ itemName.ordDesc }}</view>
                                            <view class="chufang1">
                                                <view class="item-aside"></view>
                                                <view class="item-main">
                                                    <view class="onebox">
                                                        <view class="one">
                                                            <view class="left">
                                                                <view class="name">
                                                                    <!-- <text>{{val.ordDesc}}</text> -->
                                                                </view>
                                                                <view class="yaopinguige flex-row">
                                                                    <view class="guige">
                                                                        <text>{{ itemName.spec }}</text>
                                                                    </view>
                                                                    <view class="num">
                                                                        x
                                                                        <text>{{ itemName.qtyUomStr }}</text>
                                                                    </view>
                                                                    <view class="ke">{{ itemName.doseUnitStr }}</view>
                                                                </view>
                                                            </view>
                                                            <view class="right">
                                                                x
                                                                <text>{{ itemName.durStr }}</text>
                                                            </view>
                                                        </view>
                                                    </view>
                                                </view>
                                            </view>

                                            <view v-for="(val, idx) in itemName.childOrd" :key="idx">
                                                <view class="chufang1">
                                                    <view class="item-aside"></view>
                                                    <view class="item-main">
                                                        <view class="onebox">
                                                            <view class="one">
                                                                <view class="left">
                                                                    <view class="name">
                                                                        <text>{{ val.ordDesc }}</text>
                                                                    </view>
                                                                    <view class="yaopinguige flex-row">
                                                                        <view class="guige">
                                                                            <text>{{ val.spec }}</text>
                                                                        </view>
                                                                        <view class="num">
                                                                            x
                                                                            <text>{{ val.qtyUomStr }}</text>
                                                                        </view>
                                                                        <view class="ke">{{ val.doseUnitStr }}</view>
                                                                    </view>
                                                                </view>
                                                                <view class="right">
                                                                    x
                                                                    <text>{{ val.durStr }}</text>
                                                                </view>
                                                            </view>
                                                        </view>
                                                    </view>
                                                </view>

                                                <!-- <view>{{val.ordDesc}}</view> -->
                                            </view>
                                            <view class="use">用法：{{ itemName.frequenceDesc }}，{{ itemName.usageDesc }}</view>
                                        </view>
                                        <view v-if="itemName.childOrd.length == 0">
                                            <view>{{ index + 1 }}、{{ itemName.ordDesc }} {{ itemName.spec }} {{ itemName.qtyUomStr }}</view>
                                            <view class="use">
                                                用法：{{ itemName.frequenceDesc }}，{{ itemName.usageDesc }}，{{ '每次' + itemName.doseUnitStr }}，{{ itemName.durStr }}
                                            </view>
                                        </view>
                                    </block>
                                </block>
                            </view>
                        </van-cell>

                        <view slot="title" v-if="item.elementTypeCode == 'RadioBox'">
                            <view
                                style="font-size: 30rpx; text-align: left !important; margin-left: 30rpx"
                                :class="'van-cell-text ' + (item.IEMRTempElementRequired == 'Y' ? 'required' : '') + ' '"
                            >
                                {{ item.IEMRTempElementDesc }}
                            </view>
                            <van-radio-group
                                group
                                :value="item.IEMRTempElementData"
                                :data-name="item.IEMRTempElementDesc"
                                @change="onChangeCheckBox($event, { name: item.IEMRTempElementDesc })"
                            >
                                <van-cell title-width="100px">
                                    <van-radio style="font-size: 30rpx" :name="elementDataset.id" v-for="(elementDataset, index1) in item.elementDataset" :key="elementDataset.id">
                                        {{ elementDataset.descripts }}
                                    </van-radio>
                                </van-cell>
                                <!-- <van-radio style="font-size: 30rpx;" wx:for-item="elementDataset" wx:key="{{elementDataset.id}}" wx:for="{{item.elementDataset}}" name="{{elementDataset.id}}">
							{{elementDataset.descripts}}
						</van-radio> -->
                            </van-radio-group>
                        </view>

                        <view v-else>
                            <van-cell-group>
                                <van-cell
                                    title-width="120rpx"
                                    class="fontS30"
                                    value-class="leftFont"
                                    :value="!item.IEMRTempElementData || item.IEMRTempElementData == '' ? ' ' : item.IEMRTempElementData"
                                    is-link
                                    center
                                    clickable
                                    use-label-slot
                                    :data-value="item.IEMRTempElementData"
                                    :data-tempCode="item.elementTypeCode"
                                    :data-name="item.IEMRTempElementDesc"
                                    :data-id="item.IEMRTempElementID"
                                    v-if="item.elementTypeCode !== 'Labelarea'"
                                    @tap.native="
                                        tapSelect($event, {
                                            value: item.IEMRTempElementData,
                                            tempCode: item.elementTypeCode,
                                            name: item.IEMRTempElementDesc,
                                            id: item.IEMRTempElementID
                                        })
                                    "
                                    style="flex: 1 1 auto"
                                >
                                    <view slot="title" v-if="item.elementTypeCode != 'RadioBox'">
                                        <view :class="'van-cell-text ' + (item.IEMRTempElementRequired == 'Y' ? 'required' : '') + ' '">{{ item.IEMRTempElementDesc }}</view>
                                    </view>
                                </van-cell>
                            </van-cell-group>
                        </view>
                    </view>
                </mp-cells>
            </view>
        </view>
        <view class="row">
            <view class="multiBtn-content">
                <button v-if="patientData.changeDataFlag != 'N'" class="multiBtn-right" :disabled="isLoading" @tap="add">{{ isLoading ? '保存中' : '保存' }}</button>
            </view>
        </view>
    </view>
</template>

<script>
import Cache from '../../../../../utils/cache';
// pages/diagnosticEntry/medicalRecord/medicalRecord.js
import { $http } from '../../../../../config/https';
import Util from '../../../../../utils/util.js';
import commonUtil from '../../../../../utils/common.js';
const app = getApp();
export default {
    components: {},
    data() {
        return {
            // hasSave:false, //是否保存完成,true是保存后,默认false
            diagTypeIndex: 0,

            //门诊
            diagType: [],

            //门诊
            admList: [],

            userName: '',

            baseInfo: {
                patAge: '',
                patSexDesc: '',
                patName: ''
            },

            diagnoseObj: [],
            orderPresc: [],
            childOrd: [],
            selectShow: false,
            height: app.globalData.height,
            editData: [],
            requiredData: [6, 7, 22, 8, 10, 12],

            patientData: {
                changeDataFlag: ''
            },

            isLoading: false,
            result: '',
            elementDataset: [],
            dataSource: [],
            entryedText: '',
            calldiagnoseObj: '',
            callorderPresc: '',
            name: '',

            val: {
                ordDesc: '',
                spec: '',
                qtyUomStr: '',
                doseUnitStr: '',
                durStr: ''
            }
        };
    },
    /**
     * 可以使用全局样式
     */
    options: {
        addGlobalClass: true
    },
    /**
     * 组件的属性列表
     */
    props: {},
    destroyed: function () {
        // 在组件实例被从页面节点树移除时执行
    },
    mounted() {
        // 处理小程序 attached 生命周期
        this.attached();
        // 处理小程序 ready 生命周期
        this.$nextTick(() => this.ready());
    },
    /**
     * 组件的方法列表
     */
    methods: {
        ready: function () {
            // this.getHistory();
            // 在组件在视图层布局完成后执行
            this.selectData(); // 获取 下拉框数据
            this.getFind(); // 获取 下拉框数据
            let userData = Cache.get('userData');
            let { userName } = userData;
            this.setData({
                userName: userName
            });
            let that = this;
            commonUtil.canChangeFlag('', (res) => {
                that.setData({
                    patientData: Cache.get('patientData')
                });
            });
        },

        attached: function () {},
        handlePageShow() {},

        userNameFun: function (e) {
            this.setData({
                userName: e.detail.value
            });
        },

        onChangeCheckBox(e, _dataset) {
            /* ---处理dataset begin--- */
            this.handleDataset(e, _dataset);
            /* ---处理dataset end--- */
            var value = e.detail;
            var desc = e.currentTarget.dataset.name;
            let _this = this;
            let newadmlist = _this.admList;
            newadmlist.map((el) => {
                if (el.IEMRTempElementDesc == desc) {
                    if (el.IEMRTempElementData == value) {
                        el.IEMRTempElementData = '';
                    } else {
                        el.IEMRTempElementData = value;
                    }
                }
            });
            _this.setData({
                admList: newadmlist
            });
            // if(event.detail == this.data.radio) {
            //   this.setData({
            //     result: '',
            //   });
            //   return;
            // }
            // this.setData({
            //   result: event.detail,
            // });
        },

        onClick(event) {
            const { name } = event.currentTarget.dataset;
            if (name == this.result) {
                this.setData({
                    result: ''
                });
                return;
            }
            this.setData({
                result: name
            });
        },

        //门诊
        bindPickerChange2: function (e) {
            // console.log('e', e)
            this.setData(
                {
                    diagTypeIndex: e.detail.value
                },
                () => this.getSearch(this.diagType[e.detail.value].IEMRTemplateID)
            );
        },

        selectData3: function () {
            this.setData({
                selectShow: true
            });
        },

        onClose() {
            this.setData({
                selectShow: false
            });
        },

        onSelect(event) {
            // console.log('event', event);
            this.setData(
                {
                    diagTypeIndex: event.detail.key,
                    selectShow: false
                },
                () => {
                    this.getSearch(event.detail.IEMRTemplateID);
                }
            );
        },

        // 主诉
        tapSelect: function (e, _dataset) {
            /* ---处理dataset begin--- */
            this.handleDataset(e, _dataset);
            /* ---处理dataset end--- */
            let that = e.currentTarget.value;
            if (e.currentTarget.dataset.tempcode == 'RadioBox') {
                return;
            }
            // console.log('tapSelect-e', e)
            let _this = this;
            uni.navigateTo({
                //目的页面地址
                url:
                    '/pages/components/mesicalRcordSelect/mesicalRcordSelect?content=' +
                    (e.currentTarget.dataset.value ? e.currentTarget.dataset.value : '') +
                    '&name=' +
                    (e.currentTarget.dataset.name ? e.currentTarget.dataset.name : '') +
                    '&ID=' +
                    e.currentTarget.dataset.id,
                events: {
                    // 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
                    acceptDataFromOpenedPage: function (data) {
                        // console.log('acceptDataFromOpenedPage', data, _this.data.admList)
                        let newadmlist = _this.admList;
                        newadmlist.map((el) => {
                            if (el.IEMRTempElementDesc == e.currentTarget.dataset.name) {
                                el.IEMRTempElementData = data.data;
                            }
                        });
                        _this.setData({
                            admList: newadmlist
                        });
                    }
                    // someEvent: function(data) {
                    //   console.log('someEvent', data)
                    // }
                },

                success: function (res) {
                    // console.log('tapSelect-s', res)
                    // 通过eventChannel向被打开页面传送数据
                    // res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test-跳转' })
                }
            });
        },

        // 获取 下拉框数据
        selectData: function () {
            let userData = Cache.get('userData');
            let patientData = Cache.get('patientData');
            let { admID } = patientData;
            $http.post('urlDeault', this, {
                code: '10020001',
                data: {
                    params: [
                        {
                            admID: admID,
                            hospID: userData.hospID
                        }
                    ]
                },
                success: function (res) {
                    // console.log('res', res)
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        for (var i = 0; i < res.result.TemplateList.length; i++) {
                            res.result.TemplateList[i].text = res.result.TemplateList[i].name;
                            res.result.TemplateList[i].color = res.result.TemplateList[i].entryedFlag;
                            res.result.TemplateList[i].key = i;
                        }
                        this.setData(
                            {
                                diagType: res.result.TemplateList,
                                entryedText: res.result.entryedText
                            },
                            () => this.getSearch(this.diagType[0].IEMRTemplateID)
                        );
                    }
                }
            });
        },

        // clearn 清空
        // clearn: function () {
        //   // console.log(1111111111)
        //   this.setData({
        //     diagTypeIndex: 0, //门诊
        //   }, () => this.getSearch(this.data.diagType[0].IEMRTemplateID))
        // },
        // 查询病历模板默认信息
        getFind: function () {
            let patientData = Cache.get('patientData');
            let userData = Cache.get('userData');
            let { admID } = patientData;
            $http.post('urlDeault', this, {
                code: '10020004',
                data: {
                    params: [
                        {
                            admID: admID,
                            hospID: userData.hospID
                        }
                    ]
                },
                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        this.setData(
                            {
                                baseInfo: res.result.baseInfo,
                                diagnoseObj: res.result.diagnoseObj,
                                orderPresc: res.result.orderPresc,
                                childOrd: res.result.childOrd
                            },
                            () => {
                                let { calldiagnoseObj, callorderPresc } = this;
                                if (calldiagnoseObj) {
                                    this.setData({
                                        diagnoseObj: calldiagnoseObj
                                    });
                                }
                                if (callorderPresc) {
                                    this.setData({
                                        orderPresc: callorderPresc
                                    });
                                }
                            }
                        );
                    }
                }
            });
        },

        //查询遍历接口
        getSearch: function (IEMRTemplateID) {
            let patientData = Cache.get('patientData');
            $http.post('urlDeault', this, {
                code: '10020002',
                data: {
                    params: [
                        {
                            admID: patientData.admID,
                            patID: patientData.patID,
                            IEMRTemplateID //病历模板元素表记录ID
                        }
                    ]
                },

                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        this.setData(
                            {
                                admList: res.result,
                                elementDataset: res.result.elementDataset
                            },
                            () => {
                                let { editDataFun: editData, admList } = this;
                                if (editData.length > 0) {
                                    this.editDataFun(admList);
                                }
                                this.getFind();
                            }
                        );
                    }
                }
            });
        },

        //add 保存
        add: function () {
            this.setData({
                isLoading: true
            });
            // var that=this;
            let patientData = Cache.get('patientData');
            let userData = Cache.get('userData');
            let { admID, patID } = patientData;
            let { userID } = userData;
            // console.log(admID, patID, userID, this.data.admList)
            let detailArr = [];
            this.admList.map((el) => {
                detailArr.push({
                    IEMRTempElementID: el.IEMRTempElementID,
                    IEMRTempElementData: el.IEMRTempElementData
                });
            });
            // console.log('detailArr', detailArr)

            let params = {
                params: [
                    {
                        IEMRTemplateID: this.diagType[this.diagTypeIndex].IEMRTemplateID,
                        //患者病历主记录ID
                        admID: admID || '',
                        // 就诊ID session 中获取
                        patID: patID || '',
                        // 病人ID session 中获取
                        updateUserID: userID || '',
                        // 用户ID session 中获取
                        // detailData
                        detailData: detailArr
                    }
                ]
            };
            $http.post('urlDeault', this, {
                code: '10020003',
                data: params,
                success: function (res) {
                    this.setData({
                        isLoading: false
                    });
                    // console.log('res', res)
                    if (res.errorCode == '0') {
                        uni.showToast({
                            title: res.errorMessage,
                            icon: 'none'
                        });
                        this.selectData();
                        this.getFind();
                    }
                },
                fail: function () {
                    this.setData({
                        isLoading: false
                    });
                }
            });
        },

        // 历史病历
        historyTreatment: function (e) {
            // 历史病历
            uni.navigateTo({
                //目的页面地址
                url: '/pages/myConsultRoom/page/historyTreatment/historyTreatment?Type=2' // 历史病历,
            });
        },

        callDataEdit: function (obj) {
            let { diagType } = this;
            let { select, data, diagnoseObj, orderPresc } = obj;
            let IEMRTemplateID = select.IEMRTemplateID;
            this.setData(
                {
                    diagTypeIndex: this.picakIndex('IEMRTemplateID', IEMRTemplateID, diagType),
                    editData: data,
                    calldiagnoseObj: diagnoseObj,
                    callorderPresc: orderPresc
                },
                () => {
                    this.getSearch(IEMRTemplateID);
                }
            );
        },

        // 回显
        editDataFun: function (data) {
            let { editDataFun: editData } = this;
            for (let i = 0; i < editData.length; i++) {
                for (let j = 0; j < data.length; j++) {
                    if (data[j].IEMRTempElementID === editData[i].IEMRTempElementID) {
                        data[j].IEMRTempElementData = editData[i].IEMRTempElementData || editData[i].IEMRMoudleElementData;
                    }
                }
            }
            this.setData(
                {
                    admList: data
                },
                () => {
                    this.setData({
                        editData: []
                    });
                }
            );
        },

        // 获取索引值picker
        picakIndex: function (name, id, arr) {
            let index = '';
            if (!arr) {
                return false;
            }
            arr.map((item, i) => {
                if (item[name] == id) {
                    index = i;
                }
            });
            return parseFloat(index);
        },

        requiredDataFun: function (str) {
            console.log(str);
            let { requiredData } = this;
            if (requiredData.includes(str)) {
                return true;
            } else {
                return false;
            }
        }
    },
    created: function () {}
};
</script>
<style>
/* @import '../diagnostic/addDiagnostic/addDiagnostic.css'; */

/* @import "../Entry/diagnostic/addDiagnostic/addDiagnostic.css"; */

.diagnosticcontent {
    background: #fff;
}

.diagnostic-wrapper {
    overflow: hidden;
    height: 100%;
}

.item {
    width: 100%;
    display: flex;
    height: 80rpx;
    justify-content: space-between;
    /* align-items: center; */
    text-align: right;
}

.already {
    color: #f00;
}

.BaseInfo {
    float: left;
    width: 25%;
}

.boxcontentBox {
    padding: 0px 0px 0px 7px;
    margin-left: 30rpx;
    height: 40rpx;
    line-height: 40rpx;
}

.baseinfo1 {
    /* display:inline; */
    float: right;
    text-align: center;
    padding: 0 20rpx;
}

.borderright {
    border-right: 1px solid var(--weui-FG-3);
}

.btn {
    margin-left: 10rpx;
    width: 30% !important;
    display: inline-block;
    font-size: 35rpx;
    color: #fff;
    border: none;
    border-radius: 8rpx;
    font-weight: normal;
    padding: 0 10px !important;
    height: 80rpx !important;
    line-height: 80rpx !important;
    margin-top: 60rpx;
}

.clearnbtn {
    background: #fff;
    color: #000;
    border: 2rpx solid #eee;
    margin-right: 30rpx !important;
}

.addbtn {
    background: #0ac062;
    border: 2rpx solid #0ac062;
}

.pre_item {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pre_item_inner {
    width: 100%;
    flex: 9;
}

.pre_item_info {
    width: 100%;
    display: flex;
}

.pre_item_info view {
    width: 100%;
}

.pre_right {
    width: 100%;
    flex: 2;
    margin-left: 20rpx;
    border-left: 1px solid #000;
}

.chufang-box {
    margin: 0;
    /* border-top:1px solid #ccc; */
    /* color:var(--weui-FG-1); */
}

/* .chufang1,.chufang2 {border-top:1px solid var(--weui-FG-3)} */

.chufang1 {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20rpx;
}

.chufang1 .item-aside {
    padding-top: 20rpx;
    flex: 0 0 auto;
    width: 40rpx;
}

.chufang1 .item-main {
    flex: 1 1 auto;
}

/*一个药品*/

.chufang1 .one {
    margin-top: 20rpx;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
}

.chufang1 .one .left {
    flex: 1 1 auto;
    border-right: 1px solid #ccc;
}

.chufang1 .one .right {
    flex: 0 0 140rpx;
    text-align: center;
    align-self: center;
}

.chufang1 .yaopinguige {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
}

.chufang1 .yaopinguige .guige {
    flex: 1 1 60%;
}

.chufang1 .yaopinguige .num {
    flex: 1 1 20%;
    text-align: center;
}

.chufang1 .yaopinguige .ke {
    flex: 1 1 20%;
    text-align: center;
}

.chufang2 {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 10rpx;
}

.chufang2 .item-aside {
    padding-top: 20rpx;
    flex: 0 0 auto;
    width: 40rpx;
}

.chufang2 .item-main {
    flex: 1 1 auto;
    /* border-top: 1px solid var(--weui-FG-3); */
}

.chufang2 .one {
    margin-top: 20rpx;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
}

.chufang2 .one .left {
    flex: 1 1 auto;
    /* border-right:1px solid #ccc; */
}

.chufang2 .one .right {
    flex: 0 0 140rpx;
    text-align: center;
    align-self: center;
}

.chufang2 .yaopinguige {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
}

.chufang2 .yaopinguige .guige {
    flex: 1 1 60%;
}

.chufang2 .yaopinguige .num {
    flex: 1 1 20%;
    text-align: center;
}

.chufang2 .yaopinguige .ke {
    flex: 1 1 20%;
    text-align: center;
}

/* .flex */

.custombutton {
    height: 80rpx;
    font-size: 30rpx;
    color: #fff;
    padding: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 10px 10px;
    display: flex;
}

.custom-btnleft {
    flex: 1;
    margin: 0 10rpx;
    align-items: center;
    justify-content: center;
    display: flex;
}

.custom-btnright {
    flex: 1;
    margin: 0 10rpx;
    align-items: center;
    justify-content: center;
    display: flex;
    background-color: #1890ff;
    color: #fff;
}

.fixedTop {
    overflow: auto;
}

.herbstemp {
    display: flex;
    background-color: #fff;
    /* padding-left: 10rpx; */
    padding-bottom: 12rpx;
}

.herbs-item-comPrincipletemp {
    font-size: 24rpx;
    height: 40rpx;
    width: 72rpx;
    padding-top: 6rpx;
    text-align: center;
    color: #fff;
}

.herbs-item-medItemMed {
    font-size: 28rpx;
    margin-left: 25rpx;
}

.herbs-item-decoctMethodMed {
    margin-left: 25rpx;
}

.use {
    margin-left: 42rpx;
    margin-bottom: 10rpx;
}

/* .usetemp{
  margin-left: 42rpx;
} */

.child2 {
    margin-left: 2rpx;
    margin-top: -20rpx;
}

.leftFont {
    text-align: left !important;
}
</style>
