Browse Source

调整新注册企业卖家申请过程

suntg 7 years ago
parent
commit
221200e1f1

+ 3 - 8
components/register-saler/Register.vue

@@ -84,18 +84,13 @@
       } else {
         isSelf = true
       }
-      if (!isSelf) {
+      if (!isSelf) { // 是企业
         this.$http.get('/basic/enterprise/' + tempEnterprise.uu + '/detailInfo')
           .then(response => {
             this.enterpriseData = response.data
+            this.section = 1
+            this.checkData.checked = false
           })
-        if (tempEnterprise.isVendor === 1690) { // 是企业
-          this.section = 1
-          this.checkData.checked = false
-        } else if (typeof tempEnterprise.isVendor === 'undefined' || tempEnterprise.isVendor === '') {
-          this.section = 1
-          this.checkData.checked = false
-        }
       } else { // 是个人
         this.$http.get('/basic/user/userCacheEnterprise')
           .then(response => {

+ 17 - 8
components/register-saler/register/StepFirst.vue

@@ -324,7 +324,7 @@
           this.checkFullData()
           this.submitRegisterData()
         }
-        if (val.spaceName) {  // 企业
+        if (val.uu) {  // 企业
           this.initData(val)
 //          this.nameCheck(3)
 //          this.nameTypeCheck()
@@ -361,15 +361,16 @@
     },
     methods: {
       initData: function (val) {
-        this.data.name = val.spaceName || val.name || ''
-        this.data.licenceId = val.businessCode || val.licenceId || ''
-        this.data.address = val.address || ''
+        console.log(val)
+        this.data.name = val.spaceName || val.enName || val.name || ''
+        this.data.licenceId = val.businessCode || val.enBussinessCode || ''
+        this.data.address = val.address || val.enAddress || ''
       },
       sectionChange: function (type) {
         if (!this.isValid) {
           this.$message.error('请填写正确的注册信息')
         } else {
-          if (this.enterpriseData.spaceUU) {
+          if (this.enterpriseData.uu) {
             this.enCheckFullData()
           } else {
             this.checkFullData()
@@ -385,9 +386,13 @@
 //          data.url = this.data.url
           enterprise.enIsRead = false
 //          enterprise.enBussinessCodeImage = this.data.url
+          // 个人用户,提交保存缓存企业信息
           if (this.loginData.isSelf) {
             this.$http.post('/basic/user/userCacheEnterprise', enterprise)
             this.$emit('isSelfCacheDataAction', enterprise)
+          } else { // 企业用户,更新当前企业信息,主要是更新企业地址
+            this.enterpriseData.enAddress = this.data.address
+            this.$http.post('/basic/enterprise/' + this.enterpriseData.uu + '/info', this.enterpriseData)
           }
           this.$emit('registerAction', data)
           this.$emit('sectionEvent', type)
@@ -483,10 +488,12 @@
       enCheckFullData: function () {
         this.isValid = this.validAddress.isValidAddress
       },
+      // 企业名称字符验证
       nameTypeCheck: function () {
         this.validName.isValidTypeName = this.data.name !== '' && this.data.name.length >= 2 && this.data.name.length <= 99 && this.commonValid(this.data.name)
         this.validName.init = false
       },
+      // 企业名称是否已存在验证
       nameCheck: function (num) {
         if (num > 0) {
           this.$http.post('/basic/enterprise/register/valid/name?name=' + this.data.name)
@@ -526,12 +533,14 @@
           this.validCheck()
         }
       },
-      addressCheck: function () {  // 个人地址校验
+      // 个人地址校验
+      addressCheck: function () {
         this.validAddress.init = false
         this.validAddress.isValidAddress = this.data.address !== ''
         this.validCheck()
       },
-      enAddressCheck: function () {  // 企业地址校验
+      // 企业地址校验
+      enAddressCheck: function () {
         this.validAddress.init = false
         this.validAddress.isValidAddress = this.data.address !== ''
         this.enValidCheck()
@@ -622,7 +631,7 @@
           if (this.address.detail !== '') {
             this.data.address = this.address.currentProvince + this.address.currentCity + this.address.currentDistrict + this.address.detail
             this.showAddressBox = false
-            if (this.enterpriseData.spaceUU) {
+            if (this.enterpriseData.uu) {
               this.enAddressCheck()
             } else {
               this.addressCheck()