Ben Lin
2024-06-11 5d3661fd40aa5fe0f669edb18b1c2aed458fb4e8
src/views/tigerprojects/system/lowcode/normal/basDefectGrp.ts
@@ -1,16 +1,49 @@
import { ActionItem, BasicColumn } from '/@/components/Table';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { getFormSchema } from '/@/views/components/data';
import { ref } from 'vue';
const { notification } = useMessage();
const { t } = useI18n();
const { notification, createErrorModal } = useMessage();
/* 自定义按钮方法 */
export function DftGrpRelease(fn: Fn, params: {}) {
export function DftGrpRelease(args: Fn[], params: {}) {
  console.log('点击了下发按钮');
  notification.success({
    message: '点击了下发按钮',
    description: `${params.entityName}`,
    duration: 3,
  // notification.success({
  //   message: '点击了下发按钮',
  //   description: `${params.entityName}`,
  //   duration: 3,
  // });
  // reload();
  // if (params.STATUS == 2) {
  //   createErrorModal({
  //     title: t('警告'),
  //     content: t('工单已经下发,不能再下发!'),
  //     getContainer: () => document.body,
  //   });
  //   return;
  // }
  params.dtlSlots.value = [
    {
      name: 'forminfo',
      slots: ['add', 'set'],
      preIcons: { add: 'search|svg', set: 'config|svg' }, //如果是多个表单,增加多个插槽。slots是弹出框按钮的插槽,preIcons是插槽对应的按钮图标
      title: '下发配置',
    },
  ];
  args[2](true, {
    isUpdate: true, //是否更新操作
    ctype: params.cType.value, //是哪个页面
    title: '工单下发', //标题
    width: '900px', //弹出框宽度
    formEl: params.useFormData.value,
    formElName: ['forminfo'], //表单插槽名称
    RowKeys: { add: 'ROUTE_CODE', set: 'ROUTE_CODE' }, //插槽的弹出框选择的code
    fnName: { BIZ_MES_WO: 'SaveWoBatch' }, //保存方法名
    initFnName: {}, //初始化方法名
    values: params.record, //表单记录
  });
  fn();
}
export const dftGrpactionColumn: BasicColumn = {
@@ -20,3 +53,51 @@
  slots: { customRender: 'action' },
  fixed: undefined,
};
export const dftGrpActionItem: ActionItem[] = [
  {
    icon: 'release|svg',
    tooltip: '下发',
    onClick: () => {},
  },
];
export function dftGrpGetSelectSuccess(d, u) {
  return {
    ITEM_CODE: d.values['val'],
  };
}
export function dftGrpOpenSelectItem(openItemModal: Fn) {
  openItemModal(true, {
    title: '物料列表',
    schemas: [
      {
        field: 'ITEM_CODE',
        component: 'Input',
        label: '物料编码',
        colProps: {
          span: 12,
        },
      },
    ],
    ItemColumns: [
      {
        title: t('物料编码'),
        dataIndex: 'ITEM_CODE',
        resizable: true,
        sorter: true,
        width: 200,
      },
      {
        title: t('物料名称'),
        dataIndex: 'ITEM_NAME',
        resizable: true,
        sorter: true,
        width: 180,
      },
    ],
    tableName: 'BAS_ITEM',
    rowKey: 'ITEM_CODE',
  });
}