/* eslint-disable prettier/prettier */
import { BeforeRequestType, ContentConfig } from "/@/components/PageContent";
import { ElTag } from "element-plus";
import { isBeyondTime } from "/@/views/reportCollection/_utils";
import apis from "./apis";
import { h } from "vue";

export const statusOptions = [
  { value: '0', label: '待发货' },
  { value: '1', label: '待发货完成' },
  { value: '2', label: '发货已完成' },
  { value: '3', label: '订单已取消' }
]

export const orderTypeOptions = [
  { value: "1", label: "库存商品" },
  { value: "2", label: "非库存商品" },
  { value: "3", label: "反馈商品" },
  { value: "4", label: "报备商品" },
];


const columns = [
  {
    prop: 'outCode',
    label: '发货单号',
    minWidth: '155px'
  },
  {
    prop: 'order_out_addtime',
    label: '发货单创建时间',
    width: '160px'
  },

  {
    prop: 'sendtime',
    label: '发货时间',
    width: '155px'
  },
  {
    prop: 'orderCode',
    label: '确认单编号',
    width: '155px'
  },
  {
    prop: 'companyNo',
    label: '业务公司编号',
    width: '155px'
  },
  {
    prop: 'companyName',
    label: '业务公司名称',
    width: '175px'
  },
  {
    prop: 'platform_order',
    label: '平台订单编号',
    width: '155px'
  },
  {
    prop: 'good_num',
    label: '下单数量',
    width: '100px'
  },
  {
    prop: 'order_addtime',
    label: '确认单下单时间',
    width: '155px'
  },
  {
    prop: 'post_code',
    label: '物流单号',
    width: '155px'
  },
  {
    prop: 'post_name',
    label: '物流名称',
    width: '100px'
  },
  {
    prop: 'good_code',
    label: '商品编号',
    width: '155px'
  },
  {
    prop: 'good_name',
    label: '商品名称',
    minWidth: '155px'
  },
  {
    prop: 'order_type',
    label: '商品类型',
    width: '100px',
    cellRenderer({ row }) {
      return h(ElTag, null, {
        default: () => row.order_type
      })
    }
  },
  {
    prop: 'send_num',
    label: '发货数量',
    width: '100px'
  },
  {
    prop: 'asend_num',
    label: '已发货数量',
    width: '100px'
  },
  {
    prop: 'contactor',
    label: '收货人',
    width: '100px'
  },
  {
    prop: 'mobile',
    label: '收货人联系电话',
    width: '110px'
  },
  {
    prop: 'addr',
    label: '收货地址',
    width: '140px'
  },
  {
    prop: 'apply_name',
    label: '订单创建人',
    width: '100px'
  },
  {
    prop: 'shipper_name',
    label: '发货人',
    width: '100px'
  },
  {
    prop: 'remark',
    label: '订单备注',
    width: '100px'
  },
  {
    prop: 'depart_name',
    label: '订单创建人部门',
    width: '130px'
  },
]


const contentConfig: ContentConfig = {
  columns,
  showTitle: false,
  responseCode: 1,
  superUserNoAction: false,
  // beforeRequestList(params) {
  //   const { start, end } = params;
  //   const beyondTime = isBeyondTime({ name: "下单时间", len: 90, start, end });
  //   if (beyondTime) return BeforeRequestType.EMPTY
  //   return BeforeRequestType.NEXT;
  // },
  apis: { httpList: apis.list }
};


export default contentConfig;
