|
@@ -1,60 +1,141 @@
|
|
|
<template>
|
|
|
<div class="enterprise-edit">
|
|
|
<basic-info ref="baseInfo" :base-info="baseInfo" />
|
|
|
- <PersonInfo ref="legalPersonInfoRef" :person-type="'legal'" :details-info="legalPersonInfo" />
|
|
|
- <PersonInfo ref="controlPersonInfoRef" :person-type="'control'" :details-info="controlPersonInfo" />
|
|
|
- <AuthBook ref="authBookRef" :details-info="authBookInfo" />
|
|
|
+ <PersonInfo ref="legalPersonInfoRef" :regionList="regionList" :person-type="'legal'" :details-info="legalPersonInfo" />
|
|
|
+ <PersonInfo ref="controlPersonInfoRef" :regionList="regionList" :person-type="'control'" :details-info="controlPersonInfo" />
|
|
|
+ <ContactInfo ref="contactInfoRef" :details-info="contactInfo" />
|
|
|
<div class="submit-btn">
|
|
|
<el-button @click="() => { $router.push({ name: 'MyStoreEnterprise', query: { activeName: 'enterprise' } }) }">关闭</el-button>
|
|
|
<el-button type="primary" @click="submitClick('temp')">暂存</el-button>
|
|
|
- <el-button type="primary" @click="submitClick('submit')">提交</el-button>
|
|
|
+ <el-button type="primary" @click="submitClick('submit')">下一步</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-// import { queryParent } from '@/utils';
|
|
|
-
|
|
|
+import { getRegion } from '@/api/dictionary'
|
|
|
+import { treeChildrenEmpty } from '@/utils'
|
|
|
+import { enterpriseAccessStepOne, getEnterpriseDetail } from '@/api/myStoreEnterprise'
|
|
|
|
|
|
export default {
|
|
|
name: 'MyBusinessProjectEdit',
|
|
|
components: {
|
|
|
BasicInfo: () => import('./components/BasicInfo'),
|
|
|
PersonInfo: () => import('./components/PersonInfo.vue'),
|
|
|
- AuthBook: () => import('./components/AuthBook')
|
|
|
+ ContactInfo: () => import('./components/ContactInfo.vue')
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
baseInfo: {},
|
|
|
legalPersonInfo: {},
|
|
|
controlPersonInfo: {},
|
|
|
- authBookInfo: [
|
|
|
- {
|
|
|
- contractType: 0,
|
|
|
- contractName: '测试合同名称',
|
|
|
- shortAuthUrl: 'http://www.baidu.com'
|
|
|
- },
|
|
|
- {
|
|
|
- contractType: 1,
|
|
|
- contractName: '测试合同名称1',
|
|
|
- shortAuthUrl: 'http://www.baidu.com'
|
|
|
- },
|
|
|
- {
|
|
|
- contractType: 2,
|
|
|
- contractName: '测试合同名称2',
|
|
|
- shortAuthUrl: 'http://www.baidu.com'
|
|
|
- }
|
|
|
- ]
|
|
|
+ contactInfo: {},
|
|
|
+ regionList: []
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- // this.getDetails()
|
|
|
+ const { typeName, code, name } = this.$route.query
|
|
|
+
|
|
|
+ this.baseInfo = {
|
|
|
+ typeName: typeName || '',
|
|
|
+ socialCreditCode: code || '',
|
|
|
+ enterpriseName: name || ''
|
|
|
+ }
|
|
|
+
|
|
|
+ this.queryReginList()
|
|
|
+
|
|
|
+ if (this.$route.query.id && this.$route.query.companyZrId) {
|
|
|
+ this.getDetails(this.$route.query.id)
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- getDetails() {
|
|
|
- // const { id } = this.$route.query
|
|
|
+ async queryReginList() {
|
|
|
+ getRegion({ flag: false }).then(({ data }) => {
|
|
|
+ this.regionList = treeChildrenEmpty(data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getDetails(queryId) {
|
|
|
+ const res = await getEnterpriseDetail(queryId)
|
|
|
+
|
|
|
+ if (res.success) {
|
|
|
+ this.legalPersonInfo = res.data.companyZrVo
|
|
|
+ this.controlPersonInfo = res.data.companyZrVo
|
|
|
+ this.contactInfo = res.data.companyZrVo
|
|
|
+ }
|
|
|
},
|
|
|
async submitClick(type) {
|
|
|
+ const fileIds = []
|
|
|
+ const legalParams = await this.$refs.legalPersonInfoRef.getParams(type)
|
|
|
+ console.log(legalParams)
|
|
|
+ const legalReqParams = {
|
|
|
+ legalPerson: legalParams.legalName || '', // 法人姓名
|
|
|
+ legalPersonBirthday: legalParams.bornDate || '', // 法人出生日期
|
|
|
+ legalPersonPhone: legalParams.phoneNumber || '', // 法人手机号码
|
|
|
+ legalPersonCard: legalParams.personCard || '', // 法人身份证号
|
|
|
+ legalPersonEmail: legalParams.email || '', // 法人邮箱
|
|
|
+ legalPersonProvince: legalParams.cascaderAddress[0] || '', // 省code
|
|
|
+ legalPersonCity: legalParams.cascaderAddress[1] || '', // 市code
|
|
|
+ legalPersonCounty: legalParams.cascaderAddress[2] || '', // 区code
|
|
|
+ legalPersonAddress: legalParams.contactAddress || '', // 法人身份证地址
|
|
|
+ legalPersonLiveAddress: legalParams.inputAddress || '' // 详细地址
|
|
|
+ }
|
|
|
+ fileIds.push(legalParams.cardFrontId, legalParams.cardBackId, legalParams.creditId)
|
|
|
+
|
|
|
+ const controlParams = await this.$refs.controlPersonInfoRef.getParams(type)
|
|
|
+ console.log(controlParams)
|
|
|
+ const controlReqParams = {
|
|
|
+ realControlPerson: controlParams.legalName || '', // 实控人姓名
|
|
|
+ realControlPersonBirthday: controlParams.bornDate || '', // 实控人出生日期
|
|
|
+ realControlPersonPhone: controlParams.phoneNumber || '', // 实控人手机号码
|
|
|
+ realControlPersonCard: controlParams.personCard || '', // 实控人身份证号
|
|
|
+ realControlPersonEmail: controlParams.email || '', // 法人邮箱
|
|
|
+ realControlPersonProvince: controlParams.cascaderAddress[0] || '', // 省code
|
|
|
+ realControlPersonCity: controlParams.cascaderAddress[1] || '', // 市code
|
|
|
+ realControlPersonCounty: controlParams.cascaderAddress[2] || '', // 区code
|
|
|
+ realControlPersonAddress: controlParams.contactAddress || '', // 法人身份证地址
|
|
|
+ realControlPersonLiveAddress: controlParams.inputAddress || '' // 详细地址
|
|
|
+ }
|
|
|
+ fileIds.push(controlParams.cardFrontId, controlParams.cardBackId, controlParams.creditId)
|
|
|
+
|
|
|
+ const contactParams = await this.$refs.contactInfoRef.getParams(type)
|
|
|
+ const contactReqParams = {
|
|
|
+ ...contactParams
|
|
|
+ }
|
|
|
+
|
|
|
+ const supParams = {
|
|
|
+ Loading: true,
|
|
|
+ companyId: this.$route.query.id,
|
|
|
+ ...legalReqParams,
|
|
|
+ ...controlReqParams,
|
|
|
+ ...contactReqParams,
|
|
|
+ fileIds,
|
|
|
+ flag: type === 'temp' ? 0 : 1
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$route.query.companyZrId) {
|
|
|
+ supParams.companyZrId = this.$route.query.companyZrId
|
|
|
+ }
|
|
|
+
|
|
|
+ const res = await enterpriseAccessStepOne(supParams)
|
|
|
+
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ if (type === 'temp') {
|
|
|
+ this.$router.go(-1)
|
|
|
+ } else if (type === 'submit') {
|
|
|
+ if (res.data.redNo) {
|
|
|
+ this.$router.go(-1)
|
|
|
+ } else {
|
|
|
+ this.$router.push({
|
|
|
+ name: 'StoreEnterpriseAuth',
|
|
|
+ query: {
|
|
|
+ zrId: res.data.companyZrId,
|
|
|
+ taskId: res.data.taskId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|