<template>
    <div>
        <div class="region">
            <h3>所属区域变更</h3>
            <el-table :data="regionTableData" border style="width: 100%">
                <el-table-column type="index" align="center" show-overflow-tooltip label="序号" width="60">
                    <template slot-scope="scope">
                        <span>{{ scope.$index + 1 }}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="bgqqybmmc" align="center" show-overflow-tooltip label="变更前所属区域" ></el-table-column>
                <el-table-column prop="sqqybmmc" align="center" show-overflow-tooltip label="变更后所属区域" ></el-table-column>
                <el-table-column prop="sqridmc" align="center" show-overflow-tooltip label="申请人"></el-table-column>
                <el-table-column prop="sqsj" align="center" show-overflow-tooltip label="申请时间"></el-table-column>
                <el-table-column prop="spridmc" align="center" show-overflow-tooltip label="审批人"></el-table-column>
                <el-table-column prop="spsj" align="center" show-overflow-tooltip label="审批时间"></el-table-column>
            </el-table>
        </div>
        <div class="takeover">
            <h3>收购资格变更</h3>
            <el-table :data="takeoverTableData" border style="width: 100%">
                <el-table-column align="center" label="序号" width="70">
                    <template slot-scope="scope">
                        <span>{{scope.$index+1}}</span>
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="xkjgbmmc" label="发证机关" show-overflow-tooltip>
                </el-table-column>
                <el-table-column
                        align="center"
                        prop="xkwjbh"
                        label="许可证编号"
                        min-width="130"
                        show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column align="center" prop="yxqq" label="有效期自" show-overflow-tooltip>
                    <template slot-scope="scope">
                        {{String(scope.row.yxqq).substring(0,4) + '-' + String(scope.row.yxqq).substring(4,6) + '-' + String(scope.row.yxqq).substring(6,8)}}
                    </template>
                </el-table-column>
                <el-table-column align="center" prop="yxqz" label="有限期至" show-overflow-tooltip>
                    <template slot-scope="scope">
                        {{String(scope.row.yxqz).substring(0,4) + '-' + String(scope.row.yxqz).substring(4,6) + '-' + String(scope.row.yxqz).substring(6,8)}}
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <div style="margin-top: 10px;text-align:center;">
            <el-button type="primary" icon="iconfont iconfanhui" @click="cancel">返回</el-button>
        </div>
    </div>
</template>

<script>
    import {selectByEntity, warehouseList,sgzgSelectByEntity} from "@/api/enterpriseInformationBase";

    export default {
        name: "lsbgjl",
        props: ["formQuery"],
        data() {
            return {
                regionTableData:[],
                takeoverTableData:[],
            };
        },
        watch: {
            formQuery(val, oldVal) {
                if (val !== oldVal) {
                    this.getInfo();
                }
            }
        },
        created() {},
        methods: {
            cancel() {
                this.$router.go(-1)
            },
            getInfo() {
                let params = {
                    tyshxydm: this.formQuery.tyshxydm
                };
                selectByEntity(params).then(res => {
                    if (res.infoCode == 200) {
                        this.regionTableData = res.data;
                    }
                });
                sgzgSelectByEntity(params).then(res => {
                    if (res.infoCode == 200) {
                        this.takeoverTableData = res.data;
                    }
                });
            },
        }
    }
</script>

<style scoped>

</style>
