<template>
    <div id="one_ent_init" style="width:70%;margin:auto">
        <el-container v-loading="loading" element-loading-text="请稍等......正在拼命处理中">
            <!-- <el-header style="font-size: 14px;">
            </el-header> -->
            <el-main>
                <el-card>
                    <el-steps align-center :active="active">
                        <el-step title="选择设备上架模式"> </el-step>
                        <el-step title="输入企业信息"> </el-step>
                        <el-step title="输入发票相关信息"> </el-step>
                        <el-step title="输入税盘信息"> </el-step>
                        <el-step title="完成"> </el-step>
                    </el-steps>
                </el-card>
                <div style="margin:30px auto">
                    <div id="input_platform_info" v-show="active == 0">
                        <el-form
                            :model="formPlatformInfo"
                            :rules="formPlatformInfoRules"
                            ref="formPlatformInfo"
                            label-position="top"
                        >
                            <el-row :gutter="20">
                                <el-col :span="8">
                                    <el-form-item label="选择上架模式" prop="isvPlatform">
                                        <el-select
                                            v-model="formPlatformInfo.isvPlatform"
                                            placeholder="请选择"
                                            style="width:100%"
                                        >
                                            <el-option
                                                v-for="item in isvPlatforms"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value"
                                            >
                                            </el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="16">
                                    <el-form-item label="激活码" prop="taxToken" v-if="isISVPlatformMode1">
                                        <el-input type="text" v-model="formPlatformInfo.taxToken" placeholder="" />
                                    </el-form-item>
                                    <el-form-item label="税控服务器编号" prop="taxMachineNo">
                                        <el-input type="text" v-model="formPlatformInfo.taxMachineNo" placeholder="" />
                                    </el-form-item>
                                    <el-form-item label="上架设备端口位置" prop="devicePos">
                                        <el-input type="text" v-model="formPlatformInfo.devicePos" placeholder="" />
                                    </el-form-item>
                                    <el-form-item label="上架设备类型" prop="deviceType">
                                        <el-select
                                            v-model="formPlatformInfo.deviceType"
                                            placeholder="请选择"
                                            style="width:100%"
                                        >
                                            <el-option
                                                v-for="item in deviceTypes"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value"
                                            >
                                            </el-option>
                                        </el-select>
                                    </el-form-item>
                                    <el-form-item label="默认开票设备" prop="defaultInvoiceDevice">
                                        <el-select
                                            v-model="formPlatformInfo.defaultInvoiceDevice"
                                            placeholder="请选择"
                                            style="width:100%"
                                        >
                                            <el-option
                                                v-for="item in deviceTypes"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value"
                                            >
                                            </el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-form>
                    </div>
                    <div id="input_ent_info" v-show="active == 1">
                        <el-form :model="formEntInfo" :rules="formEntInfoRules" ref="formEntInfo" label-position="top">
                            <el-row :gutter="20">
                                <el-col :span="8">
                                    <el-form-item label="企业税号" prop="entTaxId">
                                        <el-input type="text" v-model="formEntInfo.entTaxId" placeholder="" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="企业名称" prop="entName">
                                        <el-input type="text" v-model="formEntInfo.entName" placeholder="" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="企业简称" prop="entShortName">
                                        <el-input type="text" v-model="formEntInfo.entShortName" placeholder="" />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="8">
                                    <el-form-item label="企业所属省市" prop="provinceCity">
                                        <el-cascader
                                            v-model="formEntInfo.provinceCity"
                                            :options="chinaProvinceCity"
                                            style="width:100%"
                                        ></el-cascader>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="16">
                                    <el-form-item label="企业类型" prop="entType">
                                        <el-radio-group v-model="formEntInfo.entType">
                                            <el-radio v-for="item in entTypes" :key="item.value" :label="item.value">{{
                                                item.label
                                            }}</el-radio>
                                        </el-radio-group>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="6">
                                    <el-form-item label="企业联系人" prop="entContactPerson">
                                        <el-input type="text" v-model="formEntInfo.entContactPerson" placeholder="" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="企业电话" prop="entPhone">
                                        <el-input type="text" v-model="formEntInfo.entPhone" placeholder="" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="企业管理者" prop="entReserveMrName">
                                        <el-input type="text" v-model="formEntInfo.entReserveMrName" placeholder="" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="企业管理者手机号码" prop="entReserveMrMobile">
                                        <el-input
                                            type="text"
                                            v-model="formEntInfo.entReserveMrMobile"
                                            placeholder=""
                                        />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="24">
                                    <el-form-item label="开票信息公司地址" prop="entAddress">
                                        <el-input
                                            type="text"
                                            v-model="formEntInfo.entAddress"
                                            placeholder="发票开具时使用的企业地址信息"
                                        />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-form-item label="企业开户银行" prop="entBankName">
                                        <el-input type="text" v-model="formEntInfo.entBankName" placeholder="" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="企业开户银行账号" prop="entBankAccountNumber">
                                        <el-input
                                            type="text"
                                            v-model="formEntInfo.entBankAccountNumber"
                                            placeholder=""
                                        />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-form-item label="企业授权书" prop="entAuthFile">
                                        <input type="file" @change="handleFileChange($event, 'entAuthFile')" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item
                                        label="企业营业执照"
                                        prop="entBusinessLicenseImg"
                                        v-if="isISVPlatformMode1"
                                    >
                                        <input
                                            type="file"
                                            accept=".jpg,.png,.jpeg"
                                            @change="handleFileChange($event, 'entBusinessLicenseImg')"
                                        />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-form>
                    </div>
                    <div id="input_invoice_info" v-show="active == 2">
                        <el-form
                            :model="formInvoiceInfo"
                            :rules="initFormInvoiceInfoRules"
                            ref="formInvoiceInfo"
                            label-position="top"
                        >
                            <el-row :gutter="20">
                                <el-col :span="24">
                                    <el-form-item label="可用税率" prop="entAvailableTaxes">
                                        <el-input
                                            type="text"
                                            v-model="formInvoiceInfo.entAvailableTaxes"
                                            placeholder=""
                                        />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-form-item label="收款人员" prop="entPayees">
                                        <el-input type="text" v-model="formInvoiceInfo.entPayees" placeholder="" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="审核人员" prop="entReviewers">
                                        <el-input type="text" v-model="formInvoiceInfo.entReviewers" placeholder="" />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-form-item
                                        label="默认税收分类编码"
                                        prop="entDefaultTaxCode"
                                        v-if="isISVPlatformMode1"
                                    >
                                        <el-input
                                            type="text"
                                            v-model="formInvoiceInfo.entDefaultTaxCode"
                                            placeholder=""
                                        />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item
                                        label="默认商品名称"
                                        prop="entDefaultItemName"
                                        v-if="isISVPlatformMode1"
                                    >
                                        <el-input
                                            type="text"
                                            v-model="formInvoiceInfo.entDefaultItemName"
                                            placeholder=""
                                        />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-form>
                    </div>
                    <div id="input_tax_disk_info" v-show="active == 3">
                        <el-form
                            :model="formTaxDiskInfo"
                            :rules="formTaxDiskInfoRules"
                            ref="formTaxDiskInfo"
                            label-position="top"
                        >
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-form-item label="税务数字证书密码" prop="digitalCertPwd">
                                        <el-input type="text" v-model="formTaxDiskInfo.digitalCertPwd" placeholder="" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6"> </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-form-item label="修改税务数字证书密码" prop="modifyDigitalCertPwd">
                                        <el-input
                                            type="text"
                                            v-model="formTaxDiskInfo.modifyDigitalCertPwd"
                                            placeholder=""
                                        />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="修改税务数字证书密码确认" prop="modifyDigitalCertPwd2">
                                        <el-input
                                            type="text"
                                            v-model="formTaxDiskInfo.modifyDigitalCertPwd2"
                                            placeholder=""
                                        />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-form-item label="税控设备密码" prop="keyPwd">
                                        <el-input type="text" v-model="formTaxDiskInfo.keyPwd" placeholder="" />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-form-item label="修改税控设备密码" prop="modifyKeyPwd">
                                        <el-input type="text" v-model="formTaxDiskInfo.modifyKeyPwd" placeholder="" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="修改税控设备密码确认" prop="modifyKeyPwd2">
                                        <el-input type="text" v-model="formTaxDiskInfo.modifyKeyPwd2" placeholder="" />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-form-item label="管理员登录密码" prop="rootLoginPwd">
                                        <el-input type="text" v-model="formTaxDiskInfo.rootLoginPwd" placeholder="" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="管理员登录密码确认" prop="rootLoginPwd2">
                                        <el-input type="text" v-model="formTaxDiskInfo.rootLoginPwd2" placeholder="" />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-form-item label="税盘ID" prop="entTaxDiscId">
                                        <el-input type="text" v-model="formTaxDiskInfo.entTaxDiscId" placeholder="" />
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="所属税局" prop="entTaxOfficeCode">
                                        <el-input
                                            type="text"
                                            v-model="formTaxDiskInfo.entTaxOfficeCode"
                                            placeholder=""
                                        />
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-form>
                    </div>
                </div>
                <el-divider></el-divider>
                <div id="input_completed" v-if="showStopCompleted">
                    <el-row :gutter="20">
                        <el-col :span="18">
                            <span>企业上架成功！</span>
                        </el-col>
                        <el-col :span="6">
                            <el-button @click="handleGoContinue" style="width:100%;">继续上架设备</el-button>
                        </el-col>
                    </el-row>
                </div>
                <div v-else>
                    <el-row :gutter="20">
                        <el-col :span="12">
                            <span style="line-height: 46px">选择 : {{ selecteISVPlatformIndexToText }}</span>
                        </el-col>
                        <el-col :span="6">
                            <el-button @click="back" style="width:100%;">上一步</el-button>
                        </el-col>
                        <el-col :span="6">
                            <el-button @click="next" type="primary" style="width:100%;">下一步</el-button>
                        </el-col>
                    </el-row>
                </div>
            </el-main>
        </el-container>
    </div>
</template>

<script>

import {
    EntTaxDiskInit
} from '@/api/ent_init'

import CHINA_PROVINCE_CITY from '@/utils/china_province_city'

// 上架模式默认选择
const isvPlatformDefault = 1;

// 上架模式列表
const isvPlatforms = [
    {
        value: 1,
        label: '上架模式1'
    },
    {
        value: 2,
        label: '上架模式2'
    },
]

// 设备类型列表
const deviceTypes = [
    {
        value: '1',
        label: '软证书'
    },
    {
        value: '2',
        label: '税控盘'
    },
    {
        value: '3',
        label: '金税盘'
    },
    {
        value: '4',
        label: '税控UKey'
    },
    {
        value: '5',
        label: '税控服务器'
    },
]

// 企业类型列表
const entTypes = [
    {
        value: '1',
        label: '一般纳税人'
    },
    {
        value: '2',
        label: '小规模纳税人'
    },
    {
        value: '3',
        label: '起征点以下纳税人'
    },
]

const initFormPlatformInfo = {
    isvPlatform: isvPlatformDefault, // 上架模式
    taxToken: '', // 激活码
    taxMachineNo: '', // 税控服务器编号
    devicePos: '', // 上架设备端口位置
    deviceType: '', // 上架设备类型
    defaultInvoiceDevice: '',// 默认开票设备
}

const initFormEntInfo = {
    entTaxId: '', // 企业税号
    entName: '', // 企业名称
    entShortName: '',// 企业简称
    entType: '', // 企业类型
    provinceCity: '', // 企业地址省市
    entAddress: '', // 开票信息公司地址
    entContactPerson: '', // 企业联系人
    entPhone: '', // 企业电话
    entReserveMrName: '', // 企业管理者
    entReserveMrMobile: '', // 企业管理者手机号码
    entBankName: '', // 企业开户银行
    entBankAccountNumber: '', // 企业开户银行账号
    entAuthFile: '', // 企业授权书
    entBusinessLicenseImg: '', // 企业营业执照
}

const initFormInvoiceInfo = {
    entAvailableTaxes: '', // 可用税率
    entPayees: '', // 收款人员
    entReviewers: '', // 审核人员
    entDefaultTaxCode: '', // 默认税收分类编码
    entDefaultItemName: '', // 默认商品名称
}

const initFormTaxDiskInfo = {
    digitalCertPwd: '11111111', // 税务数字证书密码
    modifyDigitalCertPwd: '', // 修改税务数字证书密码
    modifyDigitalCertPwd2: '', // 修改税务数字证书密码确认
    keyPwd: '88888888', // 税务UKey密码
    modifyKeyPwd: '', // 修改税务UKey密码
    modifyKeyPwd2: '', // 修改税务UKey密码确认
    rootLoginPwd: 'wasd1234567890.', // 管理员登录密码
    rootLoginPwd2: 'wasd1234567890.', // 管理员登录密码确认
    entTaxDiscId: '', // 税盘ID
    entTaxOfficeCode: '', // 所属税局
}

export default {
    name: 'OneEntInit',
    components: {
    },
    data() {
        let validateFormEntInfo = {
            entShortName: (rule, value, callback) => {
                let reg = /[^\u4E00-\u9FA5]/g;
                if (value === '') {
                    callback(new Error('企业简称不可为空'));
                } else if (reg.test(value)) {
                    callback(new Error('企业简称必须是汉字'));
                } else if (value.length > 9) {
                    callback(new Error('企业简称是9个以内汉字，含9个汉字'));
                } else {
                    callback();
                }
            },
        }
        let validateFormTaxDiskInfo = {
            modifyDigitalCertPwd2: (rule, value, callback) => {
                if (value !== this.formTaxDiskInfo.modifyDigitalCertPwd) {
                    callback(new Error('两次输入密码不一致!'));
                } else {
                    callback();
                }
            },
            modifyKeyPwd2: (rule, value, callback) => {
                if (value !== this.formTaxDiskInfo.modifyKeyPwd) {
                    callback(new Error('两次输入密码不一致!'));
                } else {
                    callback();
                }
            },
            rootLoginPwd2: (rule, value, callback) => {
                if (value !== this.formTaxDiskInfo.rootLoginPwd) {
                    callback(new Error('两次输入密码不一致!'));
                } else {
                    callback();
                }
            },
        }
        return {
            active: 0,
            loading: false,
            showStopCompleted: false, // 是否显示完成页面
            isvPlatforms: isvPlatforms,
            deviceTypes: deviceTypes,
            entTypes: entTypes,
            chinaProvinceCity: CHINA_PROVINCE_CITY,
            formPlatformInfo: { ...initFormPlatformInfo },
            formEntInfo: { ...initFormEntInfo },
            formInvoiceInfo: { ...initFormInvoiceInfo },
            formTaxDiskInfo: { ...initFormTaxDiskInfo },

            formPlatformInfoRules: {
                isvPlatform: [
                    { required: true, message: '可用服务平台不可为空', trigger: 'blur' }
                ],
                taxToken: [
                    { required: true, message: '激活码不可为空', trigger: 'blur' }
                ],
                taxMachineNo: [
                    { required: true, message: '税控服务器编号不可为空', trigger: 'blur' }
                ],
                devicePos: [
                    { required: true, message: '上架设备端口位置不可为空', trigger: 'blur' }
                ],
                deviceType: [
                    { required: true, message: '上架设备类型不可为空', trigger: 'blur' }
                ],
                defaultInvoiceDevice: [
                    { required: true, message: '默认开票设备不可为空', trigger: 'blur' }
                ],
            },

            formEntInfoRules: {
                entType: [
                    { required: true, message: '请选择企业类型', trigger: 'blur' }
                ],
                entTaxId: [
                    { required: true, message: '企业税号不可为空', trigger: 'blur' },
                    { min: 15, max: 20, message: '长度在 15 ~ 20 个字符', trigger: 'blur' }
                ],
                entName: [
                    { required: true, message: '企业名称不可为空', trigger: 'blur' }
                ],
                entShortName: [
                    { required: true, validator: validateFormEntInfo.entShortName, trigger: 'blur' }
                ],
                provinceCity: [
                    { required: true, message: '请选择企业所属省市', trigger: 'blur' }
                ],
                entPhone: [
                    { required: true, message: '企业电话不可为空', trigger: 'blur' },
                    // { type: 'number', message: '电话号码由数字值组成', trigger: 'blur' }
                ],
                entReserveMrName: [
                    { required: true, message: '企业管理者不可为空', trigger: 'blur' }
                ],
                entReserveMrMobile: [
                    { required: true, message: '企业管理者手机号码不可为空', trigger: 'blur' },
                    // { type: 'number', message: '电话号码由数字值组成', trigger: 'blur' }
                ],
                entBankName: [
                    { required: true, message: '企业开户银行不可为空', trigger: 'blur' }
                ],
                entBankAccountNumber: [
                    { required: true, message: '企业开户银行账号不可为空', trigger: 'blur' },
                    // { type: 'number', message: '银行账号由数字值组成', trigger: 'blur' }
                ],
                entAuthFile: [
                    { required: true, message: '企业授权书不可为空', trigger: 'blur' }
                ],
                entBusinessLicenseImg: [
                    { required: true, message: '企业营业执照不可为空', trigger: 'blur' }
                ],
            },

            initFormInvoiceInfoRules: {
                entAvailableTaxes: [
                    { required: true, message: '可用税率不可为空', trigger: 'blur' }
                ],
                entDefaultTaxCode: [
                    { required: true, message: '默认税收分类编码不可为空', trigger: 'blur' }
                ],
                entDefaultItemName: [
                    { required: true, message: '默认商品名称不可为空', trigger: 'blur' }
                ],
            },

            formTaxDiskInfoRules: {
                digitalCertPwd: [
                    { required: true, message: '税务数字证书密码不可为空', trigger: 'blur' }
                ],
                modifyDigitalCertPwd2: [
                    { validator: validateFormTaxDiskInfo.modifyDigitalCertPwd2, trigger: 'blur' }
                ],
                keyPwd: [
                    { required: true, message: '税务UKey密码不可为空', trigger: 'blur' }
                ],
                modifyKeyPwd2: [
                    { validator: validateFormTaxDiskInfo.modifyKeyPwd2, trigger: 'blur' }
                ],
                rootLoginPwd: [
                    { required: true, message: '管理员登录密码不可为空', trigger: 'blur' }
                ],
                rootLoginPwd2: [
                    { required: true, message: '管理员登录密码确认不可为空', trigger: 'blur' },
                    { validator: validateFormTaxDiskInfo.rootLoginPwd2, trigger: 'blur' }
                ],
                entTaxDiscId: [
                    { required: true, message: '税盘ID不可为空', trigger: 'blur' },
                    { min: 3, max: 18, message: '长度在 3 ~ 18 个字符', trigger: 'blur' }
                ],
            }
        };
    },
    computed: {
        /**
         * 是否是上架模式1
         */
        isISVPlatformMode1() {
            return this.formPlatformInfo.isvPlatform === 1;
        },
        /**
         * 选中的上架模式对应的显示文本
         */
        selecteISVPlatformIndexToText() {
            let result = this.formPlatformInfo.isvPlatform;
            for (const item of isvPlatforms) {
                if (item.value === this.formPlatformInfo.isvPlatform) {
                    result = item.label;
                    break;
                }
            }
            return result;
        }
    },
    methods: {
        handleFileChange(event, type) {
            this.formEntInfo[type] = event.target.files[0];
            console.log('文件 改变：' + type);
            console.log(this.formEntInfo[type]);
        },
        handleGoContinue() {
            this.active = 0;
            this.showStopCompleted = false;
            this.formPlatformInfo = { ...initFormPlatformInfo };
            this.formEntInfo = { ...initFormEntInfo };
            this.formInvoiceInfo = { ...initFormInvoiceInfo };
            this.formTaxDiskInfo = { ...initFormTaxDiskInfo };
        },
        back() {
            if (this.active > 0) {
                this.active--;
            }
        },
        next() {
            let formName = '';
            if (this.active == 0) {
                formName = 'formPlatformInfo';
            } else if (this.active == 1) {
                formName = 'formEntInfo';
            } else if (this.active == 2) {
                formName = 'formInvoiceInfo';
            } else if (this.active == 3) {
                formName = 'formTaxDiskInfo';
            } else {
                return false;
            }
            // this.active++;
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    console.log(this.active);

                    if (this.active == 3) {
                        // 显示等待
                        this.loading = true;

                        let tempProvinceCity = `${this.formEntInfo.provinceCity[0]}-${this.formEntInfo.provinceCity[1]}`;
                        let tempKeyPwd = this.formTaxDiskInfo.modifyKeyPwd === '' ? this.formTaxDiskInfo.keyPwd : this.formTaxDiskInfo.modifyKeyPwd;
                        let tempDigitalCertPwd = this.formTaxDiskInfo.modifyDigitalCertPwd === '' ? this.formTaxDiskInfo.digitalCertPwd : this.formTaxDiskInfo.modifyDigitalCertPwd;

                        let args = {
                            isvPlatform: this.formPlatformInfo.isvPlatform,
                            taxToken: this.formPlatformInfo.taxToken,
                            taxMachineNo: this.formPlatformInfo.taxMachineNo,
                            devicePos: this.formPlatformInfo.devicePos,
                            deviceType: this.formPlatformInfo.deviceType,
                            defaultInvoiceDevice: this.formPlatformInfo.defaultInvoiceDevice,
                            entTaxId: this.formEntInfo.entTaxId,
                            entName: this.formEntInfo.entName,
                            entShortName: this.formEntInfo.entShortName,
                            entType: this.formEntInfo.entType,
                            entAddress: this.formEntInfo.entAddress,
                            provinceCity: tempProvinceCity,
                            entContactPerson: this.formEntInfo.entContactPerson,
                            entPhone: this.formEntInfo.entPhone,
                            bankName: this.formEntInfo.entBankName,
                            bankAccountNumber: this.formEntInfo.entBankAccountNumber,
                            reserveMrName: this.formEntInfo.entReserveMrName,
                            reserveMrMobile: this.formEntInfo.entReserveMrMobile,
                            authProtocol: this.formEntInfo.entAuthFile,
                            businessLicenseImg: this.formEntInfo.entBusinessLicenseImg,
                            availableTaxes: this.formInvoiceInfo.entAvailableTaxes,
                            payees: this.formInvoiceInfo.entPayees,
                            reviewers: this.formInvoiceInfo.entReviewers,
                            defaultTaxCode: this.formInvoiceInfo.entDefaultTaxCode,
                            defaultItemName: this.formInvoiceInfo.entDefaultItemName,
                            taxDiscId: this.formTaxDiskInfo.entTaxDiscId,
                            entTaxOfficeCode: this.formTaxDiskInfo.entTaxOfficeCode,
                            keyPwd: tempKeyPwd,
                            digitalCertPwd: tempDigitalCertPwd,
                            rootLoginPwd: this.formTaxDiskInfo.rootLoginPwd
                        }
                        // 非上架模式1时的参数调整；
                        if (this.formPlatformInfo.isvPlatform !== 1) {
                            args.taxToken = null;                   // 激活码；
                            args.businessLicenseImg = null;         // 企业营业执照；
                            args.defaultTaxCode = null;             // 默认税收分类编码；
                            args.defaultItemName = null;            // 默认商品名称；
                        }
                        // 提交
                        EntTaxDiskInit(args).then(val => {
                            // 取消等待
                            this.loading = false;
                            this.$message.success(val.msg);
                            // 切换到完成页面
                            this.active++;
                            this.showStopCompleted = true;
                        }).catch(err => {
                            // 取消等待
                            this.loading = false;
                            this.$message.error(err);
                        })
                    } else { // 非提交页面
                        this.active++;
                    }
                } else {
                    this.$message.error('输入信息不合法，请检查您的输入信息！');
                    return false;
                }
            });
        }
    }
}
</script>

<style scoped>
</style>