342次阅读
没有评论
const columns: any = [
    ...baseColumns,
    {
      title: '操作',
      width: 230,
      dataIndex: 'ACTION',
      align: 'center',
      fixed: 'right',
      actions: ({ record }) => [
        {
          label: '通过',
          auth: 'sys.user.delete',
          popConfirm: {
            title: '你确定要删除吗?',
            onConfirm: async () => {
              await prcessWithdrawal({
                id: record.id,
                audit_status: 1,
              });
              dynamicTableInstance?.reload();
            },
          },
        },
        {
          label: '不通过',
          auth: 'sys.user.delete',
          popConfirm: {
            title: '你确定要删除吗?',
            onConfirm: async () => {
              await prcessWithdrawal({
                id: record.id,
                audit_status: 2,
              });
              dynamicTableInstance?.reload();
            },
          },
        },
      ],
    },
    {
      title: '操作',
      width: 230,
      fixed: 'right',
      align: 'center',
      customRender: ({ record }: { record: any }) => {
        if (record.audit_status === null) {
          return h('div', [
            h(
              Button,
              {
                onClick: async () => {
                  Modal.confirm({
                    title: '你确定通过该申请吗?',
                    onOk: async () => {
                      await prcessWithdrawal({
                        id: record.id,
                        audit_status: 1,
                      });
                      dynamicTableInstance?.reload();
                    },
                  });
                },
              },
              '通过',
            ),
            h(
              Button,
              {
                onClick: async () => {
                  Modal.confirm({
                    title: '你确定不通过该申请吗?',
                    onOk: async () => {
                      await prcessWithdrawal({
                        id: record.id,
                        audit_status: 2,
                      });
                      dynamicTableInstance?.reload();
                    },
                  });
                },
              },
              '不通过',
            ),
          ]);
        }
      },
    },
  ];
正文完
 0
wujingquan
版权声明:本站原创文章,由 wujingquan 于2024-01-14发表,共计983字。
转载说明:Unless otherwise specified, all articles are published by cc-4.0 protocol. Please indicate the source of reprint.
评论(没有评论)