<template> <div class="information-container"> <div class="information-title"> 供应商信息填报 </div> <div class="information-from"> <div class="from-title"> 基础信息 </div> <base-info ref="supplierBaseInfo"/> </div> <div class="information-from"> <div class="from-title"> 三证信息 </div> <cert-info ref="supplierCertInfo" @updateLegalPerson="cascadeUpdateLegalPerson"/> </div> <div class="information-from"> <div class="from-title"> 联系人信息 </div> <person-info ref="supplierPersonInfo"/> </div> <div class="information-from"> <div class="from-title"> 业务信息 </div> <business-info ref="supplierBusinessInfo"/> </div> <div class="information-from"> <div class="from-title"> 经营信息 </div> <operation-info ref="supplierOperationInfo"/> </div> <div class="information-from"> <div class="from-title"> 经营许可信息 </div> <licence-info ref="supplierLicenceInfo"/> </div> <div class="information-from"> <div class="from-title"> 银行账户信息 </div> <bank-info ref="supplierBankInfo"/> </div> <div class="information-from"> <div class="from-title"> 管理体系认证信息 </div> <man-system-info ref="supplierManSystemInfo"/> </div> <div class="information-from"> <div class="from-title"> 资质认证信息 </div> <qualify-info ref="supplierQualifyInfo"/> </div> <div class="btnBox"> <el-button type="primary" class="save" style="background-color: #2483b3" @click="save">保存</el-button> </div> </div> </template> <script> import BaseInfo from '@/views/companyDetail/baseInfo' import CertInfo from '@/views/companyDetail/certInfo' import PersonInfo from '@/views/companyDetail/personInfo' import BusinessInfo from '@/views/companyDetail/businessInfo' import OperationInfo from '@/views/companyDetail/operationInfo' import LicenceInfo from '@/views/companyDetail/licenceInfo' import BankInfo from '@/views/companyDetail/bankInfo' import ManSystemInfo from '@/views/companyDetail/manSystemInfo' import QualifyInfo from '@/views/companyDetail/qualifyInfo' import { addSupplierInfo } from '@/api/supplier/supplier' export default { name: 'SupplierInfomation', components: { BaseInfo, CertInfo, PersonInfo, BusinessInfo, OperationInfo, LicenceInfo, BankInfo, ManSystemInfo, QualifyInfo }, data() { return { companyFormInfo: { baseInfo: { supplierName: '', supplierArea: '', companyNature: '', companyType: '', companyProvince: '', companyCity: '', companyArea: '', companyAddress: '' }, certificateInfo: { threeCertificatesInOne: 1, unifiedSocialCreditCode: '', licenseRegisterNumber: '', registerCapital: '', registerAddress: '', legalPerson: '', establishDate: '', businessTerm: '', businessScope: '', licenseScan: '', organizeCode: '', organizeCodeScan: '', taxpayerNature: '', taxRegisterCode: '', taxRegisterCodeScan: '' }, personInfo: { legalPersonName: '', legalPersonPhone: '', legalPersonCertificateCode: '', legalPersonCertificateType: '', legalPersonCertificateFrontScan: '', legalPersonCertificateBackScan: '', businessLeaderName: '', businessLeaderCertificateType: '', businessLeaderCertificateCode: '', businessLeaderPhone: '', businessLeaderCertificateFrontScan: '', businessLeaderCertificateBackScan: '', backupPersonName: '', backupPersonPhone: '', backupPersonCertificateType: '', backupPersonCertificateCode: '', technicalLeaderName: '', technicalLeaderPhone: '', technicalLeaderCertificateType: '', technicalLeaderCertificateCode: '', saleLeaderName: '', saleLeaderPhone: '', saleLeaderCertificateType: '', saleLeaderCertificateCode: '', financeLeaderName: '', financeLeaderPhone: '', financeLeaderCertificateType: '', financeLeaderCertificateCode: '' }, businessInfo: { businessType: '', mainCategory: '', businessNature: '', manageAddress: '', officeNature: '', officeSpace: '', currentYear: '', yearIncome: '', yearProfit: '', threeYearLiabilitiesTable: '', threeYearLossTable: '', threeYearFlowTable: '', licenseName: '', licenseTerm: '', licenseScan: '', systemCertificateName: '', systemCertificateTerm: '', systemCertificateScan: '' }, busDetailBrands: [], busDetailBanks: [], busDetailQualifyCertificates: [] }, companyValid: true } }, methods: { cascadeUpdateLegalPerson(legalPerson) { this.$refs.supplierPersonInfo.personInfo.legalPersonName = legalPerson }, save: function() { this.companyValid = true // 校验并赋值基础信息 this.companyValid = this.companyValid && this.validateBaseForm() // 校验并赋值三证信息 this.companyValid = this.companyValid && this.validateCertForm() // 校验并赋值联系人信息 this.companyValid = this.companyValid && this.validatePersonForm() // 校验业务信息并赋值 this.companyValid = this.companyValid && this.validateBusinessForm() this.companyValid = this.companyValid && this.validateOperationForm() this.companyValid = this.companyValid && this.validateLicenceForm() this.companyValid = this.companyValid && this.validateManSystemForm() this.companyFormInfo.busDetailBrands = this.$refs.supplierBusinessInfo.busDetailBrands this.companyFormInfo.busDetailBanks = this.$refs.supplierBankInfo.busDetailBanks this.companyFormInfo.busDetailQualifyCertificates = this.$refs.supplierQualifyInfo.busDetailQualifyCertificates if (this.companyValid === true) { addSupplierInfo(this.companyFormInfo).then(response => { this.$message.success('新增供应商信息成功!') this.clearSupplierInfoForm() }) } }, validateBaseForm() { this.$refs.supplierBaseInfo.validateForm() if (this.$refs.supplierBaseInfo.baseInfoValid === true) { this.companyFormInfo.baseInfo.supplierName = this.$refs.supplierBaseInfo.baseInfo.name this.companyFormInfo.baseInfo.supplierArea = this.$refs.supplierBaseInfo.baseInfo.area this.companyFormInfo.baseInfo.companyNature = this.$refs.supplierBaseInfo.baseInfo.companyNature this.companyFormInfo.baseInfo.companyType = this.$refs.supplierBaseInfo.baseInfo.companyType this.companyFormInfo.baseInfo.companyProvince = this.$refs.supplierBaseInfo.baseInfo.companyProvince this.companyFormInfo.baseInfo.companyCity = this.$refs.supplierBaseInfo.baseInfo.companyCity this.companyFormInfo.baseInfo.companyArea = this.$refs.supplierBaseInfo.baseInfo.companyArea this.companyFormInfo.baseInfo.companyAddress = this.$refs.supplierBaseInfo.baseInfo.companyAddress return true } else { this.$message.error('基础信息校验未通过,请补充相关信息') return false } }, validateCertForm() { this.$refs.supplierCertInfo.validateForm() if (this.$refs.supplierCertInfo.certInfoValid === true) { this.companyFormInfo.certificateInfo.threeCertificatesInOne = this.$refs.supplierCertInfo.certInfo.threeCertificatesInOne this.companyFormInfo.certificateInfo.unifiedSocialCreditCode = this.$refs.supplierCertInfo.certInfo.unifiedSocialCreditCode this.companyFormInfo.certificateInfo.licenseRegisterNumber = this.$refs.supplierCertInfo.certInfo.licenseRegisterNumber this.companyFormInfo.certificateInfo.registerCapital = this.$refs.supplierCertInfo.certInfo.registerCapital this.companyFormInfo.certificateInfo.registerAddress = this.$refs.supplierCertInfo.certInfo.registerAddress this.companyFormInfo.certificateInfo.legalPerson = this.$refs.supplierCertInfo.certInfo.legalPerson this.companyFormInfo.certificateInfo.establishDate = this.$refs.supplierCertInfo.certInfo.establishDate this.companyFormInfo.certificateInfo.businessTerm = this.$refs.supplierCertInfo.certInfo.businessTerm this.companyFormInfo.certificateInfo.businessScope = this.$refs.supplierCertInfo.certInfo.businessScope this.companyFormInfo.certificateInfo.licenseScan = this.$refs.supplierCertInfo.certInfo.licenseScan this.companyFormInfo.certificateInfo.organizeCode = this.$refs.supplierCertInfo.certInfo.organizeCode this.companyFormInfo.certificateInfo.organizeCodeScan = this.$refs.supplierCertInfo.certInfo.organizeCodeScan this.companyFormInfo.certificateInfo.taxpayerNature = this.$refs.supplierCertInfo.certInfo.taxpayerNature this.companyFormInfo.certificateInfo.taxRegisterCode = this.$refs.supplierCertInfo.certInfo.taxRegisterCode this.companyFormInfo.certificateInfo.taxRegisterCodeScan = this.$refs.supplierCertInfo.certInfo.taxRegisterCodeScan return true } else { this.$message.error('三证信息校验未通过,请补充相关信息') return false } }, validatePersonForm() { this.$refs.supplierPersonInfo.validateForm() if (this.$refs.supplierPersonInfo.personInfoValid === true) { this.companyFormInfo.personInfo.legalPersonName = this.$refs.supplierPersonInfo.personInfo.legalPersonName this.companyFormInfo.personInfo.legalPersonPhone = this.$refs.supplierPersonInfo.personInfo.legalPersonPhone this.companyFormInfo.personInfo.legalPersonCertificateCode = this.$refs.supplierPersonInfo.personInfo.legalPersonCertificateCode this.companyFormInfo.personInfo.legalPersonCertificateType = this.$refs.supplierPersonInfo.personInfo.legalPersonCertificateType this.companyFormInfo.personInfo.legalPersonCertificateFrontScan = this.$refs.supplierPersonInfo.personInfo.legalPersonCertificateFrontScan this.companyFormInfo.personInfo.legalPersonCertificateBackScan = this.$refs.supplierPersonInfo.personInfo.legalPersonCertificateBackScan this.companyFormInfo.personInfo.businessLeaderName = this.$refs.supplierPersonInfo.personInfo.businessLeaderName this.companyFormInfo.personInfo.businessLeaderCertificateType = this.$refs.supplierPersonInfo.personInfo.businessLeaderCertificateType this.companyFormInfo.personInfo.businessLeaderCertificateCode = this.$refs.supplierPersonInfo.personInfo.businessLeaderCertificateCode this.companyFormInfo.personInfo.businessLeaderPhone = this.$refs.supplierPersonInfo.personInfo.businessLeaderPhone this.companyFormInfo.personInfo.businessLeaderCertificateFrontScan = this.$refs.supplierPersonInfo.personInfo.businessLeaderCertificateFrontScan this.companyFormInfo.personInfo.businessLeaderCertificateBackScan = this.$refs.supplierPersonInfo.personInfo.businessLeaderCertificateBackScan this.companyFormInfo.personInfo.backupPersonName = this.$refs.supplierPersonInfo.personInfo.backupPersonName this.companyFormInfo.personInfo.backupPersonPhone = this.$refs.supplierPersonInfo.personInfo.backupPersonPhone this.companyFormInfo.personInfo.backupPersonCertificateType = this.$refs.supplierPersonInfo.personInfo.backupPersonCertificateType this.companyFormInfo.personInfo.backupPersonCertificateCode = this.$refs.supplierPersonInfo.personInfo.backupPersonCertificateCode this.companyFormInfo.personInfo.technicalLeaderName = this.$refs.supplierPersonInfo.personInfo.technicalLeaderName this.companyFormInfo.personInfo.technicalLeaderPhone = this.$refs.supplierPersonInfo.personInfo.technicalLeaderPhone this.companyFormInfo.personInfo.technicalLeaderCertificateType = this.$refs.supplierPersonInfo.personInfo.technicalLeaderCertificateType this.companyFormInfo.personInfo.technicalLeaderCertificateCode = this.$refs.supplierPersonInfo.personInfo.technicalLeaderCertificateCode this.companyFormInfo.personInfo.saleLeaderName = this.$refs.supplierPersonInfo.personInfo.saleLeaderName this.companyFormInfo.personInfo.saleLeaderPhone = this.$refs.supplierPersonInfo.personInfo.saleLeaderPhone this.companyFormInfo.personInfo.saleLeaderCertificateType = this.$refs.supplierPersonInfo.personInfo.saleLeaderCertificateType this.companyFormInfo.personInfo.saleLeaderCertificateCode = this.$refs.supplierPersonInfo.personInfo.saleLeaderCertificateCode this.companyFormInfo.personInfo.financeLeaderName = this.$refs.supplierPersonInfo.personInfo.financeLeaderName this.companyFormInfo.personInfo.financeLeaderPhone = this.$refs.supplierPersonInfo.personInfo.financeLeaderPhone this.companyFormInfo.personInfo.financeLeaderCertificateType = this.$refs.supplierPersonInfo.personInfo.financeLeaderCertificateType this.companyFormInfo.personInfo.financeLeaderCertificateCode = this.$refs.supplierPersonInfo.personInfo.financeLeaderCertificateCode return true } else { this.$message.error('联系人校验未通过,请补充相关信息') return false } }, validateBusinessForm() { this.$refs.supplierBusinessInfo.validateForm() if (this.$refs.supplierBusinessInfo.businessInfoValid === true) { this.companyFormInfo.businessInfo.businessType = this.$refs.supplierBusinessInfo.businessInfo.businessType this.companyFormInfo.businessInfo.mainCategory = this.$refs.supplierBusinessInfo.businessInfo.mainCategory this.companyFormInfo.businessInfo.businessNature = this.$refs.supplierBusinessInfo.businessInfo.businessNature this.companyFormInfo.businessInfo.manageAddress = this.$refs.supplierBusinessInfo.businessInfo.manageAddress this.companyFormInfo.businessInfo.officeNature = this.$refs.supplierBusinessInfo.businessInfo.officeNature this.companyFormInfo.businessInfo.officeSpace = this.$refs.supplierBusinessInfo.businessInfo.officeSpace return true } else { this.$message.error('业务信息校验未通过,请补充相关信息') return false } }, validateOperationForm() { this.$refs.supplierOperationInfo.validateForm() if (this.$refs.supplierOperationInfo.operationInfoValid === true) { this.companyFormInfo.businessInfo.currentYear = this.$refs.supplierOperationInfo.operationInfo.currentYear this.companyFormInfo.businessInfo.yearIncome = this.$refs.supplierOperationInfo.operationInfo.yearIncome this.companyFormInfo.businessInfo.yearProfit = this.$refs.supplierOperationInfo.operationInfo.yearProfit this.companyFormInfo.businessInfo.threeYearLiabilitiesTable = this.$refs.supplierOperationInfo.operationInfo.threeYearLiabilitiesTable this.companyFormInfo.businessInfo.threeYearLossTable = this.$refs.supplierOperationInfo.operationInfo.threeYearLossTable this.companyFormInfo.businessInfo.threeYearFlowTable = this.$refs.supplierOperationInfo.operationInfo.threeYearFlowTable return true } else { this.$message.error('经营信息校验未通过,请补充相关信息') return false } }, validateLicenceForm() { this.$refs.supplierLicenceInfo.validateForm() if (this.$refs.supplierLicenceInfo.licenceInfoValid === true) { this.companyFormInfo.businessInfo.licenseName = this.$refs.supplierLicenceInfo.licenceInfo.licenseName this.companyFormInfo.businessInfo.licenseTerm = this.$refs.supplierLicenceInfo.licenceInfo.licenseTerm this.companyFormInfo.businessInfo.licenseScan = this.$refs.supplierLicenceInfo.licenceInfo.licenseScan return true } else { this.$message.error('经营许可信息校验未通过,请补充相关信息') return false } }, validateManSystemForm() { this.$refs.supplierManSystemInfo.validateForm() if (this.$refs.supplierManSystemInfo.manSystemInfoValid === true) { this.companyFormInfo.businessInfo.systemCertificateName = this.$refs.supplierManSystemInfo.manSystemInfo.systemCertificateName this.companyFormInfo.businessInfo.systemCertificateTerm = this.$refs.supplierManSystemInfo.manSystemInfo.systemCertificateTerm this.companyFormInfo.businessInfo.systemCertificateScan = this.$refs.supplierManSystemInfo.manSystemInfo.systemCertificateScan return true } else { this.$message.error('管理体系认证信息校验未通过,请补充相关信息') return false } }, clearSupplierInfoForm() { this.$refs.supplierBaseInfo.clearForm() this.$refs.supplierCertInfo.clearForm() this.$refs.supplierPersonInfo.clearForm() this.$refs.supplierBusinessInfo.clearForm() this.$refs.supplierOperationInfo.clearForm() this.$refs.supplierLicenceInfo.clearForm() this.$refs.supplierManSystemInfo.clearForm() this.companyFormInfo.busDetailQualifyCertificates = [] this.companyFormInfo.busDetailBrands = [] this.companyFormInfo.busDetailBanks = [] } } } </script> <style lang='scss' scoped> .information-container { .information-title { font-size: 22px; font-weight: bold; margin: 10px 0 10px 20px; } .information-from { .from-title { font-size: 22px; font-weight: bold; background-color: #2483b3; color: white; padding: 10px 0 10px 20px; } .from-inputBox { display: flex; margin-left: 20px; .input-item { width: 540px; display: flex; justify-content: space-between; align-items: center; } } .from-table { display: flex; margin: 10px 20px; .el-tab { } .table-btn { margin-left: 100px; } } } .btnBox { padding: 30px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-evenly; .save, .close { width: 100px; } } } .certificateInfoForm { } </style>