云
2026-09-17 0558f330f7e3781b91d00ed4a12e60d9fa469d87
src/views/mes/qc/template/modules/indicator-list.vue
@@ -4,12 +4,13 @@
import { useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { message, Switch } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
  deleteTemplateIndicator,
  getTemplateIndicatorPage,
  updateTemplateIndicator,
} from '#/api/mes/qc/template/indicator';
import { $t } from '#/locales';
@@ -39,6 +40,16 @@
/** 编辑指标项 */
function handleEdit(row: MesQcTemplateIndicatorApi.TemplateIndicator) {
  formModalApi.setData({ ...row, templateId: props.templateId }).open();
}
/** 切换是否参与判定 */
async function handleJudgeFlagChange(
  row: MesQcTemplateIndicatorApi.TemplateIndicator,
  checked: boolean,
) {
  await updateTemplateIndicator({ ...row, judgeFlag: checked });
  message.success(`检测项[${row.indicatorName}]已${checked ? '参与' : '不参与'}判定`);
  handleRefresh();
}
/** 删除指标项 */
@@ -100,6 +111,17 @@
          ]"
        />
      </template>
      <template #judgeFlag="{ row }">
        <Switch
          :checked="row.judgeFlag !== false"
          :disabled="readonly"
          checked-children="是"
          un-checked-children="否"
          @change="
            (checked: boolean) => handleJudgeFlagChange(row, checked)
          "
        />
      </template>
      <template #actions="{ row }">
        <TableAction
          :actions="[