<template>
    <div class="p-3">
        <div class="bg-fff flex1 ov-hd d-flex flex-cln">
            <div class="d-flex a-c pd-16 border-bottom">
                <div class="f-s-20 c-333 f-w-7 mr-10">会员审核</div>
                <el-button @click="router.go(-1)" type="primary" text>
                    <el-icon>
                        <Back />
                    </el-icon>
                    返回上一级
                </el-button>
            </div>
            <div class="flex1 over-auto">
                <div class="pd-16">
                    <div class="info-title f-s-16 c-333 f-w-7 mb-10">企业基本信息</div>
                    <el-descriptions :column="4">
                        <el-descriptions-item label="企业名称:">{{ form?.cpyName || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="统一社会信用代码:">{{ form?.creditCode || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="会员级别:">{{ form?.vipLevelName || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="法人姓名:">{{ form?.legalPersonName || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="法人职务:">{{ form?.legalPersonPosition || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="法人电话:">{{ form?.legalPersonPhone || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="注册类型:">{{ form?.regType || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="主管部门:">{{ form?.department || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="企业注册资金:">
                            {{ form?.registeredCapital || '-' }}
                        </el-descriptions-item>
                        <el-descriptions-item label="企业成立时间:">
                            {{ form?.establishDate || '-' }}
                        </el-descriptions-item>
                        <el-descriptions-item label="企业位置（经纬度）:">
                            {{ form?.registeredCapital || '-' }}
                        </el-descriptions-item>
                        <el-descriptions-item label="企业详细地址:">
                            {{ form?.address || '-' }}
                        </el-descriptions-item>
                        <el-descriptions-item label="经营范围:">
                            {{ form?.businessScope || '-' }}
                        </el-descriptions-item>
                        <el-descriptions-item label="承担项目:">
                            {{ form?.undertakenProjects || '-' }}
                        </el-descriptions-item>
                        <el-descriptions-item label="取得成就:">
                            {{ form?.achievements || '-' }}
                        </el-descriptions-item>
                        <el-descriptions-item label="单位负责人:">{{ form?.contact || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="单位负责人联系电话:">{{ form?.contactTel || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="邮箱">{{ form?.email || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="单位简介:" :span="2">{{ form?.introduction || '-' }}</el-descriptions-item>
                    </el-descriptions>
                    <el-divider />
                    <el-descriptions :column="3" direction="vertical">
                        <el-descriptions-item label="营业执照:">
                            <el-image class="bg-ccc" style="width: 100px; height: 100px" :src="form?.license" :zoom-rate="1.2" :max-scale="7" :min-scale="0.2" :preview-src-list="[form?.license]" fit="contain" />
                        </el-descriptions-item>
                        <el-descriptions-item label="法人身份证:">
                            <el-image :zoom-rate="1.2" :max-scale="7" :min-scale="0.2" :preview-src-list="[form?.legalPersonIdFront]" class="mr-10 bg-ccc" style="width: 180px; height: 100px" :src="form?.legalPersonIdFront" fit="contain" />
                            <el-image style="width: 180px; height: 100px" class="bg-ccc" :zoom-rate="1.2" :max-scale="7" :min-scale="0.2" :preview-src-list="[form?.legalPersonIdBack]" :src="form?.legalPersonIdBack" fit="contain" />
                        </el-descriptions-item>
                        <el-descriptions-item label="公司荣誉证书等资料:">
                            <template v-for="(item, index) in form?.companyCertificate" :key="index">
                                <el-image class="bg-ccc mr-10" :initial-index="index" :preview-src-list="form?.companyCertificate" style="width: 100px; height: 100px" :src="item" fit="contain" />
                            </template>
                        </el-descriptions-item>
                    </el-descriptions>
                    <el-divider />
                    <div class="info-title f-s-16 c-333 f-w-7 mb-10">药材种植信息</div>
                    <vxe-table :data="form?.plantingInfo" border min-height="0" max-height="100%">
                        <vxe-column type="seq" width="60" title="序号" :formatter="colNoData"></vxe-column>
                        <vxe-column field="variety" title="品种" :formatter="colNoData"></vxe-column>
                        <vxe-column field="plantingDuration" title="种植年限" :formatter="colNoData"></vxe-column>
                        <vxe-column field="production" title="药材年产量" :formatter="colNoData"></vxe-column>
                        <vxe-column field="plantingArea" title="种植面积" :formatter="colNoData"></vxe-column>
                        <vxe-column field="baseName" title="基地名称" :formatter="colNoData"></vxe-column>
                        <vxe-column field="basePlace" title="基地详细地址" :formatter="colNoData"></vxe-column>
                        <vxe-column field="basePosition" title="基地经纬度" :formatter="colNoData"></vxe-column>
                    </vxe-table>
                    <el-divider />
                    <div class="info-title f-s-16 c-333 f-w-7 mb-10">缴费信息</div>
                    <el-descriptions :column="4">
                        <el-descriptions-item label="缴费类型:">{{ form?.vipLevelName || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="缴费金额:">{{ form?.paymentAmount || '-' }}元</el-descriptions-item>
                        <el-descriptions-item label="缴费人:">{{ form?.payManName || '-' }}</el-descriptions-item>
                        <el-descriptions-item label="缴费时间:">{{ form?.payDate || '-' }}</el-descriptions-item>
                    </el-descriptions>
                </div>
                <div v-if="!+form?.reviewStatus" class="btn-wrap pd-30 d-flex a-c j-c">
                    <el-button @click="router.go(-1)">取消</el-button>
                    <el-button @click="showNoPass = true" type="danger">不通过</el-button>
                    <el-button @click="showPass = true" type="primary">通过</el-button>
                </div>
            </div>
        </div>
    </div>
    <CheckPass v-if="showPass" v-model:show="showPass" :info="form" @success="router.go(-1)"></CheckPass>
    <CheckNoPass v-if="showNoPass" v-model:show="showNoPass" :info="form" @success="router.go(-1)"></CheckNoPass>
</template>

<script setup name="Check-detail" lang="ts">
import { getMember } from '@/api/dgtmedicine/member/index'
import { colNoData } from '@/utils/noData'
import { CheckPass, CheckNoPass } from '../model/index'
const router = useRouter()
const { query }: any = useRoute()
const form = ref<any>({})
const showPass = ref(false)
const showNoPass = ref(false)
// 获取详情
const getDetail = async () => {
   const { data } = await getMember(query?.id)
   form.value = data
}
onMounted(() => {
   getDetail()
})
</script>
