import { ContentConfig } from "/@/components/PageContent";
import { httpList, httpStatus } from "/@/api/invoiceInOut/inventoryCheck";
import {  renderIconLabelLeftValue } from "/@/utils/columnRenderHelper";

const columns = [
  {
    label: "盘点编号",
    prop: "checkCode",
    width: 170
  },
  {
    label: '销售方公司',
    minWidth: 160,
    ...renderIconLabelLeftValue(
      (row) => row.product.seller_code,
      (row) => row.product.seller_name,
      "销售方公司纳税号:"
    )
  },
  {
    label: '购买方公司',
    minWidth: 160,
    ...renderIconLabelLeftValue(
      (row) => row.product.buyer_code,
      (row) => row.product.buyer_name,
      "购买公司纳税号:"
    )
  },
  {
    label: "商品名称",
    minWidth: 160,
    ...renderIconLabelLeftValue(
      (row) => row.product.good_code,
      (row) => row.product.goodName,
      "商品编号:"
    )
  },
  {
    label: "规格",
    prop: "spec",
    width: 80,
    cellRenderer({ row }) {
      return row.product.spec
    }
  },
  {
    label: "单位",
    width: 60,
    cellRenderer({ row }) {
      return row.product.unit
    }
  },
  {
    label: '单价',
    width: 80,
    cellRenderer({ row }) {
      return row.product.subunit_price
    }
  },
  {
    label: '账面数量',
    prop: 'stock_num',
    width: 80
  },
  {
    label: '盘点数量',
    prop: 'check_num',
    width: 120
  },
  {
    label: '盘亏数量',
    prop: 'diff_num',
    width: 120
  },
  {
    label: '操作人',
    prop: 'apply_name',
    width: 80
  }
  // {
  //   label: "操作",
  //   fixed: "right",
  //   width: 50,
  //   slot: "operation"
  // }
];

const contentConfig: ContentConfig = {
  columns,
  title: "商品管理",
  permissions: ['003', '007'],
  apis: { 
    httpList,
    httpStatus,
    httpAdd: true
  }
};

export default contentConfig;
