From 2b111b98c3f2bff88455b85562645f7bf8f814af Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 02 十一月 2026 16:52:06 +0800
Subject: [PATCH] fix(srm): 供应商档案在线/离线页签筛选取值生效,去掉重复的状态字段,增加合同入口

---
 src/views/srm/supplier/index.vue |   33 +++++++++++-----
 src/views/srm/supplier/data.ts   |   36 ------------------
 2 files changed, 22 insertions(+), 47 deletions(-)

diff --git a/src/views/srm/supplier/data.ts b/src/views/srm/supplier/data.ts
index 9c50af5..efbbdcc 100644
--- a/src/views/srm/supplier/data.ts
+++ b/src/views/srm/supplier/data.ts
@@ -128,46 +128,10 @@
 export function useGridFormSchema(): VbenFormSchema[] {
   return [
     {
-      fieldName: 'code',
-      label: '缂栫爜',
-      component: 'Input',
-      componentProps: { placeholder: '璇疯緭鍏ョ紪鐮�', allowClear: true },
-    },
-    {
       fieldName: 'name',
       label: '渚涘簲鍟嗗悕绉�',
       component: 'Input',
       componentProps: { placeholder: '璇疯緭鍏ヤ緵搴斿晢鍚嶇О', allowClear: true },
-    },
-    {
-      fieldName: 'type',
-      label: '绫诲瀷',
-      component: 'Select',
-      componentProps: {
-        placeholder: '璇烽�夋嫨绫诲瀷',
-        allowClear: true,
-        options: SUPPLIER_TYPE_OPTIONS,
-      },
-    },
-    {
-      fieldName: 'onlineStatus',
-      label: '鍦ㄧ嚎鐘舵��',
-      component: 'Select',
-      componentProps: {
-        placeholder: '璇烽�夋嫨鍦ㄧ嚎鐘舵��',
-        allowClear: true,
-        options: SUPPLIER_ONLINE_STATUS_OPTIONS,
-      },
-    },
-    {
-      fieldName: 'purchaseCategory',
-      label: '閲囪喘鍝佺被',
-      component: 'Select',
-      componentProps: {
-        placeholder: '璇烽�夋嫨閲囪喘鍝佺被',
-        allowClear: true,
-        options: SUPPLIER_PURCHASE_CATEGORY_OPTIONS,
-      },
     },
   ];
 }
diff --git a/src/views/srm/supplier/index.vue b/src/views/srm/supplier/index.vue
index 7d2ff0e..87b075b 100644
--- a/src/views/srm/supplier/index.vue
+++ b/src/views/srm/supplier/index.vue
@@ -3,6 +3,7 @@
 import type { SrmSupplierApi } from '#/api/srm/supplier';
 
 import { ref } from 'vue';
+import { useRouter } from 'vue-router';
 
 import { Page, useVbenModal } from '@vben/common-ui';
 import { downloadFileFromBlobPart } from '@vben/utils';
@@ -23,7 +24,10 @@
 
 defineOptions({ name: 'SrmSupplier' });
 
-const activeTab = ref('all');
+const router = useRouter();
+
+/** 褰撳墠鏍囩椤碉細1 鍦ㄧ嚎渚涘簲鍟� 2 绂荤嚎渚涘簲鍟� */
+const activeTab = ref('1');
 
 function handleRefresh() {
   gridApi.query();
@@ -31,15 +35,8 @@
 
 /** 鍒囨崲銆屽湪绾� / 绂荤嚎銆嶄緵搴斿晢鏍囩椤� */
 async function handleTabChange(key: number | string) {
-  // VXE proxy 鏌ヨ浼氬鐢ㄦ渶杩戜竴娆℃彁浜ょ殑妫�绱㈠揩鐓э紝浠� setFieldValue 涓嶄細鐢熸晥锛�
-  // 蹇呴』鍒锋柊鎻愪氦蹇収骞跺甫涓婃渶鏂板�奸噸鏂板姞杞斤紝鍚﹀垯鍚勬爣绛鹃〉閮藉睍绀哄悓涓�鎵规暟鎹�
-  await gridApi.formApi.setFieldValue(
-    'onlineStatus',
-    key === 'all' ? undefined : Number(key),
-  );
-  const formValues = await gridApi.formApi.getValues();
-  gridApi.formApi.setLatestSubmissionValues(formValues);
-  await gridApi.reload(formValues);
+  activeTab.value = String(key);
+  gridApi.query();
 }
 
 function handleCreate() {
@@ -48,6 +45,14 @@
 
 function handleEdit(row: SrmSupplierApi.SupplierVO) {
   formModalApi.setData(row).open();
+}
+
+/** 鏌ョ湅/缁存姢璇ヤ緵搴斿晢鐨勫悎鍚� */
+function handleContract(row: SrmSupplierApi.SupplierVO) {
+  router.push({
+    name: 'ErpSupplierContract',
+    query: { supplierId: String(row.id) },
+  });
 }
 
 /** 瀵煎叆渚涘簲鍟� */
@@ -100,6 +105,7 @@
           return await getSupplierPage({
             pageNo: page.currentPage,
             pageSize: page.pageSize,
+            onlineStatus: Number(activeTab.value),
             ...formValues,
           });
         },
@@ -117,7 +123,6 @@
     <SupplierImportModal @success="handleRefresh" />
     <div class="mx-4 mb-2">
       <Tabs v-model:active-key="activeTab" @change="handleTabChange">
-        <TabPane key="all" tab="鍏ㄩ儴渚涘簲鍟�" />
         <TabPane key="1" tab="鍦ㄧ嚎渚涘簲鍟�" />
         <TabPane key="2" tab="绂荤嚎渚涘簲鍟�" />
       </Tabs>
@@ -154,6 +159,12 @@
         <TableAction
           :actions="[
             {
+              label: '鍚堝悓',
+              type: 'link',
+              auth: ['erp:supplier-contract:query'],
+              onClick: handleContract.bind(null, row),
+            },
+            {
               label: $t('common.edit'),
               type: 'link',
               icon: ACTION_ICON.EDIT,

--
Gitblit v1.9.3