AllocationConfirmation.vue 2.02 KB
<script setup lang="ts">
import { ref } from "vue";

import { VButton, VTable } from "@vui/vue";

const tableColumns = [
	{
		key: "index",
		label: "序号",
	},
	{
		key: "column2",
		label: "商品名称",
	},
	{
		key: "column3",
		label: "规格",
	},
	{
		key: "column4",
		label: "调拨数量",
	},
	{
		key: "column5",
		label: "调出仓",
	},
	{
		key: "column6",
		label: "调入仓",
	},
	{
		key: "actions",
		label: "Actions",
		width: 220,
	},
];

const rows = ref([
	{
		index: "1",
		column2: "商品名称商品名称 商品名称",
		column3: "A/B",
		column4: "20",
		column5: "杭州仓",
		column6: "上海仓",
	},
]);

function handleToolbarAction(actionId: string) {
	console.log("toolbar-action", actionId);
}

function handleRowAction(actionId: string, row: Record<string, unknown>) {
	console.log("row-action", actionId, row);
}
</script>

<template>
    <div class="generated-page AllocationConfirmation">
        <header class="page-header">
            <h1>调拨确认单</h1>
            <p>Generated from page schema pilot.</p>
        </header>
        <section class="page-section">
            <div class="section-header">
                <h2>调拨明细表</h2>
                <VButton @click="handleToolbarAction('default-action')">
                    Create
                </VButton>
            </div>
            <VTable :columns="tableColumns" :data="rows">
                <template #actions="{ row }">
                    <VButton @click="handleRowAction('default-action', row)">
                        View
                    </VButton>
                </template>
            </VTable>
        </section>
    </div>
</template>

<style scoped>
.generated-page {
	display: grid;
	gap: 16px;
	padding: 16px;
}

.page-header {
	display: grid;
	gap: 8px;
}

.page-section {
	padding: 16px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
}

.filter-row,
.section-header,
.action-row,
.field-switch {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
}
</style>