原材料库存记录

This commit is contained in:
2026-05-15 17:34:31 +08:00
parent b496a03190
commit 530a0f13e7
8 changed files with 384 additions and 1327 deletions

View File

@@ -0,0 +1,10 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/xslmes/mesXslRawMaterialSummary/list',
exportXls = '/xslmes/mesXslRawMaterialSummary/exportXls',
}
export const getExportUrl = Api.exportXls;
export const list = (params) => defHttp.get({ url: Api.list, params });

View File

@@ -0,0 +1,23 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
export const columns: BasicColumn[] = [
{ title: '所在仓库', align: 'center', dataIndex: 'warehouseName', width: 180 },
{ title: '物料名称', align: 'center', dataIndex: 'materialName', width: 180, ellipsis: true },
{ title: '物料编码', align: 'center', dataIndex: 'materialCode', width: 180 },
{ title: '总包数', align: 'center', dataIndex: 'totalPackages', width: 140 },
{ title: '总重量', align: 'center', dataIndex: 'totalWeight', width: 140 },
];
export const searchFormSchema: FormSchema[] = [
{ label: '所在仓库', field: 'warehouseName', component: 'JInput', colProps: { span: 6 } },
{ label: '物料名称', field: 'materialName', component: 'JInput', colProps: { span: 6 } },
{ label: '物料编码', field: 'materialCode', component: 'JInput', colProps: { span: 6 } },
];
export const superQuerySchema = {
warehouseName: { title: '所在仓库', order: 0, view: 'text' },
materialName: { title: '物料名称', order: 1, view: 'text' },
materialCode: { title: '物料编码', order: 2, view: 'text' },
totalPackages: { title: '总包数', order: 3, view: 'number' },
totalWeight: { title: '总重量', order: 4, view: 'number' },
};

View File

@@ -0,0 +1,54 @@
<template>
<div>
<BasicTable @register="registerTable">
<template #tableTitle>
<a-button type="primary" v-auth="'xslmes:mes_xsl_raw_material_summary:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
导出
</a-button>
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
</BasicTable>
</div>
</template>
<script lang="ts" name="xslmes-mesXslRawMaterialSummary" setup>
import { reactive } from 'vue';
import { BasicTable } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema, superQuerySchema } from './MesXslRawMaterialSummary.data';
import { list, getExportUrl } from './MesXslRawMaterialSummary.api';
const queryParam = reactive<any>({});
const { tableContext, onExportXls } = useListPage({
tableProps: {
title: '原材料汇总',
api: list,
columns,
canResize: true,
formConfig: {
schemas: searchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: '原材料汇总',
url: getExportUrl,
params: queryParam,
},
});
const [registerTable, { reload }] = tableContext;
const superQueryConfig = reactive(superQuerySchema);
function handleSuperQuery(params) {
Object.keys(params).forEach((k) => {
queryParam[k] = params[k];
});
reload();
}
</script>