<template>
    <div>
        <el-table :data="sysList" style="width: 100%" border>
            <el-table-column label="序号" type="index"></el-table-column>
            <el-table-column
                label="第三方系统名称"
                prop="sysName"
                show-overflow-tooltip
            ></el-table-column>

            <el-table-column
                label="第三方产品名称"
                prop="thirdName"
                show-overflow-tooltip
            ></el-table-column>
            <el-table-column
                label="第三方产品ID"
                prop="thirdId"
                show-overflow-tooltip
            ></el-table-column>
        </el-table>
        <el-table
            v-loading="loading"
            :data="detailList"
            style="width: 100%; margin-top: 20px"
            border
            @current-change="handleDetail"
        >
            <el-table-column
                label="产品标识"
                prop="nameCode"
                show-overflow-tooltip
            ></el-table-column>

            <el-table-column
                label="产品通用名"
                prop="cpmctymc"
                show-overflow-tooltip
            ></el-table-column>
            <el-table-column
                label="包装级别"
                prop="packLevel"
                show-overflow-tooltip
            ></el-table-column>
            <el-table-column
                label="包装层级"
                prop="bzcj"
                show-overflow-tooltip
            ></el-table-column>
        </el-table>

        <el-form
            :model="editQuery"
            ref="editQuery"
            label-width="100px"
            style="margin-top: 20px"
        >
            <el-row :gutter="20" class="el-row" type="flex">
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>产品名称:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            size="small"
                            splaceholder="请输入内容"
                            :disabled="true"
                            v-model="editQuery.cpmctymc"
                        ></el-input>
                    </div>
                </el-col>
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>产品标识:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.nameCode"
                        ></el-input>
                    </div>
                </el-col>


            </el-row>

            <el-row :gutter="20" class="el-row" type="flex">
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>规格型号:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.ggxh"
                        ></el-input>
                    </div>
                </el-col>

                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>器械类别:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.qxlb"
                        ></el-input>
                    </div>
                </el-col>
            </el-row>
            <el-row :gutter="20" class="el-row" type="flex">
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>产品类别:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.cplb"
                        ></el-input>
                    </div>
                </el-col>
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>分类编码:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.flbm"
                        ></el-input>
                    </div>
                </el-col>

            </el-row>
            <el-row :gutter="20" class="el-row" type="flex">

                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>商品条码:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.sptm"
                        ></el-input>
                    </div>
                </el-col>
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>医保编码:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.ybbm"
                        ></el-input>
                    </div>
                </el-col>
            </el-row>
            <el-row :gutter="20" class="el-row" type="flex">

                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>医疗器械注册人:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="ylqxzcrbarmc"
                            v-model="editQuery.ylqxzcrbarmc"
                        ></el-input>
                    </div>
                </el-col>
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>注册人英文名称:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.ylqxzcrbarywmc"
                        ></el-input>
                    </div>
                </el-col>

            </el-row>
            <el-row :gutter="20" class="el-row" type="flex">

                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>统一社会信用号:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.tyshxydm"
                        ></el-input>
                    </div>
                </el-col>
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>注册证/备案号:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.zczbhhzbapzbh"
                        ></el-input>
                    </div>
                </el-col>
            </el-row>
            <el-row :gutter="20" class="el-row" type="flex">
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>上级产品编码:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="true"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.sjcpbm"
                        ></el-input>
                    </div>
                </el-col>

                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>包装级别:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            size="small"
                            splaceholder="请输入内容"
                            :disabled="true"
                            v-model="editQuery.packLevel"
                        ></el-input>
                    </div>
                </el-col>
            </el-row>
            <el-row :gutter="20" class="el-row" type="flex">
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>包装单位/包装级别:&nbsp;</span>
                        </div>

                        <el-input
                            style="width: 65%"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.bzcj"
                            :disabled="true"

                        ></el-input>
                    </div>
                </el-col>

                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>包含下级包装数量:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            size="small"
                            splaceholder="请输入内容"
                            :disabled="true"
                            v-model="editQuery.bhxjsl"
                        ></el-input>
                    </div>
                </el-col>
            </el-row>
            <el-row :gutter="20" class="el-row" type="flex">
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>包含下级产品编码:&nbsp;</span>
                        </div>

                        <el-input
                            style="width: 65%"
                            size="small"
                            :disabled="true"
                            splaceholder="请输入内容"
                            v-model="editQuery.bhxjcpbm"

                        ></el-input>
                    </div>
                </el-col>

                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>包含最小销售包装数量:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            size="small"
                            :disabled="true"
                            splaceholder="请输入内容"
                            v-model="editQuery.bhzxxsbzsl"
                        ></el-input>
                    </div>
                </el-col>
            </el-row>
            <el-row :gutter="20" class="el-row" type="flex">
                <el-col :span="12" class="el-col">
                    <div class="text item">
                        <div class="itemTag">
                            <span>最小包装单元内包含使用单元数量:&nbsp;</span>
                        </div>
                        <el-input
                            style="width: 65%"
                            :disabled="!checked"
                            size="small"
                            splaceholder="请输入内容"
                            v-model="editQuery.zxxsbzbhsydysl"
                        ></el-input>
                    </div>
                </el-col>
                <el-col :span="12" class="el-col">
                    <el-form-item prop="name">
                        <el-checkbox v-model="checked" class="text item itemTag"
                                     disabled
                        >启用使用单元
                        </el-checkbox>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>

    </div>
</template>

<script>
import {thirdSysDetail} from "@/api/basic/udiRelevance";
import {filterByUuid} from "@/api/basic/udiInfo";

export default {
    name: "UdiRlDetail",
    props: {
        editQuery: {
            type: Object,
            required: true,
        },
    },
    data() {
        return {
            sysList: [],
            checked:false,
            detailList:[],
            loading:false,
        }
    },
    methods: {
        getThirdSysDetail() {
            let query = {
                id: this.editQuery.rlId,
            };

            thirdSysDetail(query)
                .then((response) => {
                    this.loading = false;
                    this.sysList = response.data.list || [];
                })
                .catch(() => {
                    this.loading = false;
                    this.sysList = [];
                });
        },
        getDetailList(detailQuery) {
            this.loading = true;
            filterByUuid(detailQuery)
                .then((response) => {
                    this.loading = false;
                    this.detailList = response.data || [];
                })
                .catch(() => {
                    this.loading = false;
                    this.detailList = [];
                });
        },
    },

    created() {
        let ttquery = {
            uuid: this.editQuery.uuid,
            page: 1,
            limit: 10,
        };
        this.getDetailList(ttquery);
        this.getThirdSysDetail();
    },
}
</script>

<style scoped>

</style>
