feat:【antd】【erp 系统】finance/receipt 的迁移 4/4(已完成)
This commit is contained in:
@@ -176,9 +176,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(
|
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
||||||
formData?: any[],
|
|
||||||
): VxeTableGridOptions['columns'] {
|
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -596,4 +594,4 @@ export function useSaleReturnGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(tableData.value),
|
columns: useFormItemColumns(),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -87,9 +87,6 @@ watch(
|
|||||||
tableData.value = [...items];
|
tableData.value = [...items];
|
||||||
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
||||||
await gridApi.grid.reloadData(tableData.value);
|
await gridApi.grid.reloadData(tableData.value);
|
||||||
// 更新表格列配置
|
|
||||||
const columns = useFormItemColumns(tableData.value);
|
|
||||||
await gridApi.grid.reloadColumn(columns);
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true,
|
immediate: true,
|
||||||
@@ -292,4 +289,4 @@ defineExpose({ validate });
|
|||||||
<SaleOutSelect ref="saleOutSelectRef" @success="handleAddSaleOut" />
|
<SaleOutSelect ref="saleOutSelectRef" @success="handleAddSaleOut" />
|
||||||
<!-- 销售退货单选择组件 -->
|
<!-- 销售退货单选择组件 -->
|
||||||
<SaleReturnSelect ref="saleReturnSelectRef" @success="handleAddSaleReturn" />
|
<SaleReturnSelect ref="saleReturnSelectRef" @success="handleAddSaleReturn" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -55,11 +55,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
} as VxeTableGridOptions<ErpSaleOutApi.SaleOut>,
|
} as VxeTableGridOptions<ErpSaleOutApi.SaleOut>,
|
||||||
gridEvents: {
|
gridEvents: {
|
||||||
checkboxChange: ({
|
checkboxChange: ({ records }: { records: ErpSaleOutApi.SaleOut[] }) => {
|
||||||
records,
|
|
||||||
}: {
|
|
||||||
records: ErpSaleOutApi.SaleOut[];
|
|
||||||
}) => {
|
|
||||||
selectedRows.value = records;
|
selectedRows.value = records;
|
||||||
},
|
},
|
||||||
checkboxAll: ({ records }: { records: ErpSaleOutApi.SaleOut[] }) => {
|
checkboxAll: ({ records }: { records: ErpSaleOutApi.SaleOut[] }) => {
|
||||||
@@ -105,4 +101,4 @@ defineExpose({ open: openModal });
|
|||||||
table-title="销售出库单列表(仅展示可收款的单据)"
|
table-title="销售出库单列表(仅展示可收款的单据)"
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -105,4 +105,4 @@ defineExpose({ open: openModal });
|
|||||||
table-title="销售退货单列表(仅展示可退款的单据)"
|
table-title="销售退货单列表(仅展示可退款的单据)"
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user