<template>
    <template v-if="data?.length">
        <template v-for="(item, index) in data" :key="index">
            <template v-if="item.fieldType === '1'">
                <el-form-item prop="1" label="其他证明材料（选填）">
                    <div class="flex1">
                        <FileLook v-model="item.fileValue" :span="18"></FileLook>
                    </div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '2'">
                <el-form-item prop="time" label="证件有效期至">
                    <div>{{ item.secularValue == 1 ? '长期有效' : item.fieldValue }}</div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '3'">
                <el-form-item prop="3" label="经营许可分类">
                    <div class="flex1">
                        <dict-tag :options="business_license" :value="item.fieldValue"></dict-tag>
                    </div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '4'">
                <el-form-item prop="4" label="药品生产许可证分类码">
                    <div class="flex1 d-flex flex-cln">
                        <div v-for="sitem in item.fieldValue" :key="sitem">
                            <dict-tag :options="drug_production_license" :value="sitem"></dict-tag>
                        </div>
                    </div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '5'">
                <el-form-item prop="5" label="药品生产许可号">
                    <div>{{ item.fieldValue }}</div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '6'">
                <el-form-item prop="6" label="药品生产许可证书">
                    <div class="flex1">
                        <FileLook v-model="item.fileValue" :span="18"></FileLook>
                    </div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '7'">
                <el-form-item prop="7" label="药品经营许可证号">
                    <div>{{ item.fieldValue }}</div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '8'">
                <el-form-item prop="8" label="药品经营许可证书">
                    <div class="flex1">
                        <FileLook v-model="item.fileValue" :span="18"></FileLook>
                    </div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '9'">
                <el-form-item prop="9" label="食品生产许可证号">
                    <div>{{ item.fieldValue }}</div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '11'">
                <el-form-item prop="11" label="食品生产许可证书">
                    <div class="flex1">
                        <FileLook v-model="item.fileValue" :span="18"></FileLook>
                    </div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '12'">
                <el-form-item prop="12" label="食品经营许可证号">
                    <div>{{ item.fieldValue }}</div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '13'">
                <el-form-item prop="13" label="食品经营许可证书">
                    <div class="flex1">
                        <FileLook v-model="item.fileValue" :span="18"></FileLook>
                    </div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '14'">
                <el-form-item prop="14" label="业务范围">
                    <div>{{  selectDictLabels(business_scope1, item.fieldValue, ',') }}</div>
                </el-form-item>
            </template>
            <template v-if="item.fieldType === '15'">
                <el-form-item prop="14" label="业务范围">
                    <div>{{  selectDictLabels(business_scope2, item.fieldValue, ',') }}</div>
                </el-form-item>
            </template>
        </template>
    </template>
    <template v-else>
        <el-empty :image-size="180" description="无"></el-empty>
    </template>
</template>
<script setup name="CertMaterials" lang="ts">

import { propTypes } from '@/utils/propTypes';
import { FileLook } from '@/views/models';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const props = defineProps({
    data: propTypes.array.def([])
});
const { business_license, drug_production_license, business_scope1, business_scope2 } = toRefs<any>(
    proxy?.useDict('business_license', 'drug_production_license', 'business_scope1', 'business_scope2')
);
</script>
