fix(srm): 供应商档案在线/离线页签筛选取值生效,去掉重复的状态字段,增加合同入口

- 页签切换改为走查询参数 onlineStatus,避免各页签复用同一批数据
- 去掉与在线/离线重复的「状态」列与筛选项
- 列表操作增加「合同」,跳转供应商合同页并按当前供应商筛选

Co-Authored-By: Claude Code <noreply@anthropic.com>
已修改2个文件
69 ■■■■■ 文件已修改
src/views/srm/supplier/data.ts 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/srm/supplier/index.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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,
      },
    },
  ];
}
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,