import { DescItem } from '/@/components/Description/index';
import { BasicColumn } from '/@/components/Table/src/types/table';
import { Button } from '/@/components/Button';
import { FormSchema } from '/@/components/Form/index';
import { incrementUseTypeList } from '/@/api/account';
import { Badge } from 'ant-design-vue';
import moment from 'moment';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();

export const refundData = {
  a1: '1000000000',
  a2: '已取货',
  a3: '1234123421',
  a4: '3214321432',
  a5: '3214321432',
  b1: '付小小',
  b2: '18100000000',
  b3: '菜鸟仓储',
  b4: '浙江省杭州市西湖区万塘路18号',
  b5: '无',
};

export const personData = {
  b1: '付小小',
  b2: '18100000000',
  b3: '菜鸟仓储',
  b4: '浙江省杭州市西湖区万塘路18号',
  b5: '无',
};
export const refundSchema: DescItem[] = [
  {
    field: 'nickName',
    label: t('routes.equity.nickName'),
  },
  {
    field: 'userName',
    label: t('routes.equity.userName1'),
  },
  {
    field: 'email',
    label: t('routes.equity.email'),
  },
  {
    field: 'createTime',
    label: t('routes.account.createTime'),
  },
  // {
  //   field: 'vip',
  //   label: '四维看看会员',
  // },
];
export const personSchema: DescItem[] = [
  {
    field: 'incrementCount',
    label: '权益数量',
  },
  {
    field: 'surDownNum',
    label: '剩余下载次数',
  },
  {
    field: 'cameraCount',
    label: '相机数量',
  },
  {
    field: 'sceneNum',
    label: '场景数量',
  },
];

export const refundTableSchema: BasicColumn[] = [
  {
    title: '商品编号',
    width: 150,
    dataIndex: 't1',
    customRender: ({ record }) => {
      return (
        <Button type="link" size="small">
          {() => record.t1}
        </Button>
      );
    },
  },
  {
    title: '商品名称',
    width: 150,
    dataIndex: 't2',
  },
  {
    title: '商品条码',
    width: 150,
    dataIndex: 't3',
  },
  {
    title: '单价	',
    width: 150,
    dataIndex: 't4',
  },
  {
    title: '数量（件）	',
    width: 150,
    dataIndex: 't5',
  },
  {
    title: '金额',
    width: 150,
    dataIndex: 't6',
  },
];
export const refundTimeTableSchema: BasicColumn[] = [
  {
    title: '时间',
    width: 150,
    dataIndex: 't1',
  },
  {
    title: '当前进度',
    width: 150,
    dataIndex: 't2',
  },
  {
    title: '状态',
    width: 150,
    dataIndex: 't3',
    customRender: ({ record }) => {
      return <Badge status="success" text={record.t3} />;
    },
  },
  {
    title: '操作员ID	',
    width: 150,
    dataIndex: 't4',
  },
  {
    title: '耗时',
    width: 150,
    dataIndex: 't5',
  },
];

export const refundTableData: any[] = [
  {
    t1: 1234561,
    t2: '矿泉水 550ml',
    t3: '12421432143214321',
    t4: '2.00',
    t5: 1,
    t6: 2.0,
  },
  {
    t1: 1234562,
    t2: '矿泉水 550ml',
    t3: '12421432143214321',
    t4: '2.00',
    t5: 2,
    t6: 2.0,
  },
  {
    t1: 1234562,
    t2: '矿泉水 550ml',
    t3: '12421432143214321',
    t4: '2.00',
    t5: 2,
    t6: 2.0,
  },
  {
    t1: 1234562,
    t2: '矿泉水 550ml',
    t3: '12421432143214321',
    t4: '2.00',
    t5: 2,
    t6: 2.0,
  },
];

export const refundTimeTableData: any[] = [
  {
    t1: '2017-10-01 14:10',
    t2: '联系客户',
    t3: '进行中',
    t4: '取货员 ID1234',
    t5: '5mins',
  },
  {
    t1: '2017-10-01 14:10',
    t2: '取货员出发',
    t3: '成功',
    t4: '取货员 ID1234',
    t5: '5mins',
  },
  {
    t1: '2017-10-01 14:10',
    t2: '取货员接单',
    t3: '成功',
    t4: '系统',
    t5: '5mins',
  },
  {
    t1: '2017-10-01 14:10',
    t2: '申请审批通过',
    t3: '成功',
    t4: '用户',
    t5: '1h',
  },
];
// 基础设置 form
export const remarkschemas: FormSchema[] = [
  {
    field: 'remark',
    component: 'InputTextArea',
    label: '备注',
    componentProps: {
      placeholder: '请输入钉钉审批单号',
      rows: 4,
    },
    colProps: { span: 20 },
  },
];
export const Addschemas: FormSchema[] = [
  {
    field: 'useType',
    component: 'ApiSelect',
    required: true,
    label: '使用类型',
    componentProps: {
      // filterOption: onFilterOption,
      // showSearch: true,
      api: incrementUseTypeList,
      labelField: 'name',
      valueField: 'id',
      immediate: true,
    },
    itemProps: {
      autoLink: false,
    },
    colProps: {
      span: 20,
    },
  },
  {
    field: 'companyName',
    component: 'Select',
    label: '合同所属公司',
    rules: [{ required: true }],
    colProps: {
      span: 20,
    },
    itemProps: {
      autoLink: false,
    },
    componentProps: {
      options: [
        {
          label: '珠海市四维时代网络科技有限公司',
          value: '珠海市四维时代网络科技有限公司',
          key: '珠海市四维时代网络科技有限公司',
        },
        {
          label: '广东四维看看智能设备有限公司',
          value: '广东四维看看智能设备有限公司',
          key: '广东四维看看智能设备有限公司',
        },
        {
          label: '四维看看（香港）有限公司',
          value: '四维看看（香港）有限公司',
          key: '四维看看（香港）有限公司',
        },
        {
          label: '四维看看(北京)数据科技有限公司',
          value: '四维看看(北京)数据科技有限公司',
          key: '四维看看(北京)数据科技有限公司',
        },
      ],
    },
  },
  {
    field: 'businessDept',
    component: 'Select',
    label: '业务部门',
    rules: [{ required: true }],
    colProps: {
      span: 20,
    },
    itemProps: {
      autoLink: false,
    },
    componentProps: {
      options: [
        {
          label: '数字营销事业部',
          value: '数字营销事业部',
          key: '数字营销事业部',
        },
        {
          label: '政企事业部',
          value: '政企事业部',
          key: '政企事业部',
        },
        {
          label: '海外事业部',
          value: '海外事业部',
          key: '海外事业部',
        },
        {
          label: '市场部',
          value: '市场部',
          key: '市场部',
        },
        {
          label: '总经办',
          value: '总经办',
          key: '总经办',
        },
      ],
    },
  },
  {
    field: 'businessName',
    component: 'Input',
    label: '业务员',
    required: true,
    componentProps: {
      maxlength: 100,
    },
    colProps: { span: 20 },
  },
  {
    field: 'customerPayTime',
    component: 'DatePicker',
    label: '客户付款时间',
    required: true,
    colProps: {
      span: 16,
    },
    itemProps: {
      autoLink: false,
    },
    componentProps: {
      // showTime: true, //{ defaultValue: moment('23:59:59', 'HH:mm:ss') }
      valueFormat: 'YYYY-MM-DD',
      // defaultValue: dayjs().add(7, 'day').format('YYYY-MM-DD') + ' 23:59:59',
      format: 'YYYY-MM-DD',
    },
  },
  {
    field: 'customerName',
    component: 'Input',
    label: '客户名称',
    required: true,
    componentProps: {
      maxlength: 100,
    },
    colProps: { span: 20 },
  },
  {
    field: 'customerType',
    component: 'Select',
    label: '客户类别',
    required: true,
    colProps: { span: 20 },
    itemProps: {
      autoLink: false,
    },
    componentProps: {
      options: [
        {
          label: '直销',
          value: 0,
          key: '0',
        },
        {
          label: '经销',
          value: 1,
          key: '1',
        },
      ],
    },
  },
  {
    field: 'endCustomer',
    component: 'Input',
    label: '终端客户',
    required: true,
    componentProps: {
      maxlength: 100,
    },
    colProps: { span: 20 },
  },

  {
    field: 'projectNum',
    component: 'Input',
    label: '项目号',
    required: true,
    componentProps: {
      maxlength: 100,
    },
    colProps: { span: 20 },
  },
];
