feat(mes/qc): 迁移批次追溯(batchtrace)ele 端 + antd 改用 Vben Description
- ele: 新增 mes/wm/batch API、batchtrace 主页和向前/向后追溯子组件,
与 antd 端实现保持一致
- antd: trace-detail 改用 useDescription({ schema }) 模式,schema
抽到 data.ts 的 useDetailSchema();trace-list 的 pagerConfig /
rowConfig / toolbarConfig 单行展开为多行
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { MesWmBatchApi } from '#/api/mes/wm/batch';
|
||||
import type { DescriptionItemSchema } from '#/components/description';
|
||||
|
||||
import { markRaw } from 'vue';
|
||||
|
||||
@@ -167,3 +168,62 @@ export function useTraceGridColumns(): VxeTableGridOptions<MesWmBatchApi.Batch>[
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 批次追溯详情的描述字段 */
|
||||
export function useDetailSchema(): DescriptionItemSchema[] {
|
||||
return [
|
||||
{
|
||||
field: 'code',
|
||||
label: '批次编号',
|
||||
},
|
||||
{
|
||||
field: 'itemCode',
|
||||
label: '物资编码',
|
||||
},
|
||||
{
|
||||
field: 'itemName',
|
||||
label: '物资名称',
|
||||
},
|
||||
{
|
||||
field: 'itemSpecification',
|
||||
label: '规格型号',
|
||||
span: 3,
|
||||
},
|
||||
{
|
||||
field: 'purchaseOrderCode',
|
||||
label: '采购订单编号',
|
||||
},
|
||||
{
|
||||
field: 'vendorCode',
|
||||
label: '供应商编码',
|
||||
},
|
||||
{
|
||||
field: 'vendorName',
|
||||
label: '供应商名称',
|
||||
},
|
||||
{
|
||||
field: 'salesOrderCode',
|
||||
label: '销售订单编号',
|
||||
},
|
||||
{
|
||||
field: 'clientCode',
|
||||
label: '客户编码',
|
||||
},
|
||||
{
|
||||
field: 'clientName',
|
||||
label: '客户名称',
|
||||
},
|
||||
{
|
||||
field: 'lotNumber',
|
||||
label: '生产批号',
|
||||
},
|
||||
{
|
||||
field: 'workOrderCode',
|
||||
label: '生产工单',
|
||||
},
|
||||
{
|
||||
field: 'workstationCode',
|
||||
label: '工作站编码',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -5,13 +5,22 @@ import { ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { Descriptions, Tabs } from 'ant-design-vue';
|
||||
import { Tabs } from 'ant-design-vue';
|
||||
|
||||
import { useDescription } from '#/components/description';
|
||||
|
||||
import { useDetailSchema } from '../data';
|
||||
import TraceList from './trace-list.vue';
|
||||
|
||||
const detailData = ref<MesWmBatchApi.Batch>(); // 当前批次详情
|
||||
const subTabsName = ref<'backward' | 'forward'>('forward'); // 当前激活的追溯方向
|
||||
|
||||
const [Descriptions] = useDescription({
|
||||
bordered: true,
|
||||
column: 3,
|
||||
schema: useDetailSchema(),
|
||||
});
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
onOpenChange(isOpen) {
|
||||
if (!isOpen) {
|
||||
@@ -31,53 +40,11 @@ const [Modal, modalApi] = useVbenModal({
|
||||
:show-cancel-button="false"
|
||||
:show-confirm-button="false"
|
||||
>
|
||||
<div class="mx-4 mt-2">
|
||||
<Descriptions :column="3" bordered size="small">
|
||||
<Descriptions.Item label="批次编号">
|
||||
{{ detailData?.code || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="物资编码">
|
||||
{{ detailData?.itemCode || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="物资名称">
|
||||
{{ detailData?.itemName || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="规格型号" :span="3">
|
||||
{{ detailData?.itemSpecification || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="采购订单编号">
|
||||
{{ detailData?.purchaseOrderCode || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="供应商编码">
|
||||
{{ detailData?.vendorCode || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="供应商名称">
|
||||
{{ detailData?.vendorName || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="销售订单编号">
|
||||
{{ detailData?.salesOrderCode || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="客户编码">
|
||||
{{ detailData?.clientCode || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="客户名称">
|
||||
{{ detailData?.clientName || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="生产批号">
|
||||
{{ detailData?.lotNumber || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="生产工单">
|
||||
{{ detailData?.workOrderCode || '-' }}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="工作站编码">
|
||||
{{ detailData?.workstationCode || '-' }}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</div>
|
||||
<Descriptions class="mx-4 mt-2" :data="detailData" />
|
||||
<Tabs
|
||||
v-if="detailData?.code"
|
||||
v-model:active-key="subTabsName"
|
||||
class="mx-4! mt-4!"
|
||||
class="mx-4 mt-4"
|
||||
type="card"
|
||||
>
|
||||
<Tabs.TabPane key="forward" tab="向前追溯">
|
||||
|
||||
@@ -21,10 +21,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
gridOptions: {
|
||||
columns: useTraceGridColumns(),
|
||||
minHeight: 240,
|
||||
pagerConfig: { enabled: false },
|
||||
rowConfig: { isHover: true, keyField: 'id' },
|
||||
pagerConfig: {
|
||||
enabled: false,
|
||||
},
|
||||
rowConfig: {
|
||||
isHover: true,
|
||||
keyField: 'id',
|
||||
},
|
||||
showOverflow: true,
|
||||
toolbarConfig: { enabled: false },
|
||||
toolbarConfig: {
|
||||
enabled: false,
|
||||
},
|
||||
} as VxeTableGridOptions<MesWmBatchApi.Batch>,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user