Bläddra i källkod

Merge branch 'dev' of http://222.90.211.174:3000/suf/domestic--e-commerc-c into dev

sufan 5 dagar sedan
förälder
incheckning
cc27e5c43b
3 ändrade filer med 111 tillägg och 30 borttagningar
  1. 1 1
      package.json
  2. 108 27
      src/views/myStoreEnterprise/EnterpriseEdit.vue
  3. 2 2
      yarn.lock

+ 1 - 1
package.json

@@ -19,7 +19,7 @@
     "axios": "0.18.1",
     "core-js": "^3.33.2",
     "docx-preview": "^0.3.0",
-    "driver.js": "^1.3.1",
+    "driver.js": "1.3.1",
     "element-ui": "2.15.14",
     "exceljs": "^4.4.0",
     "handsontable": "^14.1.0",

+ 108 - 27
src/views/myStoreEnterprise/EnterpriseEdit.vue

@@ -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
+              }
+            })
+          }
+        }
+      }
     }
   }
 }

+ 2 - 2
yarn.lock

@@ -4523,9 +4523,9 @@ dotenv@^8.2.0:
   resolved "https://registry.npmmirror.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
   integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==
 
-driver.js@^1.3.1:
+driver.js@1.3.1:
   version "1.3.1"
-  resolved "https://registry.npmmirror.com/driver.js/-/driver.js-1.3.1.tgz#5ac4d0d9e1c60f7eade418992ceffef7bf6c6610"
+  resolved "https://registry.yarnpkg.com/driver.js/-/driver.js-1.3.1.tgz#5ac4d0d9e1c60f7eade418992ceffef7bf6c6610"
   integrity sha512-MvUdXbqSgEsgS/H9KyWb5Rxy0aE6BhOVT4cssi2x2XjmXea6qQfgdx32XKVLLSqTaIw7q/uxU5Xl3NV7+cN6FQ==
 
 duplexer2@~0.1.4: