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
    }
  ],
  checkNumber: [
    {
      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
    }
  ]
};

//发票状态的options
export const status_options = [
  {
    label: "上传发票",
    value: "0"
  },
  {
    label: "待识别验证",
    value: "1"
  },
  {
    label: "待校验识别",
    value: "2"
  },
  {
    label: "待财务审核",
    value: "3"
  },
  {
    label: "待认证",
    value: "6"
  },
  {
    label: "认证成功待确认",
    value: "7"
  },
  {
    label: "回票完成",
    value: "8"
  },
  {
    label: "识别失败",
    value: "9"
  },
  {
    label: "验证失败",
    value: "10"
  },
  {
    label: "财务驳回",
    value: "11"
  },
  {
    label: "认证失败",
    value: "12"
  }
];

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

export const inv_type = [
  {
    label: "手工开票",
    value: "1"
  },
  {
    label: "ocr识别",
    value: "2"
  },
  {
    label: "金税",
    value: "3"
  }
];

//审核流程映射
export const reviewProcessMap = [
  {
    title: "财务审核",
    showStatus: "3",
    reviewOptions: {
      failStatus: "11",
      successStatus: "6"
    }
  },
  {
    title: "认证",
    showStatus: "6",
    reviewOptions: {
      failStatus: "12",
      successStatus: "7"
    }
  },
  {
    title: "确认",
    showStatus: "7",
    reviewOptions: {
      failStatus: "10",
      successStatus: "8"
    }
  }
];

export const detailColumns = [
  {
    field: "payNo",
    label: "对账编号"
  },
  {
    field: "hpNo",
    label: "回票申请编号"
  },
  {
    field: "apply_name",
    label: "申请人名称"
  },
  {
    field: "invType",
    label: "发票申请类型"
  },
  {
    field: "invoiceType",
    label: "发票类型"
  },
  {
    field: "invName",
    label: "发票名称"
  },
  {
    field: "invName",
    label: "发票名称"
  },
  {
    field: "inv_img",
    label: "发票图片"
  },
  {
    field: "inv_fee",
    label: "发票金额"
  },
  {
    field: "status",
    label: "状态"
  },
  {
    field: "open_time",
    label: "开票时间"
  },
  {
    field: "invoiceNumber",
    label: "发票号码"
  },
  {
    field: "invoiceCode",
    label: "发票代码"
  },
  {
    field: "checkNumber",
    label: "校验码"
  },
  {
    field: "pay_apply_id",
    label: "对账申请人"
  },
  {
    field: "pay_apply_name",
    label: "对账申请人"
  },
  {
    field: "supplierNo",
    label: "供应商编号"
  },
  {
    field: "supplierName",
    label: "供应商名称"
  },
  {
    field: "companyNo",
    label: "业务企业编号"
  },
  {
    field: "companyName",
    label: "业务企业名称"
  },
  {
    field: "total_fee",
    label: "对账申请总额"
  }
];
