import { FormConfig } from "/@/components/PageSearch";
import {
  orderTypeOptions,
  send_status_list,
  useTypeOptions,
  xs_order_source_options
} from "/@/utils/status";

export const USE_STATUS = [
  { value: "0", label: "未对账" },
  { value: "1", label: "参与对账" },
  { value: "2", label: "参与核销对账" }
];

export const inv_open_status = [
  { value: "1", label: "未开票" },
  { value: "2", label: "部分开票"  },
  {
    value: "3",
    label: "已开票"
  }
];

export const retrun_status = [
  {
    value: "1",
    label: "未回款"
  },
  {
    value: "2",
    label: "部分回款"
  },
  {
    value: "3",
    label: "已回款"
  }
];

export const good_type = [
  {
    value: "1",
    label: "库存品"
  },
  {
    value: "2",
    label: "非库存"
  },
  {
    value: "3",
    label: "咨询"
  }
];

export const good_source = [
  {
    value: "1",
    label: "直接下单"
  },
  {
    value: "2",
    label: "咨询"
  },
  {
    value: "3",
    label: "项目"
  },
  {
    value: "4",
    label: "平台"
  },
  {
    value: "5",
    label: "有赞"
  },
  {
    value: "6",
    label: "售后补换货"
  },
  { value: "7", label: "报备转单" },
  { value: "8", label: "支付渠道" }
];

export const seend_type = [
  {
    value: "1",
    label: "未发货"
  },
  {
    value: "2",
    label: "部分发货"
  },
  {
    value: "3",
    label: "已发货"
  }
];

export const cat_status = [
  {
    value: "0",
    label: "待采购设置"
  },
  {
    value: "1",
    label: "待财务设置"
  },
  {
    value: "2",
    label: "已设置完成"
  }
];

const tag_type = [
  {
    value: "1",
    label: "开票标签"
  },
  {
    value: "2",
    label: "回款标签"
  },
  {
    value: "3",
    label: "开票或回款标签最少有一个"
  },
  {
    value: "4",
    label: "开票和回款标签同时有"
  }
];

const searchFormConfig: FormConfig = {
  formItems: [
    {
      field: "order_timer",
      type: "date_picker",
      span: 8,
      otherOptions: {
        type: "daterange",
        startProp: "start",
        endProp: "end",
        startPlaceholder: "下单起始时间",
        endPlaceholder: "下单结束时间"
      }
    },
    {
      field: "qrdtype",
      type: "select",
      placeholder: "商品类型",
      options: good_type,
      span: 4
    },
    {
      field: "is_comon",
      type: "select",
      placeholder: "订单类型",
      options: orderTypeOptions,
      span: 4
    },
    {
      field: "inv_status",
      type: "select",
      placeholder: "开票状态",
      options: inv_open_status,
      span: 4
    },

    {
      field: "pay_status",
      type: "select",
      placeholder: "回款状态",
      options: retrun_status,
      span: 4
    },
    {
      field: "group",
      type_field: "group_type",
      type: "input_group",
      span: 8,
      otherOptions: {
        inputGroupOptions: [
          { value: "sequenceNo", label: "订单编码" },
          { value: "cxCode", label: "销售订单主编码" },
          { value: "customerNo", label: "客户编码" },
          { value: "customer", label: "客户名称" },
          { value: "platName", label: "平台名称" },
          // { value: "poCode", label: "平台订单号" },
          { value: "department", label: "部门" },
          { value: "saler", label: "销售员" }
        ]
      }
    },
    {
      span: 4,
      type: "select",
      field: "qrdsource",
      placeholder: "订单来源",
      options: xs_order_source_options
    },
    {
      field: "poCode",
      type: "input",
      placeholder: "平台订单号",
      span: 4
    },
    {
      field: "goodNo",
      type: "input",
      placeholder: "商品编号",
      span: 4
    },
    {
      field: "goodName",
      type: "input",
      placeholder: "商品名称",
      span: 4
    },
    {
      field: "sendstatus",
      type: "select",
      placeholder: "发货状态",
      options: send_status_list,
      span: 4
    },
    {
      field: "cat_status",
      type: "select",
      placeholder: "类目设置状态",
      options: cat_status,
      span: 4
    },
    {
      field: "platform_type",
      type: "select",
      placeholder: "平台类型",
      options: useTypeOptions,
      span: 4
    },
    {
      field: "tag_id",
      type: "select",
      placeholder: "标签类型",
      options: tag_type,
      span: 4
    }
    // {
    //   field: 'apay_is',
    //   type: 'select',
    //   placeholder: '是否已回款',
    //   span: 4,
    //   options: [
    //     { value: '1',  label: '是' },
    //     { value: '0',  label: '否' }
    //   ]
    // }
  ]
};

export default searchFormConfig;
