<template>
    <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom  scroll-with-animation>
        <template #top>
            <ut-navbar title="包装任务详情" :fixed="false" border></ut-navbar>
        </template>
        <view class="d-flex a-c pd3-30-24-0 f-s-30 f-w-5">
            <view @click="changeTebs" class="pd2-20-36 card-item-box mr-10">{{ form?.refType == '2' ? '打印详情' : '关联详情' }}</view>
            <view class="pd2-20-36 card-item-box active">包装任务信息</view>
        </view>
        <view class="bg-fff pd-24">
            <view class="f-s-30 pd2-16-0 info-border-bottom">
                <span class="c-#666">包装对象：</span>
                <span class="c-#333">挖个坑</span>
            </view>
            <view class="f-s-30 pd2-16-0 info-border-bottom">
                <span class="c-#666">本次包装使用量：</span>
                <span class="c-#333">{{ form?.storageUseAmount }}{{ form?.storageUseUnit }}</span>
            </view>
            <view class="f-s-30 pd2-16-0 info-border-bottom">
                <span class="c-#666">包装规格：</span>
                <span class="c-#333">{{ form?.capacity }}{{ form?.storageUseUnit }}/{{ form?.unit }}</span>
            </view>
            <view class="f-s-30 pd2-16-0 info-border-bottom">
                <span class="c-#666">包装日期：</span>
                <span class="c-#333">{{ getDateRangeFrt(form?.packagingDateStart, form?.packagingDateStart) }}</span>
            </view>
            <view class="f-s-30 pd2-16-0 info-border-bottom">
                <span class="c-#666">包装批号：</span>
                <span class="c-#333">{{ form?.packSn || '-' }}</span>
            </view>
            <view class="f-s-30 pd2-16-0 info-border-bottom">
                <span class="c-#666">成品批号：</span>
                <span class="c-#333">{{ form?.batchSn || '-' }}</span>
            </view>
            <view class="f-s-30 pd2-16-0 info-border-bottom">
                <span class="c-#666">保质期：</span>
                <span class="c-#333">{{ form?.expireDate || '-' }}{{ form?.expireDateUnit }}</span>
            </view>
            <view class="f-s-30 pd2-16-0 info-border-bottom">
                <span class="c-#666">赋码方式：</span>
                <span class="c-#333">{{ selectDictLabel(pt_pack_ref_type, form?.refType) }}</span>
            </view>
        </view>
    </z-paging>
</template>
<script setup lang="ts">
import { useClientRequest } from '@/utils/request';
const paging = ref(null);
const props = defineProps({
    packId: {
        type: String,
        default: '',
    },
    form: {
        type: Object,
        default: () => null,
    },
    dict: {
        type: Object,
        default: () => null,
    },
});
const { pt_pack_ref_type } = toRefs(props?.dict);
const emit = defineEmits(['changeTebs']);
const changeTebs = () => {
    if (props?.form?.refType == '2') {
        emit('changeTebs', 'print');
    } else {
        emit('changeTebs', 'relate');
    }
    
};
</script>
<style lang="scss" scoped>
.card-item-box {
    color: #999;
    border-radius: 10rpx 10rpx 0 0;

    &.active {
        color: $u-primary;
        background-color: #fff;
    }
}
</style>
