5 分钟以前 0c221f3e96cc6aae6b6bcf67e984cb446dcfac87
src/views/crm/product/components/data.ts
@@ -1,31 +1,29 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { DICT_TYPE } from '..\..\..\..\packages\constants\src';
/** 产品详情列表的列定义 */
export function useDetailListColumns(
  showBusinessPrice: boolean,
): VxeTableGridOptions['columns'] {
  return [
    {
      field: 'productName',
      field: 'itemName',
      title: '产品名称',
    },
    {
      field: 'productNo',
      title: '产品条码',
      field: 'itemCode',
      title: '物料编码',
    },
    {
      field: 'productUnit',
      title: '产品单位',
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.CRM_PRODUCT_UNIT },
      },
      field: 'itemBarCode',
      title: '物料条码',
    },
    {
      field: 'productPrice',
      title: '产品价格(元)',
      field: 'itemUnitName',
      title: '单位',
    },
    {
      field: 'itemPrice',
      title: '原价(元)',
      formatter: 'formatAmount2',
    },
    {
@@ -58,36 +56,42 @@
  return [
    { type: 'seq', title: '序号', minWidth: 50 },
    {
      field: 'productId',
      field: 'itemId',
      title: '产品名称',
      minWidth: 100,
      slots: { default: 'productId' },
      slots: { default: 'itemId' },
    },
    {
      field: 'productNo',
      title: '条码',
      minWidth: 150,
      field: 'itemSpecification',
      title: '规格型号',
      minWidth: 120,
    },
    {
      field: 'productUnit',
      field: 'itemUnitName',
      title: '单位',
      minWidth: 100,
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.CRM_PRODUCT_UNIT },
      },
      minWidth: 80,
    },
    {
      field: 'productPrice',
      title: '价格(元)',
      field: 'itemUnitName2',
      title: '辅单位1',
      minWidth: 80,
    },
    {
      field: 'itemUnitName3',
      title: '辅单位2',
      minWidth: 80,
    },
    {
      field: 'itemPrice',
      title: '原价(元)',
      minWidth: 100,
      formatter: 'formatAmount2',
    },
    {
      field: 'sellingPrice',
      title: '售价(元)',
      field: 'contractPrice',
      title: '合同价(元)',
      minWidth: 100,
      slots: { default: 'sellingPrice' },
      slots: { default: 'contractPrice' },
    },
    {
      field: 'count',