import { ContentConfig } from "/@/components/PageContent";
import { httpRecord } from "/@/api/InvoiceSales/sheetOrderPool";
import { h } from "vue";
import { ElTag } from "element-plus";
import { typeOptions, statusOptions } from "./_options";

const columns = [
  {
    label: '记录ID',
    prop: 'id',
    width: '60px'
  },
  {
    label: '对账编号',
    prop: 'code',
    width: '160px'
  },
  {
    label: '卖出方公司',
    prop: 'supplierName',
    width: '200px'
  },
  {
    label: '买入方公司',
    prop: 'companyName',
    width: '200px'
  },
  {
    label: '业务类型',
    prop: 'type',
    width: '100px',
    cellRenderer({row}){
      return h(ElTag,null, {
        default: () => typeOptions.find(({value}) => String(value) === String(row.type))?.label || '--'
      })
    }
  },
  {
    label: '功能类型',
    prop: 'status',
    width: '70px',
    cellRenderer({row}){
      return h(ElTag,null, {
        default: () => statusOptions.find(({value}) => String(value) === String(row.status))?.label || '--'
      })
    }
  },
  {
    label: '标签名称',
    prop: 'tag_name'
  },
  {
    label: '标签金额',
    width: '80px',
    prop: 'tag_fee'
  },
  {
    label: '创建人',
    prop: 'creater'
  },
  {
    label: '操作时间',
    prop: 'addtime'
  }
];



const contentConfig: ContentConfig = {
  title: "销售订单公海池",
  columns,
  superUserNoAction: true,
  apis: {
    httpList:(params = {}) => httpRecord({ ...params, order_type: '1' })
  }
};

export default contentConfig;
