data.tsx 3.81 KB
import { Tag } from 'ant-design-vue';
import { BasicColumn } from '@/components/Table';
import { func } from 'vue-types';
import { h } from 'vue';

export const COLUMNS = {
  1: [
    {
      title: '客户编码',
      dataIndex: 'settingValue',
      width: 150,
    },
    {
      title: '利润率',
      dataIndex: 'relationValue',
      width: 150,
      editComponent: 'InputNumber',
      editRow: true,
    },
  ],
  2: [
    {
      title: '客户编码',
      dataIndex: 'settingValue',
      width: 150,
    },
    {
      title: '包装费用',
      dataIndex: 'relationValue',
      width: 150,
      editComponent: 'InputNumber',
      editRow: true,
    },
  ],
  3: [
    {
      title: '名称',
      dataIndex: 'settingName',
      width: 150,
    },
    {
      title: '值',
      dataIndex: 'settingValue',
      width: 150,
      editComponent: 'InputNumber',
      editRow: true,
    },
  ],
  5: [
    {
      title: '客户编码',
      dataIndex: 'settingValue',
      width: 150,
    },
    {
      title: '最后汇款日期',
      dataIndex: 'relationValue',
      width: 150,
      editComponent: 'InputNumber',
      editRow: true,
    },
  ],
  6: [
    {
      title: '客户编码',
      dataIndex: 'settingValue',
      width: 150,
    },
    {
      title: '固定成本',
      dataIndex: 'relationValue',
      width: 150,
      editComponent: 'InputNumber',
      editRow: true,
    },
    {
      title: '提成比例',
      dataIndex: 'relationValue',
      width: 150,
      editComponent: 'InputNumber',
      editRow: true,
    },
    {
      title: '生产科提成单价',
      dataIndex: 'relationValue',
      width: 150,
      editComponent: 'InputNumber',
      editRow: true,
    },
  ],
  7: [
    {
      title: '客户编码',
      dataIndex: 'settingValue',
      width: 150,
    },
    {
      title: '销售额',
      dataIndex: 'relationValue',
      width: 150,
      editComponent: 'InputNumber',
      editRow: true,
    },
  ],
};

export const columns: BasicColumn[] = [
  {
    title: '客户编码',
    dataIndex: 'typeValue',
    width: 100,
  },
  {
    title: '状态',
    dataIndex: 'enableFlag',
    width: 100,
    // customRender: (column) => {
    //   const { record } = column || {};
    //   return record.enableFlag === 10 ? <Tag color="green">启用</Tag> : <Tag color="red">禁用</Tag>;
    // },
    customRender: (column) => {
      const { record } = column || {};
      const enableFlag = record.enableFlag;
      const enable = ~~enableFlag === 10;
      // return record.enableFlag === 10 ? <Tag color="green">启用</Tag> : <Tag color="red">禁用</Tag>;
      const color = enable ? 'green' : 'red';
      const text = enable ? '启用' : '禁用';
      return h(Tag, { color: color }, () => text);
    },
  },
  {
    title: '确认样品确认状态',
    dataIndex: 'configSample',
    width: 300,
  },
  {
    title: '其他需求样品发送时间',
    dataIndex: 'otherSample',
    width: 300,
  },
  {
    title: '大货样确认意见',
    dataIndex: 'bigSample',
    width: 300,
  },
  {
    title: 'AITEX/SGS测试状态',
    dataIndex: 'aitexSgsTest',
    width: 300,
  },
  {
    title: '要求包装到货日期',
    dataIndex: 'barcodeArrival',
    width: 300,
  },
  {
    title: '最晚订舱时间',
    dataIndex: 'latestDc',
    width: 300,
  },
  {
    title: '尾期验货日期',
    dataIndex: 'endCheckDate',
    width: 300,
  },
  {
    title: '中期验货报告',
    dataIndex: 'midCheckReport',
    width: 300,
  },
  {
    title: '尾期验货报告',
    dataIndex: 'endCheckReport',
    width: 300,
  },
];

export const columnsProduct: BasicColumn[] = [
  {
    title: '客户编码',
    dataIndex: 'settingValue',
    width: 100,
  },
  {
    title: '状态',
    dataIndex: 'relationValue',
    width: 170,
    editComponent: 'Input',
    editRow: true,
  },
];