import { FormRules } from "element-plus";

export const purchase_columns = [
  {
    label: "对账编号",
    prop: "payNo",
    minWidth: 180,
    align: "left"
  },
  {
    label: "供应商编号",
    prop: "supplierNo",
    minWidth: 180,
    align: "left"
  },
  {
    label: "供应商名称",
    prop: "supplierName",
    minWidth: 180,
    align: "left"
  },
  {
    label: "业务公司名称",
    prop: "companyName",
    minWidth: 180
  },
  {
    label: "总额款",
    prop: "total_fee",
    minWidth: 180,
    align: "total_fee"
  },
  {
    label: "已付款金额",
    prop: "apay_fee",
    minWidth: 180,
    align: "left"
  },
  {
    label: "已回票金额",
    prop: "ainv_fee",
    minWidth: 180,
    align: "left"
  },
  {
    label: "未回票金额",
    prop: "winv_fee",
    minWidth: 180,
    align: "left"
  }
];

export const ticket_columns = [
  {
    label: "发票申请类型",
    prop: "invType",
    width: 180
  },
  {
    label: "发票号码",
    prop: "invNumber",
    width: 180
  },
  {
    label: "发票代码",
    prop: "invCode",
    width: 180
  },
  {
    label: "发票金额",
    type: "inv_fee"
  },
  {
    label: "验票方式",
    prop: "xxx"
  },
  {
    label: "失败原因",
    prop: "rason"
  },
  {
    label: "开票时间",
    prop: "open_time"
  }
];

export const ticketFormItems = {
  //手工开票
  "1": [
    {
      label: "发票代码",
      prop: "invCode"
    },
    {
      label: "发票号码",
      prop: "invNumber"
    },
    {
      label: "税前金额",
      prop: "subtotal_amount"
    },
    {
      label: "校验码",
      prop: "checkNumber"
    },
    {
      label: "开票日期",
      prop: "open_time"
    }
  ],
  //ocr识别
  "2": [
    {
      label: "发票图片",
      prop: "inv_img"
    }
  ]
};

export const ticketAddRules: FormRules = {
  invType: [
    {
      trigger: "blur",
      message: "请选择申请类型",
      required: true
    }
  ],
  invNumber: [
    {
      trigger: "blur",
      message: "请输入发票代码",
      required: true
    }
  ],
  invCode: [
    {
      trigger: "blur",
      message: "请选择发票编码",
      required: true
    }
  ],
  open_time: [
    {
      trigger: "blur",
      message: "请选择开票时间",
      required: true
    }
  ],
  subtotal_amount: [
    {
      trigger: "blur",
      message: "请输入金额",
      required: true
    }
  ],
  inv_img: [
    {
      trigger: "blur",
      message: "请上传开票图片",
      required: true
    }
  ],
  invName: [
    {
      trigger: "blur",
      message: "请输入发票名称",
      required: true
    }
  ],
  gold: [
    {
      trigger: "blur",
      message: "请选择金额",
      required: true
    }
  ]
};

export const process_rules = {
  remark: [{ required: true, message: "请输入备注", trigger: "change" }],
  status: [{ required: true, message: "请选择状态", trigger: "change" }]
};

export const inv_type = [
  {
    value: "0",
    label: "手工添加"
  },
  {
    value: "1",
    label: "ocr识别"
  },
  {
    value: "2",
    label: "金税识别"
  }
];
