Ver Fonte

feat(brand): 更新品牌管理中的供应商授权信息展示

- 在 BasicInfoTab.vue 中为 ImageUpload 组件添加 value-type="url" 属性
- 修改产品品牌编辑页面的品牌授权信息表格结构和数据绑定
- 将授权信息的数据源从 authorizationList 改为 form.supplierAuthorizeList
- 使用 categorysMap 映射显示一、二、三级类目名称
- 格式化授权截止时间显示,只显示日期部分
- 添加授权状态字典标签显示
- 移除编辑和删除按钮,改为查看按钮并跳转到供应商授权详情页
- 在 SupplyInfoTab.vue 中实现查看授权详情功能
- 添加 SupplierAuthorizeVO 接口定义包含完整的授权信息字段
- 调整表格列宽度和操作按钮布局优化用户体验
Lijingyang há 1 mês atrás
pai
commit
38c0ef1c9b

+ 45 - 10
src/api/product/brand/types.ts

@@ -98,9 +98,6 @@ export interface BrandVO {
    */
   dataSource: string;
 
-  /**
-   * 备注
-   */
   remark: string;
 
   /**
@@ -108,6 +105,10 @@ export interface BrandVO {
    */
   brandStatus?: number;
 
+  /**
+   * 供应商授权列表
+   */
+  supplierAuthorizeList?: SupplierAuthorizeVO[];
 }
 
 export interface BrandForm extends BaseEntity {
@@ -206,9 +207,6 @@ export interface BrandForm extends BaseEntity {
    */
   dataSource?: string;
 
-  /**
-   * 备注
-   */
   remark?: string;
 
   /**
@@ -216,6 +214,10 @@ export interface BrandForm extends BaseEntity {
    */
   brandStatus?: number;
 
+  /**
+   * 供应商授权列表
+   */
+  supplierAuthorizeList?: SupplierAuthorizeVO[];
 }
 
 export interface BrandQuery extends PageQuery {
@@ -320,10 +322,43 @@ export interface BrandQuery extends PageQuery {
    */
   brandStatus?: number;
 
-    /**
-     * 日期范围参数
-     */
-    params?: any;
+  /**
+   * 日期范围参数
+   */
+  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>;
 }
 
 

+ 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;

+ 43 - 37
src/views/product/brand/edit.vue

@@ -108,22 +108,40 @@
 
         <el-form-item v-if="!isAdd" label="授权信息:" style="margin-bottom: 0">
           <div class="w-full">
-            <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">
+            <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">
-                  <template v-if="!isView">
-                    <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>
+                  <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>
@@ -147,6 +165,8 @@ 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');
 
@@ -158,8 +178,6 @@ const pageTitle = computed(() => {
   return '编辑品牌';
 });
 
-// 授权信息列表
-const authorizationList = ref<any[]>([]);
 
 const initFormData: BrandForm = {
   id: undefined,
@@ -182,6 +200,7 @@ const initFormData: BrandForm = {
   care: undefined,
   dataSource: undefined,
   remark: undefined,
+  supplierAuthorizeList: [],
 }
 
 const form = ref<BrandForm>({ ...initFormData });
@@ -207,34 +226,21 @@ 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);
 };
 
 /** 提交表单 */