<template>
    <div :class="sizeTypeClass">
        <div class="content">
            <div class="print-logo">
                <j-image-upload class="avatar-uploader" text="上传" v-model="defModel.hotelLogo" ></j-image-upload>
            </div>
            <div class="print-title">{{ storeInfo.name }}续住单</div>

            <div class="print-fee-info">
                <div class="print-fee-item-wrapper row">
                    <div class="print-fee-title">打印时间:</div>
                    <div class="print-fee-value">{{ printDate }}</div>
                </div>
            </div>

            <div class="print-feesinfo">
                <div class="print-fee-item-wrapper border-bottom">
                    <div class="print-fee-title">客人姓名</div>
                    <div class="print-fee-value"></div>
                </div>
                <div class="print-fee-item-wrapper border-bottom">
                    <div class="print-fee-title">房号</div>
                    <div class="print-fee-value"></div>
                </div>
                <div class="print-fee-item-wrapper border-bottom">
                    <div class="print-fee-title">原离店时间</div>
                    <div class="print-fee-value"></div>
                </div>
                <div class="print-fee-item-wrapper border-bottom">
                    <div class="print-fee-title">新离店时间</div>
                    <div class="print-fee-value"></div>
                </div>
                <div class="print-fee-item-wrapper">
                    <div class="print-fee-title">备注</div>
                    <div class="print-fee-value"></div>
                </div>
            </div>

            <pre style="white-space: pre-wrap;" class="print-def-content">{{ defContent }}</pre>


            <div class="print-fee-item-wrapper">
                <div class="print-fee-value" style="text-align: right">操作员:{{ nickname() }}</div>
            </div>
            <div class="print-fee-item-wrapper" style="font-weight: 600;font-size: 16px;">
                <div>住客签字:</div>
                <div class="print-fee-value value-underline"></div>
            </div>
        </div>
    </div>
</template>

<script>
    import { mapActions, mapGetters, mapState } from 'vuex'
    import { httpAction, getAction } from '@/api/manage'
    export default {
        props: {
            title: {
                type: String,
                default: '续住单'
            },
            sizeTypeClass: {
                type: String,
                default: "mm58"
            },
            feeInfo: {
                type: Object,
                default() {
                    return {
                        no: "NO202305172255",
                        payType:'现金',
                        money: 198,
                    }
                }
            },
            defModel:{
                type:Object,
                default(){
                    return {
                    }
                }
            },
            defContent: {
                type: String,
                default: ""
            }
        },
        data() {
            let storeInfo = JSON.parse(localStorage.getItem("storeInfo"))
            return {
                storeInfo,
                printDate: new Date().format('yyyy/MM/dd hh:mm:ss')
            }
        },
        created() {
        },
        methods: {
            ...mapGetters(["nickname", "avatar", "userInfo"]),
        }
    }
</script>

<style lang="less">
    .content{
        width: 94%;
        margin: auto;
    }
    .print-feesinfo{
        border: 1px solid #1d1a1a
    }
    .border-bottom{
        border-bottom: 1px solid #1d1a1a
    }
    .mm58 {
        width: 58mm;
        border: 1px solid #00000055;

        .print-title {
            text-align: center;
            font-size: 16px;
            font-weight: 600;
        }
    }

    .mm80 {
        width: 80mm;
        border: 1px solid #00000055;
        padding-left: 3mm;

        .print-fee-info {
            display: flex;
            flex-wrap: wrap;

            .print-fee-item-wrapper {
                width: 60%;
            }

            .small-item {
                width: 40%;

                .print-fee-value {
                    margin-right: 3mm;
                }
            }

            .print-fee-title {
                width: fit-content;
                text-align: right;
            }

            .row .print-fee-title {
                width: 30%;
            }

        }

        .print-title {
            text-align: center;
            font-size: 16px;
            font-weight: 600;
        }
    }

    .a5 {
        width: 210mm;
        border: 1px solid #00000055;
        padding: 3mm;

        .print-fee-info {
            display: flex;
            flex-wrap: wrap;


            .print-fee-item-wrapper {
                width: 50%;
            }

            .row{
                width: 100%;
            }

            .print-fee-title {
                width: 20%;
                text-align: right;
            }

            .row .print-fee-title {
                width: 10%;
            }

        }

        .print-no{
            text-align: center;
        }
        .print-title {
            text-align: center;
            font-size: 16px;
            font-weight: 600;
        }
        .a5-partail{
            display: flex;
            flex-wrap: wrap;
            .print-fee-item-wrapper {
                margin: 3mm 0;
                width: 45%;
            }
            .row{
                width: 100%;
            }
        }
    }

    .print-no {
        text-align: left;
        font-weight: 600;
    }

    .print-fee-item-wrapper {
        display: flex;
        width: 100%;
        padding: 4px 0;
        font-size: small;

        .print-fee-title {
            width: 65px;
            text-align: right;
        }

        .print-fee-value {
            flex: 1;
        }

        .value-underline {
            border-bottom: 1px solid #00000088;
        }
    }

    .print-fees {
        margin-bottom: 5px;
    }

    .fee-row {
        display: flex;
        margin-left: 2px;

        .fee-cell {
            color: black;
            flex: 1;
            margin: 0 3px;
            font-size: smaller;
            text-align: left;
        }

        .flex-2 {
            flex: 1.5;
        }

        .flex-3 {
            flex: 2;
        }
    }

    .info-split-dashed {
        margin: 8px 0;
        border: 1px dashed #000000;


    }

    .info-split {
        border: 1px solid #000000;
        width: 100%;
        margin: 8px 0;
    }

    .qr-code-wrapper {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;

    }

    .code-content {
        width: 150px;
        height: 150px;
        background-image: url('data:image/jpeg;base64,[encoded data, 25532 characters]');
    }
</style>
