浏览代码

页面优化

喻文俊 3 年之前
父节点
当前提交
2767983a10

+ 5 - 0
src/components/UploadFile/index.vue

@@ -2,6 +2,7 @@
   <div>
     <el-upload
       ref="fileUpload"
+      :data="data"
       :auto-upload="autoUpload"
       :class="{ 'el-upload-hidden': !chooseState}"
       :action="action"
@@ -62,6 +63,10 @@ export default {
     autoUpload: {
       type: Boolean,
       default: true
+    },
+    data: {
+      type: Object,
+      default: () => ({})
     }
   },
   data() {

+ 15 - 15
src/router/module/audit.js

@@ -7,35 +7,35 @@ const clubAuditRoutes = [
     path: 'club',
     component: () => import('@/views/admin/audit/club'),
     name: 'AuditClub',
-    meta: { title: '机构认证', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club1' }
+    meta: { title: '机构认证', roles: ['admin'], noCache: true, id: 'club1' }
   },
   {
     path: 'club-list',
     hidden: true,
     component: () => import('@/views/admin/audit/club/list'),
     name: 'AuditClubList',
-    meta: { title: '机构认证审核', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club2' }
+    meta: { title: '机构认证审核', roles: ['admin'], noCache: true, id: 'club2' }
   },
   {
     path: 'club-detail',
     hidden: true,
     component: () => import('@/views/admin/audit/club/review'),
     name: 'AuditClubDetail',
-    meta: { title: '机构认证审核详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club3' }
+    meta: { title: '机构认证审核详情', roles: ['admin'], noCache: true, id: 'club3' }
   },
   {
     path: 'club-device-list',
     hidden: true,
     component: () => import('@/views/admin/audit/club/device'),
     name: 'AuditClubDeviceList',
-    meta: { title: '设备审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club4' }
+    meta: { title: '设备审核列表', roles: ['admin'], noCache: true, id: 'club4' }
   },
   {
     path: 'club-device-detail',
     hidden: true,
     component: () => import('@/views/admin/audit/club/device/review'),
     name: 'AuditClubDeviceDetail',
-    meta: { title: '设备审核详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club4' }
+    meta: { title: '设备审核详情', roles: ['admin'], noCache: true, id: 'club4' }
   }
 ]
 
@@ -45,21 +45,21 @@ const doctorAuditRoutes = [
     path: 'doctor',
     component: () => import('@/views/admin/audit/doctor'),
     name: 'AuditDoctor',
-    meta: { title: '医师认证', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club6' }
+    meta: { title: '医师认证', roles: ['admin'], noCache: true, id: 'club6' }
   },
   {
     path: 'doctor-list',
     hidden: true,
     component: () => import('@/views/admin/audit/doctor/list'),
     name: 'AuditDoctorList',
-    meta: { title: '医师审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club7' }
+    meta: { title: '医师审核列表', roles: ['admin'], noCache: true, id: 'club7' }
   },
   {
     path: 'doctor-detail',
     hidden: true,
     component: () => import('@/views/admin/audit/doctor/review'),
     name: 'AuditDoctorDetail',
-    meta: { title: '医师审核详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club8' }
+    meta: { title: '医师审核详情', roles: ['admin'], noCache: true, id: 'club8' }
   }
 ]
 
@@ -69,49 +69,49 @@ const materialAuditRoutes = [
     path: 'material',
     component: () => import('@/views/admin/audit/material'),
     name: 'AuditMaterial',
-    meta: { title: '资料库', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club9' }
+    meta: { title: '资料库', roles: ['admin'], noCache: true, id: 'club9' }
   },
   {
     path: 'material/article-list',
     component: () => import('@/views/admin/audit/material/article'),
     name: 'AuditMaterialArticleList',
     hidden: true,
-    meta: { title: '文章审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club10' }
+    meta: { title: '文章审核列表', roles: ['admin'], noCache: true, id: 'club10' }
   },
   {
     path: 'material/article-detail',
     component: () => import('@/views/admin/audit/material/article/review'),
     name: 'AuditMaterialArticleDetail',
     hidden: true,
-    meta: { title: '审核文章', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club11' }
+    meta: { title: '审核文章', roles: ['admin'], noCache: true, id: 'club11' }
   },
   {
     path: 'material/image-list',
     component: () => import('@/views/admin/audit/material/image'),
     name: 'AuditMaterialImageList',
     hidden: true,
-    meta: { title: '图片审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club12' }
+    meta: { title: '图片审核列表', roles: ['admin'], noCache: true, id: 'club12' }
   },
   {
     path: 'material/image-detail',
     component: () => import('@/views/admin/audit/material/image/review'),
     name: 'AuditMaterialImageDetail',
     hidden: true,
-    meta: { title: '审核图片', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club3' }
+    meta: { title: '审核图片', roles: ['admin'], noCache: true, id: 'club3' }
   },
   {
     path: 'material/video-list',
     component: () => import('@/views/admin/audit/material/video'),
     name: 'AuditMaterialVideoList',
     hidden: true,
-    meta: { title: '视频审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club4' }
+    meta: { title: '视频审核列表', roles: ['admin'], noCache: true, id: 'club4' }
   },
   {
     path: 'material/file-list',
     component: () => import('@/views/admin/audit/material/file'),
     name: 'AuditMaterialFileList',
     hidden: true,
-    meta: { title: '文件审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club5' }
+    meta: { title: '文件审核列表', roles: ['admin'], noCache: true, id: 'club5' }
   }
 ]
 

+ 7 - 14
src/router/module/club.js

@@ -15,28 +15,21 @@ const clubRoutes = [
         path: 'list',
         component: () => import('@/views/normal/club'),
         name: 'ClubList',
-        meta: {
-          title: '机构列表',
-          icon: 'el-icon-menu',
-          roles: ['admin', 'normal'],
-          affix: true,
-          noCache: true,
-          proxy: true
-        }
+        meta: { title: '机构列表', roles: ['admin', 'normal'], affix: true, noCache: true, proxy: true }
       },
       {
         path: 'club-add',
         component: () => import('@/views/normal/club/edit'),
         name: 'ClubAdd',
         hidden: true,
-        meta: { title: '添加机构', icon: 'el-icon-menu', roles: ['normal'], noCache: true, proxy: true }
+        meta: { title: '添加机构', roles: ['normal'], noCache: true, proxy: true }
       },
       {
         path: 'club-edit',
         component: () => import('@/views/normal/club/edit'),
         name: 'ClubEdit',
         hidden: true,
-        meta: { title: '修改机构', icon: 'el-icon-menu', roles: ['normal'], noCache: true, proxy: true }
+        meta: { title: '修改机构', roles: ['normal'], noCache: true, proxy: true }
       },
       // 用户
       {
@@ -44,7 +37,7 @@ const clubRoutes = [
         component: () => import('@/views/normal/club/user'),
         name: 'ClubUserList',
         hidden: true,
-        meta: { title: '登录用户', icon: 'el-icon-menu', roles: ['normal'], noCache: true, proxy: true }
+        meta: { title: '登录用户', roles: ['normal'], noCache: true, proxy: true }
       },
       // 设备
       {
@@ -52,21 +45,21 @@ const clubRoutes = [
         path: 'device-list',
         component: () => import('@/views/normal/club/device'),
         name: 'ClubDeviceList',
-        meta: { title: '设备列表', icon: 'el-icon-menu', roles: ['normal'], noCache: true, id: 24 }
+        meta: { title: '设备列表', roles: ['normal'], noCache: true, id: 24 }
       },
       {
         hidden: true,
         path: 'device-add',
         component: () => import('@/views/normal/club/device/edit'),
         name: 'ClubDeviceAdd',
-        meta: { title: '添加设备', icon: 'el-icon-menu', roles: ['normal'], noCache: true, proxy: true, id: 25 }
+        meta: { title: '添加设备', roles: ['normal'], noCache: true, proxy: true, id: 25 }
       },
       {
         hidden: true,
         path: 'device-edit',
         component: () => import('@/views/normal/club/device/edit'),
         name: 'ClubDeviceEdit',
-        meta: { title: '修改设备', icon: 'el-icon-menu', roles: ['normal'], noCache: true, proxy: true, id: 26 }
+        meta: { title: '修改设备', roles: ['normal'], noCache: true, proxy: true, id: 26 }
       }
     ]
   }

+ 4 - 10
src/router/module/doctor.js

@@ -9,33 +9,27 @@ const doctorRoutes = [
     alwaysShow: true,
     redirect: '/doctor/list',
     name: 'Doctor',
-    meta: {
-      title: '医师认证',
-      icon: 'el-icon-user-solid',
-      roles: ['normal'],
-      noCache: true,
-      proxy: true
-    },
+    meta: { title: '医师认证', icon: 'el-icon-user-solid', roles: ['normal'], noCache: true, proxy: true },
     children: [
       {
         path: 'list',
         component: () => import('@/views/normal/doctor'),
         name: 'DoctorList',
-        meta: { title: '医师列表', icon: 'el-icon-menu', roles: ['normal'], noCache: true, proxy: true }
+        meta: { title: '医师列表', roles: ['normal'], noCache: true, proxy: true }
       },
       {
         hidden: true,
         path: 'add',
         component: () => import('@/views/normal/doctor/edit'),
         name: 'DoctorAdd',
-        meta: { title: '添加医师', icon: 'el-icon-menu', roles: ['normal'], noCache: true, proxy: true }
+        meta: { title: '添加医师', roles: ['normal'], noCache: true, proxy: true }
       },
       {
         hidden: true,
         path: 'edit',
         component: () => import('@/views/normal/doctor/edit'),
         name: 'DoctorEdit',
-        meta: { title: '修改医师资料', icon: 'el-icon-menu', roles: ['normal'], noCache: true, proxy: true }
+        meta: { title: '修改医师资料', roles: ['normal'], noCache: true, proxy: true }
       }
     ]
   }

+ 2 - 2
src/router/module/feedback.js

@@ -15,14 +15,14 @@ const feedbackRoutes = [
         path: 'list',
         component: () => import('@/views/normal/feedback'),
         name: 'FeedbackList',
-        meta: { title: '反馈列表', icon: 'el-icon-menu', roles: ['normal'], noCache: true }
+        meta: { title: '反馈列表', roles: ['normal'], noCache: true }
       },
       {
         path: 'detail',
         component: () => import('@/views/normal/feedback/detail'),
         name: 'FeedbackDetail',
         hidden: true,
-        meta: { title: '反馈处理', icon: 'el-icon-menu', roles: ['normal'], noCache: true }
+        meta: { title: '反馈处理', roles: ['normal'], noCache: true }
       }
     ]
   }

+ 2 - 16
src/router/module/helper.js

@@ -15,27 +15,13 @@ const helperRoutes = [
         path: 'video',
         component: () => import('@/views/common/helper/video'),
         name: 'HelperVideo',
-        meta: {
-          title: '视频教程',
-          icon: 'el-icon-menu',
-          roles: ['admin', 'normal'],
-          affix: false,
-          noCache: true,
-          proxy: false
-        }
+        meta: { title: '视频教程', roles: ['admin', 'normal'], affix: false, noCache: true, proxy: false }
       },
       {
         path: 'document',
         component: () => import('@/views/common/helper/document'),
         name: 'HelperDocument',
-        meta: {
-          title: '文档教程',
-          icon: 'el-icon-menu',
-          roles: ['admin', 'normal'],
-          affix: false,
-          noCache: true,
-          proxy: false
-        }
+        meta: { title: '文档教程', roles: ['admin', 'normal'], affix: false, noCache: true, proxy: false }
       }
     ]
   }

+ 7 - 7
src/router/module/supplier.js

@@ -15,49 +15,49 @@ const supplierRoutes = [
         path: 'list',
         component: () => import('@/views/admin/supplier'),
         name: 'SupplierList',
-        meta: { title: '供应商账号', icon: 'el-icon-menu', affix: true, roles: ['admin'], noCache: true }
+        meta: { title: '供应商账号', affix: true, roles: ['admin'], noCache: true }
       },
       {
         hidden: true,
         path: 'supplier-add',
         component: () => import('@/views/admin/supplier/edit'),
         name: 'SupplierAdd',
-        meta: { title: '添加供应商', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+        meta: { title: '添加供应商', roles: ['admin'], noCache: true }
       },
       {
         hidden: true,
         path: 'supplier-edit',
         component: () => import('@/views/admin/supplier/edit'),
         name: 'SupplierEdit',
-        meta: { title: '修改供应商', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+        meta: { title: '修改供应商', roles: ['admin'], noCache: true }
       },
       {
         hidden: true,
         path: 'club-list',
         component: () => import('@/views/admin/supplier/club'),
         name: 'SupplierClubList',
-        meta: { title: '查看认证机构', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+        meta: { title: '查看认证机构', roles: ['admin'], noCache: true }
       },
       {
         hidden: true,
         path: 'club-detail',
         component: () => import('@/views/admin/supplier/club/detail'),
         name: 'SupplierClubDetail',
-        meta: { title: '认证机构详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+        meta: { title: '认证机构详情', roles: ['admin'], noCache: true }
       },
       {
         hidden: true,
         path: 'club-device-list',
         component: () => import('@/views/admin/supplier/club/device'),
         name: 'SupplierClubDeviceList',
-        meta: { title: '查看设备认证', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+        meta: { title: '查看设备认证', roles: ['admin'], noCache: true }
       },
       {
         hidden: true,
         path: 'club-device-detail',
         component: () => import('@/views/admin/supplier/club/device/detail'),
         name: 'SupplierClubDeviceDetail',
-        meta: { title: '设备认证详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+        meta: { title: '设备认证详情', roles: ['admin'], noCache: true }
       }
     ]
   }

+ 112 - 36
src/views/admin/supplier/edit.vue

@@ -30,7 +30,7 @@
         >
           <el-option v-for="item in brandList" :key="item.id" :label="item.name" :value="item.id" />
         </el-select>
-        <el-input v-model="submitForm.shopName" placeholder="请输入供应商名称" maxlength="50" show-word-limit :disabled="editType === 'edit'" />
+        <el-input v-else v-model="submitForm.shopName" placeholder="请输入供应商名称" maxlength="50" show-word-limit :disabled="editType === 'edit'" />
       </el-form-item>
       <!-- 供应商名称END -->
 
@@ -61,6 +61,7 @@
             <el-tag v-for="(brand , index) in supplierBrands" :key="index" closable type="success" @close="handleRemoveBrand(brand)" @click="handleEditBrand(brand)">{{ brand.brandName }}</el-tag>
           </template>
           <el-tag type="primary" @click="handleAddBrand">添加品牌<span class="el-icon-plus" /></el-tag>
+          <el-input v-show="false" v-model="submitForm.shopInfo" />
         </el-form-item>
       </transition>
 
@@ -135,7 +136,7 @@
     </div>
 
     <!-- 供应商添加品牌的对话框 -->
-    <el-dialog title="添加供应商品牌" :visible.sync="dialogAddBrand" width="width" @close="handleDialogAddBrandClosed">
+    <el-dialog :title="editBrandText" :visible.sync="dialogAddBrand" width="width" @close="handleDialogAddBrandClosed">
       <el-form ref="subFormRef" :model="subForm" label-width="120px" :rules="formDataRules">
 
         <el-form-item label="选择品牌:" prop="brandId">
@@ -208,7 +209,9 @@
           <upload-file
             ref="fileUpload"
             :auto-upload="false"
+            :data="uploadParams"
             :file-list="statementFileList"
+            :before-upload="beforeUploadStatementFile"
             @success="uploadStatementFileSuccess"
             @remove="removeStatementFile"
             @change="changeStatementFile"
@@ -223,8 +226,8 @@
       </el-form>
 
       <div slot="footer">
-        <el-button @click="dialogAddBrand = false">取 消</el-button>
-        <el-button type="primary" :loading="dialogLoading" @click="handleSaveBrand">确 定</el-button>
+        <el-button @click="addBrandSubmitCancel">取 消</el-button>
+        <el-button type="primary" :loading="submitLoading" @click="handleSaveBrand">确 定</el-button>
       </div>
     </el-dialog>
 
@@ -239,6 +242,7 @@ import { isMobile } from '@/utils/validate'
 import { fetchBrandList } from '@/api/brand'
 import { deepClone } from '@/utils'
 import { addSupplier, getSupplierById } from '@/api/supplier'
+import { Promise } from 'jszip/lib/external'
 let uuid = 0
 
 export default {
@@ -250,11 +254,20 @@ export default {
       }
       return callback()
     }
+
+    const validShopInfo = (rule, value, callback) => {
+      console.log(value)
+      if (value <= 0) {
+        return callback(new Error('代理品牌不能为空'))
+      }
+      return callback()
+    }
+
     return {
       id: '', // 供应商id
       editType: '',
       isLoading: false,
-      dialogLoading: false,
+      submitLoading: false,
       dialogAddBrand: false,
       brandTagClickType: '', // 品牌表单点击类型
       selectedShopType: 1, // 当前选中的供应商类型
@@ -301,7 +314,10 @@ export default {
         linkMan: { required: true, message: '联系人不能为空', tigger: 'blur' },
         countryId: { required: true, message: '产地不能为空', tigger: 'change', type: 'number' },
         brandAuthLogo: { required: true, message: '品牌logo不能为空', tigger: 'change' },
-        shopInfo: { required: true, message: '代理品牌不能为空', tigger: 'change', type: 'string' },
+        shopInfo: [
+          { required: true, message: '代理品牌不能为空', tigger: 'change', type: 'number' },
+          { validator: validShopInfo, tigger: 'change' }
+        ],
         brandId: { required: true, message: '品牌不能为空', tigger: 'change', type: 'number' },
         statementContent: { required: true, message: '声明内容不能为空', tigger: 'change' }, // 声明内容
         statementFileId: { required: true, message: '声明文件不能为空', tigger: 'change', type: 'number' }, // 声明文件id
@@ -335,20 +351,36 @@ export default {
       }
 
       return this.brandList
+    },
+    // 文件上传参数
+    uploadParams() {
+      return {
+        brandId: this.currentBrand.id,
+        authUserId: this.id
+      }
+    },
+    // 文案提示
+    editTypeText() {
+      return this.editType === 'edit' ? '修改' : '添加'
+    },
+    editBrandText() {
+      return this.brandTagClickType === 'edit' ? '修改品牌' : '添加品牌'
     }
   },
   watch: {
+    // 根据供应商类型变化获取品牌列表
     selectedShopType(nVal) {
       this.getBrandList(nVal)
     }
   },
   created() {
-    this.editType = this.$route.query.type || 'edit'
+    this.editType = this.$route.query.type || 'add'
     this.id = parseInt(this.$route.query.id) || ''
     this.getBrandList(this.selectedShopType)
     this.fetchSupplierInfo()
   },
   methods: {
+    /** 数据回显 */
     // 获取供应商信息
     fetchSupplierInfo() {
       if (!this.id) return
@@ -359,7 +391,6 @@ export default {
 
     // 初始化供应商信息
     initSupplierInfo(info) {
-      // 表单1
       for (const key in this.submitForm) {
         if (Object.hasOwnProperty.call(info, key)) {
           this.submitForm[key] = info[key]
@@ -391,18 +422,25 @@ export default {
         if (this.submitForm.logo) {
           this.logoList = [{ name: this.submitForm.brandName, url: this.submitForm.logo }]
         }
+
+        this.submitForm.shopInfo = this.supplierBrands.length
       }
 
       // 微信公众号二维码
       if (this.submitForm.qrCodeImage) {
         this.qrCodeImageList = [{ name: '', url: this.submitForm.qrCodeImage }]
       }
-
-      console.log(this.submitForm)
     },
+    /** 数据回显END */
 
     // 提交保存
-    submit() {
+    async submit() {
+      try {
+        await this.$refs.submitFormRef.validate()
+      } catch (err) {
+        return
+      }
+
       this.isLoading = true
       let params = {}
       if (this.selectedShopType === 1) {
@@ -417,7 +455,9 @@ export default {
 
       console.log(params)
       addSupplier(params).then(res => {
-        this.$message.success('添加供应商成功')
+        this.$message.success(`${this.editTypeText}供应商成功`)
+        this.$store.dispatch('tagsView/delView', this.$route)
+        this.$router.replace('/supplier/list')
       }).finally(() => {
         this.isLoading = false
       })
@@ -503,35 +543,41 @@ export default {
     // 添加品牌对话框
     handleAddBrand() {
       this.brandTagClickType = 'add'
+      // 文件上传参数
       this.dialogAddBrand = true
     },
     // 修改品牌
     handleEditBrand(row) {
       this.brandTagClickType = 'edit'
-      this.editBrandInfo = row
-      // 设置选中品牌信息
-      this.currentBrand.id = row.brandId
-      this.currentBrand.name = row.brandName
-      this.currentBrand.authLogo = row.brandAuthLogo
-      this.statementFileName = row.statementFileName
-
-      if (row.brandAuthLogo) {
-        this.brandAuthLogoList = [{ name: row.brandName, url: row.brandAuthLogo }]
-      }
+      // 等待dialog表单渲染完成后再设置值
+      this.$nextTick(() => {
+        this.editBrandInfo = row
+        // 设置选中品牌信息
+        this.currentBrand.id = row.brandId
+        this.currentBrand.name = row.brandName
+        this.currentBrand.authLogo = row.brandAuthLogo
+        this.statementFileName = row.statementFileName
+
+        if (row.brandAuthLogo) {
+          this.brandAuthLogoList = [{ name: row.brandName, url: row.brandAuthLogo }]
+        }
 
-      if (row.statementImage) {
-        this.statementImageList = [{ name: row.brandName, url: row.statementImage }]
-      }
+        if (row.statementImage) {
+          this.statementImageList = [{ name: row.brandName, url: row.statementImage }]
+        }
 
-      if (row.statementFileId) {
-        this.statementFileList = [{ name: row.statementFileName }]
-      }
+        if (row.statementFileId) {
+          this.statementFileList = [{ name: row.statementFileName }]
+        }
 
-      for (const key in this.subForm) {
-        if (Object.hasOwnProperty.call(this.editBrandInfo, key)) {
-          this.subForm[key] = this.editBrandInfo[key]
+        for (const key in this.subForm) {
+          if (Object.hasOwnProperty.call(this.editBrandInfo, key)) {
+            this.subForm[key] = this.editBrandInfo[key]
+          }
         }
-      }
+
+        console.log(this.subForm)
+      })
 
       this.dialogAddBrand = true
     },
@@ -542,12 +588,14 @@ export default {
       // 从已添加品牌列表中移除
       const findIndex = this.supplierBrands.findIndex(item => item.uuid === row.uuid)
       this.supplierBrands.splice(findIndex, 1)
+      this.submitForm.shopInfo = this.supplierBrands.length
     },
     // 保存品牌
     async handleSaveBrand() {
       if (this.subForm.statementType === 4) {
         console.log('有文件上传')
         if (!this.subForm.statementFileId || this.subForm.statementFileId === -1) {
+          this.submitLoading = true
           this.$refs.fileUpload.$refs.fileUpload.submit()
           return
         }
@@ -558,8 +606,18 @@ export default {
       } catch (error) {
         console.log(error)
       }
-      console.log(this.supplierBrands)
     },
+
+    // 取消保存品牌
+    addBrandSubmitCancel() {
+      // 取消上传文件
+      if (this.$refs.fileUpload) {
+        this.$refs.fileUpload.$refs.fileUpload.abort()
+        this.$message.info('文件上传已取消')
+      }
+      this.dialogAddBrand = false
+    },
+
     // 保存品牌操作
     handleSaveBrandAction() {
       // 深度克隆数据
@@ -593,6 +651,10 @@ export default {
       this.statementFileList = []
       this.brandAuthLogoList = []
       this.currentBrand = {}
+      this.submitForm.shopInfo = this.supplierBrands.length
+      // 按钮loading结束
+      this.submitLoading = false
+      // 初始化表单
       this.$refs.subFormRef.resetFields()
       console.log(this.subForm)
     },
@@ -606,8 +668,6 @@ export default {
       this.selectedShopType = type
       this.brandAuthLogoList = []
       this.statementImageList = []
-      // this.supplierBrands = []
-      // this.selectedBrandIds = []
       this.currentBrand = {}
     },
     // 获取品牌列表
@@ -619,6 +679,7 @@ export default {
         this.brandList = res.data
       })
     },
+    /** 品牌标签操作END */
 
     // 输入框输入时
     handleMobileInput() {
@@ -668,7 +729,7 @@ export default {
       this.subForm.statementImage = ''
     },
 
-    /** 声明文件上传 */
+    /** 文件上传 */
     uploadStatementFileSuccess({ response, file, fileList }) {
       this.statementFileList = fileList
       this.subForm.statementFileId = response.data.fileId
@@ -686,6 +747,21 @@ export default {
     changeStatementFile({ file, fileList }) {
       this.statementFileList = fileList
       this.subForm.statementFileId = -1
+    },
+    beforeUploadStatementFile(file) {
+      const maxSize = 30
+      if (file.size <= maxSize * 1024 * 1024) return true
+      return this.$confirm(`您上传的文件大于${maxSize}MB,是否继续上传?文件上传过程中请您耐心等待!`, '文件上传提示', {
+        confirmButtonText: '继续',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return Promise.resolve()
+      }).catch(() => {
+        this.$message.info('已取消上传')
+        this.submitLoading = false
+        return Promise.reject()
+      })
     }
   }
 }