3 Revize 401c8e604a ... d17d07ed16

Autor SHA1 Zpráva Datum
  Lijingyang d17d07ed16 Merge remote-tracking branch 'origin/master' před 1 měsícem
  Lijingyang 38c0ef1c9b feat(brand): 更新品牌管理中的供应商授权信息展示 před 1 měsícem
  Lijingyang e27d608586 feat(customer): 添加客户信息详情页面的各个功能模块组件 před 1 měsícem

+ 58 - 8
src/api/product/brand/types.ts

@@ -98,11 +98,17 @@ export interface BrandVO {
    */
   dataSource: string;
 
+  remark: string;
+
   /**
-   * 备注
+   * 品牌状态(0审核中 1已生效 2资质已过期 3驳回)
    */
-  remark: string;
+  brandStatus?: number;
 
+  /**
+   * 供应商授权列表
+   */
+  supplierAuthorizeList?: SupplierAuthorizeVO[];
 }
 
 export interface BrandForm extends BaseEntity {
@@ -201,11 +207,17 @@ export interface BrandForm extends BaseEntity {
    */
   dataSource?: string;
 
+  remark?: string;
+
   /**
-   * 备注
+   * 品牌状态(0审核中 1已生效 2资质已过期 3驳回)
    */
-  remark?: string;
+  brandStatus?: number;
 
+  /**
+   * 供应商授权列表
+   */
+  supplierAuthorizeList?: SupplierAuthorizeVO[];
 }
 
 export interface BrandQuery extends PageQuery {
@@ -305,10 +317,48 @@ export interface BrandQuery extends PageQuery {
    */
   platformCode?: string;
 
-    /**
-     * 日期范围参数
-     */
-    params?: any;
+  /**
+   * 品牌状态(0审核中 1已生效 2资质已过期 3驳回)
+   */
+  brandStatus?: number;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}
+
+export interface SupplierAuthorizeVO {
+  id?: string | number;
+  categoryId?: string | number;
+  brandId?: string | number;
+  supplierNo?: string;
+  supplierId?: string | number;
+  supplierName?: string;
+  supplyProCate?: string;
+  supplyBrand?: string;
+  authorizeNo?: string;
+  authBrand?: string;
+  brandNo?: string;
+  brandName?: string;
+  brandEnglishName?: string;
+  brandLogo?: string;
+  authorizeType?: string;
+  authorizationCategory?: string;
+  brandLicensor?: string;
+  authorizationRelationshipFile?: string;
+  authorizationStartTime?: string;
+  authorizationEndTime?: string;
+  authorizedArea?: string;
+  brandHoldType?: string;
+  authorizeLevel?: string;
+  authorizedStatus?: string;
+  authorizationRelationshipFileName?: string;
+  brandRegistrant?: string;
+  reviewFeedback?: string;
+  province?: string;
+  city?: string;
+  categorysMap?: Record<string, string>;
 }
 
 

+ 38 - 0
src/api/supplier/supplierauthorize/index.ts

@@ -16,6 +16,32 @@ export const listSupplierauthorize = (query?: SupplierauthorizeQuery): AxiosProm
   });
 };
 
+/**
+ * 查询授权详情列表(新接口)
+ * @param query
+ * @returns {*}
+ */
+export const getAuthorizeDetailList = (query?: SupplierauthorizeQuery): AxiosPromise<SupplierauthorizeVO[]> => {
+  return request({
+    url: '/customer/supplierauthorize/getscmDetailList',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 获取品牌授权详情(编辑回显用)
+ * @param id
+ */
+export const getBrandAuthorizeDetail = (id: string | number): AxiosPromise<SupplierauthorizeVO> => {
+  return request({
+    url: '/customer/supplierauthorize/getBrandAuthorizeDetail',
+    method: 'get',
+    params: { id }
+  });
+};
+
+
 /**
  * 查询供应能力查询详细
  * @param id
@@ -51,6 +77,18 @@ export const updateSupplierauthorize = (data: SupplierauthorizeForm) => {
   });
 };
 
+/**
+ * 审核
+ * @param data
+ */
+export const examSupplierauthorize = (data: SupplierauthorizeForm) => {
+  return request({
+    url: '/customer/supplierauthorize/exam',
+    method: 'put',
+    data: data
+  });
+};
+
 /**
  * 删除供应能力查询
  * @param id

+ 26 - 0
src/api/supplier/supplierauthorize/types.ts

@@ -123,6 +123,16 @@ export interface SupplierauthorizeForm extends BaseEntity {
    */
   brandNo?: string;
 
+  /**
+   * 省
+   */
+  province?: string;
+
+  /**
+   * 市
+   */
+  city?: string;
+
   /**
    * 品牌名称(中文)
    */
@@ -165,6 +175,7 @@ export interface SupplierauthorizeForm extends BaseEntity {
 
   /**
    * 授权结束时间
+
    */
   authorizationEndTime?: string;
 
@@ -212,6 +223,21 @@ export interface SupplierauthorizeQuery extends PageQuery {
    */
   supplierNo?: string;
 
+  /**
+   * 品牌编号
+   */
+  brandNo?: string;
+
+  /**
+   * 省
+   */
+  province?: string;
+
+  /**
+   * 市
+   */
+  city?: string;
+
   /**
    * 品牌名称(中文)
    */

+ 6 - 1
src/api/system/oss/index.ts

@@ -13,8 +13,13 @@ export function listOss(query: OssQuery): AxiosPromise<OssVO[]> {
 
 // 查询OSS对象基于id串
 export function listByIds(ossId: string | number): AxiosPromise<OssVO[]> {
+  const raw = String(ossId ?? '').trim();
+  const isOssIds = /^\d+(,\d+)*$/.test(raw);
+  if (!isOssIds) {
+    return Promise.resolve({ data: [] } as any);
+  }
   return request({
-    url: '/resource/oss/listByIds/' + ossId,
+    url: '/resource/oss/listByIds/' + raw,
     method: 'get'
   });
 }

+ 18 - 8
src/components/FileUpload/index.vue

@@ -48,6 +48,7 @@
 import { propTypes } from '@/utils/propTypes';
 import { delOss, listByIds } from '@/api/system/oss';
 import { globalHeaders } from '@/utils/request';
+import { isHttp } from '@/utils/validate';
 
 const props = defineProps({
   modelValue: {
@@ -93,14 +94,23 @@ watch(
       if (Array.isArray(val)) {
         list = val;
       } else {
-        const res = await listByIds(val);
-        list = res.data.map((oss) => {
-          return {
-            name: oss.originalName,
-            url: oss.url,
-            ossId: oss.ossId
-          };
-        });
+        const raw = String(val ?? '').trim();
+        const isOssIds = /^\d+(,\d+)*$/.test(raw);
+        if (isOssIds) {
+          const res = await listByIds(raw);
+          list = res.data.map((oss) => {
+            return {
+              name: oss.originalName,
+              url: oss.url,
+              ossId: oss.ossId
+            };
+          });
+        } else if (isHttp(raw) || raw.startsWith('blob:')) {
+          list = [{ name: raw, url: raw, ossId: undefined }];
+        } else {
+          fileList.value = [];
+          return;
+        }
       }
       // 然后将数组转为对象数组
       fileList.value = list.map((item) => {

+ 46 - 7
src/components/ImageUpload/index.vue

@@ -16,7 +16,8 @@
       :headers="headers"
       :file-list="fileList"
       :on-preview="handlePictureCardPreview"
-      :class="{ hide: fileList.length >= limit }"
+      :disabled="disabled"
+      :class="{ hide: disabled || fileList.length >= limit }"
     >
       <el-icon class="avatar-uploader-icon">
         <plus />
@@ -45,6 +46,7 @@ import { listByIds, delOss } from '@/api/system/oss';
 import { OssVO } from '@/api/system/oss/types';
 import { propTypes } from '@/utils/propTypes';
 import { globalHeaders } from '@/utils/request';
+import { isHttp } from '@/utils/validate';
 import { compressAccurately } from 'image-conversion';
 
 const props = defineProps({
@@ -63,6 +65,16 @@ const props = defineProps({
     type: Boolean,
     default: true
   },
+  // 是否禁用(只读)
+  disabled: {
+    type: Boolean,
+    default: false
+  },
+  // v-model 保存值类型:默认 ossId(兼容旧逻辑);url 表示直接保存图片url/路径
+  valueType: {
+    type: String,
+    default: 'ossId'
+  },
   // 是否支持压缩,默认否
   compressSupport: {
     type: Boolean,
@@ -100,8 +112,25 @@ watch(
       if (Array.isArray(val)) {
         list = val as OssVO[];
       } else {
-        const res = await listByIds(val);
-        list = res.data;
+        const raw = String(val ?? '').trim();
+        if (props.valueType === 'url') {
+          const urls = raw
+            .split(',')
+            .map((s) => s.trim())
+            .filter(Boolean);
+          list = urls.map((u) => ({ ossId: undefined as any, url: u } as any));
+        } else {
+        const isOssIds = /^\d+(,\d+)*$/.test(raw);
+        if (isOssIds) {
+          const res = await listByIds(raw);
+          list = res.data;
+        } else if (isHttp(raw) || raw.startsWith('blob:')) {
+          list = [{ ossId: undefined as any, url: raw } as any];
+        } else {
+          fileList.value = [];
+          return;
+        }
+        }
       }
       // 然后将数组转为对象数组
       fileList.value = list.map((item) => {
@@ -111,7 +140,7 @@ watch(
           itemData = { name: item, url: item };
         } else {
           // 此处name使用ossId 防止删除出现重名
-          itemData = { name: item.ossId, url: item.url, ossId: item.ossId };
+          itemData = { name: item.ossId ?? item.url, url: item.url, ossId: item.ossId };
         }
         return itemData;
       });
@@ -190,7 +219,11 @@ const handleDelete = (file: UploadFile): boolean => {
   const findex = fileList.value.map((f) => f.name).indexOf(file.name);
   if (findex > -1 && uploadList.value.length === number.value) {
     const ossId = fileList.value[findex].ossId;
-    delOss(ossId);
+    const raw = String(ossId ?? '').trim();
+    const isOssId = /^\d+$/.test(raw);
+    if (props.valueType !== 'url' && isOssId) {
+      delOss(raw);
+    }
     fileList.value.splice(findex, 1);
     emit('update:modelValue', listToString(fileList.value));
     return false;
@@ -226,8 +259,14 @@ const listToString = (list: any[], separator?: string) => {
   let strs = '';
   separator = separator || ',';
   for (const i in list) {
-    if (undefined !== list[i].ossId && list[i].url.indexOf('blob:') !== 0) {
-      strs += list[i].ossId + separator;
+    if (props.valueType === 'url') {
+      if (list[i].url && list[i].url.indexOf('blob:') !== 0) {
+        strs += list[i].url + separator;
+      }
+    } else {
+      if (undefined !== list[i].ossId && list[i].url.indexOf('blob:') !== 0) {
+        strs += list[i].ossId + separator;
+      }
     }
   }
   return strs != '' ? strs.substring(0, strs.length - 1) : '';

+ 34 - 0
src/router/index.ts

@@ -103,6 +103,40 @@ export const constantRoutes: RouteRecordRaw[] = [
       }
     ]
   },
+  {
+    path: '/product',
+    component: Layout,
+    hidden: true,
+    redirect: 'noredirect',
+    children: [
+      {
+        path: 'brand/edit',
+        component: () => import('@/views/product/brand/edit.vue'),
+        name: 'ProductBrandEdit',
+        meta: { title: '品牌编辑', activeMenu: '/product/brand' }
+      }
+    ]
+  },
+  {
+    path: '/supplierexam',
+    component: Layout,
+    hidden: true,
+    redirect: 'noredirect',
+    children: [
+      {
+        path: 'edit',
+        component: () => import('@/views/supplier/supplierexam/edit.vue'),
+        name: 'SupplierExamEdit',
+        meta: { title: '供应商授权编辑', activeMenu: '/supplierexam' }
+      },
+      {
+        path: 'detail',
+        component: () => import('@/views/supplier/supplierexam/detail.vue'),
+        name: 'SupplierExamDetail',
+        meta: { title: '供应商授权查看', activeMenu: '/supplierexam' }
+      }
+    ]
+  },
   {
     path: '/supplier',
     component: Layout,

+ 3 - 1
src/views/customer/info/components/BasicInfoTab.vue

@@ -216,6 +216,7 @@
               :file-size="5"
               :file-type="['png', 'jpg', 'jpeg']"
               :is-show-tip="false"
+              value-type="url"
             />
           </div>
         </el-col>
@@ -223,12 +224,13 @@
           <div class="form-item">
             <span class="label">法人身份证照片:</span>
             <ImageUpload
-              v-model="detailData.personImageUrl"
+              v-model="detailData.personImage"
               :limit="1"
               :disabled="isViewMode"
               :file-size="5"
               :file-type="['png', 'jpg', 'jpeg']"
               :is-show-tip="false"
+              value-type="url"
             />
           </div>
         </el-col>

+ 11 - 4
src/views/customer/info/components/SupplyInfoTab.vue

@@ -87,10 +87,9 @@
             <span>{{ getAuthorizedStatusText(scope.row.authorizedStatus) }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="操作" align="center" width="150">
-          <template #default>
-            <el-button link type="primary">查看</el-button>
-            <el-button link type="primary">编辑</el-button>
+        <el-table-column label="操作" align="center" width="100">
+          <template #default="scope">
+            <el-button link type="primary" @click="handleView(scope.row)">查看</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -103,6 +102,7 @@
 </template>
 
 <script setup lang="ts">
+import { useRouter } from 'vue-router';
 const props = defineProps<{
   isViewMode: boolean;
   productCategoryList: any[];
@@ -115,6 +115,13 @@ const props = defineProps<{
   getAuthorizedStatusText: (status: string) => string;
 }>();
 
+const router = useRouter();
+
+/** 查看授权详情,跳转到供应商授权查看页面 */
+const handleView = (row: any) => {
+  router.push({ path: '/supplierexam/detail', query: { id: row.id } });
+};
+
 const emit = defineEmits<{
   (e: 'saveCategories'): void;
   (e: 'addBrand'): void;

+ 91 - 65
src/views/product/brand/edit.vue

@@ -14,12 +14,12 @@
         <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="品牌名称" prop="brandName">
-              <el-input v-model="form.brandName" placeholder="京东方" />
+              <el-input v-model="form.brandName" placeholder="京东方" :disabled="isView" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="品牌首字母" prop="brandInitials">
-              <el-input v-model="form.brandInitials" placeholder="请输入品牌首字母" />
+            <el-form-item label="品牌首字母" prop="brandInitials" required>
+              <el-input v-model="form.brandInitials" placeholder="请输入品牌首字母" :disabled="isView" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -27,7 +27,7 @@
         <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="品牌名称(英文)" prop="brandEnglishName">
-              <el-input v-model="form.brandEnglishName" placeholder="请输入品牌英文名称" />
+              <el-input v-model="form.brandEnglishName" placeholder="请输入品牌英文名称" :disabled="isView" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -39,50 +39,58 @@
                 controls-position="right"
                 style="width: 100%"
                 placeholder="请输入推荐系数"
+                :disabled="isView"
               />
             </el-form-item>
           </el-col>
         </el-row>
 
         <el-form-item label="品牌标题" prop="brandTitle">
-          <el-input v-model="form.brandTitle" placeholder="请输入内容" />
+          <el-input v-model="form.brandTitle" placeholder="请输入内容" :disabled="isView" />
         </el-form-item>
 
-        <el-form-item label="品牌LOGO" prop="brandLogo">
-          <image-upload v-model="form.brandLogo" />
+        <el-form-item label="品牌LOGO" prop="brandLogo" required>
+          <image-upload v-model="form.brandLogo" valueType="url" :isShowTip="false" :disabled="isView" />
         </el-form-item>
 
         <el-form-item label="品牌故事" prop="brandStory">
-          <el-input v-model="form.brandStory" type="textarea" :rows="3" placeholder="请输入内容" />
+          <el-input v-model="form.brandStory" type="textarea" :rows="3" placeholder="请输入内容" :disabled="isView" />
         </el-form-item>
 
         <el-form-item label="是否显示" prop="isShow">
-          <el-radio-group v-model="form.isShow">
-            <el-radio :value="1">是</el-radio>
-            <el-radio :value="0">否</el-radio>
-          </el-radio-group>
-          <div class="text-gray-500 text-sm mt-2">
-            当品牌下还没有商品的时候。分类的品牌区不会不显示品牌。
+          <div class="flex flex-col items-start">
+            <el-radio-group v-model="form.isShow" :disabled="isView">
+              <el-radio :value="1">是</el-radio>
+              <el-radio :value="0">否</el-radio>
+            </el-radio-group>
+            <div class="text-gray-500 text-sm leading-5 mt-1">
+              当品牌下还没有商品的时候。分类的品牌区不会不显示品牌。
+            </div>
           </div>
         </el-form-item>
 
         <el-form-item label="品牌介绍" prop="brandDescribe">
-          <editor v-model="form.brandDescribe" :min-height="192" />
+          <template v-if="isView">
+            <div class="w-full" v-html="form.brandDescribe"></div>
+          </template>
+          <template v-else>
+            <editor v-model="form.brandDescribe" :min-height="192" />
+          </template>
         </el-form-item>
 
         <el-form-item label="商标注册人" prop="brandRegistrant">
-          <el-input v-model="form.brandRegistrant" placeholder="请输入商标注册人" />
+          <el-input v-model="form.brandRegistrant" placeholder="请输入商标注册人" :disabled="isView" />
         </el-form-item>
 
         <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item label="上传营业执照" prop="license">
-              <image-upload v-model="form.license" />
+              <image-upload v-model="form.license" valueType="url" :isShowTip="false" :disabled="isView" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="上传商标注册证" prop="registrationCertificate">
-              <image-upload v-model="form.registrationCertificate" />
+              <image-upload v-model="form.registrationCertificate" valueType="url" :isShowTip="false" :disabled="isView" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -94,32 +102,53 @@
             value-format="YYYY-MM-DD HH:mm:ss"
             placeholder="请选择"
             style="width: 100%"
+            :disabled="isView"
           />
         </el-form-item>
 
-        <el-divider content-position="left">授权信息</el-divider>
-
-        <el-table :data="authorizationList" border style="margin-bottom: 20px">
-          <el-table-column label="供应商名称" prop="supplierName" align="center" />
-          <el-table-column label="品牌名称" prop="brandName" align="center" />
-          <el-table-column label="一级类目" prop="firstCategory" align="center" />
-          <el-table-column label="二级类目" prop="secondCategory" align="center" />
-          <el-table-column label="三级类目" prop="thirdCategory" align="center" />
-          <el-table-column label="截止时间" prop="deadline" align="center" />
-          <el-table-column label="授权区域(省)" prop="provinceArea" align="center" />
-          <el-table-column label="授权区域(市)" prop="cityArea" align="center" />
-          <el-table-column label="状态" prop="status" align="center" />
-          <el-table-column label="操作" align="center">
-            <template #default="scope">
-              <el-button link type="primary" size="small" @click="handleEditAuth(scope.$index)">编辑</el-button>
-              <el-button link type="danger" size="small" @click="handleDeleteAuth(scope.$index)">删除</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-
-        <el-button type="primary" plain @click="handleAddAuth">添加授权</el-button>
-
-        <el-form-item>
+        <el-form-item v-if="!isAdd" label="授权信息:" style="margin-bottom: 0">
+          <div class="w-full">
+            <el-table :data="form.supplierAuthorizeList" border style="width: 100%">
+              <el-table-column type="index" label="序号" align="center" width="80" />
+              <el-table-column prop="supplierName" label="供应商名称" align="center" />
+              <el-table-column prop="brandName" label="品牌名称" align="center" />
+              <el-table-column label="一级类目" align="center">
+                <template #default="scope">
+                  <span>{{ scope.row.categorysMap?.oneLevelName || '-' }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="二级类目" align="center">
+                <template #default="scope">
+                  <span>{{ scope.row.categorysMap?.twoLevelName || '-' }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="三级类目" align="center">
+                <template #default="scope">
+                  <span>{{ scope.row.categorysMap?.threeLevelName || '-' }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="authorizationEndTime" label="截止时间" align="center">
+                <template #default="scope">
+                  <span>{{ scope.row.authorizationEndTime ? scope.row.authorizationEndTime.split(' ')[0] : '-' }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="province" label="授权区域(省)" align="center" show-overflow-tooltip />
+              <el-table-column prop="city" label="授权区域(市)" align="center" show-overflow-tooltip />
+              <el-table-column prop="authorizedStatus" label="状态" align="center">
+                <template #default="scope">
+                  <dict-tag :options="authorized_status" :value="scope.row.authorizedStatus" />
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center" width="100">
+                <template #default="scope">
+                  <el-button link type="primary" @click="handleView(scope.row)">查看</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </el-form-item>
+
+        <el-form-item v-if="!isView">
           <el-button type="primary" :loading="buttonLoading" @click="submitForm">保存</el-button>
           <el-button @click="goBack">取消</el-button>
         </el-form-item>
@@ -136,14 +165,19 @@ const route = useRoute();
 const router = useRouter();
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 
+const { authorized_status } = toRefs<any>(proxy?.useDict('authorized_status'));
+
+const isAdd = computed(() => route.query.type === 'add');
+const isView = computed(() => route.query.type === 'view');
+
 const brandFormRef = ref<ElFormInstance>();
 const buttonLoading = ref(false);
 const pageTitle = computed(() => {
-  return route.query.type === 'add' ? '新增品牌' : '编辑品牌';
+  if (route.query.type === 'add') return '新增品牌';
+  if (route.query.type === 'view') return '查看品牌';
+  return '编辑品牌';
 });
 
-// 授权信息列表
-const authorizationList = ref<any[]>([]);
 
 const initFormData: BrandForm = {
   id: undefined,
@@ -166,6 +200,7 @@ const initFormData: BrandForm = {
   care: undefined,
   dataSource: undefined,
   remark: undefined,
+  supplierAuthorizeList: [],
 }
 
 const form = ref<BrandForm>({ ...initFormData });
@@ -175,10 +210,13 @@ const rules = reactive({
     { required: true, message: "品牌名称不能为空", trigger: "blur" }
   ],
   brandInitials: [
-    { required: false, message: "品牌首字母缩写不能为空", trigger: "blur" }
+    { required: true, message: "品牌首字母不能为空", trigger: "blur" }
   ],
   brandEnglishName: [
     { required: false, message: "品牌英文名称不能为空", trigger: "blur" }
+  ],
+  brandLogo: [
+    { required: true, message: "品牌LOGO不能为空", trigger: "change" }
   ]
 });
 
@@ -188,38 +226,26 @@ const getDetail = async () => {
   if (id && route.query.type !== 'add') {
     const res = await getBrand(id);
     form.value = res.data;
-    // TODO: 加载授权信息列表
   }
 };
 
-/** 添加授权 */
-const handleAddAuth = () => {
-  authorizationList.value.push({
-    supplierName: '',
-    brandName: form.value.brandName,
-    firstCategory: '',
-    secondCategory: '',
-    thirdCategory: '',
-    deadline: '',
-    provinceArea: '',
-    cityArea: '',
-    status: ''
-  });
-};
 
-/** 编辑授权 */
-const handleEditAuth = (index: number) => {
-  // TODO: 实现编辑授权逻辑
-  proxy?.$modal.msgInfo('编辑授权功能待实现');
+/** 查看授权详情 */
+const handleView = (row: any) => {
+  router.push({
+    path: '/supplierexam/detail',
+    query: { id: row.id }
+  });
 };
 
 /** 删除授权 */
 const handleDeleteAuth = (index: number) => {
-  authorizationList.value.splice(index, 1);
+  form.value.supplierAuthorizeList?.splice(index, 1);
 };
 
 /** 提交表单 */
 const submitForm = () => {
+  if (isView.value) return;
   brandFormRef.value?.validate(async (valid: boolean) => {
     if (valid) {
       buttonLoading.value = true;

+ 31 - 32
src/views/product/brand/index.vue

@@ -13,6 +13,7 @@
             <el-form-item>
               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
               <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+              <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['product:brand:add']">新增品牌</el-button>
             </el-form-item>
           </el-form>
         </el-card>
@@ -21,21 +22,18 @@
 
     <el-card shadow="never">
       <template #header>
-        <el-row :gutter="10" class="mb8">
-          <el-col :span="1.5">
-            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['product:brand:add']">新增品牌</el-button>
-          </el-col>
+        <div class="flex items-center justify-between">
+          <div class="font-bold">品牌信息列表</div>
           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
-        </el-row>
+        </div>
       </template>
 
-      <el-table v-loading="loading" border :data="brandList" @selection-change="handleSelectionChange">
-        <el-table-column type="selection" width="55" align="center" />
+      <el-table v-loading="loading" border :data="brandList">
         <el-table-column label="品牌编号" align="center" prop="brandNo" width="120" />
         <el-table-column label="品牌名称" align="center" prop="brandName" />
-        <el-table-column label="是否有授权" align="center" prop="license" width="120">
+        <el-table-column label="是否有授权" align="center" prop="brandStatus" width="120">
           <template #default="scope">
-            <span>{{ scope.row.license ? '是' : '无' }}</span>
+            <span>{{ String(scope.row.brandStatus) === '1' ? '是' : '否' }}</span>
           </template>
         </el-table-column>
         <el-table-column label="授权区域" align="center" prop="position" show-overflow-tooltip>
@@ -50,15 +48,11 @@
         </el-table-column>
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
           <template #default="scope">
-            <el-tooltip content="查看" placement="top">
-              <el-button link type="primary" icon="View" @click="handleUpdate(scope.row)" v-hasPermi="['product:brand:query']">查看</el-button>
-            </el-tooltip>
-            <el-tooltip content="编辑" placement="top">
-              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['product:brand:edit']">编辑</el-button>
-            </el-tooltip>
-            <el-tooltip content="删除" placement="top">
-              <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['product:brand:remove']">删除</el-button>
-            </el-tooltip>
+            <div class="flex items-center justify-center gap-2 whitespace-nowrap">
+              <el-button link type="primary" @click="handleView(scope.row)" v-hasPermi="['product:brand:query']">查看</el-button>
+              <el-button link type="primary" @click="handleEdit(scope.row)" v-hasPermi="['product:brand:edit']">编辑</el-button>
+              <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['product:brand:remove']">删除</el-button>
+            </div>
           </template>
         </el-table-column>
       </el-table>
@@ -152,9 +146,6 @@ const brandList = ref<BrandVO[]>([]);
 const buttonLoading = ref(false);
 const loading = ref(true);
 const showSearch = ref(true);
-const ids = ref<Array<string | number>>([]);
-const single = ref(true);
-const multiple = ref(true);
 const total = ref(0);
 
 const queryFormRef = ref<ElFormInstance>();
@@ -301,13 +292,6 @@ const resetQuery = () => {
   handleQuery();
 }
 
-/** 多选框选中数据 */
-const handleSelectionChange = (selection: BrandVO[]) => {
-  ids.value = selection.map(item => item.id);
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
-}
-
 /** 新增按钮操作 */
 const handleAdd = () => {
   router.push({
@@ -318,9 +302,23 @@ const handleAdd = () => {
   });
 }
 
-/** 修改按钮操作 */
-const handleUpdate = async (row?: BrandVO) => {
-  const _id = row?.id || ids.value[0];
+/** 查看按钮操作 */
+const handleView = async (row?: BrandVO) => {
+  const _id = row?.id;
+  if (!_id) return;
+  router.push({
+    path: '/product/brand/edit',
+    query: {
+      id: _id,
+      type: 'view'
+    }
+  });
+}
+
+/** 编辑按钮操作 */
+const handleEdit = async (row?: BrandVO) => {
+  const _id = row?.id;
+  if (!_id) return;
   router.push({
     path: '/product/brand/edit',
     query: {
@@ -349,7 +347,8 @@ const submitForm = () => {
 
 /** 删除按钮操作 */
 const handleDelete = async (row?: BrandVO) => {
-  const _ids = row?.id || ids.value;
+  const _ids = row?.id;
+  if (!_ids) return;
   await proxy?.$modal.confirm('是否确认删除产品品牌信息编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
   await delBrand(_ids);
   proxy?.$modal.msgSuccess("删除成功");

+ 22 - 27
src/views/supplier/supplierauthorize/index.vue

@@ -1,8 +1,8 @@
 <template>
-  <div class="p-2">
+  <div class="p-2 w-full">
     <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
       <div v-show="showSearch" class="mb-[10px]">
-        <el-card shadow="hover">
+        <el-card shadow="hover" class="w-full">
           <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="120px">
             <el-form-item label="供应商编号" prop="supplierNo">
               <el-input v-model="queryParams.supplierNo" placeholder="供应商编号" clearable @keyup.enter="handleQuery" />
@@ -31,50 +31,38 @@
       </div>
     </transition>
 
-    <el-card shadow="never">
+    <el-card shadow="never" class="w-full">
       <template #header>
-        <el-row :gutter="10" class="mb8">
-          <el-col :span="1.5">
-            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['supplier:supplierauthorize:add']">新增</el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['supplier:supplierauthorize:edit']">修改</el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['supplier:supplierauthorize:remove']">删除</el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['supplier:supplierauthorize:export']">导出</el-button>
-          </el-col>
-          <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
-        </el-row>
+        供应能力查询信息列表
       </template>
 
-      <el-table v-loading="loading" border :data="supplierauthorizeList" class="supplierauthorize-table" table-layout="fixed" highlight-current-row @current-change="handleCurrentChange">
+      <el-table v-loading="loading" border :data="supplierauthorizeList" class="supplierauthorize-table" table-layout="fixed" highlight-current-row @current-change="handleCurrentChange" style="width: 100%">
         <el-table-column label="供应商编号" align="left" prop="supplierNo" width="110" fixed="left" />
         <el-table-column label="供应商名称" align="left" prop="supplierName" width="250" fixed="left" />
-        <el-table-column label="供货区域(省)" align="center" prop="province" width="180">
+        <el-table-column label="供货区域(省)" align="center" prop="province" min-width="180">
           <template #default="scope">
             <el-tooltip :content="scope.row.province || ''" placement="top" :show-after="300">
               <span class="ellipsis">{{ formatProvinceDisplay(scope.row.province) }}</span>
             </el-tooltip>
           </template>
         </el-table-column>
-        <el-table-column label="供货区域(市)" align="center" prop="city" width="300">
+        <el-table-column label="供货区域(市)" align="center" prop="city" min-width="300">
           <template #default="scope">
             <el-tooltip :content="scope.row.city || ''" placement="top" :show-after="300">
               <span class="ellipsis">{{ formatCityDisplay(scope.row.city) }}</span>
             </el-tooltip>
           </template>
         </el-table-column>
-        <el-table-column label="供货类目" align="center" prop="supplyProCate" width="140" />
-        <el-table-column label="可供货品牌" align="center" prop="brandName" width="140" />
-        <el-table-column label="有授权品牌" align="center" prop="authBrand" width="140" />
+        <el-table-column label="供货类目" align="center" prop="supplyProCate" min-width="140" />
+        <el-table-column label="可供货品牌" align="center" prop="brandName" min-width="140" />
+        <el-table-column label="有授权品牌" align="center" prop="authBrand" min-width="140" />
         
-        <el-table-column label="操作" align="right" class-name="small-padding fixed-width" width="120" fixed="right">
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
           <template #default="scope">
-            <el-button link type="primary" @click="handleView(scope.row)">查看</el-button>
-            <el-button link type="primary" @click="handleEdit(scope.row)" v-hasPermi="['supplier:supplierauthorize:edit']">编辑</el-button>
+            <div class="op-actions">
+              <el-button link type="primary" @click="handleView(scope.row)">查看</el-button>
+              <el-button link type="primary" @click="handleEdit(scope.row)" v-hasPermi="['supplier:supplierauthorize:edit']">编辑</el-button>
+            </div>
           </template>
         </el-table-column>
       </el-table>
@@ -319,4 +307,11 @@ onMounted(() => {
   text-overflow: ellipsis;
 }
 
+.op-actions {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  gap: 6px;
+}
+
 </style>