feat: product list

This commit is contained in:
xingyu4j
2025-06-06 16:24:43 +08:00
parent 082bb7167f
commit acd0677f81
7 changed files with 425 additions and 33 deletions

View File

@@ -174,3 +174,60 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
},
];
}
/** 代码生成表格列定义 */
export function useProductEditTableColumns(): VxeTableGridOptions['columns'] {
return [
{ type: 'seq', title: '序号', minWidth: 50 },
{
field: 'productId',
title: '产品名称',
minWidth: 100,
slots: { default: 'productId' },
},
{
field: 'productNo',
title: '条码',
minWidth: 150,
},
{
field: 'productUnit',
title: '单位',
minWidth: 100,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.CRM_PRODUCT_UNIT },
},
},
{
field: 'productPrice',
title: '价格(元)',
minWidth: 100,
formatter: 'formatNumber',
},
{
field: 'sellingPrice',
title: '售价(元)',
minWidth: 100,
slots: { default: 'sellingPrice' },
},
{
field: 'count',
title: '数量',
minWidth: 100,
slots: { default: 'count' },
},
{
field: 'totalPrice',
title: '合计',
minWidth: 100,
formatter: 'formatNumber',
},
{
title: '操作',
width: 80,
fixed: 'right',
slots: { default: 'actions' },
},
];
}