Explorar el Código

fix(supplier): 修复供应商资质管理功能中的数据关联问题

- 更新生产环境API基础URL配置
- 移除分页组件的条件渲染限制
- 在用户存储模块中添加供应商ID字段并实现本地存储
- 为资质相关API类型定义添加供应商ID参数
- 在资质管理页面中引入用户存储并关联当前供应商ID
- 调整资质列表查询逻辑以确保正确的数据过滤
- 优化样式布局添加适当的边距和圆角效果
肖路 hace 3 semanas
padre
commit
163e45f879

+ 1 - 1
.env.production

@@ -15,7 +15,7 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications'
 VITE_APP_SNAILJOB_ADMIN = '/snail-job'
 
 # 生产环境
-VITE_APP_BASE_API = '/prod-api'
+VITE_APP_BASE_API = 'https://one.yoe365.com'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VITE_BUILD_COMPRESS = gzip

+ 15 - 0
src/api/supplier/qualification/types.ts

@@ -4,6 +4,11 @@ export interface QualificationVO {
    */
   id: string | number;
 
+  /**
+   * 供应商ID
+   */
+  supplierId: string | number;
+
   /**
    * 资质名称(对应表单“资质名称”)
    */
@@ -62,6 +67,11 @@ export interface QualificationForm extends BaseEntity {
    */
   id?: string | number;
 
+  /**
+   * 供应商ID
+   */
+  supplierId: string | number;
+
   /**
    * 资质名称(对应表单“资质名称”)
    */
@@ -116,6 +126,11 @@ export interface QualificationForm extends BaseEntity {
 
 export interface QualificationQuery extends PageQuery {
 
+  /**
+   * 供应商ID
+   */
+  supplierId: string | number;
+
   /**
    * 资质名称(对应表单“资质名称”)
    */

+ 3 - 1
src/api/system/user/types.ts

@@ -5,6 +5,7 @@ import { PostVO } from '@/api/system/post/types';
  * 用户信息
  */
 export interface UserInfo {
+  supplierId?: string;
   user: UserVO;
   roles: string[];
   permissions: string[];
@@ -20,7 +21,8 @@ export interface UserQuery extends PageQuery {
   status?: string;
   deptId?: string | number;
   roleId?: string | number;
-  userIds?:  string | number | (string | number)[] | undefined;
+  userIds?: string | number | (string | number)[] | undefined;
+  supplierId?: string | number;
 }
 
 /**

+ 4 - 4
src/store/modules/user.ts

@@ -17,7 +17,7 @@ export const useUserStore = defineStore('user', () => {
   const avatar = ref('');
   const roles = ref<Array<string>>([]); // 用户角色编码集合 → 判断路由权限
   const permissions = ref<Array<string>>([]); // 用户权限编码集合 → 判断按钮权限
-  
+
   // 供应商相关信息
   const supplierId = ref<string | number | null>(null); // 当前用户所属的供应商ID
   const supplierNo = ref<string>(''); // 供应商编号
@@ -46,7 +46,7 @@ export const useUserStore = defineStore('user', () => {
       const data = res.data;
       const user = data.user;
       const profile = user.avatar == '' || user.avatar == null ? defAva : user.avatar;
-
+      localStorage.setItem('supplierId', data.supplierId || '');
       if (data.roles && data.roles.length > 0) {
         // 验证返回的roles是否是一个非空数组
         roles.value = data.roles;
@@ -59,10 +59,10 @@ export const useUserStore = defineStore('user', () => {
       avatar.value = profile;
       userId.value = user.userId;
       tenantId.value = user.tenantId;
-      
+
       // 获取用户信息后,立即获取供应商信息
       await getSupplierInfo();
-      
+
       return Promise.resolve();
     }
     return Promise.reject(err);

+ 11 - 3
src/views/supplier/aptitude/index.vue

@@ -54,7 +54,7 @@
 
     <!-- 分页 -->
 
-    <div v-if="pagination.total > pagination.pageSize" class="pagination-container">
+    <div class="pagination-container">
       <el-pagination
         v-model:current-page="pagination.pageNum"
         v-model:page-size="pagination.pageSize"
@@ -247,6 +247,8 @@ import type { QualificationVO, QualificationForm, QualificationQuery } from '@/a
 import { listByIds } from '@/api/system/oss';
 import { getInfo, updateInfo } from '@/api/supplier/info';
 import FileUpload from '@/components/FileUpload/index.vue';
+import { useUserStore } from '@/store/modules/user';
+
 
 defineOptions({
   name: 'Aptitude'
@@ -254,6 +256,8 @@ defineOptions({
 
 const route = useRoute();
 
+const userStore = useUserStore();
+
 const qualificationList = ref<QualificationVO[]>([]);
 
 const loading = ref(false);
@@ -299,6 +303,8 @@ const viewEndDate = ref<Date | null>(null);
 // 表单数据
 
 const formData = ref<QualificationForm>({
+  supplierId: userStore.supplierId,
+
   qualificationName: '',
 
   qualificationLevel: '',
@@ -347,8 +353,8 @@ const getQualificationList = async () => {
     loading.value = true;
 
     const res = await listQualification({
+      supplierId: userStore.supplierId,
       pageNum: pagination.value.pageNum,
-
       pageSize: pagination.value.pageSize
     });
 
@@ -807,7 +813,9 @@ const getSupplierInfo = async () => {
 
   background: #fff;
 
-  border-radius: 0 0 4px 4px;
+  border-radius: 4px;
+
+  margin-top: 16px;
 }
 
 .date-range-container {