<!--
<template>
    <div class="addDataModel">
        <el-form :label-width="labelwidthStyle" ref="addFormData" :model="addFormData">
            <el-row>
                <el-col :span="11" :offset="1">
                    <el-form-item label="营业执照注册号：">
                        <el-input v-model="addFormData.tyshxydm" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="11">
                    <el-form-item label="市场主体名称：">
                        <el-input v-model="addFormData.scztmc" disabled></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="11" :offset="1">
                    <el-form-item label="组织机构代码：">
                        <el-input v-model="addFormData.zzjgdm" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="11">
                    <el-form-item label="许可文件名称：">
                        <el-input v-model="addFormData.xkwjmc" disabled></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="11" :offset="1">
                    <el-form-item label="许可文件编号：">
                        <el-input v-model="addFormData.xkwjbh" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="11">
                    <el-form-item label="许可内容：">
                        <el-input v-model="addFormData.xknr" disabled></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="11" :offset="1">
                    <el-form-item label="有效期自：">
                        <el-date-picker v-model="addFormData.yxqq1" type="date" value-format="yyyy-MM-dd" disabled style="width: 100%"></el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="11">
                    <el-form-item label="有效期至：">
                        <el-date-picker v-model="addFormData.yxqz1" type="date" value-format="yyyy-MM-dd" disabled style="width: 100%"></el-date-picker>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="11" :offset="1">
                    <el-form-item label="许可机关：">
                        <el-input v-model="addFormData.xkjgbmmc" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="11">
                    <el-form-item label="状态：">
                        <el-radio-group  v-model="addFormData.yxzt" disabled>
                            <el-radio :label="1">是</el-radio>
                            <el-radio :label="0">否</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-col>
            </el-row>
            <div v-if="addFormData.companyNewVO">
                <el-row>
                    <el-col :span="22" :offset="1">
                        <el-form-item label="企业地址：">
                            <el-input v-model="addFormData.companyNewVO.qytxdz" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="11" :offset="1">
                        <el-form-item label="企业法人：">
                            <el-input v-model="addFormData.companyNewVO.fddbr" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="11">
                        <el-form-item label="企业联系人：">
                            <el-input v-model="addFormData.companyNewVO.qylxr" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="11" :offset="1">
                        <el-form-item label="联系电话：">
                            <el-input v-model="addFormData.companyNewVO.frsjh" disabled></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="11">
                        <el-form-item label="企业性质：">
                            <el-input  v-model="addFormData.companyNewVO.qyxz" disabled></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </div>


            <el-row>
                <el-col :span="22" :offset="1">
                    <div>历史变更记录</div>
                    <el-table
                            :data="addFormData.shouGouZiGeVOList"
                            stripe
                            v-loading="listLoading"
                            border
                            fit
                            highlight-current-row
                            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-column align="center" prop="yxzt" label="状态" show-overflow-tooltip>
                            <template slot-scope="scope">
                                <span v-if="scope.row.yxzt == '1'">有效</span>
                                <span v-if="scope.row.yxzt == '0'">无效</span>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
        </el-form>
        <div style="margin-top: 10px;text-align:center;">
            <el-button type="primary" @click="cancel()" class="iconfont iconfanhui"> 返回</el-button>
        </div>
    </div>
</template>

<script>
    import { fileApi } from "@/api";
    import {getDetail} from '@/api/grainCoManage/acquisitionQualification/index';
    export default {
        data() {
            return {
                labelwidthStyle: "150px",
                list: [],
                addFormData:{
                    sfrgsd:1,
                    tzyy:null,
                    jsr:'',
                    sdsj:'',
                    fileList:[],
                },
                fileList:[],
                actionUrl: fileApi + "/file/upload",
                tableData: [],
                listLoading: false,
            };
        },
        created() {
            this.getInfo(this.$route.query.code)
        },
        methods: {
            cancel(){
                this.$router.go(-1)
            },
            getInfo(code){
                let params = {
                    "sgzgid": code
                }
                getDetail(params).then(res => {
                    if (!res) return;
                    this.addFormData = res.data;
                    this.addFormData.yxqq = this.addFormData.yxqq + ''
                    this.addFormData.yxqq1 = this.addFormData.yxqq.substring(0,4) + '-' + this.addFormData.yxqq.substring(4,6) + '-' + this.addFormData.yxqq.substring(6,8)
                    this.addFormData.yxqz = this.addFormData.yxqz + ''
                    this.addFormData.yxqz1 = this.addFormData.yxqz.substring(0,4) + '-' + this.addFormData.yxqz.substring(4,6) + '-' + this.addFormData.yxqz.substring(6,8)
                }).catch()
            },
            formatDateTimes (date) {
                let y = date.getFullYear();
                let m = date.getMonth() + 1;
                m = m < 10 ? ('0' + m) : m;
                let d = date.getDate();
                d = d < 10 ? ('0' + d) : d;
                let h = date.getHours();
                h=h < 10 ? ('0' + h) : h;
                let minute = date.getMinutes();
                minute = minute < 10 ? ('0' + minute) : minute;
                let second=date.getSeconds();
                second=second < 10 ? ('0' + second) : second;
                return y + '-' + m + '-' + d + ' ' + h +':'+minute + ':'+second;
            },
            //转时间方法
            formatDateTime (date) {
                let y = date.getFullYear();
                let m = date.getMonth() + 1;
                m = m < 10 ? ('0' + m) : m;
                let d = date.getDate();
                d = d < 10 ? ('0' + d) : d;
                let h = date.getHours();
                h=h < 10 ? ('0' + h) : h;
                let minute = date.getMinutes();
                minute = minute < 10 ? ('0' + minute) : minute;
                let second=date.getSeconds();
                second=second < 10 ? ('0' + second) : second;
                return y + '-' + m + '-' + d;
            },
        },
    };
</script>

<style scoped="scoped">
    .rowBottom{
        margin-bottom: 10px;
    }
    .addDataModel{
        padding: 10px;
    }
</style>
-->
