import { ColumnProps } from 'kts-components-antd-x3/lib/Table/interface'; import { PaginationConfig } from 'kts-components-antd-x3/lib/Table'; import { message } from 'kts-components-antd-x3'; import React from 'react'; export interface IGetGoodsListOption { /** 分页数据 */ pagination: PaginationConfig; } export default class ImportGoods { /** 表头 */ columns: ColumnProps[] = [ { title: '商品分类', dataIndex: 'itemType', key: 'itemType', }, { title: '商品编码', dataIndex: 'itemNo', key: 'itemNo', }, { title: '商品名称', dataIndex: 'itemName', key: 'itemName', }, { title: '规格型号', dataIndex: 'itemModelName', key: 'itemModelName', }, { title: '计量单位', dataIndex: 'unit', key: 'unit', }, { title: '税率', dataIndex: 'taxRate', key: 'taxRate', render: text => text || text === 0 ? `${text}%` : '' }, { title: '单价(含税)', dataIndex: 'priceIncludeTax', key: 'priceIncludeTax', }, { title: '税收分类编码', dataIndex: 'taxClassificationCode', key: 'taxClassificationCode', }, ]; /** 货物列表 */ dataSource: ColumnType[] = []; /** 分页数据 */ pagination: PaginationConfig = {}; /** 是否显示导入 */ isVisibleDrawer = false; /** 顶部扩展 */ topExpand?: React.ReactNode; /** 导入时校验函数 */ verifyFn: (record: any) => Promise = async record => { if (!record.taxClassificationCode) { message.error({ content: '请维护该商品的税收分类编码!', key: '请维护该商品的税收分类编码!' }) return false; } if (record.productStatus === 0) { message.error({ content: '当前货物为禁用', key: '当前货物为禁用' }) return false; } return true; }; isVisibleBatchImportDrawer = false; }