Browse Source

上线前bug修改

yuwenjun 4 years ago
parent
commit
9eafe878e2

+ 3 - 4
.env.development

@@ -1,12 +1,11 @@
 # just a flag
 ENV = 'development'
 
-# base api
-# VUE_APP_BASE_API = 'http://192.168.2.68:8012'
+# 正式地址 API接口
 VUE_APP_BASE_API = 'https://zplma-b.caimei365.com'
 
-# 文件上传
+# 文件上传 API接口地址
 VUE_APP_UPLOAD_API='https://zplma-b.caimei365.com'
 
-#二维码生成链接server
+#二维码生成链接location
 VUE_APP_BASE_SERVER = 'https://www-b.caimei365.com'

+ 6 - 10
.env.production

@@ -1,15 +1,11 @@
 # just a flag
 ENV = 'production'
 
-# base api
-# 测试地址
-VUE_APP_BASE_API = 'https://zplma-b.caimei365.com'
+# 正式地址 API接口
+VUE_APP_BASE_API = 'https://zplma.caimei365.com'
 
-# 正式地址
-# VUE_APP_BASE_API = 'http://192.168.2.68:8012'
+# 文件上传 API接口地址
+VUE_APP_UPLOAD_API='https://zplma.caimei365.com'
 
-# 文件上传
-VUE_APP_UPLOAD_API='https://zplma-b.caimei365.com'
-
-#二维码生成链接server
-VUE_APP_BASE_SERVER = 'https://www-b.caimei365.com'
+#二维码生成链接location
+VUE_APP_BASE_SERVER = 'https://www.caimei365.com'

+ 1 - 1
package.json

@@ -7,7 +7,7 @@
     "dev": "vue-cli-service serve",
     "lint": "eslint --ext .js,.vue src",
     "build:prod": "vue-cli-service build",
-    "build:stage": "vue-cli-service build --mode staging",
+    "build:dev": "vue-cli-service build --mode development",
     "preview": "node build/index.js --preview",
     "new": "plop",
     "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",

+ 5 - 0
src/views/supplier/auth/index.vue

@@ -191,8 +191,12 @@ export default {
           this.addAuthFormData.authUserId = this.$route.query.id || this.proxyInfo?.authUserId || this.authUserId
           this.addAuthFormData.createBy = this.addAuthFormData.authUserId
           saveBrandAuth(this.addAuthFormData).then(res => {
+            if (res.code !== 0) {
+              return
+            }
             this.getList()
             this.$message.success(res.data)
+            this.$refs.addAuthForm.resetFields()
           }).catch(err => {
             console.log(err)
             this.$message.danger('操作失败')
@@ -270,6 +274,7 @@ export default {
     // 对话框关闭事件
     dialogClosed() {
       this.addAuthFormData.authId = ''
+      this.addAuthFormData.status = 1
       this.$refs.addAuthForm.resetFields()
     },
     handleShowEditDialog(title, data) {

+ 11 - 6
src/views/supplier/components/uploadFile.vue

@@ -45,10 +45,10 @@ export default {
       action: process.env.VUE_APP_UPLOAD_API + '/shop/upload/file',
       accept: '.doc,.ppt,.pdf',
       // 请求参数
-      params: {
-        authUserId: null,
-        brandId: null
-      },
+      // params: {
+      //   authUserId: null,
+      //   brandId: this.brandId || 0
+      // },
       headers: {
         'X-Token': ''
       },
@@ -56,11 +56,16 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['token'])
+    ...mapGetters(['token']),
+    params() {
+      return {
+        authUserId: null,
+        brandId: this.brandId || 0
+      }
+    }
   },
   created() {
     this.headers['X-Token'] = this.token
-    this.params.brandId = this.brandId || 0
   },
   methods: {
     success(response) {

+ 15 - 9
src/views/supplier/user/edit.vue

@@ -174,7 +174,7 @@
             v-if="brandData.statementType === 4"
             ref="uploadFileRef"
             :auth-user-id="addFromData.authUserId"
-            :brand-id="brandData.brandId"
+            :brand-id="brandId"
             :file-list="fileList3"
             @success="fileUploadSuccess"
             @error="fileUploadFaild"
@@ -224,6 +224,7 @@ export default {
       }
     }
     return {
+      brandId: '', // 上传文件时的品牌id
       supplierId: '',
       dialogLoading: false,
       isLoading: false,
@@ -493,9 +494,16 @@ export default {
       if (selectBrand.authLogo) {
         this.fileList1 = [{ name: '文件已上传', url: selectBrand.authLogo }]
       }
+      console.log(selectBrand.id)
+      this.brandId = selectBrand.id
     },
     // 添加品牌对话框开启
     handleShowDialog() {
+      try {
+        this.$refs.brandDataRef.clearValidate()
+      } catch (error) {
+        console.log('清空')
+      }
       this.showDialog = true
     },
     // 添加品牌
@@ -503,16 +511,9 @@ export default {
       // 如果声明类型为文件
       if (this.brandData.statementType === 4 && (this.brandData.statementFileId === null || this.brandData.statementFileId === '')) {
         this.brandData.statementFileId = this.brandData.statementFileId === null ? '' : null
+        console.log(this.brandId)
         this.$refs.uploadFileRef.$refs.upload.submit()
-        // if (this.brandData.isNew) {
-        //   this.addFromData.authUserId = -1
-        //   this.$refs.uploadFileRef.$refs.upload.submit()
-        // } else {
-        //   this.addFromData.authUserId = this.supplierId
-        //   this.$refs.uploadFileRef.$refs.upload.submit()
-        // }
       } else {
-        // this.addFromData.authUserId = this.supplierId
         this.saveBrand()
       }
     },
@@ -534,6 +535,7 @@ export default {
             this.prevBrandId = -1
             console.log('添加:' + this.excludeBrand)
           }
+          this.brandData.brandId = ''
           this.showDialog = false
         }
       })
@@ -559,6 +561,8 @@ export default {
         const name = this.brandData.statementFileName || '文件已上传'
         this.fileList3 = [{ name: name, url: '' }]
       }
+      console.log(this.brandListCody)
+      this.brandId = this.supplierBrands[index].brandId
       this.showDialog = true
     },
     // 删除
@@ -575,6 +579,8 @@ export default {
       this.fileList1 = []
       this.fileList2 = []
       this.fileList3 = []
+      this.brandData.brandId = ''
+      this.brandData.statementFileId = ''
       this.brandData.isNew = true
       // 如果部位-1 代表没有保存 则恢复到上一次的排除结果
       if (this.prevBrandId !== -1) {